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

"cannot find value REG_EIP in crate libc" when targetting i686-unknown-linux-musl #2787

Open
victorpaleologue opened this issue May 11, 2022 · 0 comments
Labels
C-bug Category: bug O-musl

Comments

@victorpaleologue
Copy link

victorpaleologue commented May 11, 2022

Trying to build wasmtime for the i686-unknown-linux-musl target leads to the following error:

error[E0425]: cannot find value `REG_EIP` in crate `libc`
   --> /Users/victor.paleologue/.cargo/registry/src/github.com-1ecc6299db9ec823/wasmtime-runtime-0.33.1/src/traphandlers/unix.rs:173:40
    |
173 |             cx.uc_mcontext.gregs[libc::REG_EIP as usize] as *const u8
    |                                        ^^^^^^^ not found in `libc`

error[E0609]: no field `gregs` on type `mcontext_t`
   --> /Users/victor.paleologue/.cargo/registry/src/github.com-1ecc6299db9ec823/wasmtime-runtime-0.33.1/src/traphandlers/unix.rs:173:28
    |
173 |             cx.uc_mcontext.gregs[libc::REG_EIP as usize] as *const u8
    |                            ^^^^^ unknown field

It seems libc is lacking few elements for this target platform specifically.

Specific steps to reproduce the issue on a Mac M1:

brew tap messense/macos-cross-toolchains
brew install i686-unknown-linux-musl
rustup target add i686-unknown-linux-musl
git clone git@github.com:bytecodealliance/wasmtime.git --recurse-submodules
cd wasmtime
CC_i686_unknown_linux_musl=/opt/homebrew/Cellar/i686-unknown-linux-musl/11.2.0/bin/i686-unknown-linux-musl-gcc CXX_i686_unknown_linux_musl=/opt/homebrew/Cellar/i686-unknown-linux-musl/11.2.0/bin/i686-unknown-linux-musl-g++ AR_i686_unknown_linux_musl=/opt/homebrew/Cellar/i686-unknown-linux-musl/11.2.0/bin/i686-unknown-linux-musl-ar CARGO_TARGET_I686_UNKNOWN_LINUX_MUSL_LINKER=/opt/homebrew/Cellar/i686-unknown-linux-musl/11.2.0/bin/i686-unknown-linux-musl-gcc cargo build --target i686-unknown-linux-musl
@victorpaleologue victorpaleologue added the C-bug Category: bug label May 11, 2022
victorpaleologue added a commit to semio-ai/rust-lang-libc that referenced this issue May 11, 2022
bors added a commit that referenced this issue May 12, 2022
Complete i686-unknown-linux-musl ucontext_t #2787

Fix for #2787
bors added a commit that referenced this issue Aug 29, 2022
Complete i686-unknown-linux-musl ucontext_t #2787

Fix #2787
bors added a commit that referenced this issue Aug 31, 2022
Complete i686-unknown-linux-musl ucontext_t #2787

Fix #2787
bors added a commit that referenced this issue Sep 2, 2022
Complete i686-unknown-linux-musl ucontext_t #2787

Fix #2787
victorpaleologue added a commit to semio-ai/rust-lang-libc that referenced this issue Sep 2, 2022
bors added a commit that referenced this issue Sep 2, 2022
Complete i686-unknown-linux-musl ucontext_t #2787

Fix #2787
victorpaleologue added a commit to semio-ai/rust-lang-libc that referenced this issue Sep 2, 2022
bors added a commit that referenced this issue Sep 2, 2022
Complete i686-unknown-linux-musl ucontext_t #2787

Fix #2787
bors added a commit that referenced this issue Sep 2, 2022
Complete i686-unknown-linux-musl ucontext_t #2787

Fix #2787
victorpaleologue added a commit to semio-ai/rust-lang-libc that referenced this issue Sep 5, 2022
bors added a commit that referenced this issue Sep 5, 2022
Complete i686-unknown-linux-musl ucontext_t #2787

Fix #2787
victorpaleologue added a commit to semio-ai/rust-lang-libc that referenced this issue Sep 5, 2022
bors added a commit that referenced this issue Sep 5, 2022
Complete i686-unknown-linux-musl ucontext_t #2787

Fix #2787
victorpaleologue added a commit to semio-ai/rust-lang-libc that referenced this issue Sep 6, 2022
bors added a commit that referenced this issue Sep 6, 2022
Complete i686-unknown-linux-musl ucontext_t #2787

Fix #2787
victorpaleologue added a commit to semio-ai/rust-lang-libc that referenced this issue Sep 6, 2022
bors added a commit that referenced this issue Sep 6, 2022
Complete i686-unknown-linux-musl ucontext_t #2787

Fix #2787
victorpaleologue added a commit to semio-ai/rust-lang-libc that referenced this issue Sep 6, 2022
bors added a commit that referenced this issue Sep 6, 2022
Complete i686-unknown-linux-musl ucontext_t #2787

Fix #2787
bors added a commit that referenced this issue Sep 7, 2022
Complete i686-unknown-linux-musl ucontext_t #2787

Fix #2787
victorpaleologue added a commit to semio-ai/rust-lang-libc that referenced this issue Oct 3, 2022
bors added a commit that referenced this issue Oct 3, 2022
Complete i686-unknown-linux-musl ucontext_t #2787

Fix #2787
bors added a commit that referenced this issue Mar 23, 2023
Complete i686-unknown-linux-musl ucontext_t #2787

Fix #2787
bors added a commit that referenced this issue Mar 23, 2023
Complete i686-unknown-linux-musl ucontext_t #2787

Fix #2787
victorpaleologue added a commit to semio-ai/rust-lang-libc that referenced this issue Mar 23, 2023
victorpaleologue added a commit to semio-ai/rust-lang-libc that referenced this issue Apr 5, 2023
bors added a commit that referenced this issue Apr 5, 2023
Complete i686-unknown-linux-musl ucontext_t #2787

Fix #2787
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug O-musl
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants