rust-overlay icon indicating copy to clipboard operation
rust-overlay copied to clipboard

musl-based toolchains are missing libgcc runtime dependency

Open aaronmondal opened this issue 1 year ago • 0 comments

The pkgs.pkgsMusl.rust-bin.xxx toolchains mostly work fine, but (at least) rustdoc and cargo clippy instacrash with a missing libgcc_s.so.1. It seems like the musl stdenvs don't ship the libgcc package which supplies libgcc_s.so.1. This makes sense, but apparently the musl rust linux binaries were built against a dynamically linked libgcc_s.

The changes from https://github.com/oxalica/rust-overlay/issues/121 don't seem to work in this case.

This also affects pkgsCross.musl64.

On x86_64-unknown-linux-gnu, something that kinda-sorta works around the issue is adding LD_LIBRARY_PATH=${pkgs.pkgsMusl.libgcc} to a devShell. But that breaks all other non-musl packages as they expect a libgcc_s built against glibc.

Is there some way to explicitly add the libgcc runtime dependency? If possible I'd like to avoid pkgsStatic as it looks like that's not a cached package set and would incur massive upfront compilation of a static GCC toolchain.

Noticed in https://github.com/TraceMachina/nativelink/pull/749

cc @RaitoBezarius

aaronmondal avatar Mar 11 '24 04:03 aaronmondal