[Lldb-commits] [lldb] r269372 - Fix libstdc++ failure where <atomic> is not able to be imported on Darwin systems.

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Thu May 12 15:33:02 PDT 2016


Author: gclayton
Date: Thu May 12 17:33:02 2016
New Revision: 269372

URL: http://llvm.org/viewvc/llvm-project?rev=269372&view=rev
Log:
Fix libstdc++ failure where <atomic> is not able to be imported on Darwin systems.

The adding of <atomic> to test_common.h broke 12 tests on Darwin. We work around this by not including <atomic> when building on darwin for libstdc++ tests.


Modified:
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/Makefile
    lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
    lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h

Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/Makefile?rev=269372&r1=269371&r2=269372&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/Makefile (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/Makefile Thu May 12 17:33:02 2016
@@ -1,6 +1,7 @@
 LEVEL = ../../../make
 
 CXX_SOURCES := main.cpp
+USE_LIBSTDCPP := 1
 
 # clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD 
 # targets.  Other targets do not, which causes this test to fail.
@@ -12,8 +13,3 @@ endif
 include $(LEVEL)/Makefile.rules
 
 CXXFLAGS += -O0
-
-ifeq (,$(findstring gcc,$(CC)))
-CXXFLAGS += -stdlib=libstdc++
-LDFLAGS += -stdlib=libstdc++
-endif

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules?rev=269372&r1=269371&r2=269372&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/Makefile.rules Thu May 12 17:33:02 2016
@@ -306,7 +306,7 @@ endif
 ifeq (1,$(USE_LIBSTDCPP))
 	# Clang requires an extra flag: -stdlib=libstdc++
 	ifneq (,$(findstring clang,$(CC)))
-		CXXFLAGS += -stdlib=libstdc++
+		CXXFLAGS += -stdlib=libstdc++ -DLLDB_USING_LIBSTDCPP
 		LDFLAGS += -stdlib=libstdc++
 	endif
 endif

Modified: lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h?rev=269372&r1=269371&r2=269372&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/make/test_common.h Thu May 12 17:33:02 2016
@@ -43,6 +43,13 @@
 
 #endif
 
+#if defined(__APPLE__) && defined(LLDB_USING_LIBSTDCPP)              
+
+// on Darwin, libstdc++ is missing <atomic>, so this would cause any test to fail building
+// since this header file is being included in every C-family test case, we need to not include it
+// on Darwin, most tests use libc++ by default, so this will only affect tests that explicitly require libstdc++
+
+#else
 #ifdef __cplusplus
 #include <atomic>
 
@@ -65,3 +72,4 @@ typedef std::atomic<int> pseudo_barrier_
         (barrier) = (count);                \
     } while (0)
 #endif // __cplusplus
+#endif // defined(__APPLE__) && defined(LLDB_USING_LIBSTDCPP)




More information about the lldb-commits mailing list