From f101a8aa3c46715ec150b31bb485df26fad4489c Mon Sep 17 00:00:00 2001 From: Charlie Birks Date: Thu, 24 Oct 2024 14:17:14 +0100 Subject: [PATCH 1/2] pico: override terminate handler Saves 20-30k when building with non-nano libstdc++ --- 32blit-pico/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/32blit-pico/main.cpp b/32blit-pico/main.cpp index d5c6834a6..ca0f1f0eb 100644 --- a/32blit-pico/main.cpp +++ b/32blit-pico/main.cpp @@ -25,6 +25,11 @@ using namespace blit; static blit::AudioChannel channels[CHANNEL_COUNT]; +// override terminate handler to save ~20-30k +namespace __cxxabiv1 { + std::terminate_handler __terminate_handler = std::abort; +} + static uint32_t now() { return to_ms_since_boot(get_absolute_time()); } From 9fb1f8e21d57c59ad049b26497c51b5bc64c6750 Mon Sep 17 00:00:00 2001 From: Charlie Birks Date: Thu, 24 Oct 2024 14:19:37 +0100 Subject: [PATCH 2/2] pico: remove nano specs newlib-nano has really basic memcpy/memset code which hurts perf a lot on RP2350 --- 32blit-pico/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/32blit-pico/CMakeLists.txt b/32blit-pico/CMakeLists.txt index 7cc10705f..c1af2a1a7 100644 --- a/32blit-pico/CMakeLists.txt +++ b/32blit-pico/CMakeLists.txt @@ -180,7 +180,6 @@ function(blit_executable NAME) add_executable(${NAME} ${SOURCES}) target_link_libraries(${NAME} BlitHalPico BlitEngine) - target_link_options(${NAME} PUBLIC -specs=nano.specs -u _printf_float) pico_enable_stdio_uart(${NAME} 1) pico_enable_stdio_usb(${NAME} 0)