summaryrefslogtreecommitdiffstats
path: root/Rules.mak
diff options
context:
space:
mode:
Diffstat (limited to 'Rules.mak')
-rw-r--r--Rules.mak23
1 files changed, 22 insertions, 1 deletions
diff --git a/Rules.mak b/Rules.mak
index bad4f5f7e..e9c5c53f6 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -103,7 +103,7 @@ SHELL_SET_X=set +x
endif
# Make certain these contain a final "/", but no "//"s.
-TARGET_ARCH:=$(shell grep -s ^TARGET_ARCH $(top_builddir)/.config | sed -e 's/^TARGET_ARCH=//' -e 's/"//g')
+TARGET_ARCH:=$(shell grep -s '^TARGET_ARCH' $(top_builddir)/.config | sed -e 's/^TARGET_ARCH=//' -e 's/"//g')
TARGET_ARCH:=$(strip $(subst ",, $(strip $(TARGET_ARCH))))
RUNTIME_PREFIX:=$(strip $(subst //,/, $(subst ,/, $(subst ",, $(strip $(RUNTIME_PREFIX))))))
DEVEL_PREFIX:=$(strip $(subst //,/, $(subst ,/, $(subst ",, $(strip $(DEVEL_PREFIX))))))
@@ -166,6 +166,8 @@ ifeq ($(TARGET_ARCH),arm)
endif
ifeq ($(TARGET_ARCH),mips)
+ CPU_LDFLAGS-$(ARCH_LITTLE_ENDIAN)+=-EL
+ CPU_LDFLAGS-$(ARCH_BIG_ENDIAN)+=-EB
CPU_CFLAGS-$(CONFIG_MIPS_ISA_1)+=-mips1
CPU_CFLAGS-$(CONFIG_MIPS_ISA_2)+=-mips2 -mtune=mips2
CPU_CFLAGS-$(CONFIG_MIPS_ISA_3)+=-mips3 -mtune=mips3
@@ -174,6 +176,11 @@ ifeq ($(TARGET_ARCH),mips)
CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS64)+=-mips64 -mtune=mips32
endif
+ifeq ($(TARGET_ARCH),nios)
+ CPU_LDFLAGS-y+=-m32
+ CPU_CFLAGS-y+=-m32
+endif
+
ifeq ($(TARGET_ARCH),sh)
OPTIMIZATION+=-fstrict-aliasing
OPTIMIZATION+= $(call check_gcc,-mprefergot,)
@@ -223,6 +230,12 @@ ifeq ($(TARGET_ARCH),powerpc)
PIEFLAG_NAME:=-fpie
endif
+ifeq ($(TARGET_ARCH),bfin)
+ # This should also work, but why bother ? ;)
+ #PICFLAG:=-fPIC -mid-shared-library
+ PICFLAG:=-fpic
+endif
+
ifeq ($(TARGET_ARCH),frv)
CPU_LDFLAGS-$(CONFIG_FRV)+=-melf32frvfd
CPU_CFLAGS-$(CONFIG_FRV)+=-mfdpic
@@ -279,7 +292,11 @@ ifeq ($(UCLIBC_HAS_SOFT_FLOAT),y)
# If -msoft-float isn't supported, we want an error anyway.
# Hmm... might need to revisit this for arm since it has 2 different
# soft float encodings.
+ifneq ($(TARGET_ARCH),nios)
+ifneq ($(TARGET_ARCH),nios2)
CPU_CFLAGS += -msoft-float
+endif
+endif
ifeq ($(TARGET_ARCH),arm)
# No longer needed with current toolchains, but leave it here for now.
# If anyone is actually still using gcc 2.95 (say), they can uncomment it.
@@ -400,6 +417,10 @@ ifneq ($(DOASSERTS),y)
CFLAGS+=-DNDEBUG
endif
+ifneq ($(strip $(C_SYMBOL_PREFIX)),"")
+CFLAGS+=-D__SYMBOL_PREFIX=1
+endif
+
# moved from ldso/{ldso,libdl}
# BEWARE!!! At least mips* will die if -O0 is used!!!
ifeq ($(TARGET_ARCH),mips)