summaryrefslogtreecommitdiff
path: root/mk/wrapper
diff options
context:
space:
mode:
authorkhorben <khorben@pkgsrc.org>2017-11-16 00:36:10 +0000
committerkhorben <khorben@pkgsrc.org>2017-11-16 00:36:10 +0000
commit3411164e84b709274e6241f571b12b1c9b349641 (patch)
treee52de26be29991ed6d7171e33448182ed693e5de /mk/wrapper
parentc0f7dacd1b2b9adbd565f546e36f6e483bfce094 (diff)
downloadpkgsrc-3411164e84b709274e6241f571b12b1c9b349641.tar.gz
Obtain the MKPIE flags from the environment
This solves an issue with the command sink component of the MKPIE wrapper for GCC, where the contents of the _MKPIE_CFLAGS.gcc and _MKPIE_LDFLAGS.gcc variables was guessed. It is now communicated to cmd-sink-mkpie-gcc through the environment instead.
Diffstat (limited to 'mk/wrapper')
-rw-r--r--mk/wrapper/bsd.wrapper.mk7
-rw-r--r--mk/wrapper/cmd-sink-mkpie-gcc7
2 files changed, 9 insertions, 5 deletions
diff --git a/mk/wrapper/bsd.wrapper.mk b/mk/wrapper/bsd.wrapper.mk
index 887db29a08d..de86dad58a5 100644
--- a/mk/wrapper/bsd.wrapper.mk
+++ b/mk/wrapper/bsd.wrapper.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.wrapper.mk,v 1.97 2016/03/11 23:03:31 khorben Exp $
+# $NetBSD: bsd.wrapper.mk,v 1.98 2017/11/16 00:36:10 khorben Exp $
#
# Copyright (c) 2005 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -313,6 +313,11 @@ _WRAP_TRANSFORM.CC= ${WRAPPER_TMPDIR}/transform-gcc
_WRAP_TRANSFORM.CXX= ${_WRAP_TRANSFORM.CC}
. if ${_PKGSRC_MKPIE} != "no"
_WRAP_CMD_SINK.CC= ${WRAPPER_TMPDIR}/cmd-sink-mkpie-gcc
+_WRAP_CMD_SINK.CXX= ${_WRAP_CMD_SINK.CC}
+MKPIE_CFLAGS= ${_MKPIE_CFLAGS.gcc}
+.export MKPIE_CFLAGS
+MKPIE_LDFLAGS= ${_MKPIE_LDFLAGS.gcc}
+.export MKPIE_LDFLAGS
. endif
.endif
diff --git a/mk/wrapper/cmd-sink-mkpie-gcc b/mk/wrapper/cmd-sink-mkpie-gcc
index a2a3365f248..f4e8b03e15b 100644
--- a/mk/wrapper/cmd-sink-mkpie-gcc
+++ b/mk/wrapper/cmd-sink-mkpie-gcc
@@ -1,4 +1,4 @@
-# $NetBSD: cmd-sink-mkpie-gcc,v 1.4 2017/11/16 00:31:47 khorben Exp $
+# $NetBSD: cmd-sink-mkpie-gcc,v 1.5 2017/11/16 00:36:10 khorben Exp $
#
# Copyright (c) 2016 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -31,9 +31,8 @@
# Append any optional flags required when linking binaries.
if $test "$dont_link_binary" != "yes"; then
- # XXX obtain these flags from _MKPIE_LDFLAGS.gcc and _MKPIE_CFLAGS.gcc
- MKPIE_FLAGS="-pie"
- $test "$has_source" = "yes" && MKPIE_FLAGS="-fPIC $MKPIE_FLAGS"
+ MKPIE_FLAGS="$MKPIE_LDFLAGS"
+ $test "$has_source" = "yes" && MKPIE_FLAGS="$MKPIE_CFLAGS $MKPIE_FLAGS"
for arg in $MKPIE_FLAGS; do
$debug_log $wrapperlog " (cmd-sink-mkpie-gcc) pop: $arg"
. $buildcmd