[PATCH 13/13] mips64: Makefile, Config.in, etc.

Atsushi Nemoto anemo at mba.ocn.ne.jp
Sun Sep 17 16:40:50 UTC 2006


Add selection of 3 ABI.
CPU_CFLAGS is needed to generate correct sysnum.h.
Fix test/Rules.mak.

-------------- next part --------------
diff -urNp uClibc-20060913/Makefile.in uClibc/Makefile.in
--- uClibc-20060913/Makefile.in	2006-09-13 16:10:37.000000000 +0900
+++ uClibc/Makefile.in	2006-09-14 09:11:47.000000000 +0900
@@ -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 -urNp uClibc-20060913/Rules.mak uClibc/Rules.mak
--- uClibc-20060913/Rules.mak	2006-09-13 16:10:37.000000000 +0900
+++ uClibc/Rules.mak	2006-09-14 09:11:47.000000000 +0900
@@ -205,6 +205,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 -urNp uClibc-20060913/extra/Configs/Config.mips uClibc/extra/Configs/Config.mips
--- uClibc-20060913/extra/Configs/Config.mips	2006-09-13 16:10:09.000000000 +0900
+++ uClibc/extra/Configs/Config.mips	2006-09-14 09:11:47.000000000 +0900
@@ -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 -urNp uClibc-20060913/test/Rules.mak uClibc/test/Rules.mak
--- uClibc-20060913/test/Rules.mak	2006-09-13 16:10:03.000000000 +0900
+++ uClibc/test/Rules.mak	2006-09-14 09:11:52.000000000 +0900
@@ -30,8 +30,7 @@ TARGET_ARCH:=$(shell $(CC) -dumpmachine 
 	-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


More information about the uClibc mailing list