[libc] Fix tests' linking flags accidentally modified by #147931.#149453
Merged
[libc] Fix tests' linking flags accidentally modified by #147931.#149453
Conversation
Member
|
@llvm/pr-subscribers-libc Author: None (lntue) ChangesFull diff: https://github.com/llvm/llvm-project/pull/149453.diff 1 Files Affected:
diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index e210992c5111a..e128b4500fc2a 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -571,6 +571,8 @@ function(add_integration_test test_name)
target_compile_options(${fq_build_target_name} PRIVATE
${compile_options} ${INTEGRATION_TEST_COMPILE_OPTIONS})
+ set(link_libraries "")
+
if(LIBC_TARGET_ARCHITECTURE_IS_AMDGPU)
target_link_options(${fq_build_target_name} PRIVATE
${LIBC_COMPILE_OPTIONS_DEFAULT} ${INTEGRATION_TEST_COMPILE_OPTIONS}
@@ -599,17 +601,19 @@ function(add_integration_test test_name)
set(link_options
-nolibc
-nostartfiles
- -static
+ -nostdlib
${LIBC_LINK_OPTIONS_DEFAULT}
${LIBC_TEST_LINK_OPTIONS_DEFAULT}
)
target_link_options(${fq_build_target_name} PRIVATE ${link_options})
+ list(APPEND link_libraries ${LIBGCC_S_LOCATION})
endif()
target_link_libraries(
${fq_build_target_name}
${fq_target_name}.__libc__
libc.startup.${LIBC_TARGET_OS}.crt1
libc.test.IntegrationTest.test
+ ${link_libraries}
)
add_dependencies(${fq_build_target_name}
libc.test.IntegrationTest.test
@@ -807,7 +811,7 @@ function(add_libc_hermetic test_name)
set(link_options
-nolibc
-nostartfiles
- -static
+ -nostdlib
${LIBC_LINK_OPTIONS_DEFAULT}
${LIBC_TEST_LINK_OPTIONS_DEFAULT}
)
|
bassiounix
approved these changes
Jul 18, 2025
Member
bassiounix
left a comment
There was a problem hiding this comment.
Changing the order of linking for gcc. otherwise LGTM.
saturn691
reviewed
Jul 18, 2025
saturn691
reviewed
Jul 18, 2025
…integration tests the same as hermetic test.
Contributor
Author
Moved libgcc_s to after libc on both hermetic test and integration test. |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/38586 Here is the relevant piece of the build log for the reference |
This was referenced Jul 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#147931