summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.in2
-rw-r--r--Rules.mak11
-rw-r--r--extra/Configs/Config.mips18
-rw-r--r--test/Rules.mak3
4 files changed, 31 insertions, 3 deletions
diff --git a/Makefile.in b/Makefile.in
index d6f8cf72e..8eaa7cffb 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -94,7 +94,7 @@ headers: include/bits/uClibc_config.h
cd $(top_builddir); \
tmp=`mktemp include/bits/sysnum.h.XXXXXX 2>/dev/null`; \
[ -z "$$tmp" ] && tmp='include/bits/sysnum.h.new'; \
- top_builddir=. CC="$(CC)" $(SHELL) extra/scripts/gen_bits_syscall_h.sh > $$tmp; \
+ top_builddir=. CC="$(CC) $(CPU_CFLAGS)" $(SHELL) extra/scripts/gen_bits_syscall_h.sh > $$tmp; \
if cmp include/bits/sysnum.h $$tmp >/dev/null 2>&1; then \
$(RM) $$tmp; \
else \
diff --git a/Rules.mak b/Rules.mak
index f19529741..99d7a88a9 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -207,6 +207,17 @@ ifeq ($(TARGET_ARCH),mips)
CPU_CFLAGS-$(CONFIG_MIPS_ISA_4)+=-mips4 -mtune=mips4
CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS32)+=-mips32 -mtune=mips32
CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS64)+=-mips64 -mtune=mips32
+ ifeq ($(strip $(ARCH_BIG_ENDIAN)),y)
+ CPU_LDFLAGS-$(CONFIG_MIPS_N64_ABI)+=-melf64btsmip
+ CPU_LDFLAGS-$(CONFIG_MIPS_O32_ABI)+=-melf32btsmip
+ endif
+ ifeq ($(strip $(ARCH_LITTLE_ENDIAN)),y)
+ CPU_LDFLAGS-$(CONFIG_MIPS_N64_ABI)+=-melf64ltsmip
+ CPU_LDFLAGS-$(CONFIG_MIPS_O32_ABI)+=-melf32ltsmip
+ endif
+ CPU_CFLAGS-$(CONFIG_MIPS_N64_ABI)+=-mabi=64
+ CPU_CFLAGS-$(CONFIG_MIPS_O32_ABI)+=-mabi=32
+ CPU_CFLAGS-$(CONFIG_MIPS_N32_ABI)+=-mabi=n32
endif
ifeq ($(TARGET_ARCH),nios)
diff --git a/extra/Configs/Config.mips b/extra/Configs/Config.mips
index 43e0bbb46..0794c5f45 100644
--- a/extra/Configs/Config.mips
+++ b/extra/Configs/Config.mips
@@ -54,3 +54,21 @@ config CONFIG_MIPS_ISA_MIPS64
bool "MIPS64"
endchoice
+
+choice
+ prompt "Target ABI"
+ default CONFIG_MIPS_O32_ABI
+ help
+ This is the ABI you wish to build use. Choose either O32, N32
+ or N64.
+
+config CONFIG_MIPS_O32_ABI
+ bool "O32 ABI"
+
+config CONFIG_MIPS_N64_ABI
+ bool "N64 ABI"
+
+config CONFIG_MIPS_N32_ABI
+ bool "N32 ABI"
+
+endchoice
diff --git a/test/Rules.mak b/test/Rules.mak
index 430f789da..72a922797 100644
--- a/test/Rules.mak
+++ b/test/Rules.mak
@@ -30,8 +30,7 @@ TARGET_ARCH:=$(shell $(CC) -dumpmachine | sed -e s'/-.*//' \
-e 's/ppc/powerpc/g' \
-e 's/v850.*/v850/g' \
-e 's/sh[234]/sh/' \
- -e 's/mips-.*/mips/' \
- -e 's/mipsel-.*/mipsel/' \
+ -e 's/mips.*/mips/' \
-e 's/cris.*/cris/' \
)
endif