Glibc-2.0.7 Gcc-2.95.X README - Der Herr Hofr.at

This file describes patching and compiling glibc-2.0.7 with gcc-2.95.X under Linux - The glibc-2.0.7pre6_gcc2.95.patch patch is only for X86 and has not gotten much testing yet. Pleas let me know if it work, or what does not work. Feadback to Der Herr Hofr.at appreciated .

thx !
hofrat

Setting up sources and patching

Unpack glibc 2.0.7pre6

unpack the the add-on packages in the top level tree of glibc-2.0.7

patch glibc for the SuSE 6.0 fix ups first then add the patch for gcc-2.95.X complience for X86 - comments on the gcc patch to would be appreciated - it works for me on minirtl-3.0/3.1 but has not gotten extensiv testing.

Compiling and installing

don't mess this up unless you know what you are doing - it can overwrite your /lib and then you get to watch your linux box dying slow and painful. So don't run make install without passing it the install_root=DIR flag...

--prefix = relativ to what runtime path glibc is built for, install_root = where to "relocate" it all for install. Set the FLAGS to the CPU you are using or leave it at i386 as safe setting. Note that the glibc patch for gcc-2.95.X only applies for X86 so you can't cross compile this - if you want to do so you need to patch the arch specific files (see the glibc-2.0.7pre6_gcc2.95.patch patch)

FLAGS=' -mcpu=i386'

./configure --host=i386-linux --prefix=/ --disable-profile --enable-add-ons=crypt,linuxthreads

make
make install_root=/usr/src/minirtl install

Post Install notes

as the default libc.so ld-script will contain absolute paths to the install dir this will fail ither at compile time (when you are operating in your workstation environment) or at runtim (nfsroot or chroot) so as /lib should be in the default search path anyway the simplest solution is to kick out the path info and only referecnce the static lib - this may need fixing at runtime if you descide to kick out all .a files (which is a good idea for most setups) - If you kick out all .a files simply link libc.so to libc.so.6 and you should be set.

Last cd into the install tree for glibc-2.0.7 and set up the links so that the kernel specific system header files are found.

Compiling apps

For embedded systems packages like busybox are of interest, the folowing is a compile guid for busybox-0.48, glibc-2.0.7 using gcc 2.95.X .

rtl4:~ # cd /tmp
rtl4:~ # tar -xzf busybox-0.48.tar.gz
rtl4:~ # cd busybox-0.48

You need to add/modify a few lines in the top level makefile of busybox to use the newly built glibc-2.0.7, basically this should be applicable with modifications to any application you want to build.

---busybox-0.48 Makefile---
...
GLIBC_DEVEL=/usr/src/minirtl/
LDFLAGS+= -nodefaultlibs -L$(GLIBC_DEVEL)/lib -Wl,-rpath-link,$(GLIBC_DEVEL)/lib
LIBRARIES = -lc -lcrypt
CROSS_CFLAGS+=-nostdinc -I$(GLIBC_DEVEL)/include -I$(GCCINCDIR)
GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
...
---snip---

Note that there also is a bug in the top level Makefile for busybox 0.48:

ifndef $(PREFIX)
should be
ifndef PREFIX
otherwise PREFIX passed on the commandline to the make command will be ignored.<

Now pass the Glibc directory for development - this is not the same as for the runtime system - not only is the runtime striped and the static libs removed but also the ld script in libc.so needs to be adjusted for runtime/development

rtl4:~ # GLIBC_DEVEL=/usr/src/minirtl PREFIX=/usr/src/minirtl make all install

this will install busybox with all its links in /usr/src/minirtl . if you enabled the busybox builtin shell you can chroot to /usr/src/minirtl now.

Sources

This README in text mode
README

GLIBC source and addons
glibc-2.0.7pre6.tar.bz2 from ftp.kernel.org
glibc-crypt-2.0.6.tar.gz from ftp.fsmlabs.at
glibc-linuxthreads-2.0.7pre6.tar.bz2 from ftp.kernel.org
glibc-localedata-2.0.7pre3.tar.gz from ftp.fsmlabs.at

GLIBC 2.0.7 fixup patches from SuSE 6.0 - Thanks to the suse team
glibc-2.0.7pre6.dif from ftp.fsmlabs.at. If you know the real home of htis patch - let me know.

Hofrat's GLIBC-2.0.7 patches released under GPL terms
glibc-2.0.7pre6_gcc2.95.patch from ftp.fsmlabs.at
libc.so_ld-path.patch from ftp.fsmlabs.at