From 2906da327213119b1d77c11d97858f4045d535ac 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 ------- 1 file changed, 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 338cecc..edfd6a0 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)