summaryrefslogtreecommitdiff
path: root/mk/wrapper
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2007-02-23 00:31:29 +0000
committerrillig <rillig@pkgsrc.org>2007-02-23 00:31:29 +0000
commit215797f36f7da9227585f4831f44c3c085d7a396 (patch)
tree2813e54ba2a93c0f60db6858608c13507f9d46ea /mk/wrapper
parentaf4e1b9e9b30e51946b3fad45e66d546807b21a4 (diff)
downloadpkgsrc-215797f36f7da9227585f4831f44c3c085d7a396.tar.gz
The compiler option -Wl,foo,bar,baz is split into -Wl,foo -Wl,bar
-Wl,baz before processing the resulting options again. Fixes PR 32203.
Diffstat (limited to 'mk/wrapper')
-rw-r--r--mk/wrapper/arg-source27
1 files changed, 26 insertions, 1 deletions
diff --git a/mk/wrapper/arg-source b/mk/wrapper/arg-source
index 57959ecaf19..bf4ce639fcb 100644
--- a/mk/wrapper/arg-source
+++ b/mk/wrapper/arg-source
@@ -1,4 +1,4 @@
-# $NetBSD: arg-source,v 1.11 2007/02/21 12:27:36 rillig Exp $
+# $NetBSD: arg-source,v 1.12 2007/02/23 00:31:29 rillig Exp $
#
# Copyright (c) 2004 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -62,6 +62,31 @@ while $test $# -gt 0; do
$debug_log $wrapperlog " (arg-source) push: $arg$nextarg"
;;
##############################################################
+ # Split -Wl,option1,option2 into -Wl,option1 -Wl,option2 and
+ # process them again.
+ #
+ # XXX: The sunpro manual page says: A comma can be part of an
+ # argument by escaping it with an immediately preceding
+ # backslash. The manual pages for gcc and mipspro do not
+ # mention commas in those options at all.
+ ##############################################################
+ -Wl,*,*)
+ $debug_log $wrapperlog " (arg-source) before-split: $arg $*"
+ saved_IFS="$IFS"
+ new_args=""
+ IFS=","
+ for o in ${arg#-Wl,}; do
+ IFS="$saved_IFS"
+ shquote "$o"; o="$shquoted"
+ new_args="$new_args -Wl,$o"
+ done
+ IFS="$saved_IFS"
+ eval "set args $new_args \"\$@\""; shift
+ $debug_log $wrapperlog " (arg-source) after-split: $*"
+ continue
+ ;;
+
+ ##############################################################
# Split "-Wl,-R/dir1:/dir2" into "-Wl,-R/dir1 -Wl,-R/dir2".
# Same for -R and -Wl,-rpath and -Wl,-rpath-link.
##############################################################