Skip to content
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

Fix c_char on various targets #4199

Merged
merged 1 commit into from
Dec 17, 2024
Merged

Fix c_char on various targets #4199

merged 1 commit into from
Dec 17, 2024

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Dec 17, 2024

Description

This was originally included in the list as a TODO for rust-lang/rust#131319 and should have been done at the same time the c_char definition was updated, just as it was done for rust-lang/rust#122986.

Fixes the following targets:

  • aarch64-kmc-solid_asp3
  • armv7a-kmc-solid_asp3-eabi
  • armv7a-kmc-solid_asp3-eabihf
  • riscv64-linux-android
  • x86_64-unknown-l4re-uclibc
  • armv7-sony-vita-newlibeabihf
  • riscv32imac-unknown-nuttx-elf
  • riscv32imafc-unknown-nuttx-elf
  • riscv32imc-unknown-nuttx-elf
  • riscv64gc-unknown-nuttx-elf
  • riscv64imac-unknown-nuttx-elf
  • thumbv6m-nuttx-eabi
  • thumbv7em-nuttx-eabi
  • thumbv7em-nuttx-eabihf
  • thumbv7m-nuttx-eabi
  • thumbv8m.base-nuttx-eabi
  • thumbv8m.main-nuttx-eabi
  • thumbv8m.main-nuttx-eabihf
  • aarch64-unknown-redox
  • aarch64-unknown-illumos
  • riscv32-wrs-vxworks
  • riscv64-wrs-vxworks

Link: rust-lang/rust#132975

Sources

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot
Copy link
Collaborator

rustbot commented Dec 17, 2024

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot
Copy link
Collaborator

rustbot commented Dec 17, 2024

Some changes occurred in solarish module

cc @jclulow, @pfmooney

- aarch64-kmc-solid_asp3
- armv7a-kmc-solid_asp3-eabi
- armv7a-kmc-solid_asp3-eabihf
- riscv64-linux-android
- x86_64-unknown-l4re-uclibc
- armv7-sony-vita-newlibeabihf
- riscv32imac-unknown-nuttx-elf
- riscv32imafc-unknown-nuttx-elf
- riscv32imc-unknown-nuttx-elf
- riscv64gc-unknown-nuttx-elf
- riscv64imac-unknown-nuttx-elf
- thumbv6m-nuttx-eabi
- thumbv7em-nuttx-eabi
- thumbv7em-nuttx-eabihf
- thumbv7m-nuttx-eabi
- thumbv8m.base-nuttx-eabi
- thumbv8m.main-nuttx-eabi
- thumbv8m.main-nuttx-eabihf
- aarch64-unknown-redox
- aarch64-unknown-illumos
- riscv32-wrs-vxworks
- riscv64-wrs-vxworks
@taiki-e
Copy link
Member Author

taiki-e commented Dec 17, 2024

Ideally we should have a top-level c_char definition, but I'm not sure if that is backport friendly.

@tgross35
Copy link
Contributor

Ideally we should have a top-level c_char definition, but I'm not sure if that is backport friendly.

I have #4198 in the queue, after which it should be possible to just pub use crate::arch::c_char_def as c_char in the relevant mod.rs, rather than having the config in a handful of places. Would you be able to rebase this and use that after it lands?

@taiki-e
Copy link
Member Author

taiki-e commented Dec 17, 2024

I'm fine with it, but I think it would be ideal to provide c_char at top-level and reference it via prelude from other files (may not be backport friendly though). Like c_void does:

pub use core::ffi::c_void;

@tgross35
Copy link
Contributor

We can't use core::ffi::c_char if that is what you meant, since our MSRV is 1.63 but those got stabilized in 1.64. We could make #4198 public though; the only reason I added it this way is to do piecemeal updates. After the recently changed targets get fixed, the rest can get double checked and cleaned up.

@taiki-e
Copy link
Member Author

taiki-e commented Dec 17, 2024

I meant to define c_char at the top-level instead of re-exporting.

@tgross35
Copy link
Contributor

How would that be different from making #4198 public (without mod arch and with c_char_def -> c_char)?

@taiki-e
Copy link
Member Author

taiki-e commented Dec 17, 2024

It should mean the same thing (assuming “making #4198 public” means “making c_char_def public as c_char at top-level, remove per-target c_char definitions, and import top-level c_char as needed).

@taiki-e
Copy link
Member Author

taiki-e commented Dec 17, 2024

Closing in favor of #4202, which is doing the approach I said I think is ideal in #4199 (comment).

@taiki-e taiki-e closed this Dec 17, 2024
@taiki-e taiki-e deleted the c-char branch December 17, 2024 12:46
@taiki-e taiki-e restored the c-char branch December 17, 2024 13:18
@taiki-e
Copy link
Member Author

taiki-e commented Dec 17, 2024

Re-opening -- Since this is a non-aggressive change, we might merge this before #4202, as mentioned in #4201 (comment).

@taiki-e taiki-e reopened this Dec 17, 2024
@tgross35 tgross35 added this pull request to the merge queue Dec 17, 2024
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Dec 17, 2024
Merged via the queue into rust-lang:main with commit bd30d1e Dec 17, 2024
86 checks passed
@taiki-e taiki-e deleted the c-char branch December 18, 2024 00:58
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Dec 18, 2024
- aarch64-kmc-solid_asp3
- armv7a-kmc-solid_asp3-eabi
- armv7a-kmc-solid_asp3-eabihf
- riscv64-linux-android
- x86_64-unknown-l4re-uclibc
- armv7-sony-vita-newlibeabihf
- riscv32imac-unknown-nuttx-elf
- riscv32imafc-unknown-nuttx-elf
- riscv32imc-unknown-nuttx-elf
- riscv64gc-unknown-nuttx-elf
- riscv64imac-unknown-nuttx-elf
- thumbv6m-nuttx-eabi
- thumbv7em-nuttx-eabi
- thumbv7em-nuttx-eabihf
- thumbv7m-nuttx-eabi
- thumbv8m.base-nuttx-eabi
- thumbv8m.main-nuttx-eabi
- thumbv8m.main-nuttx-eabihf
- aarch64-unknown-redox
- aarch64-unknown-illumos
- riscv32-wrs-vxworks
- riscv64-wrs-vxworks

(backport <rust-lang#4199>)
(cherry picked from commit 0344a78)
@tgross35 tgross35 mentioned this pull request Dec 18, 2024
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants