Add compiler-rt build for LLVM 15#1
Merged
sklam merged 3 commits intosklam:enh/llvm15_conda_buildscriptfrom Apr 15, 2024
Merged
Add compiler-rt build for LLVM 15#1sklam merged 3 commits intosklam:enh/llvm15_conda_buildscriptfrom
sklam merged 3 commits intosklam:enh/llvm15_conda_buildscriptfrom
Conversation
This is a backport of:
```
commit 7939ce39dac0078fef7183d6198598b99c652c88
Author: Jon Roelofs <jonathan_roelofs@apple.com>
Date: Fri Nov 17 14:21:57 2023 -0800
[builtins] Move cfi start's after the symbol name [NFC]
... in preparation for diagnosing improperly nested .cfi regions.
See https://reviews.llvm.org/D155245
```
The ordering of `.cfi_startproc` and the function name in compiler-rt's
`assembly.h` triggers a new diagnostic about improperly nested `.cfi`
regions in Clang 18 onwards. This is fixed in compiler-rt upstream, but
needs to be applied to compiler-rt from LLVM 15 because we're building
it with Clang 18 in some cases.
References to discussions of the issue:
- rust-lang/llvm-project@8238831
- https://issues.chromium.org/issues/40945072
The symbols in the compiler-rt builtins library are private external by default on MacOS. We need them to be visible so we can link against them (e.g. when building libllvmlite.so). This patch makes the symbols visible when the CMake option `COMPILER_RT_BUILTINS_HIDE_SYMBOLS` is off. Note that this is an existing option for the compiler-rt build, and the flags requiring modification in this patch appear to be an oversight. References: - https://discourse.llvm.org/t/lld-automatically-hide-symbols-with-prefix/73192 - numba#986 (comment)
This enables the build of compiler-rt builtins with the following changes: - Add `compiler-rt` to the list of LLVM projects to build - Disable the build of all `compiler-rt` components except for the builtins. Whilst it would be interesting to add these, they seem to require clang to be built at the same time. - Setting the `COMPILER_RT_BUILTINS_HIDE_SYMBOLS` CMake option to `OFF`, to ensure that we can link against those symbols in the general case. Note that these changes are simpler than previous efforts towards enabling `compiler-rt` builtins (e.g. numba#979) - this is because we now build as part of the whole `llvm-project` tree, which simplifies things and removes issues that had to be worked around when building it separately.
Author
|
Quick update - the linux-ppcle64 build also completed successfully, so as far as I can ascertain, all is well here. |
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 is based on numba#979.
Notes:
llvm-projecttree.compiler-rtbuild with clang 18 on MacOS (backporting an actual fix)__unix0metapackage (or something similar) which means they won't install on some systems, but I don't expect this to be an issue with a buildfarm build.A lot of the work here is done by @oliverhu - I have re-packaged it here for the LLVM 15 conda recipe PR.