- link
- ln -sf <linux source dir>/include/asm <tool dir>/host/sparc-sun-solaris/powerpc-linux/include/asm
- ln -sf <linux source dir>/include/linux <tool dir>/host/sparc-sun-solaris/powerpc-linux/include/linux
- ls -la <tool dir>/host/sparc-sun-solaris/powerpc-linux/include/asm/*
- ls -la <tool dir>/host/sparc-sun-solaris/powerpc-linux/include/linux/*
- extract
- cd <source dir>
- gtar zxvf <archive dir>/glibc-2.1.3.tar.gz
- cd <source dir>/glibc-2.1.3
- gtar zxvf <archive dir>/glibc-crypt-2.1.3.tar.gz
- gtar zxvf <archive dir>/glibc-linuxthreads-2.1.3.tar.gz
- build
first, create a separate subdirectory, such as <tool dir> /target/powerpc-linux-gnu in which to install the glibc libraries. this will be the target of the --prefix configure switch.
the configure script is quite specific about what versions (and flavors) of various build tools it requires. if it doesn't find what it's looking for, chance are that things won't build. try to appease it.
- mkdir <tool dir>target
- mkdir <tool dir>target/powerpc-linux-gnu
- mkdir <object dir>/glibc-2.1.3
- cd <object dir>/glibc-2.1.3
- cc=powerpc-linux-gcc ar=powerpc-linux-ar ranlib=powerpc-linux-ranlib <source dir>/glibc-2.1.3/configure --host=powerpc-linux --with-headers=<linux source dir>/include --enable-add-ons=crypt,linuxthreads --enable-shared --prefix=<tool dir>/target/powerpc-linux-gnu
- gmake
there are a few likely pitfalls here. first, depending on which echo the make process finds (svr4, bsd, gnu, shell built-in, etc.) there will be an error in csu/version-info.h if it picks the wrong one. picking the wrong one results in '-n version...' rather than the intended 'version...' in csu/version-info.h.
you will also probably notice in the csu/version-info.h file that it reports that it was compiled "on a linux 5.7 system". this should report "on a linux 2.4.0 system". this due to more echo problems. the actual content doesn't really matter, it just affects what it output when /usr/lib/libc.so is executed.
- edit and fix the csu/version-info.h file as necessary.
- gmake
the second pitfall when building on a stock solaris 2.7 machine, is that there is a limit of 64 open file descriptors. this will result in an error building in the iconvdata/ subdirectory. this can be remedied by ratcheting up the limit to 1024:
- /usr/bin/ulimit -n 1024
- gmake
the overall build process should take several hours to complete, even on the brawniest of hardware.