Skip to content

Commit 9ed82c7

Browse files
committed
libc: link to libc and libm
1 parent 9706372 commit 9ed82c7

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/liblibc/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ pub use funcs::posix88::unistd::{execv, execve, execvp, getcwd};
197197
pub use funcs::posix88::unistd::{getpid, isatty, lseek, pipe, read};
198198
pub use funcs::posix88::unistd::{rmdir, unlink, write};
199199

200+
#[cfg(not(windows))]
201+
#[link(name = "c")]
202+
#[link(name = "m")]
203+
extern {}
204+
200205
/// A wrapper for a nullable pointer. Don't use this except for interacting
201206
/// with libc. Basically Option, but without the dependance on libstd.
202207
// If/when libprim happens, this can be removed in favor of that

src/librustc/middle/trans/context.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ use util::sha2::Sha256;
2929
use util::nodemap::{NodeMap, NodeSet, DefIdMap};
3030

3131
use libc::c_uint;
32-
use collections::{HashMap, HashSet};
3332
use std::cell::{Cell, RefCell};
3433
use std::c_str::ToCStr;
3534
use std::ptr;

src/libstd/rtdeps.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,13 @@ extern {}
2222
// On linux librt and libdl are indirect dependencies via rustrt,
2323
// and binutils 2.22+ won't add them automatically
2424
#[cfg(target_os = "linux")]
25-
#[link(name = "c")]
2625
#[link(name = "dl")]
27-
#[link(name = "m")]
2826
#[link(name = "pthread")]
2927
extern {}
3028

3129
#[cfg(target_os = "android")]
3230
#[link(name = "dl")]
3331
#[link(name = "log")]
34-
#[link(name = "m")]
35-
#[link(name = "c")]
3632
extern {}
3733

3834
#[cfg(target_os = "freebsd")]

0 commit comments

Comments
 (0)