Bart De VOS pointed out that removing absolute paths from the libc linker scripts is plainly wrong.
It dates from dawn ages of the original crosstool code, and is not well explained. At that time, binutils might not understand the sysroot stuff, and it was necessary to remove absolute paths in that case.
/trunk/scripts/build/libc/glibc.sh | 14 2 12 0 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
3 # Adds a new version to one of the toolchain component
8 Usage: ${myname} <tool> [option] <version>
10 --gcc, --binutils, --glibc, --eglibc, --uClibc, --linux,
11 --gdb, --dmalloc, --duma, --strace, --ltrace, --libelf
14 Valid options for all tools:
16 mark the version as being experimental
19 mark the version as being obsolete
21 'version' is a valid version for the specified tool.
24 add version 2.6.19.2 to linux kernel:
25 ${myname} --linux 2.6.19.2
27 add experimental versions 2.3.5 and 2.3.6 to glibc:
28 ${myname} --glibc -x 2.3.5 2.3.6
41 while [ $i -le $# ]; do
44 --gcc) cat=CC; tool=gcc; tool_prefix=cc;;
45 --binutils) cat=BINUTILS; tool=binutils; tool_prefix=;;
46 --glibc) cat=LIBC; tool=glibc; tool_prefix=libc;;
47 --eglibc) cat=LIBC; tool=eglibc; tool_prefix=libc;;
48 --uClibc) cat=LIBC; tool=uClibc; tool_prefix=libc;;
49 --linux) cat=KERNEL; tool=linux; tool_prefix=kernel;;
50 --gdb) cat=GDB; tool=gdb; tool_prefix=debug;;
51 --dmalloc) cat=DMALLOC; tool=dmalloc; tool_prefix=debug;;
52 --duma) cat=DUMA; tool=duma; tool_prefix=debug;;
53 --strace) cat=STRACE; tool=strace; tool_prefix=debug;;
54 --ltrace) cat=LTRACE; tool=ltrace; tool_prefix=debug;;
55 --libelf) cat=LIBELF; tool=libelf; tool_prefix=tools;;
56 --gmp) cat=GMP; tool=gmp; tool_prefix=gmp_mpfr;;
57 --mpfr) cat=MPFR; tool=mpfr; tool_prefix=gmp_mpfr;;
59 -x|--experimental) EXP=1; OBS=; prompt_suffix=" (EXPERIMENTAL)";;
60 -o|--obsolete) OBS=1; EXP=; prompt_suffix=" (OBSOLETE)";;
62 -h|--help) doHelp; exit 0;;
63 -*) echo "Unknown option: '${!i}' (use -h/--help for help)."; exit 1;;
64 *) VERSION="${VERSION} ${!i}";;
69 [ -n "${tool}" -o -n "${VERSION}" ] || { doHelp; exit 1; }
71 for ver in ${VERSION}; do
72 unset DEP L1 L2 L3 L4 L5 L6 FILE v ver_M ver_m
73 FILE="config/${tool_prefix}/${tool}.in"
74 v=$(echo "${ver}" |sed -r -e 's/-/_/g; s/\./_/g;')
75 L1="config ${cat}_V_${v}\n"
77 L3=" prompt \"${ver}${prompt_suffix}\"\n"
78 [ -n "${EXP}" ] && DEP="${DEP} && EXPERIMENTAL"
79 [ -n "${OBS}" ] && DEP="${DEP} && OBSOLETE"
80 [ -n "${DEP}" ] && L4=" depends on "$(echo "${DEP}" |sed -r -e 's/^ \&\& //; s/\&/\\&/g;')"\n"
81 if [ "${tool}" = "gcc" ]; then
82 # Extract 'M'ajor and 'm'inor from version string
83 ver_M=$(echo "${ver}...." |cut -d . -f 1)
84 ver_m=$(echo "${ver}...." |cut -d . -f 2)
85 if [ ${ver_M} -gt 4 -o \( ${ver_M} -eq 4 -a ${ver_m} -ge 3 \) ]; then
86 L5=" select CC_GCC_4_3_or_later\n"
89 L6=" default \"${ver}\" if ${cat}_V_${v}"
90 sed -r -i -e 's/^(# CT_INSERT_VERSION_ABOVE)$/'"${L1}${L2}${L3}${L4}${L5}"'\n\1/;' \
91 -e 's/^(# CT_INSERT_VERSION_STRING_ABOVE)$/'"${L6}"'\n\1/;' \