From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22370 invoked by alias); 15 Nov 2011 12:35:30 -0000 Received: (qmail 22248 invoked by uid 22791); 15 Nov 2011 12:35:30 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_CX,TW_DC,TW_JL X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Nov 2011 12:35:06 +0000 From: "cestrauss at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/51140] New: libstdc++-v3/libsupc++/eh_tm.cc:48: undefined reference to `___sync_sub_and_fetch_4' Date: Tue, 15 Nov 2011 12:40:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cestrauss at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-11/txt/msg01516.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51140 Bug #: 51140 Summary: libstdc++-v3/libsupc++/eh_tm.cc:48: undefined reference to `___sync_sub_and_fetch_4' Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: cestrauss@gmail.com Host: i386-pc-mingw32 Target: i386-pc-mingw32 Build: i386-pc-mingw32 Building 4.7.0 (trunk) on i368-pc-mingw32 fails with: Creating library file: .libs/libstdc++.dll.a../libsupc++/.libs/libsupc++convenience.a(eh_tm.o): In function `free_any_cxa_exception': c:\projetos\gcc\bld\svn\bld\mingw32\libstdc++-v3\libsupc++/../../../../../../gcc-svn/libstdc++-v3/libsupc++/eh_tm.cc:48: undefined reference to `___sync_sub_and_fetch_4' collect2.exe: error: ld returned 1 exit status make[5]: *** [libstdc++.la] Error 1 make[5]: Leaving directory `/projetos/gcc/bld/svn/bld/mingw32/libstdc++-v3/src' make[4]: *** [all-recursive] Error 1 make[4]: Leaving directory `/projetos/gcc/bld/svn/bld/mingw32/libstdc++-v3' make[3]: *** [all] Error 2 make[3]: Leaving directory `/projetos/gcc/bld/svn/bld/mingw32/libstdc++-v3' make[2]: *** [all-stage1-target-libstdc++-v3] Error 2 make[2]: Leaving directory `/projetos/gcc/bld/svn/bld' make[1]: *** [stage1-bubble] Error 2 make[1]: Leaving directory `/projetos/gcc/bld/svn/bld' make: *** [all] Error 2 The line in question is: if (__sync_sub_and_fetch (&h->referenceCount, 1) == 0) There is another use of __sync_sub_and_fetch in libstdc++-v3/libsupc++/eh_tm.cc, and there it is guarded by a #ifdef _GLIBCXX_ATOMIC_BUILTINS_4, which is undefined in my case. I guess this guard is missing from eh_tm.cc. $ gcc -v Using built-in specs. COLLECT_GCC=\mingw\bin\gcc.exe COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.5.2/lto-wrapper.exe Target: mingw32 Configured with: ../gcc-4.5.2/configure --enable-languages=c,c++,ada,fortran,obj c,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgo mp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-r untime-libs --disable-werror --build=mingw32 --prefix=/mingw Thread model: win32 gcc version 4.5.2 (GCC)