From 46a413e1c73cee3360ed1ea57749946a6bea4297 Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Thu, 14 Oct 2004 10:10:34 +0000 Subject: hmm, somehow cvs lost this file in the previous commit. --- Rules.mak | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Rules.mak') 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,) -- cgit v1.2.3