about summary refs log tree commit diff
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-01-31 16:36:17 +0800
committerGitHub <noreply@github.com>2018-01-31 16:36:17 +0800
commit3d8279dec772306afc2f168b074e3a53eccec80a (patch)
treec6609e83f05b4e8eb56f9eaf85c635804d94c922
parentfde67b6ae3baa7063224d5efd7fccbfbdfca383b (diff)
parent1e380cbfdd96365ef0eb6dfec341e85b68fa64b5 (diff)
downloadrust-3d8279dec772306afc2f168b074e3a53eccec80a.tar.gz
rust-3d8279dec772306afc2f168b074e3a53eccec80a.zip
Rollup merge of #47890 - pftbest:no_trap, r=alexcrichton
[MSP430] Don't enable trap_unreachable option by default on msp.

Since MSP430 doesn't meaningfully support faulting on illegal
instructions, LLVM generates a call to abort() function instead
of a trap instruction. Such calls are 4 bytes long, and that is
too much overhead for such small target.

r? @alexcrichton
-rw-r--r--src/librustc_back/target/msp430_none_elf.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librustc_back/target/msp430_none_elf.rs b/src/librustc_back/target/msp430_none_elf.rs
index 509a7cf5e03..966df897f01 100644
--- a/src/librustc_back/target/msp430_none_elf.rs
+++ b/src/librustc_back/target/msp430_none_elf.rs
@@ -53,6 +53,12 @@ pub fn target() -> TargetResult {
             // don't want to invoke that many gcc instances.
             default_codegen_units: Some(1),
 
+            // Since MSP430 doesn't meaningfully support faulting on illegal
+            // instructions, LLVM generates a call to abort() function instead
+            // of a trap instruction. Such calls are 4 bytes long, and that is
+            // too much overhead for such small target.
+            trap_unreachable: false,
+
             .. Default::default( )
         }
     })