about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2019-02-11 19:11:55 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2019-02-11 19:11:55 +0100
commit4bb8bfca94aa704b2f57f33d2f6be121ee88e3fa (patch)
treeeb2000d4c580f6e8549fd89da1ffd82083197735
parent5b3867430ff4490830a8cd735af93a92984a54ea (diff)
downloadrust-4bb8bfca94aa704b2f57f33d2f6be121ee88e3fa.tar.gz
rust-4bb8bfca94aa704b2f57f33d2f6be121ee88e3fa.zip
Disable macOS debuginfo and on all platforms optimizations
-rw-r--r--src/lib.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 370a022a92b..5863f730bca 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -296,7 +296,9 @@ impl CodegenBackend for CraneliftCodegenBackend {
 
             let mut faerie_module = new_module("some_file".to_string());
 
-            let mut debug = if tcx.sess.opts.debuginfo != DebugInfo::None {
+            let mut debug = if tcx.sess.opts.debuginfo != DebugInfo::None
+                && !tcx.sess.target.target.options.is_like_osx // macOS debuginfo doesn't work yet (see #303)
+            {
                 let debug = DebugContext::new(tcx, faerie_module.target_config().pointer_type().bytes() as u8);
                 Some(debug)
             } else {
@@ -372,7 +374,8 @@ fn build_isa(sess: &Session) -> Box<isa::TargetIsa + 'static> {
         "false"
     }).unwrap();
 
-    match sess.opts.optimize {
+    // FIXME enable again when https://github.com/CraneStation/cranelift/issues/664 is fixed
+    /*match sess.opts.optimize {
         OptLevel::No => {
             flags_builder.set("opt_level", "fastest").unwrap();
         }
@@ -383,7 +386,7 @@ fn build_isa(sess: &Session) -> Box<isa::TargetIsa + 'static> {
         OptLevel::Size | OptLevel::SizeMin => {
             sess.warn("Optimizing for size is not supported. Just ignoring the request");
         }
-    }
+    }*/
 
     let flags = settings::Flags::new(flags_builder);
     cranelift::codegen::isa::lookup(sess.target.target.llvm_target.parse().unwrap())