Submitted By: Joe Ciccone Date: 2006-11-09 Initial Package Version: 2.5 Origin: Joe Ciccone Upstream Status: Unknown Description: Checks to see if libgcc_eh has been provided by gcc. If it has the glibc will attempt to link to it. Rediffed for 2.7 by Jim Gifford Rediffed for 2.8 by Joe Ciccone Rediffed for 2.9 by Joe Ciccone diff -Naur glibc-2.9.orig/config.make.in glibc-2.9/config.make.in --- glibc-2.9.orig/config.make.in 2008-08-18 05:42:17.000000000 -0400 +++ glibc-2.9/config.make.in 2008-12-17 08:23:59.000000000 -0500 @@ -60,6 +60,7 @@ have-libaudit = @have_libaudit@ have-libcap = @have_libcap@ have-cc-with-libunwind = @libc_cv_cc_with_libunwind@ +have-cc-with-libgcc_eh = @libc_cv_cc_with_libgcc_eh@ fno-unit-at-a-time = @fno_unit_at_a_time@ bind-now = @bindnow@ have-hash-style = @libc_cv_hashstyle@ diff -Naur glibc-2.9.orig/configure.in glibc-2.9/configure.in --- glibc-2.9.orig/configure.in 2008-11-27 19:05:05.000000000 -0500 +++ glibc-2.9/configure.in 2008-12-17 08:21:56.000000000 -0500 @@ -1394,6 +1394,23 @@ AC_DEFINE(HAVE_CC_WITH_LIBUNWIND) fi + AC_CACHE_CHECK(whether to link against libgcc_eh, + libc_cv_cc_with_libgcc_eh, [ + cat > conftest.c <&1 >/dev/null | grep -q " -lgcc_eh "; then + libc_cv_cc_with_libgcc_eh=yes + else + libc_cv_cc_with_libgcc_eh=no + fi + rm -f conftest*]) + AC_SUBST(libc_cv_cc_with_libgcc_eh) + if test $libc_cv_cc_with_libgcc_eh = yes; then + AC_DEFINE(HAVE_CC_WITH_LIBGCC_EH) + fi + AC_CACHE_CHECK(for -z nodelete option, libc_cv_z_nodelete, [dnl cat > conftest.c <&5 +echo $ECHO_N "checking whether to link against libgcc_eh... $ECHO_C" >&6; } +if test "${libc_cv_cc_with_libgcc_eh+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat > conftest.c <&1 >/dev/null | grep -q " -lgcc_eh "; then + libc_cv_cc_with_libgcc_eh=yes + else + libc_cv_cc_with_libgcc_eh=no + fi + rm -f conftest* +fi +{ echo "$as_me:$LINENO: result: $libc_cv_cc_with_libgcc_eh" >&5 +echo "${ECHO_T}$libc_cv_cc_with_libgcc_eh" >&6; } + + if test $libc_cv_cc_with_libgcc_eh = yes; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_CC_WITH_LIBGCC_EH 1 +_ACEOF + + fi + { echo "$as_me:$LINENO: checking for -z nodelete option" >&5 echo $ECHO_N "checking for -z nodelete option... $ECHO_C" >&6; } if test "${libc_cv_z_nodelete+set}" = set; then @@ -9282,6 +9310,7 @@ BISON!$BISON$ac_delim VERSIONING!$VERSIONING$ac_delim libc_cv_cc_with_libunwind!$libc_cv_cc_with_libunwind$ac_delim +libc_cv_cc_with_libgcc_eh!$libc_cv_cc_with_libgcc_eh$ac_delim libc_cv_Bgroup!$libc_cv_Bgroup$ac_delim libc_cv_libgcc_s_suffix!$libc_cv_libgcc_s_suffix$ac_delim libc_cv_as_needed!$libc_cv_as_needed$ac_delim @@ -9335,7 +9364,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 54; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 55; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff -Naur glibc-2.9.orig/Makeconfig glibc-2.9/Makeconfig --- glibc-2.9.orig/Makeconfig 2008-08-18 05:42:17.000000000 -0400 +++ glibc-2.9/Makeconfig 2008-12-17 08:23:42.000000000 -0500 @@ -525,12 +525,20 @@ libunwind = -lunwind endif ifneq ($(have-as-needed),yes) - libgcc_eh := -lgcc_eh $(libunwind) + ifneq ($(have-cc-with-libgcc_eh),yes) + libgcc_eh := $(libunwind) + else + libgcc_eh := -lgcc_eh $(libunwind) + endif else 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) +ifneq ($(have-cc-with-libgcc_eh),yes) + static-gnulib := -lgcc $(libunwind) +else + static-gnulib := -lgcc -lgcc_eh $(libunwind) +endif libc.so-gnulib := -lgcc endif ifeq ($(elf),yes)