rustc: Add comments about linking to libm

This commit is contained in:
Brian Anderson 2012-06-06 12:42:56 -07:00
parent b54c76c832
commit 9975ad073a

View File

@ -636,7 +636,12 @@ fn link_binary(sess: session,
// On linux librt and libdl are an indirect dependencies via rustrt, // On linux librt and libdl are an indirect dependencies via rustrt,
// and binutils 2.22+ won't add them automatically // and binutils 2.22+ won't add them automatically
if sess.targ_cfg.os == session::os_linux { if sess.targ_cfg.os == session::os_linux {
cc_args += ["-lrt", "-ldl", "-lm"]; cc_args += ["-lrt", "-ldl"];
// LLVM implements the `frem` instruction as a call to `fmod`,
// which lives in libm. Similar to above, on some linuxes we
// have to be explicit about linking to it. See #2510
cc_args += ["-lm"];
} }
if sess.targ_cfg.os == session::os_freebsd { if sess.targ_cfg.os == session::os_freebsd {