public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcc/60475] New: undefined reference to `__gxx_personality_seh0'
@ 2014-03-09 18:05 zosrothko at orange dot fr
  2014-03-09 18:26 ` [Bug libgcc/60475] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: zosrothko at orange dot fr @ 2014-03-09 18:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60475
           Summary: undefined reference to `__gxx_personality_seh0'
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zosrothko at orange dot fr

Hi

On a cygwin platform with win7 X86-64 arch as underlying OS -- see later the
specs --, the compiling, linking and assembling of the following program 
$ cat foo.c
#include <stdio.h>

int main(void) {
        char buf[10];
        snprintf(buf, 10, "%i", 0);
        printf("buf=%s\n", buf);
        return 0;
}

fails with this error message

$ gcc -xc++ -std=gnu++11  -o foo foo.c

/tmp/ccTD9tUf.o:foo.c:(.xdata+0xc): undefined reference to
`__gxx_personality_seh0'
/tmp/ccTD9tUf.o:foo.c:(.xdata+0xc): relocation truncated to fit: rva32 against
undefined symbol `__gxx_personality_seh0'
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../../x86_64-pc-cygwin/bin/ld:
/tmp/ccTD9tUf.o: bad reloc address 0x0 in section `.pdata'
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../../x86_64-pc-cygwin/bin/ld: final
link failed: Invalid operation
collect2: error: ld returned 1 exit status

Rgds


CYGWIN_NT-6.1 idefix 1.7.28(0.271/5/3) 2014-02-09 21:06 x86_64 Cygwin

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/lto-wrapper.exe
Target: x86_64-pc-cygwin
Configured with:
/cygdrive/i/szsz/tmpp/cygwin64/gcc/gcc-4.8.2-3/src/gcc-4.8.2/configure
--srcdir=/cygdrive/i/szsz/tmpp/cygwin64/gcc/gcc-4.8.2-3/src/gcc-4.8.2
--prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
--libexecdir=/usr/libexec --datadir=/usr/share --localstatedir=/var
--sysconfdir=/etc --libdir=/usr/lib --datarootdir=/usr/share
--docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C
--build=x86_64-pc-cygwin --host=x86_64-pc-cygwin --target=x86_64-pc-cygwin
--without-libiconv-prefix --without-libintl-prefix --enable-shared
--enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs
--enable-bootstrap --disable-__cxa_atexit --with-dwarf2 --with-tune=generic
--enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-graphite
--enable-threads=posix --enable-libatomic --enable-libgomp --disable-libitm
--enable-libquadmath --enable-libquadmath-support --enable-libssp
--enable-libada --enable-libgcj-sublibs --disable-java-awt --disable-symvers
--with-ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld --with-gnu-as
--with-cloog-include=/usr/include/cloog-isl --without-libiconv-prefix
--without-libintl-prefix --with-system-zlib --libexecdir=/usr/lib
Thread model: posix
gcc version 4.8.2 (GCC)


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

* [Bug libgcc/60475] undefined reference to `__gxx_personality_seh0'
  2014-03-09 18:05 [Bug libgcc/60475] New: undefined reference to `__gxx_personality_seh0' zosrothko at orange dot fr
@ 2014-03-09 18:26 ` redi at gcc dot gnu.org
  2014-03-09 19:00 ` pinskia at gcc dot gnu.org
  2014-03-09 22:59 ` zosrothko at orange dot fr
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2014-03-09 18:26 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to zosrothko from comment #0) 
> $ gcc -xc++ -std=gnu++11  -o foo foo.c

To link a C++ program you should explicitly link to the C++ runtime library,
using -lstdc++, or use g++ which does that automatically.

(If your source file is C++ why is your file called foo.c instead of having a
C++ file extension?)


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

* [Bug libgcc/60475] undefined reference to `__gxx_personality_seh0'
  2014-03-09 18:05 [Bug libgcc/60475] New: undefined reference to `__gxx_personality_seh0' zosrothko at orange dot fr
  2014-03-09 18:26 ` [Bug libgcc/60475] " redi at gcc dot gnu.org
@ 2014-03-09 19:00 ` pinskia at gcc dot gnu.org
  2014-03-09 22:59 ` zosrothko at orange dot fr
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-03-09 19:00 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |DUPLICATE

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Actually this is a dup of bug 60221 which is now fixed for 4.8.3 and above.

*** This bug has been marked as a duplicate of bug 60221 ***


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

* [Bug libgcc/60475] undefined reference to `__gxx_personality_seh0'
  2014-03-09 18:05 [Bug libgcc/60475] New: undefined reference to `__gxx_personality_seh0' zosrothko at orange dot fr
  2014-03-09 18:26 ` [Bug libgcc/60475] " redi at gcc dot gnu.org
  2014-03-09 19:00 ` pinskia at gcc dot gnu.org
@ 2014-03-09 22:59 ` zosrothko at orange dot fr
  2 siblings, 0 replies; 4+ messages in thread
From: zosrothko at orange dot fr @ 2014-03-09 22:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from zosrothko at orange dot fr ---
(In reply to Jonathan Wakely from comment #1)
> (In reply to zosrothko from comment #0) 
> > $ gcc -xc++ -std=gnu++11  -o foo foo.c
> 
> To link a C++ program you should explicitly link to the C++ runtime library,
> using -lstdc++, or use g++ which does that automatically.
> 
> (If your source file is C++ why is your file called foo.c instead of having
> a C++ file extension?)

because the story starts with a C program. Here the point: there is a problem
with the declaration of snprintf with the std=c++11 in c++. Thus I started to
test first with gcc and the std(c90, c89), then I forget to switch to g++ for
testing the std(c++11,gnu++1). Thus as the gcc -xc++ -std=gnu++11 -c foo.c was
compiling without error, I just wanted to execute it. My mistake.... Sorry for
the noise...By the way, the error on snprintf not declared is invalid.

$ gcc -xc -std=c90 -c foo.c
$ gcc -xc -std=c89 -c foo.c
$
$ gcc -xc++ -std=c++11  -c foo.c
foo.c: In function 'int main()':
foo.c:5:27: error: 'snprintf' was not declared in this scope
  snprintf(buf, 10, "%i", 0);

$
$ gcc -xc++ -std=gnu++11  -c foo.c
$


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

end of thread, other threads:[~2014-03-09 22:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-09 18:05 [Bug libgcc/60475] New: undefined reference to `__gxx_personality_seh0' zosrothko at orange dot fr
2014-03-09 18:26 ` [Bug libgcc/60475] " redi at gcc dot gnu.org
2014-03-09 19:00 ` pinskia at gcc dot gnu.org
2014-03-09 22:59 ` zosrothko at orange dot fr

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).