diff --git a/src/redox/mod.rs b/src/redox/mod.rs
index ac0ae00bce10d63936fcc5ab42b307df9a6ad27f..cedf42be201c4cf6e0bd3085a32f22cb49bf1597 100644
--- a/src/redox/mod.rs
+++ b/src/redox/mod.rs
@@ -377,8 +377,12 @@ extern {
                  -> ::ssize_t;
 }
 
-#[link(name = "c")]
-#[link(name = "m")]
+
+#[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 {}
 
 pub use self::net::*;