From ce9efda15bf412d46ca64aa8c2d4f2d3bb56d2a2 Mon Sep 17 00:00:00 2001 From: deraadt Date: Tue, 23 Dec 2014 16:35:53 +0000 Subject: [PATCH] Small changes to buil --- share/mk/bsd.own.mk | 9 +++++++-- share/mk/bsd.prog.mk | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index e916153c03c..aa8e02bd0eb 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -1,4 +1,4 @@ -# $OpenBSD: bsd.own.mk,v 1.150 2014/04/22 14:42:53 reyk Exp $ +# $OpenBSD: bsd.own.mk,v 1.151 2014/12/23 16:35:53 deraadt Exp $ # $NetBSD: bsd.own.mk,v 1.24 1996/04/13 02:08:09 thorpej Exp $ # Host-specific overrides @@ -25,6 +25,7 @@ BINUTILS217_ARCH=hppa64 ia64 # m88k unknown # hppa64 unknown PIE_ARCH=alpha amd64 hppa i386 mips64 mips64el powerpc sh sparc64 +STATICPIE_ARCH=amd64 .for _arch in ${MACHINE_ARCH} .if !empty(GCC3_ARCH:M${_arch}) @@ -39,6 +40,10 @@ BINUTILS_VERSION=binutils-2.17 BINUTILS_VERSION=binutils .endif +.if !empty(STATICPIE_ARCH:M${_arch}) +STATICPIE?=-pie -Wl,-Bsymbolic +.endif + .if !empty(PIE_ARCH:M${_arch}) NOPIE_FLAGS?=-fno-pie NOPIE_LDFLAGS?=-nopie @@ -118,7 +123,7 @@ INSTALL_STRIP?= -s # This may be changed for _single filesystem_ configurations (such as # routers and other embedded systems); normal systems should leave it alone! -STATIC?= -static +STATIC?= -static ${STATICPIE} # Define SYS_INCLUDE to indicate whether you want symbolic links to the system # source (``symlinks''), or a separate copy (``copies''); (latter useful diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk index cbfb3776f74..88e89f3bde1 100644 --- a/share/mk/bsd.prog.mk +++ b/share/mk/bsd.prog.mk @@ -1,4 +1,4 @@ -# $OpenBSD: bsd.prog.mk,v 1.65 2014/10/31 13:46:17 jsing Exp $ +# $OpenBSD: bsd.prog.mk,v 1.66 2014/12/23 16:35:53 deraadt Exp $ # $NetBSD: bsd.prog.mk,v 1.55 1996/04/08 21:19:26 jtc Exp $ # @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 @@ -10,7 +10,7 @@ .SUFFIXES: .out .o .c .cc .cpp .C .cxx .y .l .s .8 .7 .6 .5 .4 .3 .2 .1 .0 -.if defined(LDSTATIC) || defined(NOPIE) +.if (defined(LDSTATIC) && !defined(STATICPIE)) || defined(NOPIE) CFLAGS+= ${NOPIE_FLAGS} AFLAGS+= ${NOPIE_FLAGS} LDFLAGS+= ${NOPIE_LDFLAGS} -- 2.20.1