* Re: Building GLIBC 2.3.4 on MIPS @ 2005-04-11 15:57 Daniel Laird 2005-04-11 16:08 ` Maciej W. Rozycki 0 siblings, 1 reply; 13+ messages in thread From: Daniel Laird @ 2005-04-11 15:57 UTC (permalink / raw) To: macro; +Cc: libc-alpha, linux-mips I am trying to build glibc-2.3.4 (gcc-3.4.3, binutils-2.15.96) with linux-2.6.11.6 on mips. I am having problems with bits/syscalls.h whereas yours seem to be empty mine just does not exist??? Any reason for this? I have applied your patches but they do not seem to correct this error have you seen this. Its just that when i try to compile busybox i get an error as bits/syscall.h is missing and obviously means my cross compiler toolchain is not quite correct. Hope you can help Daniel Laird ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Building GLIBC 2.3.4 on MIPS 2005-04-11 15:57 Building GLIBC 2.3.4 on MIPS Daniel Laird @ 2005-04-11 16:08 ` Maciej W. Rozycki 2005-04-11 16:33 ` Daniel Laird 2005-04-13 19:49 ` Daniel Laird 0 siblings, 2 replies; 13+ messages in thread From: Maciej W. Rozycki @ 2005-04-11 16:08 UTC (permalink / raw) To: Daniel Laird; +Cc: libc-alpha, linux-mips On Mon, 11 Apr 2005, Daniel Laird wrote: > I am trying to build glibc-2.3.4 (gcc-3.4.3, binutils-2.15.96) with > linux-2.6.11.6 on mips. You may consider glibc 2.3.5. > I am having problems with bits/syscalls.h whereas yours seem to be empty mine > just does not exist??? Can I ask you which package are you specifically referring to? Perhaps you've picked an outdated one. > Any reason for this? > I have applied your patches but they do not seem to correct this error have > you seen this. There used to be problems with <bits/syscalls.h> generation, which, depending on the exact version of Linux headers supplied, could be triggered or not. They are supposed to be fixed in 2.3.5 (credit goes to Richard Sandiford). Maciej ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Building GLIBC 2.3.4 on MIPS 2005-04-11 16:08 ` Maciej W. Rozycki @ 2005-04-11 16:33 ` Daniel Laird 2005-04-13 19:49 ` Daniel Laird 1 sibling, 0 replies; 13+ messages in thread From: Daniel Laird @ 2005-04-11 16:33 UTC (permalink / raw) To: macro; +Cc: libc-alpha, linux-mips I am using crosstool to help me build! I have a problem when i compile that it seems to include a file sysdeps/mips/mips32/Makefile. This has the option -mabi=32. When it does the install-headers target in crosstool it passes this flag to the host compiler. This causes an error. I get around this my removing this flag for the install header target and then putting it back for the rest of the crosstool script. this results in a complete toolchain and a 2.6.11.6 kernel which is running on my target. I then try to build busybox1.00 and i get the error In file included from /home/laird/ccm_wa/ipstb/ipstb_laird/ipstb/build/packages/busybox-1.00/libbb/module_syscalls.c:26: /opt/nxlinux/gcc/gcc-3.4.3-glibc-2.3.4/lib/gcc/mipsel-linux-gnu/3.4.3/../../../../mipsel-linux-gnu/sys-include/sys/syscall.h:39:27: bits/syscall.h: No such file or directory make[1]: *** [/home/laird/ccm_wa/ipstb/ipstb_laird/ipstb/build/packages/busybox-1.00/libbb/module_syscalls.o] Error 1 make[1]: Leaving directory `/home/laird/ccm_wa/ipstb/ipstb_laird/ipstb/build/packages/busybox-1.00' When i check it is missing. I am presuming my hack to get the install-headers target may be breaking things but how else do i get round this. Are you guys using crosstool? Thanks for the help ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Building GLIBC 2.3.4 on MIPS 2005-04-11 16:08 ` Maciej W. Rozycki 2005-04-11 16:33 ` Daniel Laird @ 2005-04-13 19:49 ` Daniel Laird 2005-04-13 20:01 ` Greg Weeks 1 sibling, 1 reply; 13+ messages in thread From: Daniel Laird @ 2005-04-13 19:49 UTC (permalink / raw) To: macro; +Cc: libc-alpha, linux-mips I have tried this with any number of patches you want to name I can do the following combo glibc-2.3.2 glibc-linuxthreads-2.3.4 kernel 2.6.11.6 binutils-2.15.96 It all works but glibc-2.3.3, 2.3.4, 2.3.5 all fail. bits/syscalls.h is not even generated. I do not have the problem where it generated wrongly it just does not get made on my system and also the wrong flags are passed to the HOST compiler which requires patching. If anyone ever get glibc-2.3.4 and the rest working let me know (please check that bits/syscall.h exists) cheers Dan ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Building GLIBC 2.3.4 on MIPS 2005-04-13 19:49 ` Daniel Laird @ 2005-04-13 20:01 ` Greg Weeks 0 siblings, 0 replies; 13+ messages in thread From: Greg Weeks @ 2005-04-13 20:01 UTC (permalink / raw) To: Daniel Laird; +Cc: macro, libc-alpha, linux-mips Daniel Laird wrote: > I have tried this with any number of patches you want to name > > I can do the following combo > glibc-2.3.2 > glibc-linuxthreads-2.3.4 > kernel 2.6.11.6 > binutils-2.15.96 > > It all works but glibc-2.3.3, 2.3.4, 2.3.5 all fail. bits/syscalls.h > is not even generated. I do not have the problem where it generated > wrongly it just does not get made on my system and also the wrong > flags are passed to the HOST compiler which requires patching. > > If anyone ever get glibc-2.3.4 and the rest working let me know > (please check that bits/syscall.h exists) I've got glibc-2.3.3-200407050320 and gcc-3.4.1-20040715 building here. A number of patches of course. I remember the syscall thing was a pain. Greg Weeks ^ permalink raw reply [flat|nested] 13+ messages in thread
* Building GLIBC 2.3.4 on MIPS @ 2005-02-23 0:32 Jim Gifford 2005-02-23 0:53 ` Kumba 2005-02-23 1:02 ` David Daney 0 siblings, 2 replies; 13+ messages in thread From: Jim Gifford @ 2005-02-23 0:32 UTC (permalink / raw) To: linux-mips I'm trying to build the current glibc with my RaQ2, everything builds ok, until I start compiling strace. syscall.c: In function `dumpio': syscall.c:449: error: `SYS_read' undeclared (first use in this function) syscall.c:449: error: (Each undeclared identifier is reported only once syscall.c:449: error: for each function it appears in.) syscall.c:465: error: `SYS_write' undeclared (first use in this function) syscall.c: In function `syscall_fixup': syscall.c:1265: warning: unused variable `pid' syscall.c: In function `trace_syscall': syscall.c:2481: error: `SYS_exit' undeclared (first use in this function) make[1]: *** [syscall.o] Error 1 make[1]: Leaving directory `/usr/src/strace-4.5.9' make: *** [all] Error 2 Which leads me to check syscall.h, then I noticed a big difference from my x86 version to this version, all the SYS_ entries are missing. Did I build it wrong or is this a glibc issue, due to the addition of the mips32 and mips64 directories. Here is my bug report with the glibc folks for everyone's reference. http://sources.redhat.com/bugzilla/show_bug.cgi?id=758 -- ---- Jim Gifford maillist@jg555.com ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Building GLIBC 2.3.4 on MIPS 2005-02-23 0:32 Jim Gifford @ 2005-02-23 0:53 ` Kumba 2005-02-23 1:02 ` David Daney 1 sibling, 0 replies; 13+ messages in thread From: Kumba @ 2005-02-23 0:53 UTC (permalink / raw) To: Jim Gifford; +Cc: linux-mips Jim Gifford wrote: > I'm trying to build the current glibc with my RaQ2, everything builds > ok, until I start compiling strace. > > syscall.c: In function `dumpio': > syscall.c:449: error: `SYS_read' undeclared (first use in this function) > syscall.c:449: error: (Each undeclared identifier is reported only once > syscall.c:449: error: for each function it appears in.) > syscall.c:465: error: `SYS_write' undeclared (first use in this function) > syscall.c: In function `syscall_fixup': > syscall.c:1265: warning: unused variable `pid' > syscall.c: In function `trace_syscall': > syscall.c:2481: error: `SYS_exit' undeclared (first use in this function) > make[1]: *** [syscall.o] Error 1 > make[1]: Leaving directory `/usr/src/strace-4.5.9' > make: *** [all] Error 2 > > Which leads me to check syscall.h, then I noticed a big difference from > my x86 version to this version, all the SYS_ entries are missing. Did I > build it wrong or is this a glibc issue, due to the addition of the > mips32 and mips64 directories. > > Here is my bug report with the glibc folks for everyone's reference. > http://sources.redhat.com/bugzilla/show_bug.cgi?id=758 We've bumped into this on the gentoo-side of things. The fix we're using (for now) is this a modified version of this patch here: http://lists.debian.org/debian-mips/2004/01/msg00036.html The above patch wasn't intended for 2.3.4 by default I believe, so it doesn't apply cleanly. It had to be re-diffed for 2.3.4. You can find this version here: http://dev.gentoo.org/~kumba/tmp/6630_mips_fix-syscall_h-again.patch The resulting bits/syscall.h isn't the cleanest thing, but strace will build against it and it does appear to work. --Kumba -- "Such is oft the course of deeds that move the wheels of the world: small hands do them because they must, while the eyes of the great are elsewhere." --Elrond ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Building GLIBC 2.3.4 on MIPS 2005-02-23 0:32 Jim Gifford 2005-02-23 0:53 ` Kumba @ 2005-02-23 1:02 ` David Daney 2005-02-23 2:42 ` Jim Gifford 2005-02-23 14:05 ` Maciej W. Rozycki 1 sibling, 2 replies; 13+ messages in thread From: David Daney @ 2005-02-23 1:02 UTC (permalink / raw) To: Jim Gifford; +Cc: linux-mips Jim Gifford wrote: > I'm trying to build the current glibc with my RaQ2, everything builds > ok, until I start compiling strace. > > syscall.c: In function `dumpio': > syscall.c:449: error: `SYS_read' undeclared (first use in this function) > syscall.c:449: error: (Each undeclared identifier is reported only once > syscall.c:449: error: for each function it appears in.) > syscall.c:465: error: `SYS_write' undeclared (first use in this function) > syscall.c: In function `syscall_fixup': > syscall.c:1265: warning: unused variable `pid' > syscall.c: In function `trace_syscall': > syscall.c:2481: error: `SYS_exit' undeclared (first use in this function) > make[1]: *** [syscall.o] Error 1 > make[1]: Leaving directory `/usr/src/strace-4.5.9' > make: *** [all] Error 2 > > Which leads me to check syscall.h, then I noticed a big difference from > my x86 version to this version, all the SYS_ entries are missing. Did I > build it wrong or is this a glibc issue, due to the addition of the > mips32 and mips64 directories. > > Here is my bug report with the glibc folks for everyone's reference. > http://sources.redhat.com/bugzilla/show_bug.cgi?id=758 > It seems that you might need some (but not all) of the patch I posted here: http://www.linux-mips.org/archives/linux-mips/2004-10/msg00068.html Specifically I think you will need at least the parts that add #include <sgidefs.h> To many of the .h files. Basically any file that uses the symbol _MIPS_SIM and friends needs to either directly or indirectly include sgidefs.h You may also need: http://www.linux-mips.org/archives/linux-mips/2004-10/msg00142.html And something like this: http://sources.redhat.com/ml/libc-alpha/2004-11/msg00165.html David Daney. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Building GLIBC 2.3.4 on MIPS 2005-02-23 1:02 ` David Daney @ 2005-02-23 2:42 ` Jim Gifford 2005-02-23 14:05 ` Maciej W. Rozycki 1 sibling, 0 replies; 13+ messages in thread From: Jim Gifford @ 2005-02-23 2:42 UTC (permalink / raw) To: David Daney; +Cc: linux-mips Thanx Kumba and David I really appreciate the help. Got one other question for you, this was brought up on my LFS for the RaQ2. http://sources.redhat.com/ml/libc-alpha/2005-01/msg00063.html Here is the message for those who don't want to link. A user attempting to build glibc kept getting "getconf" missing errors, upon checking /usr/bin/getconf, he found the getconf was a directory with 2 files in it POSIX_V6_ILP32_OFFBIG POSIX_V6_ILP32_OFF32 Now, I've been able to recreate this issue, but haven't figured out the root cause. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Building GLIBC 2.3.4 on MIPS 2005-02-23 1:02 ` David Daney 2005-02-23 2:42 ` Jim Gifford @ 2005-02-23 14:05 ` Maciej W. Rozycki 2005-02-24 14:36 ` Kumba 1 sibling, 1 reply; 13+ messages in thread From: Maciej W. Rozycki @ 2005-02-23 14:05 UTC (permalink / raw) To: David Daney, libc-alpha; +Cc: Jim Gifford, linux-mips On Tue, 22 Feb 2005, David Daney wrote: > > I'm trying to build the current glibc with my RaQ2, everything builds ok, > > until I start compiling strace. > > > > syscall.c: In function `dumpio': > > syscall.c:449: error: `SYS_read' undeclared (first use in this function) > > syscall.c:449: error: (Each undeclared identifier is reported only once > > syscall.c:449: error: for each function it appears in.) > > syscall.c:465: error: `SYS_write' undeclared (first use in this function) > > syscall.c: In function `syscall_fixup': > > syscall.c:1265: warning: unused variable `pid' > > syscall.c: In function `trace_syscall': > > syscall.c:2481: error: `SYS_exit' undeclared (first use in this function) > > make[1]: *** [syscall.o] Error 1 > > make[1]: Leaving directory `/usr/src/strace-4.5.9' > > make: *** [all] Error 2 > > > > Which leads me to check syscall.h, then I noticed a big difference from > > my x86 version to this version, all the SYS_ entries are missing. Did I > > build it wrong or is this a glibc issue, due to the addition of the > > mips32 and mips64 directories. > > > > Here is my bug report with the glibc folks for everyone's reference. > > http://sources.redhat.com/bugzilla/show_bug.cgi?id=758 > > > > > It seems that you might need some (but not all) of the patch I posted here: > > http://www.linux-mips.org/archives/linux-mips/2004-10/msg00068.html > > Specifically I think you will need at least the parts that add > > #include <sgidefs.h> > > To many of the .h files. Basically any file that uses the symbol _MIPS_SIM > and friends needs to either directly or indirectly include sgidefs.h > > You may also need: > > http://www.linux-mips.org/archives/linux-mips/2004-10/msg00142.html > > And something like this: > > http://sources.redhat.com/ml/libc-alpha/2004-11/msg00165.html The culprit is elsewhere. The glibc's syscall number translator script doesn't work with asm-mips/unistd.h as of Linux 2.6 (you could have probably used 2.4 headers instead; I'm not sure if that is compatible with "--enable-kernel=2.6.0", though). A correct fix has been prepared and proposed by Richard Sandiford and is available here: "http://sourceware.org/ml/libc-alpha/2004-11/msg00097.html". I would expect this patch to have been applied before 2.3.4, but apparently this hasn't happened. That's regrettable and I fear it's the result of glibc being somewhat inadequately maintained for MIPS/Linux these days, sigh... I'm not sure what the maintenance plan is for the 2.3 branch of glibc, but if 2.3.5 is ever going to happen, the Richard's patch is one of the must-have additions. Maciej ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Building GLIBC 2.3.4 on MIPS 2005-02-23 14:05 ` Maciej W. Rozycki @ 2005-02-24 14:36 ` Kumba 2005-02-24 17:21 ` Jim Gifford 2005-02-24 19:51 ` Maciej W. Rozycki 0 siblings, 2 replies; 13+ messages in thread From: Kumba @ 2005-02-24 14:36 UTC (permalink / raw) To: Maciej W. Rozycki; +Cc: libc-alpha, linux-mips Maciej W. Rozycki wrote: > > The culprit is elsewhere. The glibc's syscall number translator script > doesn't work with asm-mips/unistd.h as of Linux 2.6 (you could have > probably used 2.4 headers instead; I'm not sure if that is compatible with > "--enable-kernel=2.6.0", though). A correct fix has been prepared and > proposed by Richard Sandiford and is available here: > "http://sourceware.org/ml/libc-alpha/2004-11/msg00097.html". I would > expect this patch to have been applied before 2.3.4, but apparently this > hasn't happened. That's regrettable and I fear it's the result of glibc > being somewhat inadequately maintained for MIPS/Linux these days, sigh... > > I'm not sure what the maintenance plan is for the 2.3 branch of glibc, > but if 2.3.5 is ever going to happen, the Richard's patch is one of the > must-have additions. > > Maciej The debian patch I referenced is what we require for glibc to generate a proper syscalls.h for 2.4 kernels. Unknown on the 2.6 kernel front how that patch affects things. I'll have to see if this patch affects/changes anything for either headers version. --Kumba -- "Such is oft the course of deeds that move the wheels of the world: small hands do them because they must, while the eyes of the great are elsewhere." --Elrond ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Building GLIBC 2.3.4 on MIPS 2005-02-24 14:36 ` Kumba @ 2005-02-24 17:21 ` Jim Gifford 2005-02-24 19:51 ` Maciej W. Rozycki 1 sibling, 0 replies; 13+ messages in thread From: Jim Gifford @ 2005-02-24 17:21 UTC (permalink / raw) To: Kumba; +Cc: Maciej W. Rozycki, libc-alpha, linux-mips [-- Attachment #1: Type: text/plain, Size: 189 bytes --] I updated the patch, that was posted in libc-alpha and I have tested it. Thanx to you all for your assistance. http://ftp.jg555.com/patches/raq2/glibc/glibc-2.3.4-mips_syscall-2.patch [-- Attachment #2: glibc-2.3.4-mips_syscall-2.patch --] [-- Type: text/x-patch, Size: 11051 bytes --] Submitted By: Jim Gifford (patches at jg555 dot com) Date: 2005-02-23 Initial Package Version: 2.3.4 Origin: Richard Sandiford Upstream Status: Unknown Description: Fixes Syscall.h generation diff -Naur glibc-2.3.4.orig/sysdeps/unix/sysv/linux/mips/Makefile glibc-2.3.4/sysdeps/unix/sysv/linux/mips/Makefile --- glibc-2.3.4.orig/sysdeps/unix/sysv/linux/mips/Makefile 2004-11-24 04:38:15 +0000 +++ glibc-2.3.4/sysdeps/unix/sysv/linux/mips/Makefile 2005-02-23 18:21:54 +0000 @@ -9,11 +9,73 @@ no_syscall_list_h = 1 -# Generate the list of SYS_* macros for the system calls (__NR_* macros). -# We generate not only SYS_<syscall>, pointing at SYS_<abi>_<syscall> if -# it exists, but also define SYS_<abi>_<syscall> for all ABIs. +# A callable macro that expands to a shell command. Preprocess file $(1) +# using ABI option $(2) and see which macros it defines. Print FOO for each +# macro of the form __NR$(3)_FOO, filtering out ABI-specific __NR macros +# that have a prefix other than $(3). +mips_list_syscalls = $(filter-out -m%,$(CC)) -E -x c $(+includes) \ + $(sysincludes) -D_LIBC -dM -mabi=$(2) $(1) | \ + sed -n 's@^\#define __NR$(3)_\([^ ]*\) .*@\1@p' | \ + sed -e '/^[ON]32_/d' -e '/^N64_/d' -e '/^64_/d' | \ + LC_ALL=C sort + +# Generate a list of SYS_* macros from the linux __NR macros. +# +# Before version 2.6, linux had separate 32-bit and 64-bit MIPS ports, +# each with its own set of headers. The ports were merged for 2.6 and +# this merged port defines the syscalls in a slightly different way. +# There are therefore three sets of headers that we need to consider: +# +# (1) Headers from the separate 32-bit MIPS port. They just define +# a single list of __NR macros. +# +# (2) Headers from the separate 64-bit MIPS port. They unconditionally +# define syscalls for all three ABIs, with o32 syscalls prefixed +# by __NR_O32, n32 syscalls prefixed by __NR_N32 and n64 syscalls +# prefixed by plain __NR. +# +# (3) Headers from the combined port. They use the _MIPS_SIM macro to +# define the right set of syscalls for the current ABI. The syscalls +# themselves have no special ABI prefix, but the headers also define: +# +# __NR_O32_Linux{,_syscalls} +# __NR_N32_Linux{,_syscalls} +# __NR_64_Linux{,_syscalls} +# +# In case (1) we just want a simple list of SYS_* macros. In cases (2) +# and (3) we want a file that will work for all three ABIs, regardless +# of which ABI we are currently using. We also want the file to work +# if the user later moves from (2) to (3). Thus the file we create +# for (2) and (3) has the form: +# +# #if _MIPS_SIM == _MIPS_SIM_NABI32 +# # ifdef __NR_N32_open +# # define SYS_n32syscall1 __NR_N32_n32syscall1 +# # ... +# # else +# # define SYS_n32syscall1 __NR_n32syscall1 +# # ... +# # endif +# #elif _MIPS_SIM == _MIPS_SIM_ABI64 +# # define SYS_n64syscall1 __NR_n64syscall1 +# # ... +# #else +# # ifdef __NR_O32_open +# # define SYS_o32syscall1 __NR_O32_o32syscall1 +# # ... +# # else +# # define SYS_o32syscall1 __NR_o32syscall1 +# # ... +# # endif +# #endif +# +# Here, __NR_N32_open and __NR_O32_open are used to detect case (2) +# over case (3). The n64 SYS_* macros can always use the normal +# ABI-less names. $(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/mips/sys/syscall.h $(make-target-directory) + $(CC) -E -x c $(+includes) $(sysincludes) -D_LIBC $< -MD -MP \ + -MF $(@:.h=.d)-t -MT '$(@:.d=.h) $(@:.h=.d)' > /dev/null { \ echo '/* Generated at libc build time from kernel syscall list. */';\ echo ''; \ @@ -22,28 +84,38 @@ echo '#endif'; \ echo ''; \ echo '#include <sgidefs.h>'; \ - rm -f $(@:.d=.h).newt; \ - $(CC) -E -MD -MP -MF $(@:.h=.d)-t -MT '$(@:.d=.h) $(@:.h=.d)' \ - -x c $(+includes) $(sysincludes) $< -D_LIBC -dM | \ - sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' \ - > $(@:.d=.h).newt; \ - if grep SYS_O32_ $(@:.d=.h).newt > /dev/null; then \ + rm -f $(@:.d=.h).new32 $(@:.d=.h).newn32 $(@:.d=.h).new64; \ + $(call mips_list_syscalls,$<,n32,_N32) > $(@:.d=.h).newn32; \ + if test -s $(@:.d=.h).newn32; then \ + if grep open $(@:.d=.h).newn32 > /dev/null; then \ + $(call mips_list_syscalls,$<,32,_O32) > $(@:.d=.h).new32; \ + $(call mips_list_syscalls,$<,64,) > $(@:.d=.h).new64; \ + else \ + $(call mips_list_syscalls,$<,32,) > $(@:.d=.h).new32; \ + $(call mips_list_syscalls,$<,n32,) > $(@:.d=.h).newn32; \ + $(call mips_list_syscalls,$<,64,) > $(@:.d=.h).new64; \ + fi; \ echo '#if _MIPS_SIM == _ABIN32'; \ - sed -n 's/^\(#define SYS_\)N32_/\1/p' < $(@:.d=.h).newt | \ - LC_ALL=C sort; \ + echo '# ifdef __NR_N32_open'; \ + sed 's@\(.*\)@# define SYS_\1 __NR_N32_\1@' < $(@:.d=.h).newn32; \ + echo '# else'; \ + sed 's@\(.*\)@# define SYS_\1 __NR_\1@' < $(@:.d=.h).newn32; \ + echo '# endif'; \ echo '#elif _MIPS_SIM == _ABI64'; \ - sed -n 's/^\(#define SYS_\)N64_/\1/p' < $(@:.d=.h).newt | \ - LC_ALL=C sort; \ + sed 's@\(.*\)@# define SYS_\1 __NR_\1@' < $(@:.d=.h).new64; \ echo '#else'; \ - sed -n 's/^\(#define SYS_\)O32_/\1/p' < $(@:.d=.h).newt | \ - LC_ALL=C sort; \ + echo '# ifdef __NR_O32_open'; \ + sed 's@\(.*\)@# define SYS_\1 __NR_O32_\1@' < $(@:.d=.h).new32; \ + echo '# else'; \ + sed 's@\(.*\)@# define SYS_\1 __NR_\1@' < $(@:.d=.h).new32; \ + echo '# endif'; \ echo '#endif'; \ - sed -n '/^#define SYS_\([ON]32\|N64\)_/p' < $(@:.d=.h).newt | \ - LC_ALL=C sort +1.8; \ else \ - cat $(@:.d=.h).newt; \ + $(CC) -E -x c $(+includes) $(sysincludes) -D_LIBC -dM $< | \ + sed -n 's@^\#define __NR_\([^ ]*\) .*@\#define SYS_\1 __NR_\1@p' | \ + LC_ALL=C sort; \ fi; \ - rm $(@:.d=.h).newt; \ + rm -f $(@:.d=.h).new32 $(@:.d=.h).newn32 $(@:.d=.h).new64; \ } > $(@:.d=.h).new mv -f $(@:.d=.h).new $(@:.d=.h) ifneq (,$(objpfx)) diff -Naur glibc-2.3.4.orig/sysdeps/unix/sysv/linux/mips/configure glibc-2.3.4/sysdeps/unix/sysv/linux/mips/configure --- glibc-2.3.4.orig/sysdeps/unix/sysv/linux/mips/configure 2004-11-24 04:42:45 +0000 +++ glibc-2.3.4/sysdeps/unix/sysv/linux/mips/configure 2005-02-23 18:10:11 +0000 @@ -18,7 +18,7 @@ { echo "$as_me:$LINENO: WARNING: *** asm/unistd.h not found, it will not be pre-processed" >&5 echo "$as_me: WARNING: *** asm/unistd.h not found, it will not be pre-processed" >&2;} echo '#include <asm/unistd.h>' > asm-unistd.h - else + elif grep __NR_N32_open "$asm_unistd_h" > /dev/null; then # The point of this preprocessing is to turn __NR_<syscall> into # __NR_N64_<syscall>, as well as to define __NR_<syscall> to # __NR_<abi>_<syscall>, if __NR_<abi>_<syscall> is defined @@ -68,6 +68,8 @@ { print; }' + else + echo '#include <asm/unistd.h>' > asm-unistd.h fi ;; mips*) rm -f asm-unistd.h diff -Naur glibc-2.3.4.orig/sysdeps/unix/sysv/linux/mips/configure.in glibc-2.3.4/sysdeps/unix/sysv/linux/mips/configure.in --- glibc-2.3.4.orig/sysdeps/unix/sysv/linux/mips/configure.in 2004-11-24 04:38:31 +0000 +++ glibc-2.3.4/sysdeps/unix/sysv/linux/mips/configure.in 2005-02-23 18:10:11 +0000 @@ -18,7 +18,7 @@ if test ! -f "$asm_unistd_h"; then AC_MSG_WARN([*** asm/unistd.h not found, it will not be pre-processed]) echo '#include <asm/unistd.h>' > asm-unistd.h - else + elif grep __NR_N32_open "$asm_unistd_h" > /dev/null; then # The point of this preprocessing is to turn __NR_<syscall> into # __NR_N64_<syscall>, as well as to define __NR_<syscall> to # __NR_<abi>_<syscall>, if __NR_<abi>_<syscall> is defined @@ -68,6 +68,8 @@ { print; }' + else + echo '#include <asm/unistd.h>' > asm-unistd.h fi ;; mips*) rm -f asm-unistd.h diff -Naur glibc-2.3.4.orig/sysdeps/unix/sysv/linux/mips/mips32/kern64/sysdep.h glibc-2.3.4/sysdeps/unix/sysv/linux/mips/mips32/kern64/sysdep.h --- glibc-2.3.4.orig/sysdeps/unix/sysv/linux/mips/mips32/kern64/sysdep.h 2003-03-29 08:15:29 +0000 +++ glibc-2.3.4/sysdeps/unix/sysv/linux/mips/mips32/kern64/sysdep.h 2005-02-23 18:10:11 +0000 @@ -1,36 +0,0 @@ -/* Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _LINUX_MIPS_MIPS32_KERN64_SYSDEP_H -#define _LINUX_MIPS_MIPS32_KERN64_SYSDEP_H 1 - -/* There is some commonality. */ -#include <sysdeps/unix/sysv/linux/mips/mips32/sysdep.h> - -/* For Linux we can use the system call table in the header file - /usr/include/asm/unistd.h - of the kernel. But these symbols do not follow the SYS_* syntax - so we have to redefine the `SYS_ify' macro here. */ -#undef SYS_ify -#ifdef __STDC__ -# define SYS_ify(syscall_name) __NR_O32_##syscall_name -#else -# define SYS_ify(syscall_name) __NR_O32_/**/syscall_name -#endif - -#endif /* linux/mips/mips32/kern64/sysdep.h */ diff -Naur glibc-2.3.4.orig/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h glibc-2.3.4/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h --- glibc-2.3.4.orig/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h 2004-10-18 05:16:07 +0000 +++ glibc-2.3.4/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h 2005-02-23 18:10:11 +0000 @@ -28,9 +28,9 @@ so we have to redefine the `SYS_ify' macro here. */ #undef SYS_ify #ifdef __STDC__ -# define SYS_ify(syscall_name) __NR_N32_##syscall_name +# define SYS_ify(syscall_name) __NR_##syscall_name #else -# define SYS_ify(syscall_name) __NR_N32_/**/syscall_name +# define SYS_ify(syscall_name) __NR_/**/syscall_name #endif #ifdef __ASSEMBLER__ diff -Naur glibc-2.3.4.orig/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h glibc-2.3.4/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h --- glibc-2.3.4.orig/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h 2004-10-18 05:16:08 +0000 +++ glibc-2.3.4/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h 2005-02-23 18:10:11 +0000 @@ -28,9 +28,9 @@ so we have to redefine the `SYS_ify' macro here. */ #undef SYS_ify #ifdef __STDC__ -# define SYS_ify(syscall_name) __NR_N64_##syscall_name +# define SYS_ify(syscall_name) __NR_##syscall_name #else -# define SYS_ify(syscall_name) __NR_N64_/**/syscall_name +# define SYS_ify(syscall_name) __NR_/**/syscall_name #endif #ifdef __ASSEMBLER__ ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Building GLIBC 2.3.4 on MIPS 2005-02-24 14:36 ` Kumba 2005-02-24 17:21 ` Jim Gifford @ 2005-02-24 19:51 ` Maciej W. Rozycki 1 sibling, 0 replies; 13+ messages in thread From: Maciej W. Rozycki @ 2005-02-24 19:51 UTC (permalink / raw) To: Kumba; +Cc: libc-alpha, linux-mips On Thu, 24 Feb 2005, Kumba wrote: > The debian patch I referenced is what we require for glibc to generate a > proper syscalls.h for 2.4 kernels. Unknown on the 2.6 kernel front how that Well, glibc 2.3.4 works out of the box with 2.4. Perhaps you've had problems with an older revision. > patch affects things. I'll have to see if this patch affects/changes anything > for either headers version. It works for me with current 2.6. It requires a small obvious update due to changes to _MIPS_SIM macros. Maciej ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2005-04-13 20:01 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2005-04-11 15:57 Building GLIBC 2.3.4 on MIPS Daniel Laird 2005-04-11 16:08 ` Maciej W. Rozycki 2005-04-11 16:33 ` Daniel Laird 2005-04-13 19:49 ` Daniel Laird 2005-04-13 20:01 ` Greg Weeks -- strict thread matches above, loose matches on Subject: below -- 2005-02-23 0:32 Jim Gifford 2005-02-23 0:53 ` Kumba 2005-02-23 1:02 ` David Daney 2005-02-23 2:42 ` Jim Gifford 2005-02-23 14:05 ` Maciej W. Rozycki 2005-02-24 14:36 ` Kumba 2005-02-24 17:21 ` Jim Gifford 2005-02-24 19:51 ` Maciej W. Rozycki
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox