linux: complete siginfo_t definition - #5345
Conversation
Replace padding and alignment fields with a mirrored definition of all fields upstream. The effective sizes and alignment are the same except in RISCV-32, where the alignment in Rust was 8-bytes while in glibc it's 4 bytes. M68K is also affected in that the order of its `si_code` and `si_errno` fields has been switched. See [^1] for general details on this record, and the following list for architecture-specific overrides: - `mips`: <https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/mips/bits/siginfo-arch.h;h=cd3af7db06ba425373ee68ec302e7ea2b5e6ac01;hb=HEAD> - `sparc`: <https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/sparc/bits/siginfo-arch.h;h=4dd35237f67a63c555becffdf038e489558564e6;hb=HEAD> - `x86`: <https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/x86/bits/siginfo-arch.h;h=7688a8d66d6e6ea790a54414500774664fa28e0a;hb=HEAD> [^1]: <https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/bits/types/siginfo_t.h;h=43c4e009a44faef57558093d248a715f75759f89;hb=HEAD>
Replace dummy padding/alignment fields with a proper definition of all fields as seen upstream. This patch should be harmless in that no supported target should see a difference; A padding field that had been public without need has been made private. Certain uClibc targets for which we provide bindings, such as x86_64, have no supported Rust target. Those have been left unmodified, to be removed in a separate patch. See [^1] for details on the Arm definition and [^2] for details on the MIPS32 definition. [^1]: <https://github.com/wbx-github/uclibc-ng/blob/50c470ef4e688e6eea6fd1eff13083e4fd7b7c95/libc/sysdeps/linux/common/bits/siginfo.h#L115> [^2]: <https://github.com/wbx-github/uclibc-ng/blob/50c470ef4e688e6eea6fd1eff13083e4fd7b7c95/libc/sysdeps/linux/mips/bits/siginfo.h#L120>
Replace dummy padding/alignment fields with a definition that mirrors that of upstream. No target should be affected in terms of size and alignment, but one previously public field has been made private. This had been deprecated and hidden from the docs for seven years, so it should be fine to get rid of it. See [^1] for details. [^1]: <https://github.com/kraj/musl/blob/a42e9dee266f398026a33d0793c66225c7997755/include/signal.h#L99-L147>
siginfo_t definitionsiginfo_t definition
|
CI / Test tier1 (x86_64-unknown-linux-gnu) (pull_request) failure tracked by #5350. |
|
Would you mind using this as an opportunity to move 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). |
|
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 |
|
Reminder, once the PR becomes ready for a review, use |
Add links and update existing links to headers in the non-archived GitHub mirror kept by the Sailfish OS project at [^1]. The bminor fork has been archived for some time now. [^1]: https://github.com/sailfishos-mirror/glibc/
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>
|
☔ The latest upstream changes made this pull request unmergeable. Please resolve the merge conflicts. |
Description
Completes the
siginfo_tdefinition 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
libc-test/semverhave been updated*LASTor*MAXhave the standarddoc comment
cargo test -p libc-test --target mytarget);especially relevant for platforms that may not be checked in CI
@rustbot label +stable-nominated