Add powerpc64-unknown-linux-gnuelfv2 target#144220
Conversation
|
These commits modify compiler targets. Some changes occurred in src/doc/rustc/src/platform-support cc @Noratrieb |
This comment has been minimized.
This comment has been minimized.
|
Interesting, seems like a usecase like this one in particular is currently not intended, see here. The explicitly set ABI is processed in EDIT: This is an LLVM bug, it doesn't reset the data layout when the ABI is explicitly set, while it does on ARM |
|
LLVM side of the problem should hopefully get fixed by llvm/llvm-project#149725, |
255b058 to
755a1c9
Compare
This comment has been minimized.
This comment has been minimized.
755a1c9 to
ae5d567
Compare
This comment has been minimized.
This comment has been minimized.
ae5d567 to
d7200f0
Compare
This comment has been minimized.
This comment has been minimized.
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
|
☔ The latest upstream changes (presumably #144249) made this pull request unmergeable. Please resolve the merge conflicts. |
d7200f0 to
23a159f
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
This is no longer blocked since we now use LLVM 22. |
|
We still support LLVM 21 AFAIK. Is that a problem? |
I believe not, at least if I understand David's comment (#144220 (comment)) correctly. We only test that codegen works for the target if LLVM 22 is in use. I guess it would probably be worth documenting the LLVM 22 requirement on the target page as long as 21 is supported. |
That just means we don't see the problem, but the problem still exists. ;) |
|
Well, code compiled with LLVM 21 will still run fine. The datalayout difference between the two is If I remember correctly, rustc does patch the data layouts for a few targets to match newer LLVM if present. We could put the ELFv1 datalayout here for now and patch it to use the correct one if LLVM 22 is in use. Both will build working binaries. |
Oh yeah if that's the only difference then that sounds entirely harmless (unless something more cursed than I can imagine is going on). |
This is virtually the same target as the existing -gnu target, but using the ELFv2 ABI instead of the ELFv1 ABI and made possible now that we expose target_abi = "elfv1" or "elfv2" on the 64-bit PowerPC targets.
23a159f to
a832c14
Compare
|
Implemented that, so this now also works with LLVM 21 |
View all comments
This is virtually the same target as the existing -gnu target, but using the ELFv2 ABI instead of the ELFv1 ABI and made possible now that we expose target_abi = "elfv1" or "elfv2" on the 64-bit PowerPC targets.
The ELFv2 ABI is the preferred ABI for powerpc64 when compatibility with ELFv1 is not required and therefore used by e.g. distributions that were bootstrapped after the introduction of ELFv2.
Copying the target tier policy:
That would be me.
This is an interesting one, because I'm not aware of any toolchain that has a target triple for ppc64 + glibc + ELFv2, even though it is a totally valid combination and actively in used by some distributions. Clang and GCC both simply use
-target powerpc64-unknown-linux-gnu -mabi=elfv2to my knowledge (and cross-toolchains should be using--with-abi=elfv2when configuring GCC). However, the chosen name should be somewhat in line with the other existing targets with special ABIs. Renamingpowerpc64-unknown-linux-gnutopowerpc64-unknown-linux-gnuelfv1at the same time to avoid ambiguity would've been an interesting idea, but it'd be a breaking change to a tier 2 target.This target isn't any different than the ELFv1 target in this regard.
Nothing to comment on here on my end.
This target implements the entire standard library.
Documentation can be found in the markdown document added by this PR.
Roger that :)
This PR doesn't touch any other targets.
The LLVM backend works.
r? compiler