File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4848 - name : Compile without the standard library
4949 run : cargo clean && cargo +nightly build -Zbuild-std=core,alloc --no-default-features
5050
51+ musl-rust-lld-link-test :
52+ runs-on : ubuntu-latest
53+ # This test checks if binaries using libloading can be linked using rust-lld linker for target environments that
54+ # provide a unified libc (e.g. musl) without needing to provide additional library paths to the linker.
55+ steps :
56+ - uses : actions/checkout@v4
57+ - run : rustup install stable --profile=minimal
58+ - run : rustup target add x86_64-unknown-linux-musl
59+ - run : RUSTFLAGS="-Clinker=rust-lld" cargo build --target=x86_64-unknown-linux-musl --example e1
60+
5161 windows-test :
5262 runs-on : windows-latest
5363 strategy :
Original file line number Diff line number Diff line change 1+ fn main ( ) {
2+ unsafe {
3+ libloading:: Library :: new ( "libc.so" ) . unwrap ( ) ;
4+ }
5+ }
Original file line number Diff line number Diff line change @@ -479,7 +479,14 @@ impl<T> fmt::Debug for Symbol<T> {
479479}
480480
481481// Platform specific things
482- #[ cfg_attr( any( target_os = "linux" , target_os = "android" ) , link( name = "dl" ) ) ]
482+ #[ cfg_attr(
483+ any(
484+ all( target_os = "linux" , not( target_env = "musl" ) ) ,
485+ target_os = "android"
486+ ) ,
487+ link( name = "dl" )
488+ ) ]
489+ #[ cfg_attr( all( target_os = "linux" , target_env = "musl" ) , link( name = "c" ) ) ]
483490#[ cfg_attr( any( target_os = "freebsd" , target_os = "dragonfly" ) , link( name = "c" ) ) ]
484491extern "C" {
485492 fn dlopen (
You can’t perform that action at this time.
0 commit comments