how to build NPTL-based toolchain?

Robert P. J. Day rpjday at
Wed Nov 9 14:18:08 PST 2005

  the short question:  what's the recipe for building a cross-compiler
toolchain with NPTL support, as opposed to linuxthreads?

  the longer form:  i'm trying to follow the crosstool model for
building a toolchain for SH3/big-endian, and the build is failing at
building glibc (in fact, it fails during the configure step).

  the components:


  the steps:

	1) install sanitized kernel headers
	2) configure, build and install binutils
	3) configure, build and install glibc headers
	4) build bootstrap gcc
	5) build and install glibc

it's that last step that dies during the initial configure with:

       checking for SH TLS support... yes
       running configure fragment for nptl/sysdeps/unix/sysv/linux
       running configure fragment for nptl/sysdeps/pthread
       configure: error: compiler support for __thread is required
       make: *** No rule to make target `lib'.  Stop.
       make: *** No rule to make target `install-lib-all'.  Stop.

  ok, so i've configured glibc with "--enable-add-ons=nptl", and this
apparently requires the bootstrap compiler to have thread support.

  unfortunately, it *doesn't* as i can try to use it to test compile a
small thread-based program:

	extern __thread int i;

	int main() {

  		return 0;

and what i get is:

$ <bootstrap compiler> -c /tmp/thread.c
/tmp/thread.c:1: error: thread-local storage not supported for this target

  ok, so now we know that that bootstrap gcc has no thread support.
so how do i configure/build it to *have* that?  the CLFS book
configures the bootstrap compiler with, among other things,

  what am i missing?  glibc *clearly* wants thread support of *some*
kind in the bootstrap compiler when you're building with NPTL.


More information about the cross-lfs mailing list