pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/wrapper Obtain the MKPIE flags from the environment



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1aa1fa8f432d
branches:  trunk
changeset: 371630:1aa1fa8f432d
user:      khorben <khorben%pkgsrc.org@localhost>
date:      Thu Nov 16 00:36:10 2017 +0000

description:
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:

 mk/wrapper/bsd.wrapper.mk     |  7 ++++++-
 mk/wrapper/cmd-sink-mkpie-gcc |  7 +++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diffs (42 lines):

diff -r 44ba4f9ccc61 -r 1aa1fa8f432d mk/wrapper/bsd.wrapper.mk
--- a/mk/wrapper/bsd.wrapper.mk Thu Nov 16 00:31:47 2017 +0000
+++ b/mk/wrapper/bsd.wrapper.mk Thu Nov 16 00:36:10 2017 +0000
@@ -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.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 -r 44ba4f9ccc61 -r 1aa1fa8f432d mk/wrapper/cmd-sink-mkpie-gcc
--- a/mk/wrapper/cmd-sink-mkpie-gcc     Thu Nov 16 00:31:47 2017 +0000
+++ b/mk/wrapper/cmd-sink-mkpie-gcc     Thu Nov 16 00:36:10 2017 +0000
@@ -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



Home | Main Index | Thread Index | Old Index