Skip to content

Several fixes for Linux/musl/s390x - #4549

Merged
tgross35 merged 5 commits into
rust-lang:mainfrom
neuschaefer:s390x-statfs
Aug 14, 2025
Merged

Several fixes for Linux/musl/s390x#4549
tgross35 merged 5 commits into
rust-lang:mainfrom
neuschaefer:s390x-statfs

Conversation

@neuschaefer

Copy link
Copy Markdown
Contributor

Description

This PR updates several APIs with respect to their definitions in musl-libc.

Sources

Links are included in the commit messages.

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

@neuschaefer

Copy link
Copy Markdown
Contributor Author

@tgross35 I probably missed some of the finer details of version tracking in the libc crate. I'm looking forward to your (and/or someone else's) review

@tgross35 tgross35 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, been a bit behind on libc. Just a few small things

Comment thread src/unix/linux_like/linux/mod.rs
Comment thread src/unix/linux_like/linux/musl/b64/s390x.rs Outdated
@neuschaefer
neuschaefer force-pushed the s390x-statfs branch 3 times, most recently from adbe903 to e3f7cad Compare August 12, 2025 13:20
@neuschaefer

Copy link
Copy Markdown
Contributor Author

@tgross35 this is ready for review again

Comment on lines 89 to 94
s_no_extra_traits! {
// FIXME(union): This is actually a union.
pub struct fpreg_t {
pub union fpreg_t {
pub d: c_double,
// f: c_float,
pub f: c_float,
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting to self that this patch won't get backported

@tgross35 tgross35 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! As always, I appreciate the clean+detailed commits

@tgross35
tgross35 enabled auto-merge August 12, 2025 19:41
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Aug 12, 2025

@tgross35 tgross35 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the CI failure, looks like this needs an update to the PartialEq implementation

@neuschaefer

Copy link
Copy Markdown
Contributor Author

From the CI failure, looks like this needs an update to the PartialEq implementation

Good point. I'll follow 051fa61 and make the traits unimplemented

auto-merge was automatically disabled August 13, 2025 12:39

Head branch was pushed to by a user without write access

@tgross35 tgross35 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tgross35
tgross35 enabled auto-merge August 13, 2025 20:11
glibc provides these symbols, but musl does not.
musl-libc does not implement sysctl.
SYS_mseal is not yet defined in musl-libc, but it can only take one
possible value, dictated by the kernel's syscall ABI.
Previously, the definition was only changed for glibc but not for musl.

Fixes: 051fa61 ("Make `fpreg_t` an union")
auto-merge was automatically disabled August 14, 2025 00:40

Head branch was pushed to by a user without write access

@neuschaefer

neuschaefer commented Aug 14, 2025

Copy link
Copy Markdown
Contributor Author

rebased to trigger rebuild after android CI failure. @tgross35 sorry if this throws a wrench into the review flow

@tgross35
tgross35 added this pull request to the merge queue Aug 14, 2025
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 21, 2025
musl-libc does not implement sysctl.

(backport <rust-lang#4549>)
(cherry picked from commit 751f3b6)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 21, 2025
SYS_mseal is not yet defined in musl-libc, but it can only take one
possible value, dictated by the kernel's syscall ABI.

(backport <rust-lang#4549>)
(cherry picked from commit 6a13fd5)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 21, 2025
Previously, the definition was only changed for glibc but not for musl.

Fixes: 051fa61 ("Make `fpreg_t` an union")

(backport <rust-lang#4549>)
(cherry picked from commit 2e670a8)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 21, 2025
https://git.musl-libc.org/cgit/musl/tree/arch/s390x/bits/statfs.h

statfs64 is the same as statfs on musl-libc, so it can also be a type alias on
the Rust side.

https://git.musl-libc.org/cgit/musl/tree/include/sys/statfs.h#n21

(backport <rust-lang#4549>)
(cherry picked from commit dd6f54c)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 21, 2025
glibc provides these symbols, but musl does not.

(backport <rust-lang#4549>)
(cherry picked from commit da77f0f)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 21, 2025
musl-libc does not implement sysctl.

(backport <rust-lang#4549>)
(cherry picked from commit 751f3b6)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 21, 2025
SYS_mseal is not yet defined in musl-libc, but it can only take one
possible value, dictated by the kernel's syscall ABI.

(backport <rust-lang#4549>)
(cherry picked from commit 6a13fd5)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 21, 2025
Previously, the definition was only changed for glibc but not for musl.

Fixes: 051fa61 ("Make `fpreg_t` an union")

(backport <rust-lang#4549>)
(cherry picked from commit 2e670a8)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 21, 2025
https://git.musl-libc.org/cgit/musl/tree/arch/s390x/bits/statfs.h

statfs64 is the same as statfs on musl-libc, so it can also be a type alias on
the Rust side.

https://git.musl-libc.org/cgit/musl/tree/include/sys/statfs.h#n21

(backport <rust-lang#4549>)
(cherry picked from commit dd6f54c)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 21, 2025
glibc provides these symbols, but musl does not.

(backport <rust-lang#4549>)
(cherry picked from commit da77f0f)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 21, 2025
musl-libc does not implement sysctl.

(backport <rust-lang#4549>)
(cherry picked from commit 751f3b6)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 21, 2025
SYS_mseal is not yet defined in musl-libc, but it can only take one
possible value, dictated by the kernel's syscall ABI.

(backport <rust-lang#4549>)
(cherry picked from commit 6a13fd5)
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 21, 2025
Previously, the definition was only changed for glibc but not for musl.

Fixes: 051fa61 ("Make `fpreg_t` an union")

(backport <rust-lang#4549>)
(cherry picked from commit 2e670a8)
@tgross35 tgross35 mentioned this pull request Sep 21, 2025
github-merge-queue Bot pushed a commit that referenced this pull request Sep 22, 2025
https://git.musl-libc.org/cgit/musl/tree/arch/s390x/bits/statfs.h

statfs64 is the same as statfs on musl-libc, so it can also be a type alias on
the Rust side.

https://git.musl-libc.org/cgit/musl/tree/include/sys/statfs.h#n21

(backport <#4549>)
(cherry picked from commit dd6f54c)
github-merge-queue Bot pushed a commit that referenced this pull request Sep 22, 2025
glibc provides these symbols, but musl does not.

(backport <#4549>)
(cherry picked from commit da77f0f)
github-merge-queue Bot pushed a commit that referenced this pull request Sep 22, 2025
musl-libc does not implement sysctl.

(backport <#4549>)
(cherry picked from commit 751f3b6)
github-merge-queue Bot pushed a commit that referenced this pull request Sep 22, 2025
SYS_mseal is not yet defined in musl-libc, but it can only take one
possible value, dictated by the kernel's syscall ABI.

(backport <#4549>)
(cherry picked from commit 6a13fd5)
github-merge-queue Bot pushed a commit that referenced this pull request Sep 22, 2025
Previously, the definition was only changed for glibc but not for musl.

Fixes: 051fa61 ("Make `fpreg_t` an union")

(backport <#4549>)
(cherry picked from commit 2e670a8)
github-merge-queue Bot pushed a commit that referenced this pull request Sep 22, 2025
https://git.musl-libc.org/cgit/musl/tree/arch/s390x/bits/statfs.h

statfs64 is the same as statfs on musl-libc, so it can also be a type alias on
the Rust side.

https://git.musl-libc.org/cgit/musl/tree/include/sys/statfs.h#n21

(backport <#4549>)
(cherry picked from commit dd6f54c)
github-merge-queue Bot pushed a commit that referenced this pull request Sep 22, 2025
glibc provides these symbols, but musl does not.

(backport <#4549>)
(cherry picked from commit da77f0f)
github-merge-queue Bot pushed a commit that referenced this pull request Sep 22, 2025
musl-libc does not implement sysctl.

(backport <#4549>)
(cherry picked from commit 751f3b6)
github-merge-queue Bot pushed a commit that referenced this pull request Sep 22, 2025
SYS_mseal is not yet defined in musl-libc, but it can only take one
possible value, dictated by the kernel's syscall ABI.

(backport <#4549>)
(cherry picked from commit 6a13fd5)
github-merge-queue Bot pushed a commit that referenced this pull request Sep 22, 2025
Previously, the definition was only changed for glibc but not for musl.

Fixes: 051fa61 ("Make `fpreg_t` an union")

(backport <#4549>)
(cherry picked from commit 2e670a8)
@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 Sep 22, 2025
SteveLauC pushed a commit to Gelbpunkt/nix that referenced this pull request Feb 1, 2026
This PR fixes compilation against libc 0.2.176 on s390x-unknown-linux-musl.
libc 0.2.176 fixed the definitions of statfs to align them with musl, see
rust-lang/libc#4549 for the PR that fixed it.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
github-merge-queue Bot pushed a commit to nix-rust/nix that referenced this pull request Feb 1, 2026
This PR fixes compilation against libc 0.2.176 on s390x-unknown-linux-musl.
libc 0.2.176 fixed the definitions of statfs to align them with musl, see
rust-lang/libc#4549 for the PR that fixed it.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-linux O-musl O-unix stable-applied This PR has been cherry-picked to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants