From 9a49211633b5a45a6c804ea600b14291a00a034c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2026 11:54:27 -0500 Subject: [PATCH] fix: fit the wio-e5-mini repeater with library LTO The fork's code pushes wio-e5-mini_repeater ~4.5 KB over its 224 KB flash region. Build that target with -flto for the framework/libraries and -fno-lto for project sources: it now uses 225,284 bytes (4,092 under the limit) and still emits the .su files the stack gate checks. The override lives in the release script so the upstream variant stays untouched. --- scripts/local-release-build.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/local-release-build.sh b/scripts/local-release-build.sh index 10eef7cb..fb4e123c 100755 --- a/scripts/local-release-build.sh +++ b/scripts/local-release-build.sh @@ -147,6 +147,15 @@ if [[ ${1:-} == __worker ]]; then # (codegen unchanged, consumed by the stack gate below) + version string export PLATFORMIO_BUILD_FLAGS="-fstack-usage -DFIRMWARE_BUILD_DATE='\"${firmware_build_date}\"' -DFIRMWARE_VERSION='\"${firmware_version_string}\"'" + # wio-e5-mini_repeater is ~4.5 KB over its 224 KB flash region. LTO on the + # framework/libraries recovers the space; project sources stay non-LTO so + # the stack gate below still gets their .su files. Fork-owned override: the + # upstream variant does not carry it. + if [[ $target == wio-e5-mini_repeater ]]; then + export PLATFORMIO_BUILD_FLAGS="$PLATFORMIO_BUILD_FLAGS -flto" + export PLATFORMIO_BUILD_SRC_FLAGS="${PLATFORMIO_BUILD_SRC_FLAGS:-} -fno-lto" + fi + file_base="${target}-${firmware_version_string}" mkdir -p out