This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
PATCH: Support gcc 3.4.3 on ia64
- From: "H. J. Lu" <hjl at lucon dot org>
- To: GNU C Library <libc-alpha at sources dot redhat dot com>
- Date: Fri, 12 Nov 2004 15:47:42 -0800
- Subject: PATCH: Support gcc 3.4.3 on ia64
Gcc 3.4.3 supports the new ia64 EH ABI:
http://www.kernel.org/pub/linux/devel/gcc/unwind/
This patch updates the libunwind support for the gcc changes. This
gcc change
http://gcc.gnu.org/ml/gcc-patches/2004-10/msg02209.html
is needed for
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18153
Otherwise, some DSOs will be linked against libunwind.so.7.
H.J.
---
2004-09-08 H.J. Lu <hongjiu.lu@intel.com>
* Makeconfig (libunwind): New.
(libgcc_eh): Add $(libunwind).
(gnulib): Always set to -lgcc $(libgcc_eh).
(static-gnulib): Always set to -lgcc -lgcc_eh $(libunwind).
(libc.so-gnulib): New.
* Makerules (LDLIBS-c.so): Use $(libc.so-gnulib) instead of
$(static-gnulib).
* configure.in (libc_cv_cc_with_libunwind): Set to yes if gcc
uses -lunwind for static binaries.
* configure: Regenerated.
--- libc/Makeconfig.unwind 2004-08-11 14:23:00.000000000 -0700
+++ libc/Makeconfig 2004-09-08 10:07:59.512198328 -0700
@@ -521,18 +521,19 @@ link-libc-bounded = $(common-objpfx)libc
link-extra-libs-bounded = $(foreach lib,$(LDLIBS-$(@F:%-bp=%)),$(common-objpfx)$(lib)_b.a)
ifndef gnulib
-ifneq ($(have-as-needed),yes)
- libgcc_eh := -lgcc_eh
+ifneq ($(have-cc-with-libunwind),yes)
+ libunwind =
else
- libgcc_eh := -Wl,--as-needed -lgcc_s$(libgcc_s_suffix) -Wl,--no-as-needed
+ libunwind = -lunwind
endif
-ifneq ($(have-cc-with-libunwind),yes)
- gnulib := -lgcc $(libgcc_eh)
- static-gnulib := -lgcc -lgcc_eh
+ifneq ($(have-as-needed),yes)
+ libgcc_eh := -lgcc_eh $(libunwind)
else
- gnulib := -lgcc $(libgcc_eh) -lunwind
- static-gnulib := -lgcc -lgcc_eh -lunwind
+ libgcc_eh := -Wl,--as-needed -lgcc_s$(libgcc_s_suffix) $(libunwind) -Wl,--no-as-needed
endif
+gnulib := -lgcc $(libgcc_eh)
+static-gnulib := -lgcc -lgcc_eh $(libunwind)
+libc.so-gnulib := -lgcc
endif
ifeq ($(elf),yes)
+preinit = $(addprefix $(csu-objpfx),crti.o)
--- libc/Makerules.unwind 2004-09-01 15:44:48.000000000 -0700
+++ libc/Makerules 2004-09-08 09:12:53.000000000 -0700
@@ -581,8 +581,8 @@ build-shlib-objlist = $(build-module-hel
# Also omits crti.o and crtn.o, which we do not want
# since we define our own `.init' section specially.
LDFLAGS-c.so = -nostdlib -nostartfiles
-# But we still want to link libc.so against $(static-gnulib).
-LDLIBS-c.so += $(static-gnulib)
+# But we still want to link libc.so against $(libc.so-gnulib).
+LDLIBS-c.so += $(libc.so-gnulib)
# Give libc.so an entry point and make it directly runnable itself.
LDFLAGS-c.so += -e __libc_main
# If lazy relocation is disabled add the -z now flag.
--- libc/configure.in.unwind 2004-09-08 09:12:53.000000000 -0700
+++ libc/configure.in 2004-09-08 09:12:53.000000000 -0700
@@ -1309,13 +1309,17 @@ EOF
fi
AC_CACHE_CHECK(for libunwind-support in compiler,
- libc_cv_cc_with_libunwind, [dnl
- AC_TRY_LINK([#include <libunwind.h>], [
- unw_context_t uc;
- unw_cursor_t c;
- unw_getcontext (&uc);
- unw_init_local (&c, &uc)],
- libc_cv_cc_with_libunwind=yes, libc_cv_cc_with_libunwind=no)])
+ libc_cv_cc_with_libunwind, [
+ cat > conftest.c <<EOF
+int main (void) { return 0; }
+EOF
+ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -static -o conftest \
+ conftest.c -v 2>&1 >/dev/null | grep -q " -lunwind "; then
+ libc_cv_cc_with_libunwind=yes
+ else
+ libc_cv_cc_with_libunwind=no
+ fi
+ rm -f conftest*])
AC_SUBST(libc_cv_cc_with_libunwind)
if test $libc_cv_cc_with_libunwind = yes; then
AC_DEFINE(HAVE_CC_WITH_LIBUNWIND)