Skip to content

Commit 4bb8bfc

Browse files
committed
Disable macOS debuginfo and on all platforms optimizations
1 parent 5b38674 commit 4bb8bfc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,9 @@ impl CodegenBackend for CraneliftCodegenBackend {
296296

297297
let mut faerie_module = new_module("some_file".to_string());
298298

299-
let mut debug = if tcx.sess.opts.debuginfo != DebugInfo::None {
299+
let mut debug = if tcx.sess.opts.debuginfo != DebugInfo::None
300+
&& !tcx.sess.target.target.options.is_like_osx // macOS debuginfo doesn't work yet (see #303)
301+
{
300302
let debug = DebugContext::new(tcx, faerie_module.target_config().pointer_type().bytes() as u8);
301303
Some(debug)
302304
} else {
@@ -372,7 +374,8 @@ fn build_isa(sess: &Session) -> Box<isa::TargetIsa + 'static> {
372374
"false"
373375
}).unwrap();
374376

375-
match sess.opts.optimize {
377+
// FIXME enable again when https://github.com/CraneStation/cranelift/issues/664 is fixed
378+
/*match sess.opts.optimize {
376379
OptLevel::No => {
377380
flags_builder.set("opt_level", "fastest").unwrap();
378381
}
@@ -383,7 +386,7 @@ fn build_isa(sess: &Session) -> Box<isa::TargetIsa + 'static> {
383386
OptLevel::Size | OptLevel::SizeMin => {
384387
sess.warn("Optimizing for size is not supported. Just ignoring the request");
385388
}
386-
}
389+
}*/
387390

388391
let flags = settings::Flags::new(flags_builder);
389392
cranelift::codegen::isa::lookup(sess.target.target.llvm_target.parse().unwrap())

0 commit comments

Comments
 (0)