about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRafael Ávila de Espíndola <respindola@mozilla.com>2011-06-13 16:08:07 -0400
committerRafael Ávila de Espíndola <respindola@mozilla.com>2011-06-13 16:08:07 -0400
commiteb811a903fb1856203a8e2233efe50cd36d2e5b4 (patch)
tree52c8e682c7936714023582aa5a937d58ce16dbe8
parent913383d7755e5336c29314ea36760e07353e9983 (diff)
downloadrust-eb811a903fb1856203a8e2233efe50cd36d2e5b4.tar.gz
rust-eb811a903fb1856203a8e2233efe50cd36d2e5b4.zip
Enough driver support to link an empty program on linux. Will
try to update the Makefiles to use it.
-rw-r--r--src/comp/driver/rustc.rs21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs
index a35a07d78fe..6b1a8d395ee 100644
--- a/src/comp/driver/rustc.rs
+++ b/src/comp/driver/rustc.rs
@@ -421,8 +421,20 @@ fn main(vec[str] args) {
             compile_input(sess, env, ifile, ofile);
         }
         case (some(?ofile)) {
+            // FIXME: what about windows? This will create a foo.exe.o.
             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.
     if (sopts.output_type == link::output_type_exe) {
-
-        //FIXME: Should we make the 'stage3's variable here?
-        let str glu = "stage3/glue.o";
+        auto binary_dir = fs::dirname(binary);
+        let str glu = binary_dir + "/glue.o";
         let str main = "rt/main.o";
-        let str stage = "-Lstage3";
+        let str stage = "-L" + binary_dir;
         let vec[str] gcc_args;
         let str prog = "gcc";
         let str exe_suffix = "";