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