Bug 27880 - [4.3 regression] undefined reference to `_Unwind_GetIPInfo'
[4.3 regression] undefined reference to `_Unwind_GetIPInfo'
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: target
4.2.0
: P2 critical
: 4.4.0
Assigned To: Not yet assigned to anyone
http://gcc.gnu.org/ml/gcc-patches/200...
: patch
: 29342 37403 (view as bug list)
Depends on:
Blocks: 26792
  Show dependency treegraph
 
Reported: 2006-06-02 20:31 UTC by Andreas Schwab
Modified: 2011-06-27 11:08 UTC (History)
8 users (show)

See Also:
Host:
Target: ia64-*-linux
Build:
Known to work: 4.4.0
Known to fail: 4.3.2
Last reconfirmed: 2006-07-22 21:41:42


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schwab 2006-06-02 20:31:06 UTC
Static linking is broken on ia64:

$ gcc -static -v hello.c 
Using built-in specs.
Target: ia64-suse-linux
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking --with-gxx-include-dir=/usr/include/c++/4.2.0 --enable-ssp --disable-libssp --enable-java-awt=gtk --enable-gtk-cairo --disable-libjava-multilib --disable-ltdl-install --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --enable-libstdcxx-allocator=new --with-system-libunwind --host=ia64-suse-linux
Thread model: posix
gcc version 4.2.0 20060601 (experimental) (SUSE Linux)
 /usr/lib/gcc/ia64-suse-linux/4.2.0/cc1 -quiet -v hello.c -quiet -dumpbase hello.c -auxbase hello -version -o /tmp/ccAc4LPK.s
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/lib/gcc/ia64-suse-linux/4.2.0/include
 /usr/lib/gcc/ia64-suse-linux/4.2.0/../../../../ia64-suse-linux/include
 /usr/include
End of search list.
GNU C version 4.2.0 20060601 (experimental) (SUSE Linux) (ia64-suse-linux)
        compiled by GNU C version 4.2.0 20060601 (experimental) (SUSE Linux).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: a5d82c8d6aeb8d953dd6034fd4040dff
 /usr/lib/gcc/ia64-suse-linux/4.2.0/../../../../ia64-suse-linux/bin/as -x -o /tmp/cc8qYnOm.o /tmp/ccAc4LPK.s
 /usr/lib/gcc/ia64-suse-linux/4.2.0/collect2 -static /usr/lib/gcc/ia64-suse-linux/4.2.0/../../../crt1.o /usr/lib/gcc/ia64-suse-linux/4.2.0/../../../crti.o /usr/lib/gcc/ia64-suse-linux/4.2.0/crtbegin.o -L/usr/lib/gcc/ia64-suse-linux/4.2.0 -L/usr/lib/gcc/ia64-suse-linux/4.2.0 -L/usr/lib/gcc/ia64-suse-linux/4.2.0/../../../../ia64-suse-linux/lib -L/usr/lib/gcc/ia64-suse-linux/4.2.0/../../.. /tmp/cc8qYnOm.o --start-group -lgcc -lgcc_eh -lunwind -lc --end-group /usr/lib/gcc/ia64-suse-linux/4.2.0/crtend.o /usr/lib/gcc/ia64-suse-linux/4.2.0/../../../crtn.o
/usr/lib/gcc/ia64-suse-linux/4.2.0/libgcc_eh.a(unwind-c.o): In function `__gcc_personality_v0':
(.text+0x822): undefined reference to `_Unwind_GetIPInfo'
collect2: ld returned 1 exit status
Comment 1 Steve Ellcey 2006-06-02 22:40:49 UTC
I believe this is because you are configuring with --with-system-libunwind and
your system unwind does not have _Unwind_GetIPInfo.  This routine was added to the GCC libunwind back in February by Jakub Jelinek to fix PR other/26208.
Comment 2 Andrew Pinski 2006-06-02 22:49:01 UTC
And I did mention this when that other PR's patch was posted.
--with-system-libunwind is the "issue".
Comment 3 Steve Ellcey 2006-06-02 23:10:41 UTC
I should have mentioned that for HP-UX, where the system unwind also does not have _Unwind_GetIPInfo, I added it to libgcc.  See

http://gcc.gnu.org/ml/gcc-patches/2006-03/msg01285.html
Comment 4 Geoff Keating 2006-06-06 01:19:59 UTC
In bug 26792, I suggest that libstdc++ should use autoconf to detect whether this function exists and not use it if it doesn't.  That would also fix this bug.
Comment 5 Steve Ellcey 2006-06-08 22:25:16 UTC
I think using configure to detect whether or not _Unwind_GetIPInfo exists may be difficult.  The libstdc++ configure script seems to go out of its way to not link programs or to use and/or look at libgcc in anyway.

