From 1e380cbfdd96365ef0eb6dfec341e85b68fa64b5 Mon Sep 17 00:00:00 2001 From: Vadzim Dambrouski Date: Wed, 31 Jan 2018 00:57:30 +0300 Subject: [PATCH] [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. --- src/librustc_back/target/msp430_none_elf.rs | 6 ++++++ 1 file changed, 6 insertions(+) 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( ) } })