From 963fa85893ca37bcfa59755557bb873a3bb1b852 Mon Sep 17 00:00:00 2001 From: chrysn Date: Sat, 1 Oct 2022 22:07:02 +0200 Subject: [PATCH] rust-gcoap: Add Rust options for small binaries (-Os) --- examples/rust-gcoap/Cargo.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/rust-gcoap/Cargo.toml b/examples/rust-gcoap/Cargo.toml index e6cf6e2f89..0567dde89c 100644 --- a/examples/rust-gcoap/Cargo.toml +++ b/examples/rust-gcoap/Cargo.toml @@ -13,6 +13,10 @@ crate-type = ["staticlib"] # supports no unwinding), but setting it allows builds on native without using # the nightly-only lang_items feature. panic = "abort" +# This is a typical set of options that helps Rust binaries stay small +lto = true +codegen-units = 1 +opt-level = "s" [dependencies] riot-wrappers = { version = "^0.7.18", features = [ "set_panic_handler", "panic_handler_format", "with_coap_message", "with_coap_handler" ] }