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

std lib build broken for uclibc #95866

Closed
asomers opened this issue Apr 9, 2022 · 8 comments
Closed

std lib build broken for uclibc #95866

asomers opened this issue Apr 9, 2022 · 8 comments
Labels
C-bug Category: This is a bug.

Comments

@asomers
Copy link
Contributor

asomers commented Apr 9, 2022

Commit 33fd73f appears to have broken the build for uclibc. This command fails:

cargo +nightly check -Zbuild-std --target armv7-unknown-linux-uclibceabihf
...
error[E0599]: no method named `si_addr` found for struct `siginfo_t` in the current scope
  --> /usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/stack_overflow.rs:84:28
   |
84 |         let addr = (*info).si_addr() as usize;
   |                            ^^^^^^^ method not found in `siginfo_t`

The problem is that libc does not define that field for uclibc. Whether that's an oversight in libc, or whether uclibc itself doesn't define that field, I don't know.

@asomers asomers added the C-bug Category: This is a bug. label Apr 9, 2022
asomers added a commit to nix-rust/nix that referenced this issue Apr 9, 2022
@asomers
Copy link
Contributor Author

asomers commented Apr 9, 2022

@skrap can you figure out whether the problem is in libc or uclibc itself?

@name1e5s
Copy link
Contributor

name1e5s commented Apr 10, 2022

@skrap can you figure out whether the problem is in libc or uclibc itself?

It seems that libc doesn't implement fn si_addr in siginfo_t for uclibc, maybe we should partially revert #95688

asomers added a commit to nix-rust/nix that referenced this issue Apr 10, 2022
asomers added a commit to nix-rust/nix that referenced this issue Apr 10, 2022
asomers added a commit to nix-rust/nix that referenced this issue Apr 10, 2022
asomers added a commit to nix-rust/nix that referenced this issue Apr 10, 2022
@skrap
Copy link
Contributor

skrap commented Apr 11, 2022

@skrap can you figure out whether the problem is in libc or uclibc itself?

It seems that libc doesn't implement fn si_addr in siginfo_t for uclibc, maybe we should partially revert #95688

I'll have a look! Thanks for the CC!

@skrap
Copy link
Contributor

skrap commented Apr 11, 2022

Looks like @pfmooney has a good-looking PR out to add those accessors into libc!

bors added a commit to rust-lang/libc that referenced this issue Apr 12, 2022
Add siginfo accessors for uclibc

With rust-lang/rust#95688 switching to the libc-provided `si_addr()` accessor on `siginfo_t`, it became apparent that the uclibc target was lacking that implementation (see rust-lang/rust#95866).

It would be nice to provide the same accessor in uclibc as the other UNIX-y platforms.

CC: `@asomers` `@name1e5s` `@skrap` - If you have a testing env for this, could you try it out?
@pfmooney
Copy link
Contributor

After the next release of libc, whenever that may be, the change from the now-integrated rust-lang/libc#2750 should help address this. A stopgap fix might be justified in the mean time.

@asomers
Copy link
Contributor Author

asomers commented Apr 19, 2022

libc just released 0.2.124 , and I can build std for uclibc again.

@skrap
Copy link
Contributor

skrap commented May 2, 2022

OK, so we just need to bump the libc version in rust. Unless someone objects, I'll submit a PR to rust later today to bump the libc version.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue May 6, 2022
bump libc version for uclibc fixes

closes rust-lang#95866

The required functions have been added to libc in rust-lang/libc#2750.  That change made it into libc 0.2.124, but this just takes the latest libc.
@JohnTitor
Copy link
Member

The libc version has been updated in #96510, closing as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants