public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/29722]  New: Linking with libsupc++.a creates link time undefined references
@ 2006-11-05  8:32 raj dot khem at gmail dot com
  2006-11-05 10:17 ` [Bug libstdc++/29722] " pcarlini at suse dot de
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: raj dot khem at gmail dot com @ 2006-11-05  8:32 UTC (permalink / raw)
  To: gcc-bugs

Compiling a small C++ test program with GCC and linking with libsupc++ is
causing the link to fail.


try.C

===================

#include <stdio.h>
int main(){
printf("Hello");
 return 0;
}

==================

arm_v5t_le-gcc try.C -lsupc++


/mnt/disk2/opt/HEAD/arm_v5t_le/opt/montavista/foundation/devkit/arm/v5t_le/target/usr/lib/libsupc++.a(eh_alloc.o):
In function `__cxa_free_exception':
eh_alloc.cc:(.text.__cxa_free_exception+0xc8): undefined reference to
`std::__throw_runtime_error(char const*)'
eh_alloc.cc:(.text.__cxa_free_exception+0xd4): undefined reference to
`std::__throw_runtime_error(char const*)'
/mnt/disk2/opt/HEAD/arm_v5t_le/opt/montavista/foundation/devkit/arm/v5t_le/target/usr/lib/libsupc++.a(eh_alloc.o):
In function `__cxa_allocate_exception':
eh_alloc.cc:(.text.__cxa_allocate_exception+0xe4): undefined reference to
`std::__throw_runtime_error(char const*)'
eh_alloc.cc:(.text.__cxa_allocate_exception+0x10c): undefined reference to
`std::__throw_runtime_error(char const*)'
eh_alloc.cc:(.text.__cxa_allocate_exception+0x174): undefined reference to
`std::__throw_runtime_error(char const*)'
collect2: ld returned 1 exit status



This testcase works ok with GCC 4.1 series. and fails with GCC 4.2

I have verified the behavior on arm and x86 cross compiler.


The issue seems to be because libsupc++/guard.cc is including 

#include <ext/concurrence.h>

and in this include it has references to above mentioned symbol which is in
libstdc++ actually. I verified that by adding -lstdc++ to above gcc invoke
statement


This scenario happens when compiling icewm package.


-- 
           Summary: Linking with libsupc++.a creates link time undefined
                    references
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: raj dot khem at gmail dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: armv5tl-montavista-linux-gnueabi


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29722


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-01-25 15:31 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-05  8:32 [Bug libstdc++/29722] New: Linking with libsupc++.a creates link time undefined references raj dot khem at gmail dot com
2006-11-05 10:17 ` [Bug libstdc++/29722] " pcarlini at suse dot de
2006-11-06 11:10 ` bkoz at gcc dot gnu dot org
2006-11-06 11:11 ` bkoz at gcc dot gnu dot org
2006-11-07 18:37 ` bkoz at gcc dot gnu dot org
2006-11-08 11:58 ` bkoz at gcc dot gnu dot org
2006-11-08 11:58 ` bkoz at gcc dot gnu dot org
2006-11-08 11:59 ` bkoz at gcc dot gnu dot org
2006-12-01  0:38 ` chaoyingfu at gcc dot gnu dot org
2007-01-21 16:39 ` pcarlini at suse dot de
2007-01-24 13:59 ` bkoz at gcc dot gnu dot org
2007-01-24 14:40 ` bkoz at gcc dot gnu dot org
2007-01-24 15:04 ` bkoz at gcc dot gnu dot org
2007-01-25 15:31 ` bkoz at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).