https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62231
Bug ID: 62231 Summary: Exception handling broken on powerpc-e500v2-linux-gnuspe Product: gcc Version: 4.8.3 Status: UNCONFIRMED Severity: critical Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: manfred.rudigier at omicron dot at Problem: -------- The GCC exception handling mechanism for powerpc-e500v2-linux-gnuspe seems to be broken. Every programs abort as soon as the first exception is thrown. I can confirm that the exception handling works on at least 4.6.3 and 4.7.4, however on 4.8.3 it does not. Example program to reproduce the problem: ----------------------------------------- #include <exception> #include <stdio.h> void doThrow() { printf("Throwing now\n"); throw std::exception(); } int main(int argc, char **argv) { try { doThrow(); } catch (std::exception& e) { printf("Caught exception\n"); } return 0; } GDB output: ----------- Program received signal SIGABRT, Aborted. 0x0fc0c858 in raise () from /lib/libc.so.6 (gdb) bt #0 0x0fc0c858 in raise () from /lib/libc.so.6 #1 0x0fc117c4 in abort () from /lib/libc.so.6 #2 0x0fd78250 in ?? () from /lib/libgcc_s.so.1 #3 0x0fd78960 in _Unwind_RaiseException () from /lib/libgcc_s.so.1 #4 0x0ff33e0c in __cxa_throw () from /lib/libstdc++.so.6 #5 0x100007dc in doThrow() () #6 0x10000800 in main () (gdb) GCC version: ------------ The compiler has been compiled with crosstool-ng: ./powerpc-e500v2-linux-gnuspe-gcc -v Using built-in specs. COLLECT_GCC=./powerpc-e500v2-linux-gnuspe-gcc COLLECT_LTO_WRAPPER=/opt/x-tools/tron/4.8.3/powerpc-e500v2-linux-gnuspe/bin/../libexec/gcc/powerpc-e500v2-linux-gnuspe/4.8.3/lto-wrapper Target: powerpc-e500v2-linux-gnuspe Configured with: /home/manrud00/crosstool-ng/.build/src/gcc-4.8.3/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=powerpc-e500v2-linux-gnuspe --prefix=/home/manrud00/x-tools/powerpc-e500v2-linux-gnuspe --with-sysroot=/home/manrud00/x-tools/powerpc-e500v2-linux-gnuspe/powerpc-e500v2-linux-gnuspe/sysroot --enable-languages=c,c++ --with-cpu=8548 --with-tune=8548 --with-pkgversion='crosstool-NG hg+default-99029fac116b' --disable-sjlj-exceptions --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath --disable-libquadmath-support --with-gmp=/home/manrud00/crosstool-ng/.build/powerpc-e500v2-linux-gnuspe/buildtools --with-mpfr=/home/manrud00/crosstool-ng/.build/powerpc-e500v2-linux-gnuspe/buildtools --with-mpc=/home/manrud00/crosstool-ng/.build/powerpc-e500v2-linux-gnuspe/buildtools --with-isl=/home/manrud00/crosstool-ng/.build/powerpc-e500v2-linux-gnuspe/buildtools --with-cloog=/home/manrud00/crosstool-ng/.build/powerpc-e500v2-linux-gnuspe/buildtools --with-libelf=/home/manrud00/crosstool-ng/.build/powerpc-e500v2-linux-gnuspe/buildtools --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --enable-threads=posix --disable-nls --disable-multilib --with-local-prefix=/home/manrud00/x-tools/powerpc-e500v2-linux-gnuspe/powerpc-e500v2-linux-gnuspe/sysroot --enable-c99 --enable-long-long --enable-e500_double --with-long-double-128 Thread model: posix gcc version 4.8.3