Skip to content

[lldb][test] Link certain libc++ tests with the whole library #118986

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lldb/packages/Python/lldbsuite/test/make/Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is -nostdinc here really needed here? Headers shouldn't be accessed during the link step (and even if they were, this should probably be -nostdinc++)

else
ifeq "$(OS)" "Android"
# Nothing to do, this is already handled in
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion lldb/test/API/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import os
import platform
import re
import shlex
import shutil
import subprocess
Expand Down Expand Up @@ -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"):
Expand Down
1 change: 1 addition & 0 deletions lldb/test/Shell/helper/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading