This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Re: Problem compileing glibc-2.0.94
- To: Kaoru Fukui <k_fukui@highway.ne.jp>
- Subject: Re: Problem compileing glibc-2.0.94
- From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
- Date: Mon, 15 Jun 1998 21:38:45 +0200
- Cc: <libc-alpha@cygnus.com>, <linux-ppc@meetpoint.mcu.motsps.com>
Am Mon, 15 Jun 1998 schrieb Kaoru Fukui:
>> From: Ulrich Drepper <drepper@cygnus.com>
>>
>> Kaoru Fukui <k_fukui@highway.ne.jp> writes:
>>
>> > I can not compile glibc-2.0.94 yet.
>> > I get the error under that.
>>
>> I've corrected this yesterday. Another solution is to get a more
>> recent kernel.
>
>Manny thamks your anser.
>Since I have begun to try compiling glibc-2.0.94,I have 3 major errors.
>When I installed kernel-headers-2.1.103,I got this error.
>Please give me again any suggestion.
>Now I don't know what to do error 3.
>I found rpcgen in /sunrpc.
>I could execute rpcgen from command line.
>
>My system is PM-6100/66,
>Mklinux DR2.1 wip980421,
>binutils-2.9.1-1a.ppc.rpm,kernel-headers-2.1.103
>egcs-1.0.3a.tar.gz.
>
>Before I sent you these errors of error1 error 2,I found the cause.
>
>==========
>error 3
>==========
>make[2]: Entering directory `/wk-glibc-2.0.94-egcs103a/glibc-2.0.94/sunrpc'
>/wk-glibc-2.0.94-egcs103a/glibc-build/elf/ld.so.1 --library-path /wk-glibc-2.0.94
>-egcs103a/glibc-build:/wk-glibc-2.0.94-egcs103a/glibc-build/math:/wk-glibc-2.0.94
>-egcs103a/glibc-build/elf:/wk-glibc-2.0.94-egcs103a/glibc-build/nss:/wk-glibc
>-2.0.94-egcs103a/glibc-build/nis:/wk-glibc-2.0.94-egcs103a/glibc-build/db2:/
>wk-glibc-2.0.94-egcs103a/glibc-build/rt:/wk-glibc-2.0.94-egcs103a/glibc-build
>/resolv:/wk-glibc-2.0.94-egcs103a/glibc-build/linuxthreads /wk-glibc-2.0.94-
>egcs103a/glibc-build/sunrpc/rpcgen -c rpcsvc/bootparam.x -o /wk-glibc-2.0.94
>-egcs103a/glibc-build/sunrpc/xbootparam.T
>make[2]: *** [/wk-glibc-2.0.94-egcs103a/glibc-build/sunrpc/xbootparam.stmp]
>Segmentation fault
>make[2]: Leaving directory `/wk-glibc-2.0.94-egcs103a/glibc-2.0.94/sunrpc'
>make[1]: *** [sunrpc/others] Error 2
>make[1]: Leaving directory `/wk-glibc-2.0.94-egcs103a/glibc-2.0.94'
>make: *** [all] Error 2
>
>I have this error when using kernel-headers-2.1.24 too.
I assume you are using the glibc-2.0.94 tar-file. Since you are on MkLinux you
probably need this patch:
Index: dl-sysdep.c
===================================================================
RCS file: /egcs/carton/cvsfiles/libc/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- dl-sysdep.c 1998/05/08 23:55:50 1.12
+++ dl-sysdep.c 1998/06/02 10:58:34 1.13
@@ -24,13 +24,26 @@
#define DL_FIND_ARG_COMPONENTS(cookie, argc, argv, envp, auxp) \
do { \
char **_tmp; \
+ size_t _test; \
(argc) = *(long *) cookie; \
(argv) = (char **) cookie + 1; \
(envp) = (argv) + (argc) + 1; \
for (_tmp = (envp); *_tmp; ++_tmp) \
continue; \
- (auxp) = (void *) ++_tmp; \
- (auxp) = (void *)(((size_t)(auxp) + 0xF) & 0xFFFFFFF0); \
+ /* The following '++' is important! */ \
+ ++_tmp; \
+ \
+ _test = (size_t)_tmp; \
+ _test = _test + 0xf & ~0xf; \
+ /* Under some circumstances, MkLinux (up to at least DR3a5) \
+ omits the padding. To work around this, we make a \
+ basic sanity check of the argument vector. Of \
+ course, this means that in future, the argument \
+ vector will have to be laid out to allow for this \
+ test :-(. */ \
+ if (((ElfW(auxv_t) *)_test)->a_type <= 0x10) \
+ _tmp = (char **)_test; \
+ (auxp) = (ElfW(auxv_t) *) _tmp; \
} while (0)
><<<<<<<<<<<<<<<<< I found the cause under that.>>>>>>>>>>>>>>>
>
>=========
>error 2
>=========
>Before I sent you this error,I found the cause.
>But, this error is not, when using kernel-heraders-2.1.103.
>
>Secound parameter Not eqaul void *buf to char *buf.
>------------------------------------------------------
><pread.c>
> extern ssize_t __syscall_pread64 (int fd, void *buf, size_t count
>,
> off_t offset_hi, off_t offset_lo);
><pread64.c>
> extern ssize_t __syscall_pread64 (int fd, void *buf, size_t count
>,
> off_t offset_hi, off_t offset_lo);
><s_pread64.c>
> /* This file is used if no system call is available. */
> ssize_t
> __syscall_pread64 (int fd, char *buf, size_t count,
> off_t offset_hi, off_t offset_lo)
> {
> __set_errno (ENOSYS);
> return -1;
> }
>
><pwrite.c>
> extern ssize_t __syscall_pwrite64 (int fd, const void *buf, size_
>t count,
> off_t offset_hi, off_t offset_lo);
><pwrite64.c>
> extern ssize_t __syscall_pwrite64 (int fd, const void *buf, size_t
> count,
> off_t offset_hi, off_t offset_lo);
><s_pwrite64.c>
> /* This file is used if no system call is available. */
> ssize_t
> __syscall_pwrite64 (int fd, const char *buf, size_t count,
> off_t offset_hi, off_t offset_lo)
> {
> __set_errno (ENOSYS);
> return -1;
> }
>-----------------------------------------------------------------------
>make -C db2 others
>make[2]: Entering directory `/wk-glibc-2.0.94-egcs103a/glibc-2.0.94/db2'
>gcc -shared -o /wk-glibc-2.0.94-egcs103a/glibc-build/db2/libdb.so -Wl,-dynamic-linker
>=/lib/ld.so.1 -B/wk-glibc-2.0.94-egcs103a/glibc-build/csu/ -Wl,-soname=libdb.so
>.3 -L/wk-glibc-2.0.94-egcs103a/glibc-build -L/wk-glibc-2.0.94-egcs103a/glibc-build
>/math -L/wk-glibc-2.0.94-egcs103a/glibc-build/elf -L/wk-glibc-2.0.94-egcs103a
>/glibc-build/nss -L/wk-glibc-2.0.94-egcs103a/glibc-build/nis -L/wk-glibc-2.0.94
>-egcs103a/glibc-build/db2 -L/wk-glibc-2.0.94-egcs103a/glibc-build/rt -L/wk-glibc
>-2.0.94-egcs103a/glibc-build/resolv -L/wk-glibc-2.0.94-egcs103a/glibc-build/
>linuxthreads -Wl,-rpath-link=/wk-glibc-2.0.94-egcs103a/glibc-build:/wk-glibc
>-2.0.94-egcs103a/glibc-build/math:/wk-glibc-2.0.94-egcs103a/glibc-build/elf:
>/wk-glibc-2.0.94-egcs103a/glibc-build/nss:/wk-glibc-2.0.94-egcs103a/glibc-build
>/nis:/wk-glibc-2.0.94-egcs103a/glibc-build/db2:/wk-glibc-2.0.94-egcs103a/glibc-build
>/rt:/wk-glibc-2.0.94-egcs103a/glibc-build/resolv:/wk-glibc-2.0.94-egcs103a/glibc-build
>/linuxthreads -Wl,--whole-archive /wk-glibc-2.0.94-egcs103a/glibc-build/db2/
>libdb_pic.a /wk-glibc-2.0.94-egcs103a/glibc-build/elf/interp.os /wk-glibc-2.0.94
>-egcs103a/glibc-build/libc.so -Wl,--no-whole-archive
>rm -f /wk-glibc-2.0.94-egcs103a/glibc-build/db2/libdb.so.3.new
>/bin/sh ../scripts/rellns-sh /wk-glibc-2.0.94-egcs103a/glibc-build/db2/libdb.so
>/wk-glibc-2.0.94-egcs103a/glibc-build/db2/libdb.so.3.new
>mv -f /wk-glibc-2.0.94-egcs103a/glibc-build/db2/libdb.so.3.new /wk-glibc-2.0.94
>-egcs103a/glibc-build/db2/libdb.so.3
>gcc -nostdlib -nostartfiles -o /wk-glibc-2.0.94-egcs103a/glibc-build/db2/makedb
>-Wl,-dynamic-linker=/lib/ld.so.1 /wk-glibc-2.0.94-egcs103a/glibc-build/csu/
>crt1.o /wk-glibc-2.0.94-egcs103a/glibc-build/csu/crti.o `gcc --print-file-name
>=crtbegin.o` /wk-glibc-2.0.94-egcs103a/glibc-build/db2/makedb.o /wk-glibc-2.0.94
>-egcs103a/glibc-build/db2/libdb.so.3 -Wl,-rpath-link=/wk-glibc-2.0.94-egcs103a
>/glibc-build:/wk-glibc-2.0.94-egcs103a/glibc-build/math:/wk-glibc-2.0.94-egcs103a
>/glibc-build/elf:/wk-glibc-2.0.94-egcs103a/glibc-build/nss:/wk-glibc-2.0.94-
>egcs103a/glibc-build/nis:/wk-glibc-2.0.94-egcs103a/glibc-build/db2:/wk-glibc
>-2.0.94-egcs103a/glibc-build/rt:/wk-glibc-2.0.94-egcs103a/glibc-build/resolv
>:/wk-glibc-2.0.94-egcs103a/glibc-build/linuxthreads /wk-glibc-2.0.94-egcs103a
>/glibc-build/libc.so.6 /wk-glibc-2.0.94-egcs103a/glibc-build/libc_nonshared.a
>-lgcc `gcc --print-file-name=crtend.o` /wk-glibc-2.0.94-egcs103a/glibc-build
>/csu/crtn.o
>/wk-glibc-2.0.94-egcs103a/glibc-build/libc.so.6: undefined reference to `__syscall
>_pread64'
>/wk-glibc-2.0.94-egcs103a/glibc-build/libc.so.6: undefined reference to `__syscall
>_pwrite64'
>collect2: ld returned 1 exit status
>make[2]: *** [/wk-glibc-2.0.94-egcs103a/glibc-build/db2/makedb] Error 1
>make[2]: Leaving directory `/wk-glibc-2.0.94-egcs103a/glibc-2.0.94/db2'
>make[1]: *** [db2/others] Error 2
>make[1]: Leaving directory `/wk-glibc-2.0.94-egcs103a/glibc-2.0.94'
>make: *** [all] Error 2
>
>My system is PM-6100/66,
>Mklinux DR2.1 wip980421,
>binutils-2.9.1-1a.ppc.rpm,kernel-headers-2.1.24-980121.ppc.rpm,
>egcs-1.0.3a.tar.gz.
See Uli's message.
>=========
>error 1
>=========
>Before, I sent you this error,I found the cause.
>I got this error when using CFLAGS=-O3.
>No error when using CFLAGS=-O2.
>
>make[2]: Entering directory `/wk-glibc-2.0.94-egcs103a/glibc-2.0.94/db2'
>gcc -shared -o /wk-glibc-2.0.94-egcs103a/glibc-build/db2/libdb.so -Wl,-dynamic-linker
>=/lib/ld.so.1 -B/wk-glibc-2.0.94-egcs103a/glibc-build/csu/ -Wl,-soname=libdb.so
>.3 -L/wk-glibc-2.0.94-egcs103a/glibc-build -L/wk-glibc-2.0.94-egcs103a/glibc-build
>/math -L/wk-glibc-2.0.94-egcs103a/glibc-build/elf -L/wk-glibc-2.0.94-egcs103a
>/glibc-build/nss -L/wk-glibc-2.0.94-egcs103a/glibc-build/nis -L/wk-glibc-2.0.94
>-egcs103a/glibc-build/db2 -L/wk-glibc-2.0.94-egcs103a/glibc-build/rt -L/wk-glibc
>-2.0.94-egcs103a/glibc-build/resolv -L/wk-glibc-2.0.94-egcs103a/glibc-build/
>linuxthreads -Wl,-rpath-link=/wk-glibc-2.0.94-egcs103a/glibc-build:/wk-glibc
>-2.0.94-egcs103a/glibc-build/math:/wk-glibc-2.0.94-egcs103a/glibc-build/elf:
>/wk-glibc-2.0.94-egcs103a/glibc-build/nss:/wk-glibc-2.0.94-egcs103a/glibc-build
>/nis:/wk-glibc-2.0.94-egcs103a/glibc-build/db2:/wk-glibc-2.0.94-egcs103a/glibc-build
>/rt:/wk-glibc-2.0.94-egcs103a/glibc-build/resolv:/wk-glibc-2.0.94-egcs103a/glibc-build
>/linuxthreads -Wl,--whole-archive /wk-glibc-2.0.94-egcs103a/glibc-build/db2/
>libdb_pic.a /wk-glibc-2.0.94-egcs103a/glibc-build/elf/interp.os /wk-glibc-2.0.94
>-egcs103a/glibc-build/libc.so -Wl,--no-whole-archive
>/wk-glibc-2.0.94-egcs103a/glibc-build/csu/crtn.o: In function `dummy':
>/wk-glibc-2.0.94-egcs103a/glibc-build/csu/crtn.o(.text+0x0): multiple definition
>of `dummy'
>/wk-glibc-2.0.94-egcs103a/glibc-build/csu/crti.o(.text+0x0): first defined here
>
>/wk-glibc-2.0.94-egcs103a/glibc-build/csu/crtn.o: In function `_init':
>/wk-glibc-2.0.94-egcs103a/glibc-build/csu/crtn.o(.text+0x2c): multiple definition
>of `_init'
>/wk-glibc-2.0.94-egcs103a/glibc-build/csu/crti.o(.text+0x58): first defined
>here
>/wk-glibc-2.0.94-egcs103a/glibc-build/csu/crtn.o: In function `_fini':
>/wk-glibc-2.0.94-egcs103a/glibc-build/csu/crtn.o(.init+0x20): multiple definition
>of `_fini'
>/wk-glibc-2.0.94-egcs103a/glibc-build/csu/crti.o(.init+0x10): first defined
>here
>collect2: ld returned 1 exit status
>make[2]: *** [/wk-glibc-2.0.94-egcs103a/glibc-build/db2/libdb.so] Error 1
>make[2]: Leaving directory `/wk-glibc-2.0.94-egcs103a/glibc-2.0.94/db2'
>make[1]: *** [db2/others] Error 2
>make[1]: Leaving directory `/wk-glibc-2.0.94-egcs103a/glibc-2.0.94'
>make: *** [all] Error 2
I think this was a problem in one of the Makefiles and sed, there was some
discussion on this here, I don't remember the solution/patch.
Franz.
Index: dl-sysdep.c
===================================================================
RCS file: /egcs/carton/cvsfiles/libc/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- dl-sysdep.c 1998/05/08 23:55:50 1.12
+++ dl-sysdep.c 1998/06/02 10:58:34 1.13
@@ -24,13 +24,26 @@
#define DL_FIND_ARG_COMPONENTS(cookie, argc, argv, envp, auxp) \
do { \
char **_tmp; \
+ size_t _test; \
(argc) = *(long *) cookie; \
(argv) = (char **) cookie + 1; \
(envp) = (argv) + (argc) + 1; \
for (_tmp = (envp); *_tmp; ++_tmp) \
continue; \
- (auxp) = (void *) ++_tmp; \
- (auxp) = (void *)(((size_t)(auxp) + 0xF) & 0xFFFFFFF0); \
+ /* The following '++' is important! */ \
+ ++_tmp; \
+ \
+ _test = (size_t)_tmp; \
+ _test = _test + 0xf & ~0xf; \
+ /* Under some circumstances, MkLinux (up to at least DR3a5) \
+ omits the padding. To work around this, we make a \
+ basic sanity check of the argument vector. Of \
+ course, this means that in future, the argument \
+ vector will have to be laid out to allow for this \
+ test :-(. */ \
+ if (((ElfW(auxv_t) *)_test)->a_type <= 0x10) \
+ _tmp = (char **)_test; \
+ (auxp) = (ElfW(auxv_t) *) _tmp; \
} while (0)