From 213f4b74b4cc6e2f8dd87fc39603d9e243788a60 Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Tue, 2 Apr 2024 20:02:10 -0300 Subject: [PATCH] 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 --- ltmain.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 -- 2.30.2