Enable per-target runtime directory for compiler-rt#533
Merged
abrown merged 1 commit intoWebAssembly:mainfrom Jun 12, 2025
Merged
Conversation
Collaborator
|
I think this may need updating too but otherwise seems resonable to me 👍, thanks! |
sbc100
approved these changes
Jun 11, 2025
sbc100
reviewed
Jun 11, 2025
cmake/wasi-sdk-sysroot.cmake
Outdated
| wasi_sdk_add_tarball(dist-compiler-rt | ||
| ${dist_dir}/libclang_rt.builtins-wasm32-wasi-${wasi_sdk_version}.tar.gz | ||
| ${wasi_resource_dir}/lib/wasi) | ||
| ${wasi_resource_dir}/lib/wasm32-unknown-wasi) |
Member
There was a problem hiding this comment.
Is it normall for the target to appear both in the directory name ${wasi_resource_dir}/lib/wasm32-unknown-wasi and in the library name libclang_rt.builtins-wasm32-wasi? It seems somewhat redundant.
Contributor
Author
There was a problem hiding this comment.
You are right, updated to archive the whole lib directory of the resource dir to include rt libraries for all targets
48ab22f to
b9ed916
Compare
sbc100
reviewed
Jun 12, 2025
cmake/wasi-sdk-sysroot.cmake
Outdated
| ${clang_resource_dir}/include ${wasi_resource_dir}/include | ||
|
|
||
| # Copy the `lib/wasi` folder to `libc/wasi{p1,p2}` to ensure that those | ||
| # Copy the `lib/wasm32-unknown-wasi` folder to `libc/wasm32-unknown-wasi{p1,p2}` to ensure that those |
Member
There was a problem hiding this comment.
Should libc here be just lib? Maybe a pre-existing typo?
Contributor
Author
There was a problem hiding this comment.
Good catch!
This change allows us to have per-target libclang_rt.* libraries instead of per-OS. This is particularly required for w/threads and wo/threads targets, whose rt libraries could be incompatible even with the same OS string. This change starts building `compiler-rt` for w/threads and wo/threads separately, so that we can enable thread-related features for p1-threads target for building upcoming ASan clang_rt libraries. Also `COMPILER_RT_OS_DIR` is not set anymore as it's unused when `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` is enabled.
b9ed916 to
e4af2b7
Compare
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.
This change allows us to have per-target libclang_rt.* libraries instead of per-OS. This is particularly required for w/threads and wo/threads targets, whose rt libraries could be incompatible even with the same OS string.
This change starts building
compiler-rtfor w/threads and wo/threads separately, so that we can enable thread-related features for p1-threads target for building upcoming ASan clang_rt libraries. AlsoCOMPILER_RT_OS_DIRis not set anymore as it's unused whenLLVM_ENABLE_PER_TARGET_RUNTIME_DIRis enabled.