Bug 1269171 - Backout ccff1c4580ab (bug 1270832) because it doesn't actually work properly and blocks upcoming changes. draft
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 19 May 2016 14:41:14 +0900
changeset 368629 35699418ee18ed373586b34c3356d74605de9723
parent 367997 f3f2fa1d7eed5a8262f6401ef18ff8117a3ce43e
child 368630 a93b52463be4e596fe8eca12a7a54ec36d38058e
child 368973 a1b053a1f7ad41bb177bf1fbf052cec6afb15170
push id18617
push userbmo:mh+mozilla@glandium.org
push dateThu, 19 May 2016 08:27:44 +0000
bugs1269171, 1270832
milestone49.0a1
Bug 1269171 - Backout ccff1c4580ab (bug 1270832) because it doesn't actually work properly and blocks upcoming changes. It turns out that, since we're including <new> before setting _GLIBCXX_DEBUG, the debug parts of c++config.h are not activated, and that has an impact of how much of the debug features of the STL are activated. In contrast, the upcoming changes to the STL wrappers are avoiding the include of <new> before _GLIBCXX_DEBUG is set, which in turn breaks the build because, as we link things that use STL wrappers with things that don't, they end up with a different state of STL debugging, and have mismatching symbols.
config/gcc-stl-wrapper.template.h
--- a/config/gcc-stl-wrapper.template.h
+++ b/config/gcc-stl-wrapper.template.h
@@ -38,22 +38,24 @@
 #  if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)
 #    include "mozilla/mozalloc.h"
 #  else
 #    error "STL code can only be used with infallible ::operator new()"
 #  endif
 
 #endif
 
-// Don't enable debug mode with the clang plugin; clang doesn't recognize
-// the debug/ versions of the stdlib headers as being system headers, leading
-// to complaints about code that's out of our control.
-#if defined(DEBUG) && !defined(_GLIBCXX_DEBUG) && !defined(MOZ_CLANG_PLUGIN)
+#if defined(DEBUG) && !defined(_GLIBCXX_DEBUG)
 // Enable checked iterators and other goodies
-  # define _GLIBCXX_DEBUG 1
+//
+// FIXME/bug 551254: gcc's debug STL implementation requires -frtti.
+// Figure out how to resolve this with -fno-rtti.  Maybe build with
+// -frtti in DEBUG builds?
+//
+//  # define _GLIBCXX_DEBUG 1
 #endif
 
 #pragma GCC visibility push(default)
 #include_next <${HEADER}>
 #pragma GCC visibility pop
 
 // gcc calls a __throw_*() function from bits/functexcept.h when it
 // wants to "throw an exception".  functexcept exists nominally to