# HG changeset patch # User "Yann E. MORIN" # Date 1263049501 -3600 # Node ID 5c0d326c2ceab4517fb3d760c31713bb619cf772 # Parent fa028a13929efc6814909c84eedf91780963a42d libc/glibc: correctly handle dual-bitness archs If the selected ARCH is dual-bitness (eg. supports 32- and 64-bit), then we need to know the correct place where to fetch some headers. Currently, this applies only to x86 variants: i386 and x86_64. diff -r fa028a13929e -r 5c0d326c2cea scripts/build/libc/glibc.sh --- a/scripts/build/libc/glibc.sh Sat Jan 09 17:31:25 2010 +0100 +++ b/scripts/build/libc/glibc.sh Sat Jan 09 16:05:01 2010 +0100 @@ -103,6 +103,7 @@ do_libc_headers() { local cvs local -a extra_config + local arch4hdrs CT_DoStep INFO "Installing C library headers" @@ -113,6 +114,13 @@ CT_DoLog EXTRA "Configuring C library" + # The x86 arch needs special care... Bizarelly enough... :-( + case "${CT_KERNEL_ARCH}:${CT_ARCH_BITNESS}" in + x86:32) arch4hdrs="i386";; + x86:64) arch4hdrs="x86_64";; + *) arch4hdrs="${CT_KERNEL_ARCH}";; + esac + # The following three things have to be done to build glibc-2.3.x, but they don't hurt older versions. # 1. override CC to keep glibc's configure from using $TARGET-gcc. # 2. disable linuxthreads, which needs a real cross-compiler to generate tcb-offsets.h properly @@ -230,9 +238,9 @@ # NOTE: for some archs, the pathes are different, but they are not # supported by crosstool-NG right now. See original crosstool when they are. pthread_h="${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/${CT_THREADS}/sysdeps/pthread/pthread.h" - pthreadtypes_h="${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/nptl/sysdeps/unix/sysv/linux/${CT_KERNEL_ARCH}/bits/pthreadtypes.h" + pthreadtypes_h="${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/nptl/sysdeps/unix/sysv/linux/${arch4hdrs}/bits/pthreadtypes.h" if [ ! -f "${pthreadtypes_h}" ]; then - pthreadtypes_h="${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/ports/sysdeps/unix/sysv/linux/${CT_KERNEL_ARCH}/nptl/bits/pthreadtypes.h" + pthreadtypes_h="${CT_SRC_DIR}/glibc-${cvs}${CT_LIBC_VERSION}/ports/sysdeps/unix/sysv/linux/${arch4hdrs}/nptl/bits/pthreadtypes.h" fi ;; linuxthreads)