-
Notifications
You must be signed in to change notification settings - Fork 208
Enable per-target runtime directory for compiler-rt #533
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
Enable per-target runtime directory for compiler-rt #533
Conversation
|
I think this may need updating too but otherwise seems resonable to me 👍, thanks! |
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) |
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.
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.
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.
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
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 |
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.
Should libc here be just lib? Maybe a pre-existing typo?
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.
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
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.
Nice!
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.