static linking to an older glibc
Hi, all: I don't know if I misunderstand the purpose of this mail-list. But I don't know somewhere else to ask. Recently, I compiled a program on a Debian 5.0.2 system with default configurations. Then I got 'FATAL: kernel too old' message when I tried the binary file on a SLES9 system with the kernel 2.6.5. 'file foo' said: 'foo: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Linux 2.6.8, not stripped' So I guessed the problem might be that GLIBC is not old enough ( with --enable-kernel=2.6.8 ). Then I downloaded libc6-dev_2.3.6.ds1-13etch9+b1_i386.deb, and extracted libc.a from it. After that, I compiled again: $ gcc -Wall -Wextra -pedantic -O0 -ggdb -std=gnu99 -D_XOPEN_SOURCE=500 -c -o foo.o foo.c $ gcc -Wall -Wextra -pedantic -O0 -ggdb -std=gnu99 -c -o main.o main.c $ gcc -Wall -Wextra -pedantic -O0 -ggdb -std=gnu99 -static -nostdlib -o foo main.o foo.o old-libc/libc.a `gcc -print-libgcc-file-name` I got '/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 080480a0' during compilation. _Q1_: is it safe to ignore this warning, since the program looks good now? _Q2_: what can I do to eliminate this warning? Then I tried exact the same steps on another Debian 5.0.2 amd64 system. Of course, I replaced libc6-dev_2.3.6.ds1-13etch9+b1_i386.deb with libc6-dev_2.3.6.ds1-13etch9_amd64.deb. _Q3_: how can I get rid of the errors below. Thanks in advance. old-libc/libc.a(ioputs.o): In function `puts': (.text+0x17b): undefined reference to `_Unwind_Resume' old-libc/libc.a(ioputs.o):(.eh_frame+0x13): undefined reference to `__gcc_personality_v0' old-libc/libc.a(putchar.o):(.eh_frame+0x12): undefined reference to `__gcc_personality_v0' old-libc/libc.a(iofclose.o): In function `fclose': (.text+0x1f6): undefined reference to `_Unwind_Resume' old-libc/libc.a(iofclose.o):(.eh_frame+0x13): undefined reference to `__gcc_personality_v0' old-libc/libc.a(iofputs.o): In function `fputs': (.text+0x135): undefined reference to `_Unwind_Resume' old-libc/libc.a(iofputs.o):(.eh_frame+0x13): undefined reference to `__gcc_personality_v0' old-libc/libc.a(iofwrite.o): In function `fwrite': (.text+0x15e): undefined reference to `_Unwind_Resume' old-libc/libc.a(iofwrite.o):(.eh_frame+0x13): undefined reference to `__gcc_personality_v0' old-libc/libc.a(wfileops.o): In function `_IO_wfile_underflow': (.text+0x1193): undefined reference to `_Unwind_Resume' old-libc/libc.a(wfileops.o):(.eh_frame+0x13): undefined reference to `__gcc_personality_v0' old-libc/libc.a(fileops.o): In function `_IO_file_underflow': (.text+0x10ee): undefined reference to `_Unwind_Resume' old-libc/libc.a(fileops.o): In function `_IO_file_fopen': (.text+0x196e): undefined reference to `_Unwind_Resume' old-libc/libc.a(fileops.o):(.eh_frame+0x13): undefined reference to `__gcc_personality_v0' old-libc/libc.a(syslog.o): In function `openlog': (.text+0x2d7): undefined reference to `_Unwind_Resume' old-libc/libc.a(syslog.o): In function `vsyslog': (.text+0x814): undefined reference to `_Unwind_Resume' old-libc/libc.a(syslog.o): In function `vsyslog': (.text+0x82c): undefined reference to `_Unwind_Resume' old-libc/libc.a(syslog.o): In function `closelog': (.text+0x942): undefined reference to `_Unwind_Resume' old-libc/libc.a(syslog.o):(.eh_frame+0x13): undefined reference to `__gcc_personality_v0' old-libc/libc.a(iofflush.o): In function `fflush': (.text+0xf0): undefined reference to `_Unwind_Resume' old-libc/libc.a(iofflush.o):(.eh_frame+0x13): undefined reference to `__gcc_personality_v0' old-libc/libc.a(ioftell.o):(.eh_frame+0x12): undefined reference to `__gcc_personality_v0' old-libc/libc.a(iogetdelim.o):(.eh_frame+0x12): undefined reference to `__gcc_personality_v0' old-libc/libc.a(ioseekoff.o):(.eh_frame+0x12): undefined reference to `__gcc_personality_v0' old-libc/libc.a(fseek.o):(.eh_frame+0x12): undefined reference to `__gcc_personality_v0' collect2: ld returned 1 exit status -- Regards. -Tian -- To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#535313: libc6-dev-i386 content is left in /emul/ia32-linux after upgrade from 2.9-12 to 2.9-20
Hi, yesterday I ran into this problem, too, and found that the content of libc6-dev-i386 was still under /emul/ia32-linux/usr/lib (but registered with dpkg for /usr/lib32) because the files were unpacked before the lib32 symlink was replaced by a directory. Probably the Depends: libc6-i386 needs to be raised to Pre-Depends libc6-i386 (= 2.9-xx) for libc6-dev-i386 (where xx is a fixed version, 21 would be the next) as it was/needs to be done for all other *ia32* lib packages. Then there has to be some cleanup done to the forgotten files in /emul/ia32-linux/. This problem can easily be reproduced in a minimalistic squeeze chroot (e.g. pbuilder) with libc6-dev-i386 installed when all eglibc packages are updated to the version from sid. Andreas -- To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#535809: fixed in eglibc 2.9-20
On Sun, Jul 12, 2009, Aurelien Jarno wrote: * Don't ship /usr/include/scsi/scsi.h anymore. Closes: #535809. Now packages that use scsi/scsi.h no longer build in unstable. Can you suggest a way to fix them? -- Sam. -- To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
r3623 - in glibc-package/trunk/debian: . patches/kfreebsd
Author: ps-guest Date: 2009-07-14 11:53:59 + (Tue, 14 Jul 2009) New Revision: 3623 Modified: glibc-package/trunk/debian/changelog glibc-package/trunk/debian/patches/kfreebsd/local-sysdeps.diff Log: * kfreebsd/local-sysdeps.diff: update to revision 2625 (from glibc-bsd). Modified: glibc-package/trunk/debian/changelog === --- glibc-package/trunk/debian/changelog2009-07-12 22:39:34 UTC (rev 3622) +++ glibc-package/trunk/debian/changelog2009-07-14 11:53:59 UTC (rev 3623) @@ -1,3 +1,10 @@ +eglibc (2.9-21) UNSTABLE; urgency=low + + [ Petr Salinger ] + * kfreebsd/local-sysdeps.diff: update to revision 2625 (from glibc-bsd). + + -- Aurelien Jarno aure...@debian.org Sun, 12 Jul 2009 14:39:01 +0200 + eglibc (2.9-20) unstable; urgency=low [ Clint Adams ] Modified: glibc-package/trunk/debian/patches/kfreebsd/local-sysdeps.diff === --- glibc-package/trunk/debian/patches/kfreebsd/local-sysdeps.diff 2009-07-12 22:39:34 UTC (rev 3622) +++ glibc-package/trunk/debian/patches/kfreebsd/local-sysdeps.diff 2009-07-14 11:53:59 UTC (rev 3623) @@ -9899,7 +9899,7 @@ +#define OFF_T off64_t +#include getdirentries.c --- /dev/null -+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/getdomainname.c b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/getdomain.c @@ -0,0 +1,51 @@ +/* Copyright (C) 2009 Free Software Foundation, Inc. + This file is part of the GNU C Library. @@ -19320,7 +19320,7 @@ +weak_alias (__libc_sendto, __sendto) +weak_alias (__libc_sendto, sendto) --- /dev/null -+++ b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/setdomainname.c b/ports/sysdeps/unix/bsd/bsd4.4/kfreebsd/setdomain.c @@ -0,0 +1,37 @@ +/* Copyright (C) 2002 Free Software Foundation, Inc. + This file is part of the GNU C Library. -- To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: static linking to an older glibc
On Tue, Jul 14, 2009 at 1:51 AM, aXqdaxqd...@gmail.com wrote: I don't know if I misunderstand the purpose of this mail-list. But I don't know somewhere else to ask. This is not the right place to ask. The correct place is libc-h...@sourceware.org, the GNU C Library help mailing list (added to the CC). This list is intended for debian-glibc development and issues. You don't have a debian-glibc issue. Recently, I compiled a program on a Debian 5.0.2 system with default configurations. Then I got 'FATAL: kernel too old' message when I tried the binary file on a SLES9 system with the kernel 2.6.5. 'file foo' said: 'foo: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for GNU/Linux 2.6.8, not stripped' So I guessed the problem might be that GLIBC is not old enough ( with --enable-kernel=2.6.8 ). Correct, every binary compiled with a given version of glibc expects a given kernel version or newer. The minimum kernel version is encoded at glibc build time using --enable-kernel. The minimum kernel version allows glibc to *expect* certain kernel features to be present. Then I downloaded libc6-dev_2.3.6.ds1-13etch9+b1_i386.deb, and extracted libc.a from it. After that, I compiled again: $ gcc -Wall -Wextra -pedantic -O0 -ggdb -std=gnu99 -D_XOPEN_SOURCE=500 -c -o foo.o foo.c $ gcc -Wall -Wextra -pedantic -O0 -ggdb -std=gnu99 -c -o main.o main.c $ gcc -Wall -Wextra -pedantic -O0 -ggdb -std=gnu99 -static -nostdlib -o foo main.o foo.o old-libc/libc.a `gcc -print-libgcc-file-name` This procedure is wrong, you can't extract libc.a and use that, there are many other pieces which are required. You need to unpack all of libc6-dev and be prepared for some work. Try the following: 1) Link your application using -v and copy down all the command-line arguments used by the compiler in the final link. 2) Re-run the final link but instead of using say crti.o use /path/to/extracted/libc6-dev/crti.o etc, for all the object files on the link line that you can find equivalents for in libc6-dev unpacked package. This will build you a static application with an old libc6-dev and the current compiler pieces. I got '/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 080480a0' during compilation. _Q1_: is it safe to ignore this warning, since the program looks good now? No, it is not safe to ignore this warning. _Q2_: what can I do to eliminate this warning? Follow the steps I just mentioned. Then I tried exact the same steps on another Debian 5.0.2 amd64 system. Of course, I replaced libc6-dev_2.3.6.ds1-13etch9+b1_i386.deb with libc6-dev_2.3.6.ds1-13etch9_amd64.deb. You are lucky the two glibc's were compatible enough that they worked. _Q3_: how can I get rid of the errors below. Follow the steps I just mentioned. Cheers, Carlos. -- To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: static linking to an older glibc
2009-7-14,20:37,Carlos O'Donell car...@systemhalted.org Follow the steps I just mentioned. Cheers, Carlos. I got it. It's very helpful. You, Debian people, are so kind. Thanks very much. Regards. -Tian From my iphone -- To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#535809: fixed in eglibc 2.9-20
On Tue, Jul 14, 2009 at 12:24:31PM +0200, Sam Hocevar wrote: On Sun, Jul 12, 2009, Aurelien Jarno wrote: * Don't ship /usr/include/scsi/scsi.h anymore. Closes: #535809. Now packages that use scsi/scsi.h no longer build in unstable. Can you suggest a way to fix them? I think the way is to wait for kernel 2.6.31 to get into unstable, or to patch kernel 2.6.30 to provide this file already. It looks like this RC bug report was a bit premature. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurel...@aurel32.net http://www.aurel32.net -- To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#537047: glibc-doc: pthread_cancel manpage has faulty/racy workaround
Package: glibc-doc Version: 2.7-18 Severity: normal The pthread_cancel manpage, under bugs, recommends the following code as a workaround for syscalls not being cancellation points: pthread_testcancel(); retcode = read(fd, buffer, length); pthread_testcancel(); However, this code is inherently racy (when the signal arrives after the first pthread_testcancel and before the read, the thread will simply hang in read). This should either be documented, or a really working workaround should be given. -- System Information: Debian Release: 5.0 APT prefers stable APT policy: (990, 'stable'), (500, 'unstable'), (500, 'testing'), (1, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 2.6.26-1-amd64 (SMP w/4 CPU cores) Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash glibc-doc depends on no packages. glibc-doc recommends no packages. Versions of packages glibc-doc suggests: pn glibc-doc-reference none (no description available) -- no debconf information -- To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Re: libc6 2.10?
On Mon, Jul 13, 2009 at 1:14 PM, Carlos O'Donellcar...@systemhalted.org wrote: On Mon, Jul 13, 2009 at 12:46 PM, Aurelien Jarnoaure...@debian.org wrote: On Mon, Jul 13, 2009 at 10:40:32AM -0400, Carlos O'Donell wrote: Aurelian, Is there a debian libc6 2.10 somewhere? I see unstable has 2.9. My plan is to upload it to experimental once it builds correctly on alpha/ia64/hppa. Currently it is developed in the SVN [1]. I have made a current snapshot of the SVN, you can find it on [2]. Note that linuxthreads is still the default on HPPA, you have to tweak debian/sysdeps/hppa.mk to switch to NPTL. Thanks. I'll try this out today. FYI. I see the following when I test experimental 2.10: annexc.out, Error 1 (ignored) bug-iconv6.out, Error 1 check-localplt.out, Error 1 check-textrel.out, Error 1 nodelete.out, Error 1 tst-addr1.out, Error 1 tst-audit2.out, Error 139 tst-cancel20.out, Error 1 tst-cancelx17.out, Error 1 tst-cancelx20.out, Error 1 tst-cancelx21.out, Error 1 tst-cancelx4.out, Error 1 tst-cancelx5.out, Error 1 tst-cleanupx4.out, Error 1 tst-cputimer1.out, Error 1 tst-cputimer2.out, Error 1 tst-cputimer3.out, Error 1 tst-deep1.out, Error 1 tst-dlmopen1.out, Error 1 tst-dlmopen3.out, Error 1 tst-getcpu.out, Error 1 tst-mbrtowc2.out, Error 1 tst-mqueue3.out, Error 1 tst-robustpi5.out, Error 1 tst-timer4.out, Error 1 tst-timer5.out, Error 1 tst-tls4.out, Error 1 tst-tls6.out, Error 1 tst-tls9.out, Error 1 tst-tls-dlinfo.out, Error 1 In comparison, upstream is: annexc.out Error 1 (ignored) tst-vfork2.out Error 1 tst-cancelx4.out Error 1 tst-cancelx5.out Error 1 tst-cancelx20.out Error 1 tst-cancelx21.out Error 1 tst-cleanupx4.out Error 1 tst-mqueue3.out Error 1 tst-timer4.out Error 1 tst-timer5.out Error 1 tst-cputimer1.out Error 1 tst-cputimer2.out Error 1 tst-cputimer3.out Error 1 tst-longjmp_chk.out Error 1 tst-pie1.out Error 139 tst-audit2.out Error 139 tst-addr1.out Error 1 check-textrel.out Error 1 check-execstack.out Error 1 check-localplt.out Error 1 I'll have a closer look at the experimental sources and patches. Thanks. Cheers, Carlos. -- To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org