When trying to compile numerous programs I stumbled accross a lot of these type of errors. Looks to be caused by syscall.h not being generated properly. error: `SYS_read' undeclared (first use in this function) error: (Each undeclared identifier is reported only once error: for each function it appears in.) error: `SYS_write' undeclared (first use in this function) Comparing my contents to the contents of a known working distro's version 2.3.3 of syscall.h, I noticied a big difference. Here is my contents of syscall.h /* Generated at libc build time from kernel syscall list. */ #ifndef _SYSCALL_H # error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead." #endif #include <sgidefs.h> #if _MIPS_SIM == _ABIN32 #define SYS_Linux __NR_N32_Linux #define SYS_Linux_syscalls __NR_N32_Linux_syscalls #elif _MIPS_SIM == _ABI64 #else #define SYS_Linux __NR_O32_Linux #define SYS_Linux_syscalls __NR_O32_Linux_syscalls #endif The distro's version had a lot of lines simlar to the following #define SYS_accept __NR_accept #define SYS_fdatasync __NR_fdatasync #define SYS_bind __NR_bind #define SYS_mlockall __NR_mlockall #define SYS_connect __NR_connect #define SYS_sched_yield __NR_sched_yield I'm using no patches to build my glibc, using the following build commands. I'm building with linuxthreads and libcibn. cd /usr/src/glibc-2.3.4 rm -rf nptl* mkdir /usr/src/glibc-2.3.4-build /usr/src/glibc-2.3.4/configure --prefix=/usr \ --libexecdir=/usr/bin --disable-profile \ --enable-add-ons --enable-bind-now \ --enable-kernel=2.6.0 --without-cvs make make install
Was giving to me by some folks at linux-mips.org. Here is a link to the messages http://www.linux-mips.org/archives/linux-mips/2005-02/msg00197.html
A patch was proposed here on libc-alpha for this issue http://sourceware.org/ml/libc-alpha/2004-11/msg00097.html
Created attachment 422 [details] Updated Patch based on libc-alpha message
I have attached an updated patch to the one posted to libc-alpha in november 2004, I have tested the patch and it does properly generate the syscall.h file.
Subject: Bug 758 CVSROOT: /cvs/glibc Module name: libc Changes by: aj@sources.redhat.com 2005-02-25 15:18:14 Modified files: sysdeps/unix/sysv/linux/mips: Makefile configure configure.in sysdeps/unix/sysv/linux/mips/mips32/kern64: sysdep.h sysdeps/unix/sysv/linux/mips/mips64/n32: sysdep.h sysdeps/unix/sysv/linux/mips/mips64/n64: sysdep.h Log message: 2004-11-11 Richard Sandiford <rsandifo@redhat.com> [BZ #758] * sysdeps/unix/sysv/linux/mips/configure.in (asm-unistd.h): Only preprocess <asm/unistd.h> if it defines ABI-prefixed syscall names like __NR_N32_open. Just include <asm/unistd.h> otherwise. * sysdeps/unix/sysv/linux/mips/configure: Regenerate. * sysdeps/unix/sysv/linux/mips/mips32/kern64/sysdep.h: Delete * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h (SYS_ify): Use the standard __NR prefix. * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h (SYS_ify): Likewise. * sysdeps/unix/sysv/linux/mips/Makefile (syscall-%.h): Rework so that the output file is compatible with both pre-2.6 and 2.6 kernel headers. Extract separate syscall lists for each ABI. Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/mips/Makefile.diff?cvsroot=glibc&r1=1.14&r2=1.15 http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/mips/configure.diff?cvsroot=glibc&r1=1.8&r2=1.9 http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/mips/configure.in.diff?cvsroot=glibc&r1=1.7&r2=1.8 http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/mips/mips32/kern64/sysdep.h.diff?cvsroot=glibc&r1=1.1&r2=1.2 http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h.diff?cvsroot=glibc&r1=1.4&r2=1.5 http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h.diff?cvsroot=glibc&r1=1.4&r2=1.5
Roland, this should go into 2.3 as well.
I haven't gotten confirmation that this has had testing meeting the 2.3 branch inclusion criteria.
(In reply to comment #7) > I haven't gotten confirmation that this has had testing meeting the 2.3 branch > inclusion criteria. Roland, mips64 won't even build without this fix. Would it be possible to relax the inclusion criteria on this occasion? If you do decide to apply it on the branch, this fixup is also needed: http://sources.redhat.com/ml/glibc-cvs/2005-q1/msg00811.html Thanks
The relevant criterion is that someone testify that they have built a 2.3-based glibc using this patch into a production or production-testing binary form and had real-world testing of it. If there is noone who can get even that minimally serious about mips maintenance, then the changes do not belong in the 2.3 branch. It's not a hard requirement to meet, and I cannot imagine how you could be in the position of caring what's in the 2.3 branch without already having done the requisite work of making a usable package with the necessary patch and testing it.
MontaVista applies this patch to glibc 2.3.4 and 2.3.5 (the patch attached to the bug is mildly whitespace-mangled, but functionally the same). Does that help? Debian uses a somewhat different patch that I wrote before Richard's better version.
Can you send me a nonmangled patch against the current 2.3 branch, that you have tested? If you do some work beyond merging and have your own log entry, send that; otherwise, I'll use the trunk log entry shown in this bug and your patch should match its description of changes.
Created attachment 716 [details] Debian's backported patch. This is the patch that Debian now applies. All I changed from Richard's posting was a couple of _MIPS_SIM vs _ABI macros that changed after 2.3.
Subject: Bug 758 CVSROOT: /cvs/glibc Module name: libc Branch: glibc-2_3-branch Changes by: roland@sources.redhat.com 2005-10-23 00:42:56 Modified files: sysdeps/unix/sysv/linux/mips: Makefile configure configure.in sysdeps/unix/sysv/linux/mips/mips64/n32: sysdep.h sysdeps/unix/sysv/linux/mips/mips32/kern64: sysdep.h sysdeps/unix/sysv/linux/mips/mips64/n64: sysdep.h Log message: 2004-11-11 Richard Sandiford <rsandifo@redhat.com> [BZ #758] * sysdeps/unix/sysv/linux/mips/configure.in (asm-unistd.h): Only preprocess <asm/unistd.h> if it defines ABI-prefixed syscall names like __NR_N32_open. Just include <asm/unistd.h> otherwise. * sysdeps/unix/sysv/linux/mips/configure: Regenerate. * sysdeps/unix/sysv/linux/mips/mips32/kern64/sysdep.h: Delete * sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h (SYS_ify): Use the standard __NR prefix. * sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h (SYS_ify): Likewise. * sysdeps/unix/sysv/linux/mips/Makefile (syscall-%.h): Rework so that the output file is compatible with both pre-2.6 and 2.6 kernel headers. Extract separate syscall lists for each ABI. Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/mips/Makefile.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.14&r2=1.14.2.1 http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/mips/configure.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.8&r2=1.8.2.1 http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/mips/configure.in.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.7&r2=1.7.2.1 http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/mips/mips64/n32/sysdep.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.4&r2=1.4.2.1 http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/mips/mips32/kern64/sysdep.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.1&r2=1.1.4.1 http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/mips/mips64/n64/sysdep.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.4&r2=1.4.2.1
This bug should be fixed in the 2.3.6 release just made.
Subject: Bug 758 CVSROOT: /cvs/glibc Module name: libc Branch: glibc-2_3-branch Changes by: roland@sources.redhat.com 2005-11-15 02:08:20 Modified files: . : ChangeLog Removed files: sysdeps/unix/sysv/linux/mips/mips32/kern64: sysdep.h Log message: 2005-11-14 Roland McGrath <roland@redhat.com> [BZ #758] * sysdeps/unix/sysv/linux/mips/mips32/kern64/sysdep.h: Really remove. Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/mips/mips32/kern64/sysdep.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.1.4.1&r2=NONE http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/ChangeLog.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.9088.2.75&r2=1.9088.2.76