diff options
-rw-r--r-- | Rules.mak | 9 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/Makefile | 2 |
2 files changed, 5 insertions, 6 deletions
@@ -108,6 +108,7 @@ export TARGET_ARCH ARFLAGS:=r OPTIMIZATION:= +PICFLAG:=-fPIC # Some nice CPU specific optimizations ifeq ($(strip $(TARGET_ARCH)),i386) OPTIMIZATION+=$(call check_gcc,-mpreferred-stack-boundary=2,) @@ -158,6 +159,7 @@ endif ifeq ($(strip $(TARGET_ARCH)),cris) CPU_LDFLAGS-$(CONFIG_CRIS):="-mcrislinux" CPU_CFLAGS-$(CONFIG_CRIS):="-mlinux" + PICFLAG:=-fpic endif # use '-Os' optimization if available, else use -O2, allow Config to override @@ -174,6 +176,7 @@ CFLAGS:=$(XWARNINGS) $(OPTIMIZATION) $(XARCH_CFLAGS) $(CPU_CFLAGS) \ ifeq ($(DODEBUG),y) CFLAGS += -g + #CFLAGS = $(XWARNINGS) -O0 -g $(CPU_CFLAGS) -fno-builtin -nostdinc -D_LIBC -I$(TOPDIR)include -I. LDFLAGS:= $(CPU_LDFLAGS-y) -shared --warn-common --warn-once -z combreloc STRIPTOOL:= true -Since_we_are_debugging else @@ -206,11 +209,7 @@ endif CFLAGS_NOPIC:=$(CFLAGS) ifeq ($(DOPIC),y) -ifeq ($(strip $(TARGET_ARCH)),cris) - CFLAGS += -fpic -mlinux -else - CFLAGS += -fPIC -endif + CFLAGS += $(PICFLAG) endif LIBGCC_CFLAGS ?= $(CFLAGS) $(CPU_CFLAGS-y) diff --git a/libc/sysdeps/linux/common/Makefile b/libc/sysdeps/linux/common/Makefile index 064626050..f308856ec 100644 --- a/libc/sysdeps/linux/common/Makefile +++ b/libc/sysdeps/linux/common/Makefile @@ -45,7 +45,7 @@ SAFECFLAGS=$(XWARNINGS) $(OPTIMIZATION) $(XARCH_CFLAGS) $(CPU_CFLAGS) -fno-built # SAFECFLAGS := $(subst -g,,$(SAFECFLAGS)) ifeq ($(strip $(DOPIC)),y) -SAFECFLAGS+=-fPIC +SAFECFLAGS+=$(PICFLAG) endif ifeq ($(strip $(UCLIBC_PROFILING)),y) SAFECFLAGS+=-DGMON_SUPPORT |