add support for building outlined aarch64 intrinsics #407
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/llvm-project@a4ac434 saw the
addition of out-of-line aarch64 atomic intrinsics. LLVM will sometimes
emit these, so we need to ensure they're included in Rust's compiler-rt.
===
This probably isn't an issue that we'll see in ToT Rust until we pull in a new LLVM. Seems reasonable to me to hold off on merging this PR until then; I just had to do it anyway, so thought I'd provide the result in case it's helpful. :)
The approach here is admittedly ugly. If we want to stick more closely with the "all builds are done by
cfg.compile("libcompiler-rt.a");
," a potentially cleaner alternative would be to generate a temp .S file for each combination of these things. These would boil down to something like:LLVM's cmake approach (AIUI) is "create a lot of symlinks to lse.S, and compile those with differing flags." Adopting that approach would still give us badness here, since it doesn't seem
cc
lets us apply file-specific flags.I'm still doing a bit of extra testing to ensure this does the right thing, but aarch64 builds successfully for me with a local backport of the recent lse.S changes.