This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Building syscall.h on mips
- From: "Steve Ellcey " <sellcey at mips dot com>
- To: <libc-ports at sourceware dot org>
- Date: Tue, 22 May 2012 14:01:52 -0700
- Subject: Building syscall.h on mips
I am trying to build the ToT glibc on MIPS and am running into a problem.
I build it 8 different ways for various versions and when I compile it with
'gcc -mips32', it fails to build. This is due to the syscall-list changes
in glibc-ports/sysdeps/unix/sysv/linux/mips/Makefile.
With these changes, the Makefile is trying to run GCC with '-mips32 -mabi=n32'
which is an illegal combination. The -mips32 comes from my setting of CC and
the -mabi=n32 is coming from syscall-list-n32-options in the Makefile.
I was able to fix things with this patch:
diff --git a/ports/sysdeps/unix/sysv/linux/mips/Makefile b/ports/sysdeps/unix/sy
index 41e9258..a8aebf7 100644
--- a/ports/sysdeps/unix/sysv/linux/mips/Makefile
+++ b/ports/sysdeps/unix/sysv/linux/mips/Makefile
@@ -9,11 +9,11 @@ sysdep_headers += sys/cachectl.h sys/sysmips.h sys/tas.h
syscall-list-variants := o32 n32 n64
syscall-list-includes := sgidefs.h
-syscall-list-o32-options := -mabi=32
+syscall-list-o32-options := -mips32 -march=mips32
syscall-list-o32-condition := _MIPS_SIM == _MIPS_SIM_ABI32
-syscall-list-n32-options := -mabi=n32
+syscall-list-n32-options := -mips32r2 -march=mips32r2
syscall-list-n32-condition := _MIPS_SIM == _MIPS_SIM_ABIN32
-syscall-list-n64-options := -mabi=64
+syscall-list-n64-options := -mips64 -march=mips64
syscall-list-n64-condition := _MIPS_SIM == _MIPS_SIM_ABI64
endif
But I noticed that when I did this syscall.h had 3 sections, ifdefed
using the above conditions and each one was identical. So rather then
change the options I just removed them along with the conditions and
syscall-list-variants. This gave me a syscall.h that looks very
similar to glibc 1.14. The only difference is that the new file has
an include of sgidefs.h.
diff --git a/sysdeps/unix/sysv/linux/mips/Makefile b/sysdeps/unix/sysv/linux/mip
index 41e9258..2d5ec60 100644
--- a/sysdeps/unix/sysv/linux/mips/Makefile
+++ b/sysdeps/unix/sysv/linux/mips/Makefile
@@ -4,17 +4,8 @@ endif
ifeq ($(subdir),misc)
sysdep_routines += cachectl cacheflush sysmips _test_and_set
-
sysdep_headers += sys/cachectl.h sys/sysmips.h sys/tas.h
-
-syscall-list-variants := o32 n32 n64
syscall-list-includes := sgidefs.h
-syscall-list-o32-options := -mabi=32
-syscall-list-o32-condition := _MIPS_SIM == _MIPS_SIM_ABI32
-syscall-list-n32-options := -mabi=n32
-syscall-list-n32-condition := _MIPS_SIM == _MIPS_SIM_ABIN32
-syscall-list-n64-options := -mabi=64
-syscall-list-n64-condition := _MIPS_SIM == _MIPS_SIM_ABI64
endif
ifeq ($(subdir),elf)
So, does this second patch look OK for glibc-ports for MIPS?
Steve Ellcey
sellcey@mips.com