Skip to content

Commit

Permalink
Little experiment rust-lang#2
Browse files Browse the repository at this point in the history
  • Loading branch information
operutka committed Dec 22, 2020
1 parent 0b56e54 commit 78c1089
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,11 @@ pub const ATF_USETRAILERS: ::c_int = 0x10;
cfg_if! {
if #[cfg(target_os = "l4re")] {
// required libraries for L4Re are linked externally, ATM
panic!("match l4re");
} else if #[cfg(feature = "std")] {
// cargo build, don't pull in anything extra as the libstd dep
// already pulls in all libs.
panic!("match std");
} else if #[cfg(all(target_os = "linux",
any(target_env = "gnu", target_env = "uclibc"),
target_env = "gnu",
feature = "rustc-dep-of-std"))] {
#[link(name = "util", kind = "static-nobundle",
cfg(target_feature = "crt-static"))]
Expand All @@ -326,15 +324,40 @@ cfg_if! {
#[link(name = "dl", cfg(not(target_feature = "crt-static")))]
#[link(name = "c", cfg(not(target_feature = "crt-static")))]
extern {}
panic!("match gnu/uclibc");
} else if #[cfg(all(target_os = "linux",
target_env = "uclibc",
feature = "rustc-dep-of-std"))] {
#[link(name = "util", kind = "static-nobundle",
cfg(target_feature = "crt-static"))]
#[link(name = "rt", kind = "static-nobundle",
cfg(target_feature = "crt-static"))]
#[link(name = "pthread", kind = "static-nobundle",
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",
cfg(target_feature = "crt-static"))]
#[link(name = "gcc", kind = "static-nobundle",
cfg(target_feature = "crt-static"))]
#[link(name = "util", cfg(not(target_feature = "crt-static")))]
#[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 {}
panic!("match uclibc");
} else if #[cfg(target_env = "musl")] {
#[cfg_attr(feature = "rustc-dep-of-std",
link(name = "c", kind = "static",
cfg(target_feature = "crt-static")))]
#[cfg_attr(feature = "rustc-dep-of-std",
link(name = "c", cfg(not(target_feature = "crt-static"))))]
extern {}
panic!("match musl");
} else if #[cfg(target_os = "emscripten")] {
#[link(name = "c")]
extern {}
Expand Down

0 comments on commit 78c1089

Please sign in to comment.