Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#1485 - NPTL glibc with 2.4 kernel fallback support
Attached to Project:
Arch Linux
Opened by Jan de Groot (JGC) - Monday, 20 September 2004, 21:48 GMT
Last edited by Judd Vinet (judd) - Monday, 20 September 2004, 22:18 GMT
Opened by Jan de Groot (JGC) - Monday, 20 September 2004, 21:48 GMT
Last edited by Judd Vinet (judd) - Monday, 20 September 2004, 22:18 GMT
|
DetailsCurrently, we have two glibc packages, each with different kernelheaders included in /usr/include. One comes with linuxthreads, the other with NPTL.
I built a package that contains both glibcs and that uses the NPTL version on 2.6 kernels, while automatically switching to the linuxthreads version for the 2.4 kernel. This support has been included upstream in glibc 2.3.3, and has been in use for a while in Debian, Redhat, Mandrake and SuSE. The solution is simple: place the linuxthreads glibc in /lib, place the NPTL/TLS glibc in /lib/tls. ldconfig will search in /lib/tls first, and switches to /lib if it can't use the libraries in /lib/tls (when a 2.4 kernel is installed that is). Here's an example: [root@lappie ~]# getconf GNU_LIBPTHREAD_VERSION NPTL 0.60 [root@lappie ~]# LD_ASSUME_KERNEL=2.4.0 getconf GNU_LIBPTHREAD_VERSION linuxthreads-0.10 [root@lappie ~]# ldd /bin/bash | grep libc.so.6 libc.so.6 => /lib/tls/libc.so.6 (0x4006a000) [root@lappie ~]# LD_ASSUME_KERNEL=2.4.0 ldd /bin/bash | grep libc.so.6 libc.so.6 => /lib/libc.so.6 (0x4006a000) These examples shows the libc6 switching for different architectures works. The updated PKGBUILD and the binary version of this package can be found at ftp://schoolbak.dyndns.org/nptl/ Another thing I found out during this: the VIA C3 is an i686 CPU without CMOV instructions, which causes them to fail on archlinux. There's a patch around that switches back to i586 when CMOV on a i686 CPU isn't found. Maybe it's also nice to patch this thing into glibc and provide an i586 glibc tarball that gets placed in /lib/i586 and /lib/tls/i586 to support these CPUs (glibc uses CMOV instructions when optimized for i686) |
This task depends upon
What about header files? Do you use headers from the linux-libc-headers tarball, or from the vanilla kernel source? And are the headers usable (ie, you can build with them) on both kernel versions?
Can 2.4 users build with them?
The linux-libc header tarball that gets pulled in the glibc PKGBUILD should match the running kernelversion where glibc is built on. Since my build machine runs 2.6.8.1, I use 2.6.8.1 version of linux-libc-headers. This way, any assumtions made in glibc about kernel versions and its headers will stay in sync (if you build on 2.6.7, you need the linux-libc-headers 2.6.7 to get a good build).
The only problem with these headers is that they decided userspace programs shouldn't include <linux/config.h>. To deny them from including that file, they put ##error in that file. The errormessage points to a FAQ where it states this, it also says package maintainers of distributions may want to empty the file, so that's what I do in the echo "" > $startdir/pkg/usr/include/config.h
Also, try using LD_ASSUME_KERNEL=2.4.0 /bin/bash on the current NPTL glibc: it will complain about not being able to find ld-linux.so