Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy structs from bits/user.h for musl x86_64 #1488

Merged
merged 3 commits into from
Sep 7, 2019

Conversation

loganwendholt
Copy link
Contributor

While statically compiling a binary with musl, I ran into the following error regarding a missing struct:

error[E0412]: cannot find type `user_regs_struct` in crate `libc`
  --> src/debug.rs:37:32
   |
37 | fn show_user_regs(regs: &libc::user_regs_struct) -> String {
   |                                ^^^^^^^^^^^^^^^^ not found in `libc`

This struct was previously added for glibc in #599, but was never added to musl, despite the data format being the same in both.

This fix simply copies user_regs_struct into the proper location within the musl files.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @gnzlbg (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@gnzlbg
Copy link
Contributor

gnzlbg commented Aug 23, 2019

Looks like the type definition does not match the C one for musl on some targets.

@loganwendholt loganwendholt changed the title Add user_regs_struct for musl x86_64 Copy structs from bits/user.h for musl x86_64 Aug 23, 2019
@loganwendholt
Copy link
Contributor Author

Type definitions should all be correct now.

@gnzlbg
Copy link
Contributor

gnzlbg commented Aug 24, 2019

@bors: r+

@bors
Copy link
Contributor

bors commented Aug 24, 2019

📌 Commit 9883697 has been approved by gnzlbg

@bors
Copy link
Contributor

bors commented Aug 24, 2019

⌛ Testing commit 9883697 with merge d033b45...

bors added a commit that referenced this pull request Aug 24, 2019
Copy structs from bits/user.h for musl x86_64

While statically compiling a binary with `musl`, I ran into the following error regarding a missing struct:

```
error[E0412]: cannot find type `user_regs_struct` in crate `libc`
  --> src/debug.rs:37:32
   |
37 | fn show_user_regs(regs: &libc::user_regs_struct) -> String {
   |                                ^^^^^^^^^^^^^^^^ not found in `libc`
```

This struct was previously added for `glibc` in #599, but was never added to `musl`, despite the data format being the same in both.

This fix simply copies `user_regs_struct` into the proper location within the `musl` files.
@bors
Copy link
Contributor

bors commented Aug 24, 2019

💔 Test failed - checks-cirrus-freebsd-12

@loganwendholt
Copy link
Contributor Author

I'm a bit stumped on this one. Looks like the homu test has two build scripts that fail: rand_chacha v0.1.1 and rand_pcg v0.1.2. This is strange to me for two reasons:

  1. This test is using nightly x86_64-unknown-freebsd-12, while the code change in the PR is specific to musl targets. It's not clear to me why the change should impact any of the FreeBSD targets at all.

  2. In the other nightly x86_64-unknown-freebsd-12 test, these same two packages built successfully. So why are they failing in the homu test?

@gnzlbg
Copy link
Contributor

gnzlbg commented Aug 24, 2019

It's not this PR fault, see #1489

@loganwendholt
Copy link
Contributor Author

loganwendholt commented Sep 6, 2019

@gnzlbg since the current CI failure is unrelated to this change, are we okay to move forward?

@gnzlbg
Copy link
Contributor

gnzlbg commented Sep 7, 2019

@bors: r+

@bors
Copy link
Contributor

bors commented Sep 7, 2019

💡 This pull request was already approved, no need to approve it again.

  • This pull request previously failed. You should add more commits to fix the bug, or use retry to trigger a build again.
  • There's another pull request that is currently being tested, blocking this pull request: Remove WASI Core API #1461

@bors
Copy link
Contributor

bors commented Sep 7, 2019

📌 Commit 9883697 has been approved by gnzlbg

@bors
Copy link
Contributor

bors commented Sep 7, 2019

⌛ Testing commit 9883697 with merge 71e298f...

bors added a commit that referenced this pull request Sep 7, 2019
Copy structs from bits/user.h for musl x86_64

While statically compiling a binary with `musl`, I ran into the following error regarding a missing struct:

```
error[E0412]: cannot find type `user_regs_struct` in crate `libc`
  --> src/debug.rs:37:32
   |
37 | fn show_user_regs(regs: &libc::user_regs_struct) -> String {
   |                                ^^^^^^^^^^^^^^^^ not found in `libc`
```

This struct was previously added for `glibc` in #599, but was never added to `musl`, despite the data format being the same in both.

This fix simply copies `user_regs_struct` into the proper location within the `musl` files.
@bors
Copy link
Contributor

bors commented Sep 7, 2019

☀️ Test successful - checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, status-azure
Approved by: gnzlbg
Pushing 71e298f to master...

@bors bors merged commit 9883697 into rust-lang:master Sep 7, 2019
@loganwendholt loganwendholt deleted the user-regs branch September 12, 2019 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants