Browse Source

fix qemu-ppc64 building on Darwin, use --with-cpu=ultrasparc for qemu-sparc64, still another issue exist.

Waldemar Brodkorb 10 years ago
parent
commit
7d2b38ba6e

+ 1 - 1
Makefile

@@ -2,7 +2,7 @@
 # material, please see the LICENCE file in the top-level directory.
 
 _UNLIMIT=	__limit=$$(ulimit -dH 2>/dev/null); \
-		test -n "$$__limit" && ulimit -Sd $$__limit;
+		test -n "$$__limit" && ulimit -Sd $$__limit; ulimit -n 1024;
 
 all: checkreloc .prereq_done
 	@${_UNLIMIT} ${GMAKE_INV} all

+ 1 - 1
mk/build.mk

@@ -561,7 +561,7 @@ test-framework:
 	for libc in uclibc glibc musl;do \
 		mkdir -p $(TOPDIR)/firmware/$(SYSTEM)_$(ARCH)_$$libc; \
 		( \
-			for arch in arm mips mipsel i686 x86_64;do \
+			for arch in arm mips mipsel mips64 mips64el ppc ppc64 sparc sparc64 i686 x86_64;do \
 				tarch=$$(echo $$arch|sed -e "s#el##" -e "s#eb##" -e "s#mips64.*#mips#" -e "s#i686#x86#"); \
 				echo === building qemu-$$arch for $$libc with $$tarch on $$(date); \
 				$(GMAKE) prereq && \

+ 1 - 1
target/config/Config.in

@@ -579,7 +579,7 @@ config ADK_TARGET_CFLAGS
 	default "-march=atom" if ADK_CPU_ATOM
 	default "-march=amdfam10" if ADK_CPU_AMDFAM10
 	default "-mcpu=v8" if ADK_CPU_SPARC_V8
-	default "-m64 -mcpu=v9" if ADK_CPU_SPARC_V9
+	default "-m64 -mcpu=ultrasparc" if ADK_CPU_SPARC_V9
 	default "-march=loongson2f -Wa,-mfix-loongson2f-nop" if ADK_CPU_LOONGSON2F
 	default "-march=mips32" if ADK_CPU_MIPS32
 	default "-march=mips64" if ADK_CPU_MIPS64

+ 11 - 0
target/linux/patches/3.13.5/ppc64-missing_arch_random.patch

@@ -0,0 +1,11 @@
+diff -Nur linux-3.13.5.orig/arch/powerpc/platforms/pseries/Kconfig linux-3.13.5/arch/powerpc/platforms/pseries/Kconfig
+--- linux-3.13.5.orig/arch/powerpc/platforms/pseries/Kconfig	2014-02-22 22:35:30.000000000 +0100
++++ linux-3.13.5/arch/powerpc/platforms/pseries/Kconfig	2014-03-04 13:55:06.000000000 +0100
+@@ -20,6 +20,7 @@
+ 	select PPC_DOORBELL
+ 	select HAVE_CONTEXT_TRACKING
+ 	select HOTPLUG_CPU if SMP
++	select ARCH_RANDOM
+ 	default y
+ 
+ config PPC_SPLPAR

+ 4 - 0
toolchain/gcc/Makefile

@@ -100,6 +100,10 @@ ifeq ($(ADK_CPU_CORTEX_A9),y)
 GCC_CONFOPTS+=          --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=neon
 endif
 
+ifeq ($(ADK_CPU_SPARC_V9),y)
+GCC_CONFOPTS+=          --with-cpu=ultrasparc
+endif
+
 ifneq ($(ADK_TARGET_MIPS_ABI),)
 GCC_CONFOPTS+=		--with-abi=${ADK_TARGET_MIPS_ABI}
 endif

+ 16 - 17
toolchain/glibc/patches/glibc-cross.patch

@@ -1,8 +1,8 @@
-diff -Nur glibc-2.18.orig/sunrpc/rpc/types.h glibc-2.18/sunrpc/rpc/types.h
---- glibc-2.18.orig/sunrpc/rpc/types.h	2013-08-11 00:52:55.000000000 +0200
-+++ glibc-2.18/sunrpc/rpc/types.h	2013-09-13 08:25:18.000000000 +0200
-@@ -69,19 +69,25 @@
- #include <sys/types.h>
+diff -Nur glibc-2.19.orig/sunrpc/rpc/types.h glibc-2.19/sunrpc/rpc/types.h
+--- glibc-2.19.orig/sunrpc/rpc/types.h	2014-02-07 10:04:38.000000000 +0100
++++ glibc-2.19/sunrpc/rpc/types.h	2014-03-03 13:42:42.000000000 +0100
+@@ -74,19 +74,24 @@
+ # define __daddr_t_defined
  #endif
  
 -#ifndef __u_char_defined
@@ -18,15 +18,14 @@ diff -Nur glibc-2.18.orig/sunrpc/rpc/types.h glibc-2.18/sunrpc/rpc/types.h
 +typedef unsigned short u_short;
 +typedef unsigned int u_int;
 +typedef unsigned long u_long;
-+#if __WORDSIZE == 64
++#if __WORDSIZE == 64 
++#ifndef __APPLE__
 +typedef long int quad_t;
 +typedef unsigned long int u_quad_t;
++#endif
 +#elif defined __GLIBC_HAVE_LONG_LONG
 +typedef long long int quad_t;
 +typedef unsigned long long int u_quad_t;
-+#endif
-+#if defined(_CROSS_RPCGEN_)
-+typedef u_quad_t fsid_t;
  #endif
 -#ifndef __daddr_t_defined
 -typedef __daddr_t daddr_t;
@@ -39,14 +38,14 @@ diff -Nur glibc-2.18.orig/sunrpc/rpc/types.h glibc-2.18/sunrpc/rpc/types.h
  # define __daddr_t_defined
  #endif
  
-diff -Nur glibc-2.18.orig/sunrpc/rpc_main.c glibc-2.18/sunrpc/rpc_main.c
---- glibc-2.18.orig/sunrpc/rpc_main.c	2013-08-11 00:52:55.000000000 +0200
-+++ glibc-2.18/sunrpc/rpc_main.c	2013-09-13 08:26:07.000000000 +0200
+diff -Nur glibc-2.19.orig/sunrpc/rpc_main.c glibc-2.19/sunrpc/rpc_main.c
+--- glibc-2.19.orig/sunrpc/rpc_main.c	2014-02-07 10:04:38.000000000 +0100
++++ glibc-2.19/sunrpc/rpc_main.c	2014-03-04 07:12:00.000000000 +0100
 @@ -38,7 +38,11 @@
  #include <stdio.h>
  #include <string.h>
  #include <unistd.h>
-+#ifdef _CROSS_RPCGEN_
++#ifdef __APPLE__
 +#define gettext(X) (X)
 +#else
  #include <libintl.h>
@@ -70,14 +69,14 @@ diff -Nur glibc-2.18.orig/sunrpc/rpc_main.c glibc-2.18/sunrpc/rpc_main.c
  
      }
    else
