Bug 1073709 - Disable C++11 <atomic> when using GCC with libc++. r=waldo
authorJan Beich <jbeich@vfemail.net>
Fri, 26 Sep 2014 15:15:00 +0200
changeset 231071 7a96fbcf0c020568ab44b72e4f272bfb1ef38d10
parent 231070 0a90ee0dad24384de0ff8522975c5267819aa81d
child 231072 afcd7e31bb0bacbf5e2f4a720918b88d9a6ebf43
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswaldo
bugs1073709
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1073709 - Disable C++11 <atomic> when using GCC with libc++. r=waldo
mfbt/Atomics.h
--- a/mfbt/Atomics.h
+++ b/mfbt/Atomics.h
@@ -29,20 +29,22 @@
  * along with C++0x support.
  */
 #if defined(__clang__) || defined(__GNUC__)
    /*
     * Clang doesn't like <atomic> from libstdc++ before 4.7 due to the
     * loose typing of the atomic builtins. GCC 4.5 and 4.6 lacks inline
     * definitions for unspecialized std::atomic and causes linking errors.
     * Therefore, we require at least 4.7.0 for using libstdc++.
+    *
+    * libc++ <atomic> is only functional with clang.
     */
 #  if MOZ_USING_LIBSTDCXX && MOZ_LIBSTDCXX_VERSION_AT_LEAST(4, 7, 0)
 #    define MOZ_HAVE_CXX11_ATOMICS
-#  elif MOZ_USING_LIBCXX
+#  elif MOZ_USING_LIBCXX && defined(__clang__)
 #    define MOZ_HAVE_CXX11_ATOMICS
 #  endif
 /*
  * Although Visual Studio 2012's CRT supports <atomic>, its atomic load
  * implementation unnecessarily uses an atomic intrinsic for the less
  * restrictive memory orderings, which can be prohibitively expensive.
  * Therefore, we require at least Visual Studio 2013 for using the CRT
  * (bug 1061764).