Skip to content

linux(uclibc): add cfg for LFS bindings#5315

Open
dybucc wants to merge 3 commits into
rust-lang:mainfrom
dybucc:uclibc-lfs-support
Open

linux(uclibc): add cfg for LFS bindings#5315
dybucc wants to merge 3 commits into
rust-lang:mainfrom
dybucc:uclibc-lfs-support

Conversation

@dybucc

@dybucc dybucc commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds a new cfg for file offset types in uClibc to ensure target
triples with a 32-bit machine word size can also have 64-bit unsuffixed file
offset types. None of these changes affect 64-bit platforms.

The LFS types continue being exposed by default in all platforms, but when the
cfg option is issued, they will have equivalent definitions to the unsuffixed
types.

Would like to ask @operutka, @lancethepants, @skrap and @japaric whether you
think it's worth it to add this cfg, you folks being or having been
maintainers for targets using uClibc. It was originally part of #5165, but got
split because our need to customize rust-lang/libc to fit upstream build options
wasn't entirely clear.

Sources

Checklist

  • Relevant tests in libc-test/semver have been updated
  • Commit messages permalink to headers for added or changed API
  • Placeholder or unstable values like *LAST or *MAX have the standard
    doc comment
  • Tested locally (cargo test -p libc-test --target mytarget); especially
    relevant for platforms that may not be checked in CI

@rustbot label +stable-nominated

dybucc added 3 commits July 22, 2026 16:12
Adds a `cfg` to enable LFS64 bindings under 32-bit targets. This does
not apply to 64-bit targets. Their suffixed types are equivalent to
their unsuffixed types. They unconditionally get both suffixed and
unsuffixed types.

This `cfg` replicates a build option upstream.
Fixes the definitions of:

- `stat`.
- `statfs`.
- `statvfs`.

The analogous 64-bit types wer also tweaked. They are equivalent on some
target architectures. They only needed to be aliased.
Replaces existing definitions. They were not correct under MIPS. This
target needed some special casing.
@dybucc
dybucc force-pushed the uclibc-lfs-support branch from 6d404a0 to 729cebc Compare July 22, 2026 14:12
@rustbot

rustbot commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-arm O-linux O-linux-like O-mips O-unix S-waiting-on-review stable-nominated This PR should be considered for cherry-pick to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants