From 7139155f2d63a9d99d740a2bb1b2e2964df3e3c3 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Sun, 28 Feb 2021 21:38:10 +0100 Subject: [PATCH] Add code size optimization flags. --- embassy-nrf-examples/.cargo/config | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/embassy-nrf-examples/.cargo/config b/embassy-nrf-examples/.cargo/config index 2bfb098e..37e38ec9 100644 --- a/embassy-nrf-examples/.cargo/config +++ b/embassy-nrf-examples/.cargo/config @@ -1,3 +1,8 @@ +[unstable] +namespaced-features = true +build-std = ["core"] +build-std-features = ["panic_immediate_abort"] + [target.'cfg(all(target_arch = "arm", target_os = "none"))'] runner = "probe-run --chip nRF52840_xxAA" @@ -7,17 +12,12 @@ rustflags = [ "-C", "link-arg=-Tlink.x", "-C", "link-arg=-Tdefmt.x", - # if you run into problems with LLD switch to the GNU linker by commenting out - # this line - # "-C", "linker=arm-none-eabi-ld", - - # if you need to link to pre-compiled C libraries provided by a C toolchain - # use GCC as the linker by commenting out both lines above and then - # uncommenting the three lines below - # "-C", "linker=arm-none-eabi-gcc", - # "-C", "link-arg=-Wl,-Tlink.x", - # "-C", "link-arg=-nostartfiles", + # Code-size optimizations. + "-Z", "trap-unreachable=no", + "-C", "inline-threshold=5", + "-C", "no-vectorize-loops", ] [build] target = "thumbv7em-none-eabi" +