From 65913d8e66e492787812067f8e76e22bcf2fc8a6 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Tue, 28 Mar 2023 12:51:30 +0100 Subject: [PATCH] ports/rp2: Add nano.specs snippet for C++ modules. Document how to reemove C++ stack unwinding and exception handling. Set options as per https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/pico_cxx_options/CMakeLists.txt Saves around 10,880 bytes of RAM in our batteries-included build. Signed-off-by: Phil Howard --- examples/usercmodule/cppexample/micropython.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/usercmodule/cppexample/micropython.cmake b/examples/usercmodule/cppexample/micropython.cmake index 6da972c94e3b5..37604e808d935 100644 --- a/examples/usercmodule/cppexample/micropython.cmake +++ b/examples/usercmodule/cppexample/micropython.cmake @@ -14,3 +14,14 @@ target_include_directories(usermod_cppexample INTERFACE # Link our INTERFACE library to the usermod target. target_link_libraries(usermod INTERFACE usermod_cppexample) + +# Do not include stack unwinding & exception handling for C++ user modules +# This can dramatically reduce build size on embedded ports like rp2 +# target_compile_definitions(usermod INTERFACE PICO_CXX_ENABLE_EXCEPTIONS=0) +# target_compile_options(usermod INTERFACE $<$: +# -fno-exceptions +# -fno-unwind-tables +# -fno-rtti +# -fno-use-cxa-atexit +# >) +# target_link_options(usermod INTERFACE -specs=nano.specs) \ No newline at end of file pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy