[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: atexit() segfault in 2.2.3 and more
From: |
Andreas Jaeger |
Subject: |
Re: atexit() segfault in 2.2.3 and more |
Date: |
16 May 2001 20:34:00 +0200 |
User-agent: |
Gnus/5.090004 (Oort Gnus v0.04) XEmacs/21.1 (Channel Islands) |
Andreas Steinmetz <address@hidden> writes:
> Hi,
> when building static (-static) versions of fileutils-4.1 with gcc 2.95.3 the
> resulting binaries segfault in atexit(). Temporary fix for me is an atexit()
> shim diverting the call to on_exit().
Did you apply the appended patch to GCC 2.95.3 as mentioned in the
release notes?
> After the upgrade from 2.2.2 to 2.2.3 the following packages stopped working
> and had to be rebuilt against the new library:
>
> ypserv-1.3.12
> nfs-utils-0.3.1 (rpc.kstatd)
Really?
> Installing glibc-2.2.3 did cause problems too:
>
> [snip]
>
> make -C linuxthreads subdir_install
> make[2]: Entering directory `/usr/src/glibc-2.2.3/linuxthreads'
> /bin/install -c -m 644 ../linuxthreads/sysdeps/pthread/pthread.h
> /usr/include/pt/bin/install -c -m 644 semaphore.h /usr/include/semaphore.h
> /bin/install -c /usr/src/glibc-2.2.3/build/linuxthreads/libpthread.so
> /lib/libpthread-0.9.so.new
> mv -f /lib/libpthread-0.9.so.new /lib/libpthread-0.9.so
> echo libpthread-0.9.so /lib/libpthread.so.0 >>
> /usr/src/glibc-2.2.3/build/elf/symlink.list
> rm -f /usr/lib/libpthread.so.new
> /bin/sh ../scripts/rellns-sh /lib/libpthread.so.0 /usr/lib/libpthread.so.new
> mv -f /usr/lib/libpthread.so.new /usr/lib/libpthread.so
> /bin/install -c -m 644 /usr/src/glibc-2.2.3/build/linuxthreads/libpthread.a
> /usr/lib/libpthread.a
> : /usr/lib/libpthread.a
> make[2]: Leaving directory `/usr/src/glibc-2.2.3/linuxthreads'
> make -C resolv subdir_install
> make: /lib/libc.so.6: version `GLIBC_2.2.3' not found (required by
> /lib/libpthread.so.0)
> make[1]: *** [resolv/subdir_install] Error 1
> make[1]: Leaving directory `/usr/src/glibc-2.2.3'
> make: *** [install] Error 2
>
> This happens as (at least my) make (make-3.79.1) is linked against
> libpthread.so.0 which is installed before the symbolic link /lib/libc.so.6 is
> set up to point to the new glibc. Workaround is to use a statically linked
> make
> during installation (if you have one available).
I'll forward this,
Andreas
P.S. see http://gcc.gnu.org/ml/gcc-patches/2001-03/msg01187.html
2001-03-16 Jakub Jelinek <address@hidden>
* crtstuff.c (init_dummy): Use CRT_END_INIT_DUMMY if defined.
Remove ia32 linux PIC kludge and move it...
* config/i386/linux.h (CRT_END_INIT_DUMMY): ...here.
--- gcc/config/i386/linux.h.jj Mon Mar 12 11:45:15 2001
+++ gcc/config/i386/linux.h Fri Mar 16 18:52:31 2001
@@ -170,3 +170,21 @@ Boston, MA 02111-1307, USA. */
} \
} while (0)
#endif
+
+#if defined(__PIC__) && defined (USE_GNULIBC_1)
+/* This is a kludge. The i386 GNU/Linux dynamic linker needs ___brk_addr,
+ __environ and atexit (). We have to make sure they are in the .dynsym
+ section. We accomplish it by making a dummy call here. This
+ code is never reached. */
+
+#define CRT_END_INIT_DUMMY \
+ do \
+ { \
+ extern void *___brk_addr; \
+ extern char **__environ; \
+ \
+ ___brk_addr = __environ; \
+ atexit (0); \
+ } \
+ while (0)
+#endif
============================================================
Index: gcc/crtstuff.c
--- gcc/crtstuff.c 1999/03/23 00:43:51 1.18
+++ gcc/crtstuff.c 2001/03/19 10:21:44
@@ -379,20 +379,8 @@
FORCE_INIT_SECTION_ALIGN;
#endif
asm (TEXT_SECTION_ASM_OP);
-
-/* This is a kludge. The i386 GNU/Linux dynamic linker needs ___brk_addr,
- __environ and atexit (). We have to make sure they are in the .dynsym
- section. We accomplish it by making a dummy call here. This
- code is never reached. */
-
-#if defined(__linux__) && defined(__PIC__) && defined(__i386__)
- {
- extern void *___brk_addr;
- extern char **__environ;
-
- ___brk_addr = __environ;
- atexit ();
- }
+#ifdef CRT_END_INIT_DUMMY
+ CRT_END_INIT_DUMMY;
#endif
}
--
Andreas Jaeger
SuSE Labs address@hidden
private address@hidden
http://www.suse.de/~aj