http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55779
Bug #: 55779 Summary: Debug program abort on pthread_exit() while using -static-libgcc and -static-libstdc++ Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: major Priority: P3 Component: libgcc AssignedTo: unassig...@gcc.gnu.org ReportedBy: ry...@synopsys.com Created attachment 29022 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29022 The *.i* files On SUSE 10 SP3, a debug build (-g) thread program abort on ptherad_exit() when statically link libgcc and libstdc++ (use option -static-libgcc -static-libstdc++). No issue with optimized build (-O). GCC version: 4.7.2 System: SUSE 10 SP3, Linux peemt210 2.6.16.60-0.83.2-smp #1 SMP Fri Sep 2 13:49:16 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux GCC build options/configuration: ryang@peemt210 RAII> /depot/qsc/QSCI/bin/g++ -v Using built-in specs. COLLECT_GCC=/depot/qsc/QSCI/bin/g++ COLLECT_LTO_WRAPPER=/depot/gcc-4.7.2/libexec/gcc/x86_64-suse-linux/4.7.2/lto-wrapper Target: x86_64-suse-linux Configured with: ../../src/gcc-4.7.2/configure --prefix=/depot/gcc-4.7.2 --enable-bootstrap --enable-threads=posix --enable-languages=c,c++,fortran --enable-checking=release --enable-ssp --disable-libssp --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --without-system-libunwind --with-cpu=generic --host=x86_64-suse-linux --build=x86_64-suse-linux Thread model: posix gcc version 4.7.2 (GCC) Command line to triggers the bug (mttest is the program name): mttest 2 2 Compiler outputs: /depot/qsc/QSCI/bin/g++ -I. -Wall -Wextra -m64 -c -DSynopsys_Debug -DSynopsys_suse64 -DSynopsys_linux -msse2 -mfpmath=sse -fno-omit-frame-pointer -fno-dollars-in-identifiers -save-temps -g -o main.o main.c /depot/qsc/QSCI/bin/g++ -I. -Wall -Wextra -m64 -c -DSynopsys_Debug -DSynopsys_suse64 -DSynopsys_linux -msse2 -mfpmath=sse -fno-omit-frame-pointer -fno-dollars-in-identifiers -save-temps -g -o threads_raii.o threads_raii.C /depot/qsc/QSCI/bin/g++ -I. -Wall -Wextra -m64 -c -DSynopsys_Debug -DSynopsys_suse64 -DSynopsys_linux -msse2 -mfpmath=sse -fno-omit-frame-pointer -fno-dollars-in-identifiers -save-temps -g -o raii.o raii.C /depot/qsc/QSCI/bin/g++ -static-libgcc -static-libstdc++ -o mttest main.o threads_raii.o raii.o -lpthread -lm -ldl