-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
De-duplicate and improve definition of core::ffi::c_char #132975
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
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cuviper (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
|
Failed to set assignee to
|
|
I think r? @joshtriplett should work. |
maurer
left a comment
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.
Some OSes are no longer conditioned on, for example, os=nto arch=aarch64 or os=l4re, arch=x86_64 are missing.
I didn't manually verify everything, but at least l4re and x86_64 just got flipped from u8, which it appears to have been manually set to, to i8.
Can we get a summary of what changed in terms of supported target triples? I would expect disagreements with clang to be rare, but this patch looks like it accidentally changes obscure targets at a minimum. It might also be clearer what changed if we didn't have the 4-branch if statement for 2 results.
05aff14 to
05f561b
Compare
|
I'm pretty sure this still changes |
|
As Apple and Windows targets always use signed char, you could simplify the cfg statement further to |
I'm trying to figure out if that value is intentional or not. It dates back to 2cf0a4a, |
|
Looks like l4re should be setting this for all architectures, I spotted |
c19462d to
4d8abde
Compare
|
r? libs-api |
4d8abde to
5e82b5e
Compare
|
I have validated the new c_char definitions against my build of clang that has fixes for MSP430, Xtensa (although printing the builtin defines fails with Unlike #131319 this PR does not have links to all the ABI docs, but it does have a correct definition for l4re (which clang does not support and treats as unknown OS). |
|
As for L4Re: ({x86_64,aarch64}-l4re-gcc are from https://l4re.org/download/snapshots/toolchain/.) As for Xtensa: However, it appears that Xtensa has multiple ABIs. (Section 1.4 "Calling convention" of Overview of Xtensa ISA https://dl.espressif.com/github_assets/espressif/xtensa-isa-doc/releases/download/latest/Xtensa.pdf) |
5e82b5e to
4e3c262
Compare
|
Rebased and fixed the l4re issue.
Thanks for checking this, I've updated the change to remove l4re from the list. I've done this as a separate commit in case this needs to be reverted in the future.
Regarding Xtensa, my Clang change to make it unsigned by default was approved by Xtensa developers and has been merged now: llvm/llvm-project#115967. |
Instead of having a list of unsigned char targets for each OS, follow the logic Clang uses and instead set the value based on architecture with a special case for Darwin and Windows operating systems. This makes it easier to support new operating systems targeting Arm/AArch64 without having to modify this config statement for each new OS. The new list does not quite match Clang since I noticed a few bugs in the Clang implementation (llvm/llvm-project#115957).
Fixes #129945
Closes #131319