@@ -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)
;;