Skip to content

correct siginfo_t and add other signal related items for redox - #5436

Open
auronandace wants to merge 2 commits into
rust-lang:mainfrom
auronandace:redox-signal
Open

correct siginfo_t and add other signal related items for redox#5436
auronandace wants to merge 2 commits into
rust-lang:mainfrom
auronandace:redox-signal

Conversation

@auronandace

@auronandace auronandace commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Corrected siginfo_t to match relibc:

Added the following items:

These changes, when released in a stable 0.2.x release, will allow us to use upstream libc for compiling wasmtime natively on Redox.

Edited to add the following:

@auronandace
auronandace marked this pull request as draft August 26, 2026 08:26
@auronandace
auronandace marked this pull request as ready for review August 26, 2026 09:48
@auronandace
auronandace requested a review from jackpot51 August 26, 2026 09:49

@JohnTitor JohnTitor 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.

@JohnTitor
JohnTitor added this pull request to the merge queue Aug 30, 2026
@JohnTitor
JohnTitor removed this pull request from the merge queue due to a manual request Aug 30, 2026
@JohnTitor

Copy link
Copy Markdown
Member

Let me try if bors could squash here,
@bors squash

@JohnTitor

Copy link
Copy Markdown
Member

Seems not, @auronandace could you squash commits into one?

@auronandace

Copy link
Copy Markdown
Contributor Author

I don't understand how to squash. I tried following this: https://www.geeksforgeeks.org/git/git-squash/

I can tell you my main branch of my libc now has just the one commit which seems to have this redox-signal branch commit squashed into one.

@tgross35

Copy link
Copy Markdown
Member

The usual sequence would be:

  1. Start a rebase without changing the base, using git rebase -i main --keep-base. (Or omit --keep-base to change the base as well)
  2. In the editor, change "pick" to "f" (or "fixup") on all but the first commit. Save+exit
  3. Your local is up to date. Update github with git push --force-with-lease

You could have the first two steps completed already but might just need to do the third. If you get stuck, we can also do it for you.

@auronandace

Copy link
Copy Markdown
Contributor Author

CI seems to be saying #[repr(C)] attribute is being used multiple times. This wasn't failing in CI before. All the structs that specify it only specify it once so I'm not quite following what is going on. Is the macro adding it automatically too?

@tgross35

Copy link
Copy Markdown
Member

Try the same thing without --keep-base, after making sure your local main is up to date (if you're not sure how, git fetch https://github.com/rust-lang/libc.git main:main should do it) to grab the latest changes. That was fixed recently.

@rustbot

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

@rustbot

rustbot commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

⚠️ Warning ⚠️

  • The following commits have merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged.

    You can start a rebase with the following commands:

    $ # rebase
    $ git pull --rebase https://github.com/rust-lang/libc.git main
    $ git push --force-with-lease
    

@auronandace

Copy link
Copy Markdown
Contributor Author

CI seems to be showing the same error.

Comment thread src/unix/redox/mod.rs Outdated
Comment thread src/unix/redox/mod.rs Outdated
Comment thread src/unix/redox/mod.rs Outdated
Comment thread src/unix/redox/mod.rs Outdated
@auronandace

Copy link
Copy Markdown
Contributor Author

I'm not sure what the protocol is regarding marking conversations as resolved. Is that something I should do or the reviewer?

@auronandace
auronandace requested a review from tgross35 August 31, 2026 13:13
Corrected `siginfo_t` to match relibc:
- [siginfo struct](https://gitlab.redox-os.org/redox-os/relibc/-/blob/f1772c4bb829e02742275e655d349dda02b27cec/src/header/signal/mod.rs#L152) (siginfo_t struct in libc)
- [siginfo_t pub type pointing to siginfo](https://gitlab.redox-os.org/redox-os/relibc/-/blob/f1772c4bb829e02742275e655d349dda02b27cec/src/header/signal/mod.rs#L185)

Added the following items:
- [sigaltstack struct](https://gitlab.redox-os.org/redox-os/relibc/-/blob/f1772c4bb829e02742275e655d349dda02b27cec/src/header/signal/mod.rs#L99) (stack_t struct in libc)
- [stack_t pub type pointing to sigaltstack struct](https://gitlab.redox-os.org/redox-os/relibc/-/blob/f1772c4bb829e02742275e655d349dda02b27cec/src/header/signal/mod.rs#L188)
- [sigaltstack function](https://gitlab.redox-os.org/redox-os/relibc/-/blob/f1772c4bb829e02742275e655d349dda02b27cec/src/header/signal/mod.rs#L346)
- [SS_ONSTACK constant](https://gitlab.redox-os.org/redox-os/relibc/-/blob/f1772c4bb829e02742275e655d349dda02b27cec/src/header/signal/constants.rs#L131)
- [SS_DISABLE constant](https://gitlab.redox-os.org/redox-os/relibc/-/blob/f1772c4bb829e02742275e655d349dda02b27cec/src/header/signal/constants.rs#L133)
- [pid_t type](https://gitlab.redox-os.org/redox-os/relibc/-/blob/f1772c4bb829e02742275e655d349dda02b27cec/src/header/bits_pid-t/mod.rs#L5)

These changes, when released in a stable 0.2.x release, will allow us to use upstream libc for compiling wasmtime natively on Redox.

Edited to add the following:
- [ucontext struct](https://gitlab.redox-os.org/redox-os/relibc/-/blob/e596d08aeaf43f90b18b961c1155d1c1e3eea416/src/header/signal/redox.rs#L48)
- [ucontext_t pub type pointing to ucontext](https://gitlab.redox-os.org/redox-os/relibc/-/blob/e596d08aeaf43f90b18b961c1155d1c1e3eea416/src/header/signal/redox.rs#L42)
- [mcontext struct x86_64](https://gitlab.redox-os.org/redox-os/relibc/-/blob/e596d08aeaf43f90b18b961c1155d1c1e3eea416/src/header/signal/redox.rs#L82)
- [mcontext struct x86](https://gitlab.redox-os.org/redox-os/relibc/-/blob/e596d08aeaf43f90b18b961c1155d1c1e3eea416/src/header/signal/redox.rs#L74)
- [mcontext struct aarch64](https://gitlab.redox-os.org/redox-os/relibc/-/blob/e596d08aeaf43f90b18b961c1155d1c1e3eea416/src/header/signal/redox.rs#L107)
- [mcontext struct riscv64](https://gitlab.redox-os.org/redox-os/relibc/-/blob/e596d08aeaf43f90b18b961c1155d1c1e3eea416/src/header/signal/redox.rs#L113)
- [mcontext_t pub type pointing to mcontext struct](https://gitlab.redox-os.org/redox-os/relibc/-/blob/e596d08aeaf43f90b18b961c1155d1c1e3eea416/src/header/signal/redox.rs#L44)
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Aug 31, 2026

@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! I added a commit fixing the spacing for this and a few existing structs.

I'm not sure what the protocol is regarding marking conversations as resolved. Is that something I should do or the reviewer?

Different reviewers have different preferences but I prefer to resolve them myself, so I have a list of what I need to look at.

View changes since this review

@tgross35
tgross35 added this pull request to the merge queue Aug 31, 2026
@tgross35
tgross35 removed this pull request from the merge queue due to a manual request Aug 31, 2026
@tgross35
tgross35 enabled auto-merge August 31, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-redox 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.

5 participants