Browse Source

mips64 patch from Atsushi Nemoto:
Add selection of 3 ABI.
CPU_CFLAGS is needed to generate correct sysnum.h.
Fix test/Rules.mak.

Eric Andersen 18 years ago
parent
commit
1da8fd9223
4 changed files with 31 additions and 3 deletions
  1. 1 1
      Makefile.in
  2. 11 0
      Rules.mak
  3. 18 0
      extra/Configs/Config.mips
  4. 1 2
      test/Rules.mak

+ 1 - 1
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 \

+ 11 - 0
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)

+ 18 - 0
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

+ 1 - 2
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