-
Couldn't load subscription status.
- Fork 15k
[lldb][test] When an external stdlib is specified do not link to the system stdlib #164462
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
Conversation
On linux if you specify the an external libc++ and clang will still link to the system's libc++. This patch fixes that.
|
@llvm/pr-subscribers-lldb Author: Ebuka Ezike (da-viper) ChangesOn linux if you specify the an external libc++ and clang will still link to the system's libc++. This patch fixes that. Full diff: https://github.com/llvm/llvm-project/pull/164462.diff 1 Files Affected:
diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index e72ffd1f030ec..1676fb3d4520c 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -386,6 +386,11 @@ ifeq (,$(filter 1, $(USE_LIBSTDCPP) $(USE_LIBCPP) $(USE_SYSTEM_STDLIB)))
ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" ""
CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR)
endif
+
+ # If `-nostdlib++` is not passed, clang will link to the system's stdlib.
+ ifeq ($(LDC), clang)
+ LDFLAGS += -nostdlib++ -nostdinc++
+ endif
LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++
else
USE_SYSTEM_STDLIB := 1
|
| endif | ||
|
|
||
| # If `-nostdlib++` is not passed, clang will link to the system's stdlib. | ||
| ifeq ($(LDC), clang) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this. Clang, GCC and clang-cl are all aware of this option
| ifeq ($(LDC), clang) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. This should fix the immediate issue of accidentally linking against libstdc++ in the DAP tests. We should also add the flag to the USE_LIBCPP codepath as @dzhidzhoev pointed out, but I don't mind doing that in a separate PR. I was going to do a minor cleanup of this logic in a follow-up PR, and might include that in those changes.
Could add Fixes https://github.com/llvm/llvm-project/issues/116040 to the PR description before merging?
|
Ignore the AArch64 CI failure. It has been unintentionally running on PRs as of late. |
…system stdlib (llvm#164462) On linux if you specify the an external libc++ and clang will still link to the system's libc++. This patch fixes that. Fixes llvm#116040
On linux if you specify the an external libc++ and clang will still link to the system's libc++. This patch fixes that.
Fixes #116040