Bug 900965 - compile failures with gcc 4.6.3 on std::atomic enum support from bug 888548 r=waldo
authorNathan Froyd <nfroyd@mozilla.com>
Fri, 02 Aug 2013 18:18:41 -0700
changeset 153560 ada4c3b6223326dce9bb7eca32ef0a93ebb32b81
parent 153559 353c951a48d6b44619b223c771e9bd998564ff82
child 153561 d2aab866cf347dd4f2abb770496b6bc58966c2c9
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswaldo
bugs900965, 888548
milestone25.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 900965 - compile failures with gcc 4.6.3 on std::atomic enum support from bug 888548 r=waldo
mfbt/Atomics.h
--- a/mfbt/Atomics.h
+++ b/mfbt/Atomics.h
@@ -38,22 +38,27 @@
     */
 #  if !defined(__linux__) && !defined(__OpenBSD__) && \
       (__cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)) && \
       __has_include(<atomic>)
 #    define MOZ_HAVE_CXX11_ATOMICS
 #  endif
 /*
  * Android uses a different C++ standard library that does not provide
- * support for <atomic>
+ * support for <atomic>.
+ *
+ * GCC 4.5.x and 4.6.x's unspecialized std::atomic template doesn't include
+ * inline definitions for the functions declared therein.  This oversight
+ * leads to linking errors when using atomic enums.  We therefore require
+ * GCC 4.7 or higher.
  */
 #elif defined(__GNUC__) && !defined(__ANDROID__)
 #  include "mozilla/Compiler.h"
 #  if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L) && \
-      MOZ_GCC_VERSION_AT_LEAST(4, 5, 2)
+      MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
 #    define MOZ_HAVE_CXX11_ATOMICS
 #  endif
 #elif defined(_MSC_VER) && _MSC_VER >= 1700
 #  define MOZ_HAVE_CXX11_ATOMICS
 #endif
 
 namespace mozilla {