Skip to content

linux: complete siginfo_t definition - #5345

Open
dybucc wants to merge 7 commits into
rust-lang:mainfrom
dybucc:linux-siginfo_t-tweaks
Open

linux: complete siginfo_t definition#5345
dybucc wants to merge 7 commits into
rust-lang:mainfrom
dybucc:linux-siginfo_t-tweaks

Conversation

@dybucc

@dybucc dybucc commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Description

Completes the siginfo_t definition under Linux targets to attempt closing
#716.

See the patch messages for details on each of the GNU targets, uClibc targets
and musl targets.

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 dybucc changed the title Linux: complete siginfo_t definition linux: complete siginfo_t definition Jul 31, 2026
@xtqqczze

This comment was marked as outdated.

@tgross35

tgross35 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Would you mind using this as an opportunity to move signifo_t to src/new? At least on glibc, that should make things a lot easier with less duplication. No need to be perfect with siginfo-arch.h since that's tricky to replicate in Rust, cfg is fine.

Also fyi, @xtqqczze found https://github.com/sailfishos-mirror/glibc as a mirror for glibc that's much easier to search and less flaky, that's fine to link (as is sourceware, of course).

@tgross35

tgross35 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

There will be quite a bit less to review after that, so will hold off taking a closer look. Let me know if you need help figuring out the module structure.

@rustbot author

@rustbot

rustbot commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot

This comment has been minimized.

@dybucc
dybucc force-pushed the linux-siginfo_t-tweaks branch from a6ba6f4 to bd71182 Compare August 5, 2026 06:49
@rustbot

rustbot commented Aug 5, 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.

@dybucc
dybucc force-pushed the linux-siginfo_t-tweaks branch 7 times, most recently from b02986c to 08192fa Compare August 5, 2026 15:18
@dybucc
dybucc force-pushed the linux-siginfo_t-tweaks branch 2 times, most recently from d0d15ea to f8ca28d Compare August 5, 2026 16:31
dybucc added 2 commits August 5, 2026 18:37
Replace references to `siginfo_t` in the regular repository layout with
a crate-relative path that uses the reexport from the `new` module. This
allows the next few patches to all work as individual revisions.
Replace alignment/padding fields with a one-to-one definition as that
used upstream. These have been incorporated as definitions in the `new`
module to avoid huge repetition across target triples without overrides.
The glibc definitions are mostly the same across target architectures
except for MIPS, SPARC and x86. x86 is confusing because there's only an
override when running under x86_64 and compiling for x32. I'm not sure
how Rust handles this, so the `#[path]`-redirected files for that
architecture are the same as the generic ones. See [^1] for the generic
file and the following list for the architecture-specific overrides.

- `mips`:
<https://github.com/sailfishos-mirror/glibc/blob/4a07bb292f921c10e71fbf48c4a7f44391feb06c/sysdeps/unix/sysv/linux/mips/bits/siginfo-arch.h>
- `sparc`:
<https://github.com/sailfishos-mirror/glibc/blob/4a07bb292f921c10e71fbf48c4a7f44391feb06c/sysdeps/unix/sysv/linux/sparc/bits/siginfo-arch.h>
- `x86`:
<https://github.com/sailfishos-mirror/glibc/blob/4a07bb292f921c10e71fbf48c4a7f44391feb06c/sysdeps/unix/sysv/linux/x86/bits/siginfo-arch.h>

[^1]:
<https://github.com/sailfishos-mirror/glibc/blob/4a07bb292f921c10e71fbf48c4a7f44391feb06c/sysdeps/unix/sysv/linux/bits/types/siginfo_t.h>
@dybucc
dybucc force-pushed the linux-siginfo_t-tweaks branch from f8ca28d to 64b8345 Compare August 5, 2026 16:37
dybucc added 2 commits August 5, 2026 18:40
Remove older bindings to `siginfo_t` using dummy fields instead of the
upstream `union`. This follows from the patch providing a full
definition for glibc bindings.

Add reexports for `siginfo_t` under the `new` module. This has required
renaming the reexport for the `nptl` module as it also contains a `bits`
module of the same name as the `bits::types::siginfo_t` module path
under `sysdeps`.
Replace alignment/padding fields with a mirrored definition of the
upstream `union`. See [^1] for details.

[^1]: <https://github.com/kraj/musl/blob/a42e9dee266f398026a33d0793c66225c7997755/include/signal.h>
@dybucc
dybucc force-pushed the linux-siginfo_t-tweaks branch 2 times, most recently from 71bbc5f to 76b6884 Compare August 5, 2026 16:43
Remove older bindings to `siginfo_t` using dummy fields instead of the
upstream `union`. This follows from the patch providing a full
definition for musl bindings.

Add modified bindings under `new`.
@dybucc
dybucc force-pushed the linux-siginfo_t-tweaks branch from 76b6884 to 1e7631c Compare August 5, 2026 16:45
dybucc added 2 commits August 5, 2026 19:25
Replace alignment/padding dummy fields with a mirrored definition
fitting that of upstream's `union`. uClibc supports targets for which we
have no support in Rust. No architecture-specific definition has been
provided for those. See [^1] for details on the generic definition and
[^2] for details on the MIPS definition.

[^1]: <https://github.com/wbx-github/uclibc-ng/blob/60d8e8c0cb9be8a241f6f2645daba260c8aec33c/libc/sysdeps/linux/common/bits/siginfo.h>
[^2]: <https://github.com/wbx-github/uclibc-ng/blob/60d8e8c0cb9be8a241f6f2645daba260c8aec33c/libc/sysdeps/linux/mips/bits/siginfo.h>
Remove older bindings to `siginfo_t` using dummy fields instead of the
upstream `union`. This follows from the patch providing a full
definition for uClibc bindings.

Add modified bindings to `new` module.
@dybucc
dybucc force-pushed the linux-siginfo_t-tweaks branch from 1e7631c to 72a1606 Compare August 5, 2026 17:25
@dybucc

dybucc commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

I'm not sure what, but I had something else to do in this patchset. Hopefully
the review will surface it.

@rustbot ready

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.

4 participants