patches/glibc/2.3.3/glibc-2.3.3-libeh-kludge.patch
changeset 1 eeea35fbf182
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/2.3.3/glibc-2.3.3-libeh-kludge.patch	Sat Feb 24 11:00:05 2007 +0000
     1.3 @@ -0,0 +1,75 @@
     1.4 +wget "http://sources.redhat.com/cgi-bin/get-raw-msg?listname=libc-alpha&date=2003-09&msgid=20030911190500.GE12344%40sunsite.ms.mff.cuni.cz"
     1.5 +aka http://sources.redhat.com/ml/libc-alpha/2003-09/msg00104.html
     1.6 +
     1.7 +This seems to fix the error
     1.8 +   gcc-3.4.1-glibc-2.3.3/lib/gcc/powerpc-7400-linux-gnu/3.4.1/../../../../powerpc-7400-linux-gnu/bin/ld: cannot find -lgcc_eh
     1.9 +   make[1]: *** [build/powerpc-7400-linux-gnu/gcc-3.4.1-glibc-2.3.3/build-glibc/libc.so] Error 1
    1.10 +but I assume it might cause trouble with nptl
    1.11 +FIXME: once we figure out why this patch is wrong, fix it right :-)
    1.12 +
    1.13 +Date: Thu, 11 Sep 2003 21:05:00 +0200
    1.14 +From: Jakub Jelinek <jakub at redhat dot com>
    1.15 +To: libc-alpha at sources dot redhat dot com
    1.16 +Subject: Re: Another ugly bootstrapping patch for libgcc_eh
    1.17 +Message-ID: <20030911190500.GE12344@sunsite.ms.mff.cuni.cz>
    1.18 +Reply-To: Jakub Jelinek <jakub at redhat dot com>
    1.19 +References: <20030911194944.GA6104@nevyn.them.org> <20030911180703.GD12344@sunsite.ms.mff.cuni.cz> <20030911203621.GA31503@nevyn.them.org>
    1.20 +In-Reply-To: <20030911203621 dot GA31503 at nevyn dot them dot org>
    1.21 +
    1.22 +On Thu, Sep 11, 2003 at 04:36:21PM -0400, Daniel Jacobowitz wrote:
    1.23 +> > Why exactly do you need that?
    1.24 +> > What exact library needs the functions from libgcc_eh.a?
    1.25 +> > There shouldn't be any these days (__register_*/__frame_state_for etc.
    1.26 +> > functions should come from sysdeps/generic on arches which need them,
    1.27 +> > _Unwind_* come from unwind*.c).
    1.28 +> > IMHO both:
    1.29 +> > 
    1.30 +> > # Force the backward compatibility EH functions to be linked.
    1.31 +> > LDFLAGS-c.so += -u __register_frame
    1.32 +> > 
    1.33 +> > in Makerules and -lgcc_eh in Makeconfig should go.
    1.34 +> 
    1.35 +> If you say so.  That -lgcc_eh's been in and out quite a number of
    1.36 +> times.  I was just assuming that it was necessary.
    1.37 +
    1.38 +I have been testing following patch on hammer.
    1.39 +linuxthreads built just fine and NPTL libraries too,
    1.40 +and in both cases libraries had the same exported symbols as without
    1.41 +the patch (though its .text slightly shrunk because it no longer contained
    1.42 +unneeded libgcc_eh routines (and also libc.so has fewer .plt slots).
    1.43 +Unfortunately, sln in NPTL build doesn't link, as libgcc_eh.a is needed
    1.44 +in this case.
    1.45 +So, IMHO we need my Makerules change and Daniel's patch.
    1.46 +
    1.47 +2003-09-11  Jakub Jelinek  <jakub@redhat.com>
    1.48 +
    1.49 +	#* Makerules (LDFLAGS-c.so): Remove -u __register_frame.
    1.50 +	* Makeconfig (gnulib): Remove -lgcc_eh.
    1.51 +
    1.52 +# Ulrich already applied this.
    1.53 +#--- libc/Makerules.jj	2003-07-23 03:56:16.000000000 -0400
    1.54 +#+++ libc/Makerules	2003-09-11 16:22:44.000000000 -0400
    1.55 +#@@ -572,8 +572,6 @@ LDFLAGS-c.so = -nostdlib -nostartfiles
    1.56 +# LDLIBS-c.so += $(gnulib)
    1.57 +# # Give libc.so an entry point and make it directly runnable itself.
    1.58 +# LDFLAGS-c.so += -e __libc_main
    1.59 +#-# Force the backward compatibility EH functions to be linked.
    1.60 +#-LDFLAGS-c.so += -u __register_frame
    1.61 +# # Pre-link the objects of libc_pic.a so that we can locally resolve
    1.62 +# # COMMON symbols before we link against ld.so.  This is because ld.so
    1.63 +# # contains some of libc_pic.a already, which will prevent the COMMONs
    1.64 +--- libc/Makeconfig.jj	2003-07-22 08:25:32.000000000 -0400
    1.65 ++++ libc/Makeconfig	2003-09-11 16:23:08.000000000 -0400
    1.66 +@@ -505,7 +505,7 @@ link-libc-bounded = $(common-objpfx)libc
    1.67 + link-extra-libs-bounded = $(foreach lib,$(LDLIBS-$(@F:%-bp=%)),$(common-objpfx)$(lib)_b.a)
    1.68 + 
    1.69 + ifndef gnulib
    1.70 +-gnulib := -lgcc -lgcc_eh
    1.71 ++gnulib := -lgcc
    1.72 + endif
    1.73 + ifeq ($(elf),yes)
    1.74 + +preinit = $(addprefix $(csu-objpfx),crti.o)
    1.75 +
    1.76 +
    1.77 +	Jakub
    1.78 +