std.os: fix alignment of Sigaction.handler_fn#13418
Merged
Vexu merged 3 commits intoziglang:masterfrom Nov 9, 2022
Merged
Conversation
3 tasks
matu3ba
reviewed
Nov 3, 2022
Contributor
Author
|
Hmm just realized that the existing test calls w/ |
Contributor
Author
|
Ok I namespaced the handler_called_count and made sure the test fully tests the |
ryanschneider
commented
Nov 3, 2022
e652829 to
d8b47ca
Compare
Contributor
|
ci.ziglang fails in debug mode with Is there maybe some unformatted code? |
d8b47ca to
31ac4f9
Compare
* Should start failing on aarch64 and other word-aligned CPUs.
31ac4f9 to
bcaa439
Compare
Contributor
Author
|
Oops ya I thought I had my editor setup to run |
bcaa439 to
a68b27c
Compare
matu3ba
approved these changes
Nov 5, 2022
Contributor
matu3ba
left a comment
There was a problem hiding this comment.
Not sure though, if some align(1) are missing on some OSes.
algitbot
pushed a commit
to alpinelinux/aports
that referenced
this pull request
Jan 9, 2023
fixes build of river see ziglang/zig#13418 ziglang/zig#13216
andrewrk
pushed a commit
that referenced
this pull request
Jan 9, 2023
std.os: fix alignment of Sigaction.handler_fn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fix (proposed independently by @Vexu here (#13216 (comment)) and @marler8997 here (marler8997/ziglibc#3 (comment)) allows one to pass
os.SIG.IGNor other non-pointer aligned values for thehandler_fnon word-aligned architectures like aarch64.The PR is two separate commits simply because this is my first PR to zig and I wanted to make sure that the CI picks up the failing case first and will be fixed w/ the 2nd commit, IMO the PR can be squashed before merging.
I added the
align(1)to all thelib/std/cimplementations, even the ones like dragonfly that only (currently) target x86 for consistency but am happy to remove those changes if preferred.Fixes #13216.