From: Alessandro Ghedini Date: Thu, 5 Oct 2023 21:31:47 +0000 (+0100) Subject: Work around libtool --as-needed reordering bug X-Git-Tag: archive/raspbian/7.88.1-10+rpi1+deb12u4^2~25 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d87881691a7c981e0a9e16921a6dc40a6611d805;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