Enough driver support to link an empty program on linux. Will

try to update the Makefiles to use it.
This commit is contained in:
Rafael Ávila de Espíndola 2011-06-13 16:08:07 -04:00
parent 913383d775
commit eb811a903f

View file

@ -421,8 +421,20 @@ fn main(vec[str] args) {
compile_input(sess, env, ifile, ofile); compile_input(sess, env, ifile, ofile);
} }
case (some(?ofile)) { case (some(?ofile)) {
// FIXME: what about windows? This will create a foo.exe.o.
saved_out_filename = ofile; saved_out_filename = ofile;
compile_input(sess, env, ifile, ofile); auto temp_filename;
alt (sopts.output_type) {
case (link::output_type_exe) {
// FIXME: what about shared?
temp_filename = ofile + ".o";
}
case (_) {
temp_filename = ofile;
}
}
compile_input(sess, env, ifile, temp_filename);
} }
} }
@ -431,11 +443,10 @@ fn main(vec[str] args) {
// //
// TODO: Factor this out of main. // TODO: Factor this out of main.
if (sopts.output_type == link::output_type_exe) { if (sopts.output_type == link::output_type_exe) {
auto binary_dir = fs::dirname(binary);
//FIXME: Should we make the 'stage3's variable here? let str glu = binary_dir + "/glue.o";
let str glu = "stage3/glue.o";
let str main = "rt/main.o"; let str main = "rt/main.o";
let str stage = "-Lstage3"; let str stage = "-L" + binary_dir;
let vec[str] gcc_args; let vec[str] gcc_args;
let str prog = "gcc"; let str prog = "gcc";
let str exe_suffix = ""; let str exe_suffix = "";