]> git.lizzy.rs Git - rust.git/commitdiff
Use LLVM integrated assembler on Windows too.
authorVadim Chugunov <vadimcn@gmail.com>
Mon, 9 Dec 2013 04:13:10 +0000 (20:13 -0800)
committerVadim Chugunov <vadimcn@gmail.com>
Mon, 9 Dec 2013 04:14:36 +0000 (20:14 -0800)
src/librustc/driver/driver.rs
src/librustc/driver/session.rs

index 63d6c60d2698d07fae13ef37818960d58c6e668c..d57bbdb5f2f9721db61554c1cff4c5188660055c 100644 (file)
@@ -352,13 +352,7 @@ pub fn phase_5_run_llvm_passes(sess: Session,
                                trans: &CrateTranslation,
                                outputs: &OutputFilenames) {
 
-    // On Windows, LLVM integrated assembler emits bad stack unwind tables when
-    // segmented stacks are enabled.  However, unwind info directives in assembly
-    // output are OK, so we generate assembly first and then run it through
-    // an external assembler.
-    if sess.targ_cfg.os == abi::OsWin32 &&
-        (sess.opts.output_type == link::output_type_object ||
-         sess.opts.output_type == link::output_type_exe) {
+    if sess.no_integrated_as() {
         let output_type = link::output_type_assembly;
         let asm_filename = outputs.obj_filename.with_extension("s");
 
@@ -371,7 +365,7 @@ pub fn phase_5_run_llvm_passes(sess: Session,
 
         link::write::run_assembler(sess, &asm_filename, &outputs.obj_filename);
 
-        // Remove assembly source unless --save-temps was specified
+        // Remove assembly source, unless --save-temps was specified
         if !sess.opts.save_temps {
             fs::unlink(&asm_filename);
         }
index 6a4755344eff45241c2d49c6c1296256aecca0ef..2d1d7033300b53516454023708542a25d7471aa2 100644 (file)
@@ -66,6 +66,7 @@ pub struct config {
 pub static use_softfp:              uint = 1 << 26;
 pub static gen_crate_map:           uint = 1 << 27;
 pub static prefer_dynamic:          uint = 1 << 28;
+pub static no_integrated_as:        uint = 1 << 29;
 
 pub fn debugging_opts_map() -> ~[(&'static str, &'static str, uint)] {
     ~[("verbose", "in general, enable more debug printouts", verbose),
@@ -117,6 +118,8 @@ pub fn debugging_opts_map() -> ~[(&'static str, &'static str, uint)] {
      ("soft-float", "Generate software floating point library calls", use_softfp),
      ("gen-crate-map", "Force generation of a toplevel crate map", gen_crate_map),
      ("prefer-dynamic", "Prefer dynamic linking to static linking", prefer_dynamic),
+     ("no-integrated-as",
+      "Use external assembler rather than LLVM's integrated one", no_integrated_as),
     ]
 }
 
@@ -335,6 +338,9 @@ pub fn gen_crate_map(&self) -> bool {
     pub fn prefer_dynamic(&self) -> bool {
         self.debugging_opt(prefer_dynamic)
     }
+    pub fn no_integrated_as(&self) -> bool {
+        self.debugging_opt(no_integrated_as)
+    }
 
     // pointless function, now...
     pub fn str_of(&self, id: ast::Ident) -> @str {