How do you compile 32 bit glibc on a 64 bit SLED

I would like to recompile a 32 bit version of glibc 2.3.6 on 64 bit SLED 10.1. Yes I know SLED 10.1 uses libc 2.4, but I need to also complie libc 2.3.6 on the same system.

I have tried the following configure:
…/glibc-2.3.6/configure --enable-add-ons --prefix=/export/home/SLES9x/usr/local --host=i686-pc-linux-gnu

This creates a make file, but the make file fails with the following error:
#error “TLS support is required.”

If I compile for 64 bit using
…/glibc-2.3.6/configure --enable-add-ons --prefix=/export/home/SLES9x/usr/local,
the configure and make work without a problem.

Can some one give me some help.

Try looking for the option --target=…
It’s been a long time, but that’s what i remember from compiling to 32-bit on a 64-bit machine. I suddenly remember to have seen --arch=… too.

The configure script is human readable, it should contain help as well. Try this one :
…/glibc-2.3.6/configure --help
It should give you a lot of info on available compiler options