diff options
author | khorben <khorben@pkgsrc.org> | 2017-11-07 16:57:58 +0000 |
---|---|---|
committer | khorben <khorben@pkgsrc.org> | 2017-11-07 16:57:58 +0000 |
commit | ee5630a82e0348479e354b87a634e56a720514b8 (patch) | |
tree | b8b0c9b1d1ba137ec496c7bb1e514043802adfd1 /mk/compiler | |
parent | 66cefddb31ced4ba269a15997bdfd44850422386 (diff) | |
download | pkgsrc-ee5630a82e0348479e354b87a634e56a720514b8.tar.gz |
Always add "-fPIC" when linking with PKGSRC_MKPIE
This makes sure a simple "cc -o hello hello.c" will still build a valid
executable. It does not let us detect when CFLAGS or LDFLAGS are
ignored anymore, but it is legitimate for packages to expect it to work
without any additional parameter.
ld(1) does not expect "-fPIC" but it seems to be ignored by our wrappers
in this case, so no disruption is expected there.
Diffstat (limited to 'mk/compiler')
-rw-r--r-- | mk/compiler/gcc.mk | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mk/compiler/gcc.mk b/mk/compiler/gcc.mk index dab5ef749cc..5d8ed005d03 100644 --- a/mk/compiler/gcc.mk +++ b/mk/compiler/gcc.mk @@ -1,4 +1,4 @@ -# $NetBSD: gcc.mk,v 1.185 2017/10/03 09:38:16 jperkin Exp $ +# $NetBSD: gcc.mk,v 1.186 2017/11/07 16:57:58 khorben Exp $ # # This is the compiler definition for the GNU Compiler Collection. # @@ -336,7 +336,7 @@ _MKPIE_CFLAGS.gcc= -fPIC # XXX for executables it should be: #_MKPIE_CFLAGS.gcc= -fPIE # XXX for libraries a sink wrapper around gcc is required and used instead -_MKPIE_LDFLAGS.gcc= -pie +_MKPIE_LDFLAGS.gcc= -fPIC -pie .endif .if ${_PKGSRC_MKPIE} == "yes" |