Skip to content

Commit bfc3d31

Browse files
committed
Don't link with libdl on musl
On musl dlopen is part of libc and there's no separate libdl. Signed-off-by: Marcel Guzik <marcel.guzik@inetum.com>
1 parent f4ec9e7 commit bfc3d31

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎src/os/unix/mod.rs‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,13 @@ impl<T> fmt::Debug for Symbol<T> {
466466
}
467467

468468
// Platform specific things
469-
#[cfg_attr(any(target_os = "linux", target_os = "android"), link(name = "dl"))]
469+
#[cfg_attr(
470+
all(
471+
any(target_os = "linux", target_os = "android"),
472+
not(target_env = "musl")
473+
),
474+
link(name = "dl")
475+
)]
470476
#[cfg_attr(any(target_os = "freebsd", target_os = "dragonfly"), link(name = "c"))]
471477
extern "C" {
472478
fn dlopen(filename: *const raw::c_char, flags: raw::c_int) -> *mut raw::c_void;

0 commit comments

Comments
 (0)