From 81dd08df0db585f2216026076e97135fa309eae2 Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 19 Oct 2008 15:22:50 +0000 Subject: [PATCH] handle assembly files for MKPIE --- share/mk/bsd.lib.mk | 3 ++- share/mk/bsd.prog.mk | 3 ++- share/mk/bsd.sys.mk | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 766d06ecf8bd..daf442247ac6 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.lib.mk,v 1.287 2008/10/17 17:29:39 christos Exp $ +# $NetBSD: bsd.lib.mk,v 1.288 2008/10/19 15:22:50 christos Exp $ # @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94 .include @@ -39,6 +39,7 @@ clean: cleanlib # files or always have a shared library. .if defined(MKPIE) && (${MKPIE} != "no") CFLAGS+= ${PIE_CFLAGS} +AFLAGS+= ${PIE_AFLAGS} .endif COPTS+= ${COPTS.lib${LIB}} CPPFLAGS+= ${CPPFLAGS.lib${LIB}} diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index 87ed7e3563b1..cc7a5a3eb424 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.prog.mk,v 1.238 2008/10/16 14:36:42 christos Exp $ +# $NetBSD: bsd.prog.mk,v 1.239 2008/10/19 15:22:50 christos Exp $ # @(#)bsd.prog.mk 8.2 (Berkeley) 4/2/94 .ifndef HOSTPROG @@ -53,6 +53,7 @@ CLEANFILES+=strings .if defined(MKPIE) && (${MKPIE} != "no") CFLAGS+= ${PIE_CFLAGS} +AFLAGS+= ${PIE_AFLAGS} LDFLAGS+= ${PIE_LDFLAGS} .endif diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index bc689c407a92..eed646f3014d 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.sys.mk,v 1.174 2008/10/16 14:36:42 christos Exp $ +# $NetBSD: bsd.sys.mk,v 1.175 2008/10/19 15:22:50 christos Exp $ # # Build definitions used for NetBSD source tree builds. @@ -89,8 +89,9 @@ CFLAGS+= ${CPUFLAGS} AFLAGS+= ${CPUFLAGS} # Position Independent Executable flags -PIE_CFLAGS?= -fPIC +PIE_CFLAGS?= -fPIC -DPIC PIE_LDFLAGS?= -Wl,-pie -shared-libgcc +PIE_AFLAGS?= -fPIC -DPIC # Helpers for cross-compiling HOST_CC?= cc