Skip to content

Commit eb811a9

Browse files
committed
Enough driver support to link an empty program on linux. Will
try to update the Makefiles to use it.
1 parent 913383d commit eb811a9

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/comp/driver/rustc.rs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,20 @@ fn main(vec[str] args) {
421421
compile_input(sess, env, ifile, ofile);
422422
}
423423
case (some(?ofile)) {
424+
// FIXME: what about windows? This will create a foo.exe.o.
424425
saved_out_filename = ofile;
425-
compile_input(sess, env, ifile, ofile);
426+
auto temp_filename;
427+
alt (sopts.output_type) {
428+
case (link::output_type_exe) {
429+
// FIXME: what about shared?
430+
temp_filename = ofile + ".o";
431+
}
432+
case (_) {
433+
temp_filename = ofile;
434+
}
435+
}
436+
437+
compile_input(sess, env, ifile, temp_filename);
426438
}
427439
}
428440

@@ -431,11 +443,10 @@ fn main(vec[str] args) {
431443
//
432444
// TODO: Factor this out of main.
433445
if (sopts.output_type == link::output_type_exe) {
434-
435-
//FIXME: Should we make the 'stage3's variable here?
436-
let str glu = "stage3/glue.o";
446+
auto binary_dir = fs::dirname(binary);
447+
let str glu = binary_dir + "/glue.o";
437448
let str main = "rt/main.o";
438-
let str stage = "-Lstage3";
449+
let str stage = "-L" + binary_dir;
439450
let vec[str] gcc_args;
440451
let str prog = "gcc";
441452
let str exe_suffix = "";

0 commit comments

Comments
 (0)