The shared libgcc in gcc 3.0 poses a problem for glibc. This is an
attempt to bring gcc 3.0 and glibc together for shared libgcc. There
are 2 patches:

1. gcc-3.0-libgcc.patch. A patch for gcc 3.0.
2. glibc-libgcc.patch. A patch for glibc 2.2 in CVS.

To install, please follow the procedure outlined here:

1. Apply gcc-3.0-libgcc.patch to gcc 3.0. You will need autoconf to
regenerate gcc/configure. Do

# cd gcc/gcc
# patch -p1 < .../gcc-3.0-libgcc.patch
# autoconf

2. Configure gcc 3.0 with --enable-shared --enable-shared=libgcc.

--enable-shared=libgcc is only needed for the first time when you build gcc 3.0
after you apply gcc-3.0-libgcc.patch.

3. Bootstrap/install gcc 3.0.

4. Move libgcc_s.so to /lib. Do

# rm `gcc -print-file-name=libgcc_s.so`
# mv `gcc -print-file-name=libgcc_s.so.0` /lib/libgcc_s-`gcc -dumprelease`.so
# ldconfig
# ln -s ../../lib/libgcc_s.so.0 /usr/lib/libgcc_s.so

Once you have done step #4, please don't configure gcc 3.0 --enable-shared=libgcc.

Now you have built/installed libgcc_s.so.0 as a system library for the first time.
From now on, you can rebuild libgcc_s.so.0 from the installed gcc 3.0:

# gcc -nodefaultlibs -shared -o libgcc_s-`gcc -dumprelease`.so \
	-Wl,--version-script,`gcc -print-file-name=libgcc.map` \
	-Wl,--whole-archive -lgcc -Wl,--no-whole-archive -lc

It will create libgcc_s-`gcc -dumprelease`.so. You can move it to /lib and run

# ldconfig

But it is recommended to build libgcc_s.so with glibc.

5. Install the libgcc addon and apply glibc-libgcc.patch.

# cd ../libc
# tar xfz ..... libgcc-VERSION.tar.gz
# patch -p1 < libgcc/glibc-libgcc.patch
# autoconf

6. Enable libgcc to glibc. You have to add libgcc to addon by

# .../configure .... --enable-add-ons=linuxthreads,libgcc

or

# .../configure .... --enable-add-ons=yes

libgcc_s.so.0 will be installed in /lib and libgcc_s.so will be installed in
/usr/lib during installation.


H.J. Lu
hjl@gnu.org
03/28/2001
