summaryrefslogtreecommitdiff
path: root/Rules.mak
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-12-22 21:34:27 +0000
committerEric Andersen <andersen@codepoet.org>2004-12-22 21:34:27 +0000
commitf8e6aa06ffb1897b87f4d90545e8ca5b3d0cdb9a (patch)
tree2611d23c8bdd8c0191e6b32cb0e074826293cc23 /Rules.mak
parent6ae64d25832babd791a3991c34f23c90fd4966ae (diff)
Patch from Peter S. Mazinger:
Add UCLIBC_BUILD_NOEXECSTACK support.
Diffstat (limited to 'Rules.mak')
-rw-r--r--Rules.mak8
1 files changed, 6 insertions, 2 deletions
diff --git a/Rules.mak b/Rules.mak
index 4e2853807..edc9241bf 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -89,10 +89,10 @@ ARFLAGS:=r
OPTIMIZATION:=
PICFLAG:=-fPIC
+
PIEFLAG:=$(call check_gcc,-fPIE,)
ifeq ($(strip $(PIEFLAG)),-fPIE)
-# should add check if ld supports -pie
-LDPIEFLAG:=-Wl,-pie
+LDPIEFLAG:=$(shell $(LD) --help | grep -q pie && echo "-Wl,-pie")
endif
# Some nice CPU specific optimizations
@@ -286,6 +286,10 @@ ifeq ($(DOPIC),y)
endif
ASFLAGS = $(CFLAGS)
+ifeq ($(UCLIBC_BUILD_NOEXECSTACK),y)
+check_as_noexecstack=$(shell if $(LD) --help | grep -q "z noexecstack"; then echo "-Wa,--noexecstack"; fi)
+ASFLAGS += $(check_as_noexecstack)
+endif
LIBGCC_CFLAGS ?= $(CFLAGS) $(CPU_CFLAGS-y)
LIBGCC:=$(shell $(CC) $(LIBGCC_CFLAGS) -print-libgcc-file-name)