diff options
author | Josh Triplett <josh@joshtriplett.org> | 2020-09-19 20:46:25 -0700 |
---|---|---|
committer | Josh Triplett <josh@joshtriplett.org> | 2020-09-21 01:15:03 -0700 |
commit | 5bf6ee5d8e06aea64a2b20c47afe5062da1a7848 (patch) | |
tree | 2a5adbc4f10bd6bd5525ca0ffaab7f5acf0829b0 | |
parent | e005f4cad598c7278dfcef52ac7cbe1203c963f2 (diff) | |
download | rust-libc-5bf6ee5d8e06aea64a2b20c47afe5062da1a7848.tar.gz |
Consolidate handling of libdl, and handle crt-static
Move the link line for `libdl` up to `src/unix/mod.rs`, making it easier
to see all the libraries `libc` links to.
This also makes `libdl` respect `target-feature=+crt-static`.
-rw-r--r-- | src/unix/linux_like/linux/gnu/mod.rs | 1 | ||||
-rw-r--r-- | src/unix/mod.rs | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs index 9ea34dec38..6ead42fee6 100644 --- a/src/unix/linux_like/linux/gnu/mod.rs +++ b/src/unix/linux_like/linux/gnu/mod.rs @@ -1435,7 +1435,6 @@ extern "C" { ) -> ::c_int; } -#[link(name = "dl")] extern "C" { pub fn dlmopen( lmid: Lmid_t, diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 32e8d932bb..21439c8a49 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -309,6 +309,8 @@ cfg_if! { cfg(target_feature = "crt-static"))] #[link(name = "m", kind = "static-nobundle", cfg(target_feature = "crt-static"))] + #[link(name = "dl", kind = "static-nobundle", + cfg(target_feature = "crt-static"))] #[link(name = "c", kind = "static-nobundle", cfg(target_feature = "crt-static"))] #[link(name = "gcc_eh", kind = "static-nobundle", @@ -319,6 +321,7 @@ cfg_if! { #[link(name = "rt", cfg(not(target_feature = "crt-static")))] #[link(name = "pthread", cfg(not(target_feature = "crt-static")))] #[link(name = "m", cfg(not(target_feature = "crt-static")))] + #[link(name = "dl", cfg(not(target_feature = "crt-static")))] #[link(name = "c", cfg(not(target_feature = "crt-static")))] extern {} } else if #[cfg(target_env = "musl")] { |