diff options
Diffstat (limited to 'share/mk/bsd.prog.mk')
-rw-r--r-- | share/mk/bsd.prog.mk | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index fd35e03..229ce8e 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -11,6 +11,18 @@ CFLAGS+=${COPTS} .endif +.if ${MK_PIE} != "no" && (!defined(NO_PIE) || ${NO_PIE} == "no") +.if !defined(RESCUE) && !defined(NO_SHARED) +CFLAGS+= -fPIE -pie +LDFLAGS+= -pie +.elif defined(NO_SHARED) +.if ${NO_SHARED} == "no" || ${NO_SHARED} == "NO" +CFLAGS+= -fPIE -pie +LDFLAGS+= -pie +.endif +.endif +.endif + .if ${MK_ASSERT_DEBUG} == "no" CFLAGS+= -DNDEBUG NO_WERROR= |