https://sourceware.org/bugzilla/show_bug.cgi?id=21931
Bug ID: 21931 Summary: glibc 2.26 Exception handling problem on powerpc Product: binutils Version: 2.26 Status: UNCONFIRMED Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: marc.balem...@c-s.fr Target Milestone: --- Hello, I'm building a cross-compiler for powerpc and C++ exception result in SIGABRT. However, if the program is compiled with "-static" everything works fine. the program used to reproduce the problem is the following : ------- #include <unistd.h> #include <cstdlib> #include <cstdio> #include <stdexcept> class toto { public: toto () throw () : a (0) {}; ~toto () throw () {}; void do_toto (void) throw (std::runtime_error) { a = 10000; throw (std::runtime_error ("exception toto")); } private: int a; }; int main (int argc, char **argv) { toto mon; try { mon.do_toto (); } catch (std::runtime_error &except) { printf ("except: %s\n", except.what ()); } exit (0); } ------- It is compiled using the following command: > ppc-linux-g++ -Wall -g -O2 titi.cc -o titi_1.4.0_no_static ( or /opt/cldk-1.4.0/bin/ppc-linux-g++ -Wall -g -O2 -static titi.cc -o titi_1.4.0_static for the "working" version) GDB output is the following ------ > GNU gdb (GDB) 7.8.1 > Copyright (C) 2014 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. Type "show copying" > and "show warranty" for details. > This GDB was configured as "ppc-linux". > Type "show configuration" for configuration details. > For bug reporting instructions, please see: > <http://www.gnu.org/software/gdb/bugs/>. > Find the GDB manual and other documentation resources online at: > <http://www.gnu.org/software/gdb/documentation/>. > For help, type "help". > Type "apropos word" to search for commands related to "word"... > Reading symbols from ./titi_1.4.0_no_static...done. > (gdb) run > Starting program: /root/titi_1.4.0_no_static > warning: Could not load shared library symbols for linux-vdso32.so.1. > Do you need "set solib-search-path" or "set sysroot"? > > Program received signal SIGABRT, Aborted. > 0x0fb6193c in raise () from /lib/libc.so.6 > (gdb) bt > #0 0x0fb6193c in raise () from /lib/libc.so.6 > #1 0x0fb6324c in abort () from /lib/libc.so.6 > #2 0x0fce3c44 in uw_init_context_1 () from /lib/nof/libgcc_s.so.1 > #3 0x0fce43e8 in _Unwind_RaiseException () from /lib/nof/libgcc_s.so.1 > #4 0x0fec2f90 in __cxa_throw () from /lib/nof/libstdc++.so.6 > #5 0x10000aac in toto::do_toto (this=this@entry=0xbfb3bf18) at titi.cc:16 > #6 0x10000758 in main (argc=<optimized out>, argv=<optimized out>) at > titi.cc:28 ------- After checking that no library was missing on the target, exploring compilation logs, i managed to find that compiling with : > ppc-linux-g++ -Wall -g -O2 titi.cc -o titi_1.4.0_no_static -Wl,lc end with working exceptions. The cross compiler was built with binutils 2.26 (binutils 2.27 and binutils 2.28 have also been tried). cross compiler GCC is : > ppc-linux-gcc -v > Using built-in specs. > COLLECT_GCC=ppc-linux-gcc > COLLECT_LTO_WRAPPER=/opt/cldk-1.4.0/libexec/gcc/ppc-linux/5.4.0/lto-wrapper > Target: ppc-linux > Configured with: /root/cldk/gcc-5.4.0/configure --target=ppc-linux > --with-headers=yes --with-cpu=860 --prefix=/opt/cldk-1.4.0 > --bindir=/opt/cldk-1.4.0/bin --sbindir=/opt/cldk-1.4.0/sbin > --libexecdir=/opt/cldk-1.4.0/libexec --datadir=/opt/cldk-1.4.0/share > --sysconfdir=/opt/cldk-1.4.0/etc --libdir=/opt/cldk-1.4.0/lib > --includedir=/opt/cldk-1.4.0/usr/include > --oldincludedir=/opt/cldk-1.4.0/usr/include > --infodir=/opt/cldk-1.4.0/share/info --mandir=/opt/cldk-1.4.0/share/man > --with-glibc-version=2.18 --enable-languages=c,c++ > Thread model: posix > gcc version 5.4.0 (GCC) with glibc 2.23. binutils itself was built using : > gcc -v > Using built-in specs. > Target: x86_64-redhat-linux > Configured with: ../configure --prefix=/usr --mandir=/usr/share/man > --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla > --enable-bootstrap --enable-shared --enable-threads=posix > --enable-checking=release --with-system-zlib --enable-__cxa_atexit > --disable-libunwind-exceptions --enable-gnu-unique-object > --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk > --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre > --enable-libgcj-multifile --enable-java-maintainer-mode > --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib > --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 > --build=x86_64-redhat-linux > Thread model: posix > gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) Cheers, Marc -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils