Open
Description
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