diff options
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/make')
4 files changed, 34 insertions, 47 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/make/Android.rules b/lldb/packages/Python/lldbsuite/test/make/Android.rules index 2ab3b9fde89..634f8660c72 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Android.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Android.rules @@ -72,7 +72,7 @@ ifeq (1,$(USE_LIBCPP)) ARCH_LDFLAGS += \ -L$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH) \ - -l$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH)/libc++.a + $(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH)/libc++.a else ARCH_CFLAGS += \ -isystem $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/include \ diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index 30f3e9c39b0..a7b94ef5738 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -202,7 +202,7 @@ else CFLAGS += $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(CFLAGS_EXTRAS) -I$(LLDB_BASE_DIR)include endif -CFLAGS += -include $(THIS_FILE_DIR)test_common.h $(ARCH_CFLAGS) +CFLAGS += -include $(THIS_FILE_DIR)test_common.h -I$(THIS_FILE_DIR) $(ARCH_CFLAGS) # Use this one if you want to build one part of the result without debug information: ifeq "$(OS)" "Darwin" @@ -324,23 +324,21 @@ ifeq (1,$(USE_LIBSTDCPP)) endif ifeq (1,$(USE_LIBCPP)) - # Clang requires an extra flag: -stdlib=libstdc++ - ifneq (,$(findstring clang,$(CC))) - CXXFLAGS += -DLLDB_USING_LIBCPP - ifeq "$(OS)" "Linux" - # This is the default install location on Ubuntu 14.04 - ifneq ($(wildcard /usr/include/c++/v1/.),) - CXXFLAGS += -stdlib=libc++ - LDFLAGS += -stdlib=libc++ - CXXFLAGS += -I/usr/include/c++/v1 - endif - else ifeq "$(OS)" "Android" - # Nothing to do, this is already handled in - # Android.rules. - else + CXXFLAGS += -DLLDB_USING_LIBCPP + ifeq "$(OS)" "Linux" + ifneq (,$(findstring clang,$(CC))) CXXFLAGS += -stdlib=libc++ LDFLAGS += -stdlib=libc++ + else + CXXFLAGS += -isystem /usr/include/c++/v1 + LDFLAGS += -lc++ endif + else ifeq "$(OS)" "Android" + # Nothing to do, this is already handled in + # Android.rules. + else + CXXFLAGS += -stdlib=libc++ + LDFLAGS += -stdlib=libc++ endif endif diff --git a/lldb/packages/Python/lldbsuite/test/make/pseudo_barrier.h b/lldb/packages/Python/lldbsuite/test/make/pseudo_barrier.h new file mode 100644 index 00000000000..592000ddea4 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/make/pseudo_barrier.h @@ -0,0 +1,20 @@ +#include <atomic> + +// Note that although hogging the CPU while waiting for a variable to change +// would be terrible in production code, it's great for testing since it +// avoids a lot of messy context switching to get multiple threads synchronized. + +typedef std::atomic<int> pseudo_barrier_t; +#define pseudo_barrier_wait(barrier) \ + do \ + { \ + --(barrier); \ + while ((barrier).load() > 0) \ + ; \ + } while (0) + +#define pseudo_barrier_init(barrier, count) \ + do \ + { \ + (barrier) = (count); \ + } while (0) diff --git a/lldb/packages/Python/lldbsuite/test/make/test_common.h b/lldb/packages/Python/lldbsuite/test/make/test_common.h index 3ffece26d04..529d0952ed3 100644 --- a/lldb/packages/Python/lldbsuite/test/make/test_common.h +++ b/lldb/packages/Python/lldbsuite/test/make/test_common.h @@ -45,34 +45,3 @@ #define lldb_enable_attach() #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> - -// Note that although hogging the CPU while waiting for a variable to change -// would be terrible in production code, it's great for testing since it -// avoids a lot of messy context switching to get multiple threads synchronized. - -typedef std::atomic<int> pseudo_barrier_t; -#define pseudo_barrier_wait(barrier) \ - do \ - { \ - --(barrier); \ - while ((barrier).load() > 0) \ - ; \ - } while (0) - -#define pseudo_barrier_init(barrier, count) \ - do \ - { \ - (barrier) = (count); \ - } while (0) -#endif // __cplusplus -#endif // defined(__APPLE__) && defined(LLDB_USING_LIBSTDCPP) |