x11-rs icon indicating copy to clipboard operation
x11-rs copied to clipboard

Musl target builds

Open skyne98 opened this issue 6 years ago • 3 comments

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!

skyne98 avatar Feb 12 '19 21:02 skyne98

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

cloudhead avatar Aug 17 '19 21:08 cloudhead

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

cloudhead avatar Aug 18 '19 07:08 cloudhead

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: https://github.com/orhun/menyoki/issues/17

orhun avatar Dec 26 '21 21:12 orhun