Add code size optimization flags.

This commit is contained in:
Dario Nieuwenhuis 2021-02-28 21:38:10 +01:00
parent da91779117
commit 7139155f2d

View File

@ -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"))'] [target.'cfg(all(target_arch = "arm", target_os = "none"))']
runner = "probe-run --chip nRF52840_xxAA" runner = "probe-run --chip nRF52840_xxAA"
@ -7,17 +12,12 @@ rustflags = [
"-C", "link-arg=-Tlink.x", "-C", "link-arg=-Tlink.x",
"-C", "link-arg=-Tdefmt.x", "-C", "link-arg=-Tdefmt.x",
# if you run into problems with LLD switch to the GNU linker by commenting out # Code-size optimizations.
# this line "-Z", "trap-unreachable=no",
# "-C", "linker=arm-none-eabi-ld", "-C", "inline-threshold=5",
"-C", "no-vectorize-loops",
# 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",
] ]
[build] [build]
target = "thumbv7em-none-eabi" target = "thumbv7em-none-eabi"