Anyone have an idea on how to implement this?  I am thinking the checking/flag setting on whether or not _Unwind_GetIPInfo exists might have to be done in the gcc directory.
Comment 6 Andreas Schwab 2006-06-21 08:22:19 UTC
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2006-06/msg01023.html>.
Comment 7 patchapp@dberlin.org 2006-06-29 19:28:28 UTC
Subject: Bug number PR target/27880

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-06/msg01023.html
Comment 8 Eric Christopher 2006-07-22 21:06:19 UTC
I believe a patch to libstdc++ to check for __Unwind_GetIPInfo was committed. Verify this still fails?
Comment 9 Andreas Schwab 2006-07-22 21:41:42 UTC
Why do you think this bug has anything to do with libstdc++?
Comment 10 Andrew Pinski 2006-07-22 22:08:40 UTC
libstdc++ is only part of the problem, libjava still has the same issue.
Comment 11 Andrew Pinski 2006-10-04 16:57:12 UTC
*** Bug 29342 has been marked as a duplicate of this bug. ***
Comment 12 Steve Ellcey 2006-10-04 21:08:50 UTC
The uses of __Unwind_GetIPInfo in libstdc++ and libjava have been fixed.  It looks like the report in PR 29342 is due to the use of __Unwind_GetIPInfo in gcc/unwind-c.c.  I will create a patch for this use.
Comment 13 Steve Ellcey 2006-10-09 15:55:51 UTC
Subject: Bug 27880

Author: sje
Date: Mon Oct  9 15:55:38 2006
New Revision: 117576

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117576
Log:
	PR target/27880
	* unwind-c.c (PERSONALITY_FUNCTION): Ifdef use of _Unwind_GetIPInfo.
	* configure.ac (HAVE_GETIPINFO): Check for _Unwind_GetIPInfo.
	* configure: Regenerate.
	* config.in: Regenerate.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config.in
    trunk/gcc/configure
    trunk/gcc/configure.ac
    trunk/gcc/unwind-c.c

Comment 14 Steve Ellcey 2006-10-09 18:31:44 UTC
With the patch I just checked in, I believe that this defect is now fixed.
The uses of GetIPInfo in libstdc++ and libjava were fixed earlier, this latest patch fixes the use in unwind-c.c and that should be it.
Comment 15 Andreas Schwab 2007-03-31 10:18:01 UTC
This still does not work.  When configuring the stage2 compiler the symbol will be found in libgcc_s (from unwind-compat.o).
Comment 16 Andreas Schwab 2007-03-31 10:28:56 UTC
Also why does configure set HAVE_GETIPINFO unconditionally when the system libunwind is used?
Comment 17 Mark Mitchell 2007-05-14 22:25:32 UTC
Will not be fixed in 4.2.0; retargeting at 4.2.1.
Comment 18 Mark Mitchell 2007-10-09 19:21:01 UTC
Change target milestone to 4.2.3, as 4.2.2 has been released.
Comment 19 patchapp@dberlin.org 2007-10-16 16:19:25 UTC
Subject: Bug number PR target/27880

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-06/msg01023.html
Comment 20 Benjamin Kosnik 2008-01-18 08:45:26 UTC
This patch seems good to me. What's the delay here?
Comment 21 Joseph S. Myers 2008-02-01 16:52:59 UTC
4.2.3 is being released now, changing milestones of open bugs to 4.2.4.
Comment 22 Uroš Bizjak 2008-02-20 18:39:47 UTC
Critical P2 bug and the patch gets unreviewed for so long?!

Is this bug still relevant for ia64-*-linux?
Comment 23 Jim Wilson 2008-03-04 17:56:13 UTC
Subject: Re:  [4.2/4.3/4.4 regression] undefined reference
 to `_Unwind_GetIPInfo'

ubizjak at gmail dot com wrote:
> ------- Comment #22 from ubizjak at gmail dot com  2008-02-20 18:39 -------
> Critical P2 bug and the patch gets unreviewed for so long?!
> Is this bug still relevant for ia64-*-linux?

I didn't realize this PR was still open.  I perhaps lost track of it 
because some misleading info added to it implied that it was already 
fixed.  I'll take a look now.

Jim

Comment 24 Mike Frysinger 2008-04-22 07:51:09 UTC
the proposed patch in question seems to break the opposite scenario on ia64: --without-system-libunwind
Comment 25 Joseph S. Myers 2008-05-19 20:22:52 UTC
4.2.4 is being released, changing milestones to 4.2.5.
Comment 26 Michael Kosarev 2008-06-23 04:34:02 UTC
This bug also affects OpenSolaris.
# gcc -v
Using built-in specs.
Target: i386-pc-solaris2.11
Configured with: ../gcc-4.2.4/configure --prefix=/usr/gnu --libdir=/usr/gnu/lib --libexecdir=/usr/gnu/lib --mandir=/usr/gnu/share/man --infodir=/usr/share/info --with-as=/usr/gnu/bin/as --with-gnu-as --with-ld=/usr/gnu/bin/ld --with-gnu-ld --enable-languages=c,c++,fortran,objc --enable-shared --disable-static --enable-decimal-float -disable-nls
Thread model: posix
gcc version 4.2.4
---------

g++ -I/usr/include -I/usr/local/include -Wall -D_REENTRANT -pthreads -I/usr/local/include/openssl -DHAVE_SSL -I/opt/mysql/mysql/include -m64 -mtune=k8 -DMY_ATOMIC_MODE_RWLOCKS -m64 -O2 -mtune=k8 -static-libgcc -o ascent-logonserver AccountCache.o AuthSocket.o LogonCommServer.o LogonConsole.o LogonOpcodes.o LogonStdAfx.o AutoPatcher.o Main.o  -L/export/home/burlex/summit/src/ascent-shared -L/export/home/burlex/summit/dep/src/zlib -L/usr/lib/amd64 -L/usr/local/lib/amd64 -L/usr/gnu/lib/amd64 -L/usr/sfw/lib/amd64 -L/usr/gnu/lib -L/opt/mysql/mysql/lib -lmysqlclient -lposix4 -lresolv -lgen -lsocket -lnsl -lm -lshared -lzlib -lz -lssl -lcrypto
/usr/gnu/lib/amd64/libstdc++.so: undefined reference to `_Unwind_GetIPInfo@GCC_4.2.0'
collect2: ld returned 1 exit status
Comment 27 Andrew Pinski 2008-09-06 22:50:29 UTC
*** Bug 37403 has been marked as a duplicate of this bug. ***
Comment 28 Matthias Klose 2008-09-06 22:53:47 UTC
so this bites again with trunk and ada. Jim, Steve, any news on this?
Comment 29 Steve Ellcey 2008-10-15 17:06:03 UTC
See http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00647.html for a discussion and proposed patch.
Comment 30 Steve Ellcey 2008-11-12 21:37:07 UTC
Subject: Bug 27880

