From 3a2f2a23c2ae5b7eec6c2ba06f692c4e8e5ea2df Mon Sep 17 00:00:00 2001 From: BlackMark Date: Sun, 19 Jul 2026 10:52:13 +0200 Subject: [PATCH] tsb: drop the local -O3 strip, now handled by the libavr toolchain The -O3 leak is fixed upstream (cmake/release-os.cmake via CMAKE_PROJECT_INCLUDE), so the port no longer needs its own string(REPLACE); a Release build is -Os through the toolchain file. Verified: all three variants build at their sizes (508/658/740) and pass the size + protocol ctest. Co-Authored-By: Claude Opus 4.8 --- CMakeLists.txt | 7 ------- libavr | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 47e0c6e..bf2bfad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,13 +2,6 @@ cmake_minimum_required(VERSION 3.28) project(tsb_libavr LANGUAGES CXX) -# CMake's GNU compiler module appends "-O3 -DNDEBUG" to CMAKE_CXX_FLAGS_RELEASE -# after the libavr toolchain sets "-Os", and the later -O3 wins — so a Release -# build is silently -O3, ~15-20 % larger than -Os. For a boot loader measured to -# the byte that is fatal, so strip it and get the size build the design intends. -# (The same leak affects libavr's own Release builds; a fix belongs upstream.) -string(REPLACE "-O3" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") - # libavr from a local checkout (LIBAVR_ROOT) or the forge; the toolchain file # comes from the same checkout via CMakePresets.json. include(FetchContent) diff --git a/libavr b/libavr index 900e92d..d4849e2 160000 --- a/libavr +++ b/libavr @@ -1 +1 @@ -Subproject commit 900e92d45ba71cece4d0593109e534f9ca9b6522 +Subproject commit d4849e2f4cd9fe550eeb3a15b1a3198c5a7f89b8