Module Name: src
Committed By: martin
Date: Wed Mar 30 13:05:09 UTC 2016
Modified Files:
src/share/mk: bsd.prog.mk bsd.sys.mk
Log Message:
Pass -pie to cc, not -Wl,-pie. This way we have a chance to fix specs
for obscure corner cases like -pie -fPIE -static (used for
/usr/tests/lib/csu/h_initfini2 if building with MKPIE=yes).
While there also replace -fPIC with -fPIE for the PIE case, even if
it should be mostly equivalent.
To generate a diff of this commit:
cvs rdiff -u -r1.297 -r1.298 src/share/mk/bsd.prog.mk
cvs rdiff -u -r1.256 -r1.257 src/share/mk/bsd.sys.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/share/mk/bsd.prog.mk
diff -u src/share/mk/bsd.prog.mk:1.297 src/share/mk/bsd.prog.mk:1.298
--- src/share/mk/bsd.prog.mk:1.297 Sat Mar 12 23:08:58 2016
+++ src/share/mk/bsd.prog.mk Wed Mar 30 13:05:09 2016
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.prog.mk,v 1.297 2016/03/12 23:08:58 mrg Exp $
+# $NetBSD: bsd.prog.mk,v 1.298 2016/03/30 13:05:09 martin Exp $
# @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94
.ifndef HOSTPROG
@@ -540,7 +540,7 @@ ${_P}: .gdbinit ${LIBCRT0} ${LIBCRTI} ${
${_P}.ro: ${OBJS.${_P}} ${_DPADD.${_P}}
${_MKTARGET_LINK}
- ${CC} ${LDFLAGS:N-Wl,-pie} -nostdlib -r -Wl,-dc -o ${.TARGET} ${OBJS.${_P}}
+ ${CC} ${LDFLAGS:N-pie} -nostdlib -r -Wl,-dc -o ${.TARGET} ${OBJS.${_P}}
.if defined(_PROGDEBUG.${_P})
${_PROGDEBUG.${_P}}: ${_P}
Index: src/share/mk/bsd.sys.mk
diff -u src/share/mk/bsd.sys.mk:1.256 src/share/mk/bsd.sys.mk:1.257
--- src/share/mk/bsd.sys.mk:1.256 Tue Mar 22 08:17:27 2016
+++ src/share/mk/bsd.sys.mk Wed Mar 30 13:05:09 2016
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.sys.mk,v 1.256 2016/03/22 08:17:27 mrg Exp $
+# $NetBSD: bsd.sys.mk,v 1.257 2016/03/30 13:05:09 martin Exp $
#
# Build definitions used for NetBSD source tree builds.
@@ -178,9 +178,9 @@ AFLAGS+= ${CPUFLAGS}
.if !defined(NOPIE) && (!defined(LDSTATIC) || ${LDSTATIC} != "-static")
# Position Independent Executable flags
-PIE_CFLAGS?= -fPIC
-PIE_LDFLAGS?= -Wl,-pie ${${ACTIVE_CC} == "gcc":? -shared-libgcc :}
-PIE_AFLAGS?= -fPIC
+PIE_CFLAGS?= -fPIE
+PIE_LDFLAGS?= -pie ${${ACTIVE_CC} == "gcc":? -shared-libgcc :}
+PIE_AFLAGS?= -fPIE
.endif
ELF2ECOFF?= elf2ecoff