From 05c1d186cba26147468f38718ec58811b85f55a7 Mon Sep 17 00:00:00 2001 From: Peter Alfredsen Date: Sun, 3 May 2009 20:03:10 +0000 Subject: Import patch from Debian http://bugs.debian.org/347650 which hacks around libtool deplib re-ordering, which inhibits -Wl,--as-needed. You have to set -Wl,--as-needed seperately in LDFLAGS for this to do any good, -Wl,--as-needed,--something-else will not do, but you can set -Wl,--something-else afterwards. Also make sure eclasses I 'own' run elibtoolize so they can reap the benefit. --- eclass/ELT-patches/as-needed/1.5 | 30 +++++++++++++++++++++++++++++ eclass/ELT-patches/as-needed/1.5.26 | 38 +++++++++++++++++++++++++++++++++++++ eclass/ELT-patches/as-needed/2.2.6 | 38 +++++++++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 eclass/ELT-patches/as-needed/1.5 create mode 100644 eclass/ELT-patches/as-needed/1.5.26 create mode 100644 eclass/ELT-patches/as-needed/2.2.6 (limited to 'eclass/ELT-patches') diff --git a/eclass/ELT-patches/as-needed/1.5 b/eclass/ELT-patches/as-needed/1.5 new file mode 100644 index 000000000000..d9d45652c505 --- /dev/null +++ b/eclass/ELT-patches/as-needed/1.5 @@ -0,0 +1,30 @@ +--- ltmain.sh.orig 2006-03-29 15:45:36.000000000 +0200 ++++ ltmain.sh 2006-03-29 16:39:30.000000000 +0200 +@@ -1754,6 +1754,11 @@ + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + ++ -Wl,--as-needed) ++ deplibs="$deplibs $arg" ++ continue ++ ;; ++ + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= +@@ -2094,6 +2099,15 @@ + lib= + found=no + case $deplib in ++ -Wl,--as-needed) ++ if test "$linkmode,$pass" = "prog,link"; then ++ compile_deplibs="$deplib $compile_deplibs" ++ finalize_deplibs="$deplib $finalize_deplibs" ++ else ++ deplibs="$deplib $deplibs" ++ fi ++ continue ++ ;; + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" diff --git a/eclass/ELT-patches/as-needed/1.5.26 b/eclass/ELT-patches/as-needed/1.5.26 new file mode 100644 index 000000000000..8afd6d47dbdd --- /dev/null +++ b/eclass/ELT-patches/as-needed/1.5.26 @@ -0,0 +1,38 @@ +--- ltmain.sh.orig 2009-04-18 16:51:52.000000000 +0200 ++++ ltmain.sh 2009-04-18 16:55:05.000000000 +0200 +@@ -1812,10 +1812,15 @@ + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + ++ -Wl,--as-needed) ++ deplibs="$deplibs $arg" ++ continue ++ ;; ++ + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do +@@ -2152,10 +2157,19 @@ + fi + for deplib in $libs; do + lib= + found=no + case $deplib in ++ -Wl,--as-needed) ++ if test "$linkmode,$pass" = "prog,link"; then ++ compile_deplibs="$deplib $compile_deplibs" ++ finalize_deplibs="$deplib $finalize_deplibs" ++ else ++ deplibs="$deplib $deplibs" ++ fi ++ continue ++ ;; + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else diff --git a/eclass/ELT-patches/as-needed/2.2.6 b/eclass/ELT-patches/as-needed/2.2.6 new file mode 100644 index 000000000000..c56369be7606 --- /dev/null +++ b/eclass/ELT-patches/as-needed/2.2.6 @@ -0,0 +1,38 @@ +--- ltmain.sh.orig 2009-04-18 14:37:16.000000000 +0200 ++++ ltmain.sh 2009-04-18 14:40:08.000000000 +0200 +@@ -4721,10 +4721,15 @@ + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + ++ -Wl,--as-needed) ++ deplibs="$deplibs $arg" ++ continue ++ ;; ++ + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' +@@ -5075,10 +5080,19 @@ + + for deplib in $libs; do + lib= + found=no + case $deplib in ++ -Wl,--as-needed) ++ if test "$linkmode,$pass" = "prog,link"; then ++ compile_deplibs="$deplib $compile_deplibs" ++ finalize_deplibs="$deplib $finalize_deplibs" ++ else ++ deplibs="$deplib $deplibs" ++ fi ++ continue ++ ;; + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else -- cgit v1.2.3-65-gdbad