From 01fe8e27da2cbebfe2db79606e7bb846554a6863 Mon Sep 17 00:00:00 2001 From: Thomas Jahns Date: Mon, 31 Oct 2016 11:08:43 +0100 Subject: [PATCH] Fix handling of flags for GNU ld library grouping. * -Wl,--start-group -Wl,--end-group -Wl,-\( -Wl,-) must preserve their respective position within the list of libraries to work as expected. --- build-aux/ltmain.in | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 4cd3818..41e95d9 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -5324,6 +5324,11 @@ func_mode_link () arg=$func_stripname_result ;; + -Wl,--start-group|-Wl,--end-group|-Wl,-\(|-Wl,-\)) + func_append deplibs " $arg" + continue + ;; + -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result @@ -5938,6 +5943,15 @@ func_mode_link () alldeplibs=: continue ;; + -Wl,--start-group|-Wl,--end-group|-Wl,-\(|-Wl,-\)) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + fi + continue + ;; esac # case $deplib $found || test -f "$lib" \ -- 2.7.0.79.gdc08a19