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

Musl target builds #96

Open
skyne98 opened this issue Feb 12, 2019 · 3 comments
Open

Musl target builds #96

skyne98 opened this issue Feb 12, 2019 · 3 comments

Comments

@skyne98
Copy link

skyne98 commented Feb 12, 2019

Hey there! Thanks for your awesome work, guys!

However, I have an issue building the crate for a linux-musl target while building any of the gfx-rs projects.
Here is the error message:

error: failed to run custom build command for `x11 v2.18.1`
process didn't exit successfully: `/home/fox/Documents/Development/Temp/gfx/target/release/build/x11-e03f3f938e7478ea/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: CrossCompilation', src/libcore/result.rs:997:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed

Is there anything that can be done on my side?

Thanks!

@cloudhead
Copy link

Hello, any news on this? Also trying to cross compile and getting the same error :(

@cloudhead
Copy link

Ok, this is fixed by running the build with PKG_CONFIG_ALLOW_CROSS=1

https://docs.rs/pkg-config/0.3.15/pkg_config/enum.Error.html#variant.CrossCompilation

@orhun
Copy link

orhun commented Dec 26, 2021

I can build my project for Musl by setting PKG_CONFIG_ALLOW_CROSS=1 but the binary doesn't run as expected.

$ target/x86_64-unknown-linux-musl/debug/menyoki
bash: target/x86_64-unknown-linux-musl/debug/menyoki: No such file or directory

It is probably due to the binary being dynamically linked:

$ file target/x86_64-unknown-linux-musl/debug/menyoki
target/x86_64-unknown-linux-musl/debug/menyoki: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld64.so.1, BuildID[sha1]=92e319447b2ab64c38473c96b5b90ba09afe30ee, with debug_info, not stripped

You can also see it from the readelf output:

$ readelf -a target/x86_64-unknown-linux-musl/debug/menyoki | grep interpreter
      [Requesting program interpreter: /lib/ld64.so.1]

I appreciate any kind of help here. Related issue: orhun/menyoki#17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants