3

I'm trying to compile glibc-2.16 statically for x64 system,

../configure --enable-kernel=2.6.9 --prefix=/run/shm/libc-static-64 --enable-static --enable-shared --host=i486-linux-gnu --build=i486-linux-gnu -q

Then I got:

configure: WARNING:
*** These auxiliary programs are missing or incompatible versions: sed
*** some features will be disabled.
*** Check the INSTALL file for required versions.
configure: error: the assembler must support TLS

In config.log I saw:

configure:354: checking for i386 TLS support
configure:376: gcc -c -g -O2 conftest.s 1>&5
conftest.s: Assembler messages:
conftest.s:8: Error: @TLSLDM reloc is not supported with 64-bit output format
conftest.s:8: Error: junk `@TLSLDM' after expression
conftest.s:9: Error: relocated field and relocation type differ in signedness
conftest.s:10: Error: relocated field and relocation type differ in signedness
conftest.s:11: Error: relocated field and relocation type differ in signedness
conftest.s:12: Error: @GOTNTPOFF reloc is not supported with 64-bit output format
conftest.s:12: Error: junk `@GOTNTPOFF' after expression
conftest.s:14: Error: @NTPOFF reloc is not supported with 64-bit output format
conftest.s:14: Error: junk `@NTPOFF' after expression
configure:379: $? = 1
configure:387: result: no
configure:390: error: the assembler must support TLS

Did I pass in wrong parameters?

  • I believe glibc just can't be compiled as a static library. At least not all of it. – vonbrand Mar 3 '14 at 2:29
  • @vonbrand It works for 32bit. – daisy Mar 3 '14 at 2:29
  • Fix the missing/out of date sed before continuing. Make very sure all build requirements are satisfied. And check the build instructions carefully, they aren't trivial nor typical. – vonbrand Mar 3 '14 at 2:30
2

I got this error as well when building glibc-2.15.

Turns out it's because I had the --build configure flag wrong, so glibc's configury brought in a 32-bit sysdep directory that doesn't work in 64bit mode. I see you're doing something similar; I was trying to set it to i686-pc-linux-gnu instead of i486, but same difference. Try a 64-bit target triple instead.

I went with whatever ../glibc-2.15/scripts/config.guess printed (x86_64-unknown-linux-gnu on my system, but run it yourself and see) and it seemed to successfully configure. I believe the first chunk is the important one (x86_64).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.