Sat Apr 25 22:15:38 2015 UTC ()
If we have -Wl,--whole-archive -lfoo -lbar -Wl,--no-whole-archive
surrounding a list of static libraries, we must preserve that order so the
effect of --whole-archive is as intended by the package.
cwrappers does this correctly but classic wrappers didn't.


(tnn)
diff -r1.6 -r1.7 pkgsrc/mk/wrapper/buildcmd

cvs diff -r1.6 -r1.7 pkgsrc/mk/wrapper/buildcmd (expand / switch to context diff)
--- pkgsrc/mk/wrapper/buildcmd 2012/04/13 06:36:08 1.6
+++ pkgsrc/mk/wrapper/buildcmd 2015/04/25 22:15:38 1.7
@@ -1,4 +1,4 @@
-# $NetBSD: buildcmd,v 1.6 2012/04/13 06:36:08 wiz Exp $
+# $NetBSD: buildcmd,v 1.7 2015/04/25 22:15:38 tnn Exp $
 #
 # Copyright (c) 2004 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -68,9 +68,10 @@
 ######################################################################
 # Treat the '--as-needed' and '--no-as-needed' arguments to ld as if
 # thay are libraries so that they still surround the given library.
+# Same for '-Wl,--whole-archive' and '-Wl,--no-whole-archive'.
 # WARNING: this may not work if the wrapper reorders libraries.
 ######################################################################
--l*|--as-needed|--no-as-needed)
+-l*|--as-needed|--no-as-needed|-Wl,--whole-archive|-Wl,--no-whole-archive)
 	case $libs in
 	*" "$arg)
 		;;