Bug 38300 - [4.4 Regression] libstdc++ and libgcj contain a reference to _Unwind_GetIPInfo
Summary: [4.4 Regression] libstdc++ and libgcj contain a reference to _Unwind_GetIPInfo
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.4.0
: P1 blocker
Target Milestone: 4.4.0
Assignee: Andrew Pinski
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: build, link-failure, patch
Depends on:
Blocks:
 
Reported: 2008-11-28 08:52 UTC by Andrew Pinski
Modified: 2008-12-21 22:26 UTC (History)
3 users (show)

See Also:
Host:
Target: *-*-darwin8.11
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-11-28 09:04:06


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2008-11-28 08:52:17 UTC
I found the patch for PR 27880 causes libgcj and libstdc++ to contain a reference to _Unwind_GetIPInfo on darwin8.11.  This causes a bootstrap failure and/or the testsuite to fail all the time with an undefined symbol.

/bin/sh ./libtool --tag=GCJ --mode=link /Users/apinski/src/local/gcc/objdir/gcc/gcj -B/Users/apinski/src/local/gcc/objdir/i386-apple-darwin8.11.1/libjava/ -B/Users/apinski/src/local/gcc/objdir/gcc/ -L/Users/apinski/src/local/gcc/objdir/i386-apple-darwin8.11.1/libjava -ffloat-store -fomit-frame-pointer -Usun -g -O2  -o gij -rpath /Users/apinski/local-gcc/lib/gcj-4.4.0-10 -rpath /Users/apinski/local-gcc/lib -shared-libgcc      -L/Users/apinski/src/local/gcc/objdir/i386-apple-darwin8.11.1/libjava/.libs libgij.la
/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: Undefined symbols:
__Unwind_GetIPInfo
collect2: ld returned 1 exit status
Comment 1 Andrew Pinski 2008-11-28 08:53:12 UTC
The link test was doing the correct thing as libgcc in Darwin (before 9) did not contain _Unwind_GetIPInfo.
Comment 2 Andrew Pinski 2008-11-28 09:04:06 UTC
Here is the patch which I am currently testing:
Index: unwind_ipinfo.m4
===================================================================
--- unwind_ipinfo.m4    (revision 142255)
+++ unwind_ipinfo.m4    (working copy)
@@ -15,6 +15,10 @@ AC_DEFUN([GCC_CHECK_UNWIND_GETIPINFO], [
       *) with_system_libunwind=no ;;
     esac
   fi
+  # Darwin before version 9 does not have _Unwind_GetIPInfo.
+  case ${target} in
+    *-*-darwin[0-8]*) have_unwind_getipinfo=no ;;
+  esac
   # Based on system-libunwind and target, do we have ipinfo?
   if  test x$with_system_libunwind = xyes; then
     case ${target} in

--- CUT ---
I should note that someone almost forgot to regenerate libstdc++ after the original change went in.
Comment 3 Andreas Schwab 2008-11-28 09:31:39 UTC
This will also match darwin10.
Comment 4 Andrew Pinski 2008-11-28 17:35:20 UTC
(In reply to comment #3)
> This will also match darwin10.

You are correct, in fact it does not set have_unwind_getipinfo to no anyways as it was being set to yes in the else statement.

Index: unwind_ipinfo.m4
===================================================================
--- unwind_ipinfo.m4    (revision 142255)
+++ unwind_ipinfo.m4    (working copy)
@@ -22,7 +22,11 @@ AC_DEFUN([GCC_CHECK_UNWIND_GETIPINFO], [
       *) have_unwind_getipinfo=yes ;;
     esac
   else
-     have_unwind_getipinfo=yes
+    # Darwin before version 9 does not have _Unwind_GetIPInfo.
+    case ${target} in
+      *-*-darwin[1-8].*) have_unwind_getipinfo=no ;;
+      *) have_unwind_getipinfo=yes ;;
+    esac
   fi
 
   if test x$have_unwind_getipinfo = xyes; then
Comment 5 Jack Howarth 2008-12-05 17:30:02 UTC
Andrew,
    This last patch would still be problematic since it will not catch targets set to *-*-darwin8 rather than *-*-darwin8.5. A better fix would be to use the approach from...

------------------------------------------------------------------------
r142417 | janis | 2008-12-03 18:41:46 -0500 (Wed, 03 Dec 2008) | 2 lines

        * g++.old-deja/g++.eh/badalloc1.C: Reinstate XFAIL for Darwin 3-7.

...and use a patch like....

Index: unwind_ipinfo.m4
===================================================================
--- unwind_ipinfo.m4    (revision 142255)
+++ unwind_ipinfo.m4    (working copy)
@@ -22,7 +22,11 @@ AC_DEFUN([GCC_CHECK_UNWIND_GETIPINFO], [
       *) have_unwind_getipinfo=yes ;;
     esac
   else
-     have_unwind_getipinfo=yes
+    # Darwin before version 9 does not have _Unwind_GetIPInfo.
+    case ${target} in
+      *-*-darwin[3-8]*) have_unwind_getipinfo=no ;;
+      *) have_unwind_getipinfo=yes ;;
+    esac
   fi

   if test x$have_unwind_getipinfo = xyes; then

...which would work until we reach darwin30.
Comment 6 Andreas Schwab 2008-12-05 17:47:59 UTC
You can use multiple patterns:

*-*-darwin[1-8]|*-*-darwin[1-8].*) ...
Comment 7 Jack Howarth 2008-12-06 16:49:43 UTC
Remember we don't want to match darwin10. Mike Stump recommended recently that
not worrying about darwin1 and darwin2 would be okay. So the alternative would be...

*-*-darwin[3-8]|*-*-darwin[3-8].*) ...
Comment 8 Jack Howarth 2008-12-06 16:53:13 UTC
Ignore my last comment. I misread the proposed syntax.
Comment 9 Mike Stump 2008-12-18 12:21:28 UTC
Ok with the:

+      *-*-darwin[3-8]*) have_unwind_getipinfo=no ;;

spelling.  It matches the spelling in the rest of the compiler, which makes it easier to spot and modify.  Technically, the:

*-*-darwin[0-8]|*-*-darwin[0-8].*) ...

is a bit more perfect, but, I'm not terribly worried about darwin1 or darwin2 systems.  They won't work for other reasons.
Comment 10 Andrew Pinski 2008-12-21 22:26:12 UTC
Fixed.
Comment 11 Andrew Pinski 2008-12-21 22:28:42 UTC
Subject: Bug 38300

Author: pinskia
Date: Sun Dec 21 22:27:18 2008
New Revision: 142877

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142877
Log:
Index: config/ChangeLog
+2008-12-21  Andrew Pinski  <pinskia@gmail.com>
+
+       PR target/38300
+       * unwind_ipinfo.m4: Darwin before 9 does not have _Unwind_GetIPInfo.
+
Index: gcc/ChangeLog
+2008-12-21  Andrew Pinski  <pinskia@gmail.com>
+
+       PR target/38300
+       * configure: Regenerate.
Index: libstdc++-v3/ChangeLog
+2008-12-21  Andrew Pinski  <pinskia@gmail.com>
+
+       PR target/38300
+       * configure: Regenerate.
+
Index: libjava/ChangeLog
+2008-12-21  Andrew Pinski  <pinskia@gmail.com>
+
+       PR target/38300
+       * configure: Regenerate.


Modified:
    trunk/config/ChangeLog
    trunk/config/unwind_ipinfo.m4
    trunk/gcc/ChangeLog
    trunk/gcc/configure
    trunk/libjava/ChangeLog
    trunk/libjava/configure
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/configure