]> git.lizzy.rs Git - rust.git/blob - src/libstd/rtdeps.rs
std: Push process stdio setup in std::sys
[rust.git] / src / libstd / rtdeps.rs
1 // Copyright 2013-2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 //! This module contains the linkage attributes to all runtime dependencies of
12 //! the standard library This varies per-platform, but these libraries are
13 //! necessary for running libstd.
14
15 // LLVM implements the `frem` instruction as a call to `fmod`, which lives in
16 // libm. Hence, we must explicitly link to it.
17 //
18 // On Linux, librt and libdl are indirect dependencies via std,
19 // and binutils 2.22+ won't add them automatically
20 #[cfg(all(target_os = "linux", not(target_env = "musl")))]
21 #[link(name = "dl")]
22 #[link(name = "pthread")]
23 extern {}
24
25 #[cfg(target_os = "android")]
26 #[link(name = "dl")]
27 #[link(name = "log")]
28 extern {}
29
30 #[cfg(target_os = "freebsd")]
31 #[link(name = "execinfo")]
32 #[link(name = "pthread")]
33 extern {}
34
35 #[cfg(any(target_os = "dragonfly",
36           target_os = "bitrig",
37           target_os = "netbsd",
38           target_os = "openbsd"))]
39 #[link(name = "pthread")]
40 extern {}
41
42 #[cfg(target_os = "solaris")]
43 #[link(name = "socket")]
44 #[link(name = "posix4")]
45 #[link(name = "pthread")]
46 extern {}
47
48 // For PNaCl targets, nacl_io is a Pepper wrapper for some IO functions
49 // missing (ie always error) in Newlib.
50 #[cfg(all(target_os = "nacl", not(test)))]
51 #[link(name = "nacl_io", kind = "static")]
52 #[link(name = "c++", kind = "static")] // for `nacl_io` and EH.
53 #[link(name = "pthread", kind = "static")]
54 extern {}
55
56 #[cfg(target_os = "macos")]
57 #[link(name = "System")]
58 extern {}
59
60 #[cfg(target_os = "ios")]
61 #[link(name = "System")]
62 extern {}