-diff -Nur glibc-2.18.orig/sunrpc/rpc_scan.c glibc-2.18/sunrpc/rpc_scan.c
---- glibc-2.18.orig/sunrpc/rpc_scan.c	2013-08-11 00:52:55.000000000 +0200
-+++ glibc-2.18/sunrpc/rpc_scan.c	2013-09-13 08:25:18.000000000 +0200
+diff -Nur glibc-2.19.orig/sunrpc/rpc_scan.c glibc-2.19/sunrpc/rpc_scan.c
+--- glibc-2.19.orig/sunrpc/rpc_scan.c	2014-02-07 10:04:38.000000000 +0100
++++ glibc-2.19/sunrpc/rpc_scan.c	2014-03-04 07:11:29.000000000 +0100
 @@ -37,7 +37,11 @@
  #include <stdio.h>
  #include <ctype.h>
  #include <string.h>
-+#ifdef _CROSS_RPCGEN_
++#ifdef __APPLE__
 +#define gettext(X) (X)
 +#else
  #include <libintl.h>

+ 0 - 21
toolchain/glibc/patches/sparc64.patch

@@ -1,21 +0,0 @@
-diff -Nur glibc-2.12.1.orig/sysdeps/sparc/sparc64/Makefile glibc-2.12.1/sysdeps/sparc/sparc64/Makefile
---- glibc-2.12.1.orig/sysdeps/sparc/sparc64/Makefile	2010-07-27 13:34:39.000000000 +0200
-+++ glibc-2.12.1/sysdeps/sparc/sparc64/Makefile	2011-01-01 23:58:16.370676501 +0100
-@@ -1,3 +1,5 @@
-+sysdep-CFLAGS += -mcpu=v9 -Wa,-Av9a
-+
- ifeq ($(subdir),csu)
- sysdep_routines += hp-timing
- elide-routines.os += hp-timing
-@@ -10,3 +12,11 @@
- ifeq ($(subdir),string)
- sysdep_routines += align-cpy
- endif
-+
-+ASFLAGS-.o += -Wa,-Av9a
-+ASFLAGS-.os += -Wa,-Av9a
-+ASFLAGS-.op += -Wa,-Av9a
-+ASFLAGS-.og += -Wa,-Av9a
-+ASFLAGS-.ob += -Wa,-Av9a
-+ASFLAGS-.oS += -Wa,-Av9a
-+