summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-01-09 15:05:01 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-01-09 15:05:01 (GMT)
commit261709c8d4b014a40c48c73e778dd9a09a991def (patch)
treeef52fdecdfed8a7b6319edff0e8377da6b6f494e
parent28d1a52859bc7ec419dea1af2e754ba327c03f23 (diff)
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.
-rw-r--r--scripts/build/libc/glibc.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh
index a18bff6..8f28918 100644
--- a/scripts/build/libc/glibc.sh
+++ b/scripts/build/libc/glibc.sh
@@ -103,6 +103,7 @@ do_libc_check_config() {
do_libc_headers() {
local cvs
local -a extra_config
+ local arch4hdrs
CT_DoStep INFO "Installing C library headers"
@@ -113,6 +114,13 @@ do_libc_headers() {
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 @@ do_libc_headers() {
# 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)