summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2004-10-14 10:10:34 +0000
committerJoakim Tjernlund <joakim.tjernlund@transmode.se>2004-10-14 10:10:34 +0000
commit46a413e1c73cee3360ed1ea57749946a6bea4297 (patch)
treefc1cc046877af627a6ce5f0d8cbf66c518bf2300
parent13ca772ddcc86d5a92ee8277d712ed108c1ba606 (diff)
hmm, somehow cvs lost this file in the previous commit.
-rw-r--r--Rules.mak13
1 files changed, 12 insertions, 1 deletions
diff --git a/Rules.mak b/Rules.mak
index 72dba878f..f41adaa62 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -89,6 +89,10 @@ ARFLAGS:=r
OPTIMIZATION:=
PICFLAG:=-fPIC
+PIEFLAG:=$(call check_gcc,-fPIE,)
+ifeq ($(strip $(PIEFLAG)),-fPIE)
+LDPIEFLAG:=-Wl,-pie
+endif
# Some nice CPU specific optimizations
ifeq ($(strip $(TARGET_ARCH)),i386)
@@ -172,6 +176,7 @@ ifeq ($(strip $(TARGET_ARCH)),cris)
CPU_LDFLAGS-$(CONFIG_CRIS)+=-mcrislinux
CPU_CFLAGS-$(CONFIG_CRIS)+=-mlinux
PICFLAG:=-fpic
+ PIEFLAG:=$(call check_gcc,-fpie,)
endif
ifeq ($(strip $(TARGET_ARCH)),powerpc)
@@ -179,13 +184,14 @@ ifeq ($(strip $(TARGET_ARCH)),powerpc)
# enough. Therefore use -fpic which will reduce code size and generates
# faster code.
PICFLAG:=-fpic
+ PIEFLAG=$(call check_gcc,-fpie,)
endif
ifeq ($(strip $(TARGET_ARCH)),frv)
CPU_LDFLAGS-$(CONFIG_FRV)+=-melf32frvfd
CPU_CFLAGS-$(CONFIG_FRV)+=-mfdpic
PICFLAG=-fPIC -DPIC
- PIEFLAG=-fpie
+ PIEFLAG=$(call check_gcc,-fpie,)
# Using -pie causes the program to have an interpreter, which is
# forbidden, so we must make do with -shared. Unfortunately,
# -shared by itself would get us global function descriptors
@@ -220,6 +226,11 @@ ifeq ($(strip $(TARGET_ARCH)),arm)
endif
endif
+ifneq ($(strip $(UCLIBC_PIE_SUPPORT)),y)
+PIEFLAG=
+LDPIEFLAG=
+endif
+
ifeq ($(SSP_CFLAGS),)
SSP_CFLAGS=$(call check_gcc,-fno-stack-protector-all,)
SSP_CFLAGS+=$(call check_gcc,-fstack-protector,)