Skip to content

Commit 554c3c3

Browse files
committed
Use LLVM integrated assembler on Windows too.
1 parent 820271d commit 554c3c3

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/librustc/driver/driver.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,7 @@ pub fn phase_5_run_llvm_passes(sess: Session,
352352
trans: &CrateTranslation,
353353
outputs: &OutputFilenames) {
354354

355-
// On Windows, LLVM integrated assembler emits bad stack unwind tables when
356-
// segmented stacks are enabled. However, unwind info directives in assembly
357-
// output are OK, so we generate assembly first and then run it through
358-
// an external assembler.
359-
if sess.targ_cfg.os == abi::OsWin32 &&
360-
(sess.opts.output_type == link::output_type_object ||
361-
sess.opts.output_type == link::output_type_exe) {
355+
if sess.no_integrated_as() {
362356
let output_type = link::output_type_assembly;
363357
let asm_filename = outputs.obj_filename.with_extension("s");
364358

@@ -371,7 +365,7 @@ pub fn phase_5_run_llvm_passes(sess: Session,
371365

372366
link::write::run_assembler(sess, &asm_filename, &outputs.obj_filename);
373367

374-
// Remove assembly source unless --save-temps was specified
368+
// Remove assembly source, unless --save-temps was specified
375369
if !sess.opts.save_temps {
376370
fs::unlink(&asm_filename);
377371
}

src/librustc/driver/session.rs

+6
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ pub static no_prepopulate_passes: uint = 1 << 25;
6666
pub static use_softfp: uint = 1 << 26;
6767
pub static gen_crate_map: uint = 1 << 27;
6868
pub static prefer_dynamic: uint = 1 << 28;
69+
pub static no_integrated_as: uint = 1 << 29;
6970

7071
pub fn debugging_opts_map() -> ~[(&'static str, &'static str, uint)] {
7172
~[("verbose", "in general, enable more debug printouts", verbose),
@@ -117,6 +118,8 @@ pub fn debugging_opts_map() -> ~[(&'static str, &'static str, uint)] {
117118
("soft-float", "Generate software floating point library calls", use_softfp),
118119
("gen-crate-map", "Force generation of a toplevel crate map", gen_crate_map),
119120
("prefer-dynamic", "Prefer dynamic linking to static linking", prefer_dynamic),
121+
("no-integrated-as",
122+
"Use external assembler rather than LLVM's integrated one", no_integrated_as),
120123
]
121124
}
122125

@@ -335,6 +338,9 @@ impl Session_ {
335338
pub fn prefer_dynamic(&self) -> bool {
336339
self.debugging_opt(prefer_dynamic)
337340
}
341+
pub fn no_integrated_as(&self) -> bool {
342+
self.debugging_opt(no_integrated_as)
343+
}
338344

339345
// pointless function, now...
340346
pub fn str_of(&self, id: ast::Ident) -> @str {

0 commit comments

Comments
 (0)