Skip to content

Commit 043bca8

Browse files
committed
ports/rp2: Use nano.specs for C++ modules.
Remove C++ stack unwinding and exception handling in all cases. Set options as per https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/pico_cxx_options/CMakeLists.txt Save around 10,880 bytes of RAM. Signed-off-by: Phil Howard <phil@gadgetoid.com>
1 parent 38e7b84 commit 043bca8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ports/rp2/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,16 @@ target_compile_options(${MICROPY_TARGET} PRIVATE
365365
-Werror
366366
)
367367

368+
# Do not include stack unwinding & exception handling for C++ user modules
369+
target_compile_definitions(usermod INTERFACE PICO_CXX_ENABLE_EXCEPTIONS=0)
370+
target_compile_options(usermod INTERFACE $<$<COMPILE_LANGUAGE:CXX>:
371+
-fno-exceptions
372+
-fno-unwind-tables
373+
-fno-rtti
374+
-fno-use-cxa-atexit
375+
>)
376+
target_link_options(usermod INTERFACE -specs=nano.specs)
377+
368378
set_source_files_properties(
369379
${PICO_SDK_PATH}/src/rp2_common/pico_double/double_math.c
370380
${PICO_SDK_PATH}/src/rp2_common/pico_float/float_math.c

0 commit comments

Comments
 (0)
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