Skip to content

Commit 7f4e3e1

Browse files
committed
---
yaml --- r: 5824 b: refs/heads/master c: b42e551 h: refs/heads/master v: v3
1 parent 3a433aa commit 7f4e3e1

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: ad5014bf4c81fdfd6c382d2f2df1e9f824787dde
2+
refs/heads/master: b42e551285541a1634b0e5fd731109f74a4f9ef7

trunk/src/comp/back/link.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,14 @@ fn link_binary(sess: session::session,
582582
gcc_args += ["-lm", main];
583583
}
584584

585-
gcc_args += ["-lrustrt", "-lrt"];
585+
// On linux librt is an indirect dependency via rustrt,
586+
// and binutils 2.22+ won't add it automatically
587+
if sess.get_targ_cfg().os == session::os_linux {
588+
gcc_args += ["-lrt"];
589+
}
590+
591+
// Always want the runtime linked in
592+
gcc_args += ["-lrustrt"];
586593

587594
gcc_args += rpath::get_rpath_flags(sess, saved_out_filename);
588595

0 commit comments

Comments
 (0)