Wording on x86_64 Glibc headers page
Alexander E. Patrakov
patrakov at ums.usu.ru
Sun Jan 22 23:28:41 PST 2006
Jim Gifford wrote:
> This is something if they ever fix GCC can be remove and if you
> notice on all the other architectures other than x86, x86_64, and
> alpha it is removed. This is related to a GCC bug, that is looming in
> la-la land.
Why bug? Suppose that the host is a plain x86 and the target is x86_64.
Glibc attempts to do, e.g., this (found in config.log):
configure:6138: checking for ld --no-whole-archive
configure:6151: gcc -B/cross-tools/x86_64-pc-linux-gnu/bin/ -Os -s
-nostdlib -nostartfiles -Wl,--no-whole-archive
-o conftest conftest.c 1>&5
/tmp/ccnkhuyd.s: Assembler messages:
/tmp/ccnkhuyd.s:6: Error: suffix or operands invalid for `push'
/tmp/ccnkhuyd.s:8: Error: suffix or operands invalid for `pop'
/tmp/ccnkhuyd.s:14: Error: suffix or operands invalid for `push'
/tmp/ccnkhuyd.s:16: Error: suffix or operands invalid for `pop'
configure:6154: $? = 1
configure:6162: result: no
What happens is that the assembler for x86 (generated by host x86 gcc)
is fed into x86_64 binutils. Thus, push/pop errors. They are just
expected for this combination.
> Yes it's a trick, but it's a trick to make allows use to build GCC.
> If you have a suggestion of how to change the wording, please provide it.
The commands below will populate the config.cache file with the fake
results of some tests. The goal is to make the configure script return
with the exit status 0 and create Makefiles just good enough to install
the headers. The need to fake test results in order for this to happen
is not a cross-compilation issue, but a result of using at this step an
insane combination of host GCC and target Binutils that is not supposed
to work at all.
echo "libc_cv_forced_unwind=yes" > config.cache
echo "libc_cv_c_cleanup=yes" >> config.cache
echo "libc_cv_initfini_array=yes" >> config.cache
Now run the configure script:
CC=gcc ../glibc-20051107/configure ...
NOTE: The results of other tests will have nothing to do with the
reality (e.g., the linker support for the --no-whole-archive flag won't be
detected and there will be NPTL-related errors), because the host GCC
assembler output is fed to target binutils that don't (and are not
supposed to) understand it.
Alexander E. Patrakov
More information about the cross-lfs