[ATFE] Run llvmlibc tests against generated sysroot matching final multilib layout.#879
Merged
Merged
Conversation
…ltilib layout.
LLVM libc tests now run against a generated build-tree
sysroot so tests can be compiled and linked using the same multilib
layout that will be installed in the final package.
LLVM libc tests need to resolve headers and libraries through
the multilib layout, including the optimized common-header
layout when enabled. Building a dedicated test sysroot lets
the tests exercise the generated multilib package structure
instead of relying only on per-variant temporary install directories.
This is particularly important for the layered multilib layout,
where minor variants contain only the payload required for their
subarchive and rely on content inherited from base variants.
As a result, individual per-variant temporary install directories
no longer represent a complete view of the installed sysroot and
are not suitable as test environments. Using a generated test sysroot
ensures tests resolve files exactly as they will in the final packaged
multilib installation
This patch:
- Adds LLVM_LIBC_TEST_SYSROOT.
- When C_LIBRARY=llvmlibc, creates a new target: llvmlibc-test-sysroot.
- That target deletes/recreates the test sysroot, copies either:
- multilib-optimised/ if header optimisation is enabled, or
- multilib/ otherwise.
- For LLVM libc tests, the test compile and link options now include:
- --sysroot=<LLVM_LIBC_TEST_SYSROOT>.
- the variant's multilib flags
- A dependency from LLVM libc check targets to the generated test sysroot
vhscampos
approved these changes
Jul 1, 2026
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.
LLVM libc tests now run against a generated build-tree sysroot so tests can be compiled and linked using the same multilib layout that will be installed in the final package.
LLVM libc tests need to resolve headers and libraries through the multilib layout, including the optimised common-header layout when enabled. So the ATFE build system passes --sysroot when compiling and linking these tests. Before this change, that sysroot pointed at the runtimes tmp_install area, which is created as a per-variant temporary install directory. That layout is useful while building each variant, but it does not work in the layered layout where minor variants contain only the payload required for their subarchive and rely on content inherited from base variants. As a result, individual per-variant temporary install directories no longer represent a complete view of the installed sysroot and are not suitable as test environments. Building a dedicated test sysroot lets the tests exercise the generated multilib package structure instead of relying only on per-variant temporary install directories.
This patch:
- That target deletes/recreates the test sysroot, copies either:
- multilib-optimised/ if header optimisation is enabled, or
- multilib/ otherwise.