Greetings.
While I am getting closer to full toolchain build, GCC-4.1.0 is still not behaving the way it should. Below is the output that I am running up against. I attempted to define a stack variable to hold the value of zero and tried using that instead of the actual value, but nothing worked. I had a similar problem with 'do_waitid' and I have attached the patch just for the sake of discussion. Does anyone have some insight on this? I am using binutils-2.15, glibc-2.3.4, 2.6.12-rc2 kernel headers and gcc-4.1.0-20050418. Thanks.
-Steve
mips-unknown-linux-gnu-gcc -mabi=32 ../sysdeps/unix/sysv/linux/mips/pread.c -c -std=gnu99 -O2 -Wall -Winline -Wstrict-prototypes -Wwrite-strings -finline-limit=10000 -isystem /home/sjhill/mips-nptl/crosstool-0.31-nptl/build/mips-unknown-linux-gnu/gcc-4.1.0-20050418-glibc-2.3.4/linux-2.6.12/include/asm-mips/mach-generic -fexceptions -fasynchronous-unwind-tables -I../include -I. -I/home/sjhill/mips-nptl/crosstool-0.31-nptl/build/mips-unknown-linux-gnu/gcc-4.1.0-20050418-glibc-2.3.4/build-glibc/posix -I.. -I../libio -I/home/sjhill/mips-nptl/crosstool-0.31-nptl/build/mips-unknown-linux-gnu/gcc-4.1.0-20050418-glibc-2.3.4/build-glibc -I../sysdeps/mips/elf -I../linuxthreads/sysdeps/unix/sysv/linux/mips -I../linuxthreads/sysdeps/unix/sysv/linux -I../linuxthreads/sysdeps/pthread -I../sysdeps/pthread -I../linuxthreads/sysdeps/unix/sysv -I../linuxthreads/sysdeps/unix -I../linuxthreads/sysdeps/mips -I../sysdeps/unix/sysv/linux/mips/mips32 -I../sysdeps/unix/sysv/linux/mips -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/common -I../sysdeps/unix/mman -I../sysdeps/unix/inet -I../sysdeps/unix/sysv -I../sysdeps/unix/mips/mips32 -I../sysdeps/unix/mips -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/mips/mips32 -I../sysdeps/mips -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/wordsize-32 -I../sysdeps/mips/fpu -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -nostdinc -isystem /opt/crosstool/mips-unknown-linux-gnu/gcc-4.1.0-20050418-glibc-2.3.4/lib/gcc/mips-unknown-linux-gnu/4.1.0/include -isystem /opt/crosstool/mips-unknown-linux-gnu/gcc-4.1.0-20050418-glibc-2.3.4/mips-unknown-linux-gnu/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DPIC -o /home/sjhill/mips-nptl/crosstool-0.31-nptl/build/mips-unknown-linux-gnu/gcc-4.1.0-20050418-glibc-2.3.4/build-glibc/posix/pread.o -MD -MP -MF /home/sjhill/mips-nptl/crosstool-0.31-nptl/build/mips-unknown-linux-gnu/gcc-4.1.0-20050418-glibc-2.3.4/build-glibc/posix/pread.o.dt -MT /home/sjhill/mips-nptl/crosstool-0.31-nptl/build/mips-unknown-linux-gnu/gcc-4.1.0-20050418-glibc-2.3.4/build-glibc/posix/pread.o
../sysdeps/unix/sysv/linux/mips/pread.c: In function '__libc_pread':
../sysdeps/unix/sysv/linux/mips/pread.c:69: error: memory input 6 is not directly addressable
../sysdeps/unix/sysv/linux/mips/pread.c:86: error: memory input 6 is not directly addressable
make[2]: *** [/home/sjhill/mips-nptl/crosstool-0.31-nptl/build/mips-unknown-linux-gnu/gcc-4.1.0-20050418-glibc-2.3.4/build-glibc/posix/pread.o] Error 1
make[2]: Leaving directory `/home/sjhill/mips-nptl/crosstool-0.31-nptl/build/mips-unknown-linux-gnu/gcc-4.1.0-20050418-glibc-2.3.4/glibc-2.3.4/posix'
make[1]: *** [posix/subdir_lib] Error 2
make[1]: Leaving directory `/home/sjhill/mips-nptl/crosstool-0.31-nptl/build/mips-unknown-linux-gnu/gcc-4.1.0-20050418-glibc-2.3.4/glibc-2.3.4'
make: *** [lib] Error 2
../sysdeps/unix/sysv/linux/waitid.c: In function 'do_waitid': ../sysdeps/unix/sysv/linux/waitid.c:52: error: memory input 6 is not directly addressable ../sysdeps/unix/sysv/linux/waitid.c:55: error: memory input 6 is not directly addressable
diff -ur glibc-2.3.4/sysdeps/unix/sysv/linux/waitid.c glibc-2.3.4-patched/sysdeps/unix/sysv/linux/waitid.c --- glibc-2.3.4/sysdeps/unix/sysv/linux/waitid.c 2004-10-30 13:01:02.000000000 -0500 +++ glibc-2.3.4-patched/sysdeps/unix/sysv/linux/waitid.c 2005-04-18 19:01:28.334689002 -0500 @@ -47,12 +47,14 @@ do_waitid (idtype_t idtype, id_t id, siginfo_t *infop, int options) { static int waitid_works; + struct rusage *sim = NULL; + if (waitid_works > 0) - return INLINE_SYSCALL (waitid, 5, idtype, id, infop, options, NULL); + return INLINE_SYSCALL (waitid, 5, idtype, id, infop, options, sim); if (waitid_works == 0) { int result = INLINE_SYSCALL (waitid, 5, - idtype, id, infop, options, NULL); + idtype, id, infop, options, sim); if (result < 0 && errno == ENOSYS) waitid_works = -1; else