Only link librt on linux

This commit is contained in:
Brian Anderson 2011-10-16 02:36:42 -07:00
parent ad5014bf4c
commit b42e551285

View File

@ -582,7 +582,14 @@ fn link_binary(sess: session::session,
gcc_args += ["-lm", main];
}
gcc_args += ["-lrustrt", "-lrt"];
// On linux librt is an indirect dependency via rustrt,
// and binutils 2.22+ won't add it automatically
if sess.get_targ_cfg().os == session::os_linux {
gcc_args += ["-lrt"];
}
// Always want the runtime linked in
gcc_args += ["-lrustrt"];
gcc_args += rpath::get_rpath_flags(sess, saved_out_filename);