From 97b5865610584609c4a6a24fb73084142e1e6285 Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Fri, 29 Dec 2023 15:34:11 -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 1dea62ab..abf67247 100755 --- a/ltmain.sh +++ b/ltmain.sh @@ -7488,6 +7488,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 @@ -7887,6 +7892,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