Skip to content

Commit 1af829c

Browse files
committed
ci: add build test for musl libc & rust-lld
1 parent cfbd235 commit 1af829c

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/libloading.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@ jobs:
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:

examples/e1.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fn main() {
2+
unsafe {
3+
libloading::Library::new("libc.so").unwrap();
4+
}
5+
}

0 commit comments

Comments
 (0)