diff --git a/src/redox/mod.rs b/src/redox/mod.rs
index ac0ae00bce10d63936fcc5ab42b307df9a6ad27f..0d2cacc27b2ec64282ccf0d233e20cc7ccd8b332 100644
--- a/src/redox/mod.rs
+++ b/src/redox/mod.rs
@@ -377,8 +377,11 @@ 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::*;