Patch from Enrico WEIGELT <weigelt@metux.de> to disable __cxa_atexit for those C libraries with no support (old uClibc).
1 wget "http://sources.redhat.com/cgi-bin/get-raw-msg?listname=libc-alpha&date=2003-09&msgid=20030911190500.GE12344%40sunsite.ms.mff.cuni.cz"
2 aka http://sources.redhat.com/ml/libc-alpha/2003-09/msg00104.html
4 This seems to fix the error
5 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
6 make[1]: *** [build/powerpc-7400-linux-gnu/gcc-3.4.1-glibc-2.3.3/build-glibc/libc.so] Error 1
7 but I assume it might cause trouble with nptl
8 FIXME: once we figure out why this patch is wrong, fix it right :-)
10 Date: Thu, 11 Sep 2003 21:05:00 +0200
11 From: Jakub Jelinek <jakub at redhat dot com>
12 To: libc-alpha at sources dot redhat dot com
13 Subject: Re: Another ugly bootstrapping patch for libgcc_eh
14 Message-ID: <20030911190500.GE12344@sunsite.ms.mff.cuni.cz>
15 Reply-To: Jakub Jelinek <jakub at redhat dot com>
16 References: <20030911194944.GA6104@nevyn.them.org> <20030911180703.GD12344@sunsite.ms.mff.cuni.cz> <20030911203621.GA31503@nevyn.them.org>
17 In-Reply-To: <20030911203621 dot GA31503 at nevyn dot them dot org>
19 On Thu, Sep 11, 2003 at 04:36:21PM -0400, Daniel Jacobowitz wrote:
20 > > Why exactly do you need that?
21 > > What exact library needs the functions from libgcc_eh.a?
22 > > There shouldn't be any these days (__register_*/__frame_state_for etc.
23 > > functions should come from sysdeps/generic on arches which need them,
24 > > _Unwind_* come from unwind*.c).
27 > > # Force the backward compatibility EH functions to be linked.
28 > > LDFLAGS-c.so += -u __register_frame
30 > > in Makerules and -lgcc_eh in Makeconfig should go.
32 > If you say so. That -lgcc_eh's been in and out quite a number of
33 > times. I was just assuming that it was necessary.
35 I have been testing following patch on hammer.
36 linuxthreads built just fine and NPTL libraries too,
37 and in both cases libraries had the same exported symbols as without
38 the patch (though its .text slightly shrunk because it no longer contained
39 unneeded libgcc_eh routines (and also libc.so has fewer .plt slots).
40 Unfortunately, sln in NPTL build doesn't link, as libgcc_eh.a is needed
42 So, IMHO we need my Makerules change and Daniel's patch.
44 2003-09-11 Jakub Jelinek <jakub@redhat.com>
46 #* Makerules (LDFLAGS-c.so): Remove -u __register_frame.
47 * Makeconfig (gnulib): Remove -lgcc_eh.
49 # Ulrich already applied this.
50 #--- libc/Makerules.jj 2003-07-23 03:56:16.000000000 -0400
51 #+++ libc/Makerules 2003-09-11 16:22:44.000000000 -0400
52 #@@ -572,8 +572,6 @@ LDFLAGS-c.so = -nostdlib -nostartfiles
53 # LDLIBS-c.so += $(gnulib)
54 # # Give libc.so an entry point and make it directly runnable itself.
55 # LDFLAGS-c.so += -e __libc_main
56 #-# Force the backward compatibility EH functions to be linked.
57 #-LDFLAGS-c.so += -u __register_frame
58 # # Pre-link the objects of libc_pic.a so that we can locally resolve
59 # # COMMON symbols before we link against ld.so. This is because ld.so
60 # # contains some of libc_pic.a already, which will prevent the COMMONs
61 --- libc/Makeconfig.jj 2003-07-22 08:25:32.000000000 -0400
62 +++ libc/Makeconfig 2003-09-11 16:23:08.000000000 -0400
63 @@ -505,7 +505,7 @@ link-libc-bounded = $(common-objpfx)libc
64 link-extra-libs-bounded = $(foreach lib,$(LDLIBS-$(@F:%-bp=%)),$(common-objpfx)$(lib)_b.a)
67 -gnulib := -lgcc -lgcc_eh
71 +preinit = $(addprefix $(csu-objpfx),crti.o)