From b0b52bec81213161729546537f7b0fb76853606b Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 23 Aug 2026 14:01:34 -0500 Subject: [PATCH] Ungate the build_src_flags producer for the native generator The generator now reads build_src_flags instead of hardcoding the throw_stubs force-include, so the option must be set on both toolchains; gated, the native build silently lost the include (+168 bytes of libstdc++ throw strings). Verified byte-identical again. --- esphome/components/esp8266/__init__.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/esphome/components/esp8266/__init__.py b/esphome/components/esp8266/__init__.py index 5a68d1bae2..af614a42a9 100644 --- a/esphome/components/esp8266/__init__.py +++ b/esphome/components/esp8266/__init__.py @@ -447,12 +447,11 @@ async def to_code(config: ConfigType) -> None: # Force-include inline std::__throw_* overrides so GCC dead-strips the unused # libstdc++ error message strings (e.g. "basic_string::_M_create") from DRAM. # See throw_stubs.h for details. Must be prepended before , so this - # uses build_src_flags with -include. The native toolchain's build - # generator adds the equivalent flag itself. - if use_platformio: - cg.add_platformio_option( - "build_src_flags", "-include esphome/components/esp8266/throw_stubs.h" - ) + # uses build_src_flags with -include. Unconditional: the native build + # generator reads the same option, keeping one source of truth. + cg.add_platformio_option( + "build_src_flags", "-include esphome/components/esp8266/throw_stubs.h" + ) # In testing mode, fake larger memory to allow linking grouped component tests # Real ESP8266 hardware only has 32KB IRAM and ~80KB RAM, but for CI testing