Work around the fact that GNU libstdc++'s debug mode uses RTTI.
[oota-llvm.git] / Makefile.rules
index bcaed80f2db744c5338100bc3221e424a7581587..23ffe3ea9609f9fdb9112bf20b9576290eb08a77 100644 (file)
@@ -375,6 +375,12 @@ ifeq ($(OS),MingW)
   endif
 endif
 
+ifdef ENABLE_EXPENSIVE_CHECKS
+  # GNU libstdc++ uses RTTI if you define _GLIBCXX_DEBUG, which we did above.
+  # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40160
+  CXX.Flags := $(filter-out -fno-rtti,$(CXX.Flags))
+endif
+
 #--------------------------------------------------------------------
 # Directory locations
 #--------------------------------------------------------------------
@@ -515,7 +521,10 @@ endif
 # Options To Invoke Tools
 #----------------------------------------------------------
 
-CompileCommonOpts += -pedantic -Wall -W -Wwrite-strings -Wno-long-long \
+ifndef NO_PEDANTIC
+CompileCommonOpts += -pedantic
+endif
+CompileCommonOpts += -Wall -W -Wwrite-strings -Wno-long-long \
                      -Wunused -Wno-unused-parameter $(EXTRA_OPTIONS)
 
 ifeq ($(OS),HP-UX)