summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Ghedini <ghedo@debian.org>2021-06-25 20:59:54 +0200
committerPaul Gevers <elbrus@debian.org>2021-06-25 20:59:54 +0200
commitb4e4cc366e78b11d8ed2339a6caa0b853d5a46d0 (patch)
tree054bc974a38394d7b6772e9eabf89d17e468d964
parent9fbfa241ad9fed557e5bbc5752847da2773557cd (diff)
Work around libtool --as-needed reordering bug
Origin: vendor Bug-Debian: http://bugs.debian.org/347650 Forwarded: not-needed Reviewed-by: Alessandro Ghedini <ghedo@debian.org> Last-Update: 2016-08-03 Gbp-Pq: Name 04_workaround_as_needed_bug.patch
-rw-r--r--ltmain.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/ltmain.sh b/ltmain.sh
index 0cb7f90d..0dbcb39f 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -7312,6 +7312,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
@@ -7705,6 +7710,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