http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42734
--- Comment #34 from Jacob McIntosh <nacitar at gmail dot com> 2010-10-15 19:46:56 UTC --- (In reply to comment #32) > I'm not sure -march=i386 explains the original report, since the OP said his > compiler command was: > > $ g++ -std=c++0x -pthread thread.cc -o thread > > Does the front-end disable the HAVE_SYNC_COMPARE_AND_SWAP macros if you > compile > with (implicit or explicit) march=i386 ? > If not, the library will think it can use builtins which aren't available. I > seem to recall known issues arising from mismatches in -march options used > when > building and using the library. Maybe by default, his gcc installation/configuration builds i386 (or some other arch that has the same problem even), and it didn't seem relevant to mention. I'm unsure how gcc determines its default, but that seems a likely scenario to me. And I can reproduce it by explicitly specifying i386, so I'm inclined to think this is the case.