summaryrefslogtreecommitdiff
path: root/Rules.mak
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-07-15 07:44:34 +0000
committerEric Andersen <andersen@codepoet.org>2003-07-15 07:44:34 +0000
commitecbc93c3990cf2ed89a62639139ab89e68037a3f (patch)
tree3016549ac0c94b87e885f90db1994d1c38d4dc89 /Rules.mak
parenteb37884f7f33a81ec7dae0859d269a6b25ff8e36 (diff)
Patch from Peter Kjellerstedt to make it simpler for arches to specify
either -fPIC or -fpic
Diffstat (limited to 'Rules.mak')
-rw-r--r--Rules.mak9
1 files changed, 4 insertions, 5 deletions
diff --git a/Rules.mak b/Rules.mak
index b328c7c29..a3cd1f2ba 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -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)