changeset 991:c49753970700

Add 64-bit mips target.
author Rob Landley <rob@landley.net>
date Mon, 01 Mar 2010 02:43:27 -0600
parents 00704bb2c556
children 3dc3e3627af2
files sources/patches/gcc-core-fixmips64.patch sources/patches/uClibc-mips64.patch sources/targets/mips64/description sources/targets/mips64/miniconfig-linux sources/targets/mips64/settings
diffstat 5 files changed, 149 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/patches/gcc-core-fixmips64.patch	Mon Mar 01 02:43:27 2010 -0600
@@ -0,0 +1,12 @@
+diff -ru gcc-core/gcc/config/mips/linux64.h gcc-core.bak/gcc/config/mips/linux64.h
+--- gcc-core/gcc/config/mips/linux64.h	2006-05-04 08:21:11.000000000 -0500
++++ gcc-core.bak/gcc/config/mips/linux64.h	2010-02-27 23:00:22.000000000 -0600
+@@ -23,7 +23,7 @@
+    in order to make the other specs easier to write.  */
+ #define DRIVER_SELF_SPECS \
+ "%{!EB:%{!EL:%(endian_spec)}}", \
+-"%{!mabi=*: -mabi=n32}"
++"%{!mabi=*: -mabi=64}"
+ 
+ #undef SUBTARGET_ASM_SPEC
+ #define SUBTARGET_ASM_SPEC "\
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/patches/uClibc-mips64.patch	Mon Mar 01 02:43:27 2010 -0600
@@ -0,0 +1,46 @@
+From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
+Subject: [PATCH] getdents: Fix mips64 build
+
+Some archs (such as mips64) do not have getdents64 syscall but have
+getdents syscall.  Define alias for it.
+
+This fixes regression from 0.9.30.1.
+
+Backgrounds:
+This is once done by commit e8b1c674.  But after the commit 33bcf733
+("Use getdents syscall if kernel provide supports for this instead of
+relying upon getdents64."), if __ASSUME_GETDENTS32_D_TYPE was defined
+the alias for getdents64 is not defined.  The macro
+__ASSUME_GETDENTS32_D_TYPE had been effectively ignored until 0.9.30.1
+but the commit 0f0f20ab ("Move kernel-features.h header from the
+linuxthread directory to a common one...") really enables it.
+
+Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
+---
+ libc/sysdeps/linux/common/getdents.c |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/libc/sysdeps/linux/common/getdents.c b/libc/sysdeps/linux/common/getdents.c
+index 6a38772..5dda190 100644
+--- a/libc/sysdeps/linux/common/getdents.c
++++ b/libc/sysdeps/linux/common/getdents.c
+@@ -133,10 +133,6 @@ ssize_t __getdents (int fd, char *buf, size_t nbytes)
+     return (char *) dp - buf;
+ }
+ 
+-#if defined __UCLIBC_HAS_LFS__ && ! defined __NR_getdents64
+-attribute_hidden strong_alias(__getdents,__getdents64)
+-#endif
+-
+ #elif __WORDSIZE == 32
+ 
+ /* Experimentally off - libc_hidden_proto(memmove) */
+@@ -167,4 +163,8 @@ ssize_t __getdents (int fd, char *buf, size_t nbytes)
+ }
+ #endif
+ 
++#if defined __UCLIBC_HAS_LFS__ && ! defined __NR_getdents64
++attribute_hidden strong_alias(__getdents,__getdents64)
++#endif
++
+ #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/targets/mips64/description	Mon Mar 01 02:43:27 2010 -0600
@@ -0,0 +1,1 @@
+64 bit big endian mips.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/targets/mips64/miniconfig-linux	Mon Mar 01 02:43:27 2010 -0600
@@ -0,0 +1,66 @@
+CONFIG_MIPS_MALTA=y
+CONFIG_CPU_MIPS64_R1=y
+CONFIG_64BIT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_HZ_100=y
+CONFIG_EXPERIMENTAL=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_PCI_QUIRKS=y
+CONFIG_COMPAT_BRK=y
+CONFIG_BLOCK=y
+CONFIG_PCI=y
+CONFIG_BINFMT_ELF=y
+CONFIG_PM=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_BLK_DEV=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_IDE=y
+CONFIG_IDE_GD=y
+CONFIG_IDE_GD_ATA=y
+CONFIG_BLK_DEV_GENERIC=y
+CONFIG_BLK_DEV_PIIX=y
+CONFIG_NETDEVICES=y
+CONFIG_NET_ETHERNET=y
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=y
+CONFIG_8139CP=y
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=8
+CONFIG_HW_RANDOM=y
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+CONFIG_FILE_LOCKING=y
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_MISC_FILESYSTEMS=y
+CONFIG_SQUASHFS=y
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/targets/mips64/settings	Mon Mar 01 02:43:27 2010 -0600
@@ -0,0 +1,24 @@
+KARCH=mips
+KERNEL_PATH=vmlinux
+BINUTILS_FLAGS="--enable-64-bit-bfd"
+GCC_FLAGS="--enable-sjlj-exceptions"
+QEMU_TEST=mips64
+
+ROOT=hda
+CONSOLE=ttyS0
+
+# Gentoo from Scratch
+GFS_CHOST="mips64-gentoo-linux-uclibc"
+GFS_ARCH="mips64"
+
+UCLIBC_CONFIG="
+TARGET_mips=y
+CONFIG_MIPS_N64_ABI=y
+CONFIG_MIPS_ISA_MIPS64=y
+UCLIBC_HAS_FPU=y
+"
+
+emulator_command()
+{
+  echo qemu-system-mips64 -M malta $(qemu_defaults "$@")
+}