diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-07-29 03:44:35 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-07-29 03:44:35 +0000 |
commit | ce5d0580f8ec4b8a154db400e71115cddf14d112 (patch) | |
tree | 94ca9240b1b3d5968d93870d9a5caeafc6cc97c0 | |
parent | f13d9be54c8845d70209cf5731079661f3d2b2f3 (diff) |
finish cleaning up the PIE flag checks
-rw-r--r-- | Rules.mak | 25 |
1 files changed, 9 insertions, 16 deletions
@@ -115,8 +115,7 @@ ARFLAGS:=cr OPTIMIZATION:= PICFLAG:=-fPIC - -PIEFLAG:=$(call check_gcc,-fPIE,) +PIEFLAG_NAME:=-fPIE # Some nice CPU specific optimizations ifeq ($(strip $(TARGET_ARCH)),i386) @@ -207,7 +206,7 @@ ifeq ($(strip $(TARGET_ARCH)),cris) CPU_LDFLAGS-$(CONFIG_CRIS)+=-mcrislinux CPU_CFLAGS-$(CONFIG_CRIS)+=-mlinux PICFLAG:=-fpic - PIEFLAG:=$(call check_gcc,-fpie,) + PIEFLAG_NAME:=-fpie endif ifeq ($(strip $(TARGET_ARCH)),powerpc) @@ -215,27 +214,26 @@ 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,) + PIEFLAG_NAME:=-fpie endif ifeq ($(strip $(TARGET_ARCH)),frv) CPU_LDFLAGS-$(CONFIG_FRV)+=-melf32frvfd CPU_CFLAGS-$(CONFIG_FRV)+=-mfdpic - # 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 - # and calls through PLTs, dynamic resolution of symbols, etc, - # which would break as well, but -Bsymbolic comes to the rescue. - LDPIEFLAG=-shared -Bsymbolic UCLIBC_LDSO=ld.so.1 endif +ifneq ($(UCLIBC_BUILD_PIE),y) +PIEFLAG:= +else +PIEFLAG:=$(call check_gcc,$(PIEFLAG_NAME),) +endif + # Use '-Os' optimization if available, else use -O2, allow Config to override OPTIMIZATION+=$(call check_gcc,-Os,-O2) # Use the gcc 3.4 -funit-at-a-time optimization when available OPTIMIZATION+=$(call check_gcc,-funit-at-a-time,) - # Add a bunch of extra pedantic annoyingly strict checks XWARNINGS=$(subst ",, $(strip $(WARNINGS))) -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing XARCH_CFLAGS=$(subst ",, $(strip $(ARCH_CFLAGS))) @@ -255,11 +253,6 @@ ifeq ($(strip $(TARGET_ARCH)),arm) endif endif -ifneq ($(UCLIBC_BUILD_PIE),y) -PIEFLAG= -LDPIEFLAG= -endif - SSP_DISABLE_FLAGS:=$(call check_gcc,-fno-stack-protector,) ifeq ($(UCLIBC_BUILD_SSP),y) SSP_CFLAGS:=$(call check_gcc,-fno-stack-protector-all,) |