From 1906cf93f86d8d66f45f90380a8d3da25c087ee5 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sat, 24 Feb 2007 11:00:05 +0000 Subject: Add the full crosstool-NG sources to the new repository of its own. You might just say: 'Yeah! crosstool-NG's got its own repo!". Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup. That means I'm putting backups in place in the afternoon. That also means we've lost history... :-( --- .../glibc-2.2.5-allow-gcc-3.4-weakextern.patch | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-3.4-weakextern.patch (limited to 'patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-3.4-weakextern.patch') diff --git a/patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-3.4-weakextern.patch b/patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-3.4-weakextern.patch new file mode 100644 index 00000000..31b7b67c --- /dev/null +++ b/patches/glibc/2.2.5/glibc-2.2.5-allow-gcc-3.4-weakextern.patch @@ -0,0 +1,48 @@ +Suggested by Jake Page +in http://sources.redhat.com/ml/crossgcc/2004-07/msg00169.html +but the libc-symbols.h fragment has been reworked to fix typos +and to still work on gcc-2.95.3, which lacks _Pragma. + +His comment was: + Fixes gcc-3.4 optimizing out comparisons to weak external symbols in code + like: + if (__pthread_mutex_init != NULL) + __pthread_mutex_init(...); + that causes segfaults during libc init when not linked to libpthread + +diff -uNr glibc-2.2.5-orig/resolv/res_libc.c glibc-2.2.5/resolv/res_libc.c +--- glibc-2.2.5-orig/resolv/res_libc.c 2001-02-12 12:23:34.000000000 -0800 ++++ glibc-2.2.5/resolv/res_libc.c 2004-07-27 22:56:32.000000000 -0700 +@@ -84,7 +84,8 @@ + + #if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_2) + # undef res_init +-strong_alias (__res_init, __res_init_weak); ++extern int __res_init_weak (void); + weak_extern (__res_init_weak); ++strong_alias (__res_init, __res_init_weak); + compat_symbol (libc, __res_init_weak, res_init, GLIBC_2_0); + #endif +--- glibc-2.2.5/include/libc-symbols.h.old Fri Aug 13 04:20:55 2004 ++++ glibc-2.2.5/include/libc-symbols.h Fri Aug 13 04:37:06 2004 +@@ -108,10 +108,16 @@ + + /* Declare SYMBOL as weak undefined symbol (resolved to 0 if not defined). */ + # define weak_extern(symbol) _weak_extern (symbol) +-# ifdef HAVE_ASM_WEAKEXT_DIRECTIVE +-# define _weak_extern(symbol) asm (".weakext " __SYMBOL_PREFIX #symbol); +-# else +-# define _weak_extern(symbol) asm (".weak " __SYMBOL_PREFIX #symbol); ++# if __GNUC__ >= 3 ++ /* see http://sources.redhat.com/ml/libc-alpha/2003-01/msg00043.html */ ++# define __weak_extern_1(expr) _Pragma(#expr) ++# define _weak_extern(symbol) __weak_extern_1(weak symbol) ++# else /* __GNUC__ == 2 */ ++# ifdef HAVE_ASM_WEAKEXT_DIRECTIVE ++# define _weak_extern(symbol) asm (".weakext " __SYMBOL_PREFIX #symbol); ++# else ++# define _weak_extern(symbol) asm (".weak " __SYMBOL_PREFIX #symbol); ++# endif + # endif + + # else -- cgit v1.2.3