From: Alessandro Ghedini Date: Sun, 9 Mar 2025 10:45:45 +0000 (+0000) Subject: Work around libtool --as-needed reordering bug X-Git-Tag: archive/raspbian/7.88.1-10+rpi1+deb12u12^2~41 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=959d8155d26064c10682e3233879c71eafd0b0b7;p=curl.git Work around libtool --as-needed reordering bug Origin: vendor Bug-Debian: http://bugs.debian.org/347650 Forwarded: not-needed Reviewed-by: Alessandro Ghedini Last-Update: 2016-08-03 Gbp-Pq: Name 04_workaround_as_needed_bug.patch --- diff --git a/ltmain.sh b/ltmain.sh index 9b12fbb7..23603aef 100755 --- a/ltmain.sh +++ b/ltmain.sh @@ -7500,6 +7500,11 @@ func_mode_link () arg=$func_stripname_result ;; + -Wl,--as-needed|-Wl,--no-as-needed) + deplibs="$arg $deplibs" + continue + ;; + -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result @@ -7899,6 +7904,15 @@ func_mode_link () lib= found=false case $deplib in + -Wl,--as-needed|-Wl,--no-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|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then