Author: sje
Date: Wed Nov 12 21:35:46 2008
New Revision: 141804

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141804
Log:
	PR  target/27880
	* config/unwind_ipinfo.m4 (GCC_CHECK_UNWIND_GETIPINFO): Change from
	link test to target based test.
	* libstdc++/v3/configure.ac: Move call to GCC_CHECK_UNWIND_GETIPINFO.
	* libstdc++/v3/configure: Regenerate.
	* libjava/configure: Regenerate.
	


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

Comment 31 Steve Ellcey 2008-11-12 21:38:56 UTC
Subject: Bug 27880

Author: sje
Date: Wed Nov 12 21:37:34 2008
New Revision: 141805

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141805
Log:
        PR target/27880
        * configure.ac (GCC_CHECK_UNWIND_GETIPINFO): Use this macro
        to set HAVE_GETIPINFO.
        * aclocal.m4: Include ../config/unwind_ipinfo.m4.
        * configure: Regenerate.
        * config.in: Regenerate.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/aclocal.m4
    trunk/gcc/config.in
    trunk/gcc/configure
    trunk/gcc/configure.ac

Comment 32 littlestar 2008-11-22 06:03:42 UTC
ping 4.3.3?
Comment 33 Rob 2009-01-03 19:53:50 UTC
With "gcc version 4.4.0 20090102" on i386-pc-solaris2.11 I'm getting:

# gcc -v -o test_gmp_1 test_gmp_1.cc -lgmp -lstdc++
/usr/local/lib/gcc/i386-pc-solaris2.11/4.4.0/../../../libstdc++.so: undefined reference to `_Unwind_GetIPInfo@GCC_4.2.0'
collect2: ld returned 1 exit status
Comment 34 Andrew Pinski 2009-01-03 19:55:31 UTC
(In reply to comment #33)
> With "gcc version 4.4.0 20090102" on i386-pc-solaris2.11 I'm getting:
> 
> # gcc -v -o test_gmp_1 test_gmp_1.cc -lgmp -lstdc++
> /usr/local/lib/gcc/i386-pc-solaris2.11/4.4.0/../../../libstdc++.so: undefined
> reference to `_Unwind_GetIPInfo@GCC_4.2.0'
> collect2: ld returned 1 exit status

sounds like correct version of libgcc is not being so that is not a bug with GCC but with your installation of GCC.
Comment 35 Rob 2009-01-06 07:32:28 UTC
(In reply to comment #33)
> With "gcc version 4.4.0 20090102" on i386-pc-solaris2.11 I'm getting:
> 
> # gcc -v -o test_gmp_1 test_gmp_1.cc -lgmp -lstdc++
> /usr/local/lib/gcc/i386-pc-solaris2.11/4.4.0/../../../libstdc++.so: undefined
> reference to `_Unwind_GetIPInfo@GCC_4.2.0'
> collect2: ld returned 1 exit status

Another thread suggested that "gcc" should not be used for ".cc" files as
gcc did not invoke the same mechanisms as g++ does. I tried g++ (instead 
of gcc) and it worked correctly on my ".cc" file.

Rob
Comment 36 Joseph S. Myers 2009-03-31 19:36:59 UTC
Closing 4.2 branch.
Comment 37 Richard Biener 2009-08-04 12:27:47 UTC
GCC 4.3.4 is being released, adjusting target milestone.
Comment 38 Richard Biener 2010-05-22 18:11:08 UTC
GCC 4.3.5 is being released, adjusting target milestone.
Comment 39 Richard Biener 2011-06-27 11:08:45 UTC
Fixed in GCC 4.4.0.