public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/51140] New: libstdc++-v3/libsupc++/eh_tm.cc:48: undefined reference to `___sync_sub_and_fetch_4'
@ 2011-11-15 12:40 cestrauss at gmail dot com
  2011-11-15 12:45 ` [Bug libstdc++/51140] " cestrauss at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: cestrauss at gmail dot com @ 2011-11-15 12:40 UTC (permalink / raw)
  To: gcc-bugs

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)


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

* [Bug libstdc++/51140] libstdc++-v3/libsupc++/eh_tm.cc:48: undefined reference to `___sync_sub_and_fetch_4'
  2011-11-15 12:40 [Bug libstdc++/51140] New: libstdc++-v3/libsupc++/eh_tm.cc:48: undefined reference to `___sync_sub_and_fetch_4' cestrauss at gmail dot com
@ 2011-11-15 12:45 ` cestrauss at gmail dot com
  2011-11-15 13:53 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: cestrauss at gmail dot com @ 2011-11-15 12:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Cesar Strauss <cestrauss at gmail dot com> 2011-11-15 12:39:50 UTC ---
(In reply to comment #0)
> There is another use of __sync_sub_and_fetch in
> libstdc++-v3/libsupc++/eh_tm.cc,

I meant libstdc++-v3/libsupc++/eh_throw.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.


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

* [Bug libstdc++/51140] libstdc++-v3/libsupc++/eh_tm.cc:48: undefined reference to `___sync_sub_and_fetch_4'
  2011-11-15 12:40 [Bug libstdc++/51140] New: libstdc++-v3/libsupc++/eh_tm.cc:48: undefined reference to `___sync_sub_and_fetch_4' cestrauss at gmail dot com
  2011-11-15 12:45 ` [Bug libstdc++/51140] " cestrauss at gmail dot com
@ 2011-11-15 13:53 ` redi at gcc dot gnu.org
  2011-11-18  0:24 ` paolo.carlini at oracle dot com
  2011-11-22 21:50 ` cestrauss at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2011-11-15 13:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-11-15 13:12:20 UTC ---
That guard should be added to eh_tm.cc but ...

don't build for i386-* because that targets the 80386 processor, which doesn't
have the required atomic operations, and I *really doubt you're running on an
80386 so there's no reason to unnecessary cripple your code.

you should configure for i486-pc-mingw32 or better, whatever is the lowest spec
you want to be able to run the generated code on


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

* [Bug libstdc++/51140] libstdc++-v3/libsupc++/eh_tm.cc:48: undefined reference to `___sync_sub_and_fetch_4'
  2011-11-15 12:40 [Bug libstdc++/51140] New: libstdc++-v3/libsupc++/eh_tm.cc:48: undefined reference to `___sync_sub_and_fetch_4' cestrauss at gmail dot com
  2011-11-15 12:45 ` [Bug libstdc++/51140] " cestrauss at gmail dot com
  2011-11-15 13:53 ` redi at gcc dot gnu.org
@ 2011-11-18  0:24 ` paolo.carlini at oracle dot com
  2011-11-22 21:50 ` cestrauss at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-11-18  0:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-11-18 00:06:59 UTC ---
I suppose this is a duplicate of PR51181


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

* [Bug libstdc++/51140] libstdc++-v3/libsupc++/eh_tm.cc:48: undefined reference to `___sync_sub_and_fetch_4'
  2011-11-15 12:40 [Bug libstdc++/51140] New: libstdc++-v3/libsupc++/eh_tm.cc:48: undefined reference to `___sync_sub_and_fetch_4' cestrauss at gmail dot com
                   ` (2 preceding siblings ...)
  2011-11-18  0:24 ` paolo.carlini at oracle dot com
@ 2011-11-22 21:50 ` cestrauss at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: cestrauss at gmail dot com @ 2011-11-22 21:50 UTC (permalink / raw)
  To: gcc-bugs

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

Cesar Strauss <cestrauss at gmail dot com> changed:

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

--- Comment #4 from Cesar Strauss <cestrauss at gmail dot com> 2011-11-22 21:32:33 UTC ---
(In reply to comment #3)
> I suppose this is a duplicate of PR51181

Indeed. The fix for PR51181 also fixed the build failure I reported here.

Thanks,
Cesar

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


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

end of thread, other threads:[~2011-11-22 21:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-15 12:40 [Bug libstdc++/51140] New: libstdc++-v3/libsupc++/eh_tm.cc:48: undefined reference to `___sync_sub_and_fetch_4' cestrauss at gmail dot com
2011-11-15 12:45 ` [Bug libstdc++/51140] " cestrauss at gmail dot com
2011-11-15 13:53 ` redi at gcc dot gnu.org
2011-11-18  0:24 ` paolo.carlini at oracle dot com
2011-11-22 21:50 ` cestrauss at gmail dot com

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