glibc-2.11-libgcc_eh-1.patch

Submitted By: Joe Ciccone <jciccone@linuxfromscratch.org>
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.9 by Brett Neumeier
             Rediffed for 2.10.1 by Brett Neumeier
             Rediffed for 2.11 by Brett Neumeier

diff --git a/Makeconfig b/Makeconfig
index 9f134cc..1cbed8a 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -538,12 +538,20 @@ else
   libunwind = -lunwind
 endif
 ifneq ($(have-as-needed),yes)
+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)
diff --git a/config.make.in b/config.make.in
index d65706c..807285e 100644
--- a/config.make.in
+++ b/config.make.in
@@ -64,6 +64,7 @@ have-selinux = @have_selinux@
 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 --git a/configure b/configure
index ce76653..fe0c1b1 100755
--- a/configure
+++ b/configure
@@ -692,6 +692,7 @@ ASFLAGS_config
 libc_cv_as_needed
 libc_cv_libgcc_s_suffix
 libc_cv_Bgroup
+libc_cv_cc_with_libgcc_eh
 libc_cv_cc_with_libunwind
 VERSIONING
 BISON
@@ -6443,6 +6444,33 @@ _ACEOF
 
   fi
 
+  { $as_echo "$as_me:$LINENO: checking whether to link against libgcc_eh" >&5
+$as_echo_n "checking whether to link against libgcc_eh... " >&6; }
+if test "${libc_cv_cc_with_libgcc_eh+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+    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 " -lgcc_eh "; then
+      libc_cv_cc_with_libgcc_eh=yes
+    else
+      libc_cv_cc_with_libgcc_eh=no
+    fi
+    rm -f conftest*
+fi
+{ $as_echo "$as_me:$LINENO: result: $libc_cv_cc_with_libgcc_eh" >&5
+$as_echo "$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
+
   { $as_echo "$as_me:$LINENO: checking for -z nodelete option" >&5
 $as_echo_n "checking for -z nodelete option... " >&6; }
 if test "${libc_cv_z_nodelete+set}" = set; then
diff --git a/configure.in b/configure.in
index 182c683..7038f8b 100644
--- a/configure.in
+++ b/configure.in
@@ -1505,6 +1505,23 @@ EOF
     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 <<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 " -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 <<EOF
--
1.6.3.3

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值