diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index d0045ac9f91a7..3972fa5da7faf 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -368,7 +368,7 @@ ifeq (,$(filter 1, $(USE_LIBSTDCPP) $(USE_LIBCPP) $(USE_SYSTEM_STDLIB))) ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" "" CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR) endif - LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ + LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ -lc++abi else USE_SYSTEM_STDLIB := 1 endif @@ -389,7 +389,7 @@ ifeq (1,$(USE_LIBCPP)) ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" "" CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR) endif - LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ + LDFLAGS += -nostdlib++ -nostdinc -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ -lc++abi else ifeq "$(OS)" "Android" # Nothing to do, this is already handled in diff --git a/lldb/test/API/commands/expression/import-std-module/array/Makefile b/lldb/test/API/commands/expression/import-std-module/array/Makefile index f938f7428468a..6f0d77235b59d 100644 --- a/lldb/test/API/commands/expression/import-std-module/array/Makefile +++ b/lldb/test/API/commands/expression/import-std-module/array/Makefile @@ -1,3 +1,8 @@ USE_LIBCPP := 1 CXX_SOURCES := main.cpp + +ifneq ($(OS),Darwin) + LDFLAGS := -Xlinker --push-state -Xlinker --whole-archive -lc++ -lc++abi -Xlinker --pop-state +endif + include Makefile.rules diff --git a/lldb/test/API/commands/expression/import-std-module/deque-dbg-info-content/Makefile b/lldb/test/API/commands/expression/import-std-module/deque-dbg-info-content/Makefile index f938f7428468a..6f0d77235b59d 100644 --- a/lldb/test/API/commands/expression/import-std-module/deque-dbg-info-content/Makefile +++ b/lldb/test/API/commands/expression/import-std-module/deque-dbg-info-content/Makefile @@ -1,3 +1,8 @@ USE_LIBCPP := 1 CXX_SOURCES := main.cpp + +ifneq ($(OS),Darwin) + LDFLAGS := -Xlinker --push-state -Xlinker --whole-archive -lc++ -lc++abi -Xlinker --pop-state +endif + include Makefile.rules diff --git a/lldb/test/API/commands/expression/import-std-module/list-dbg-info-content/Makefile b/lldb/test/API/commands/expression/import-std-module/list-dbg-info-content/Makefile index f938f7428468a..6f0d77235b59d 100644 --- a/lldb/test/API/commands/expression/import-std-module/list-dbg-info-content/Makefile +++ b/lldb/test/API/commands/expression/import-std-module/list-dbg-info-content/Makefile @@ -1,3 +1,8 @@ USE_LIBCPP := 1 CXX_SOURCES := main.cpp + +ifneq ($(OS),Darwin) + LDFLAGS := -Xlinker --push-state -Xlinker --whole-archive -lc++ -lc++abi -Xlinker --pop-state +endif + include Makefile.rules diff --git a/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/Makefile b/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/Makefile index f938f7428468a..6f0d77235b59d 100644 --- a/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/Makefile +++ b/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/Makefile @@ -1,3 +1,8 @@ USE_LIBCPP := 1 CXX_SOURCES := main.cpp + +ifneq ($(OS),Darwin) + LDFLAGS := -Xlinker --push-state -Xlinker --whole-archive -lc++ -lc++abi -Xlinker --pop-state +endif + include Makefile.rules diff --git a/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/Makefile b/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/Makefile index f938f7428468a..6f0d77235b59d 100644 --- a/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/Makefile +++ b/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/Makefile @@ -1,3 +1,8 @@ USE_LIBCPP := 1 CXX_SOURCES := main.cpp + +ifneq ($(OS),Darwin) + LDFLAGS := -Xlinker --push-state -Xlinker --whole-archive -lc++ -lc++abi -Xlinker --pop-state +endif + include Makefile.rules diff --git a/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py index 06c685ebc3f5a..320e6c94976ff 100644 --- a/lldb/test/API/lit.cfg.py +++ b/lldb/test/API/lit.cfg.py @@ -4,6 +4,7 @@ import os import platform +import re import shlex import shutil import subprocess @@ -211,7 +212,7 @@ def delete_module_cache(path): # If we have a just-built libcxx, prefer it over the system one. if is_configured("has_libcxx") and config.has_libcxx: - if platform.system() != "Windows": + if platform.system() != "Windows" or re.match(r".*-linux.*", config.target_triple): if is_configured("libcxx_include_dir") and is_configured("libcxx_libs_dir"): dotest_cmd += ["--libcxx-include-dir", config.libcxx_include_dir] if is_configured("libcxx_include_target_dir"): diff --git a/lldb/test/Shell/helper/toolchain.py b/lldb/test/Shell/helper/toolchain.py index 42968128f2702..a62f6f4ec52cb 100644 --- a/lldb/test/Shell/helper/toolchain.py +++ b/lldb/test/Shell/helper/toolchain.py @@ -239,6 +239,7 @@ def use_support_substitutions(config): host_flags += [ "-L{}".format(config.libcxx_libs_dir), "-lc++", + "-lc++abi", ] host_flags = " ".join(host_flags)