mirror of
https://github.com/esphome/esphome.git
synced 2026-09-15 17:18:40 +00:00
[esp32] Disable PicolibC Newlib compatibility shim on IDF 6.0+
ESP-IDF 6.0 switched from Newlib to PicolibC. The Newlib compatibility
shim (CONFIG_LIBC_PICOLIBC_NEWLIB_COMPATIBILITY) provides thread-local
stdin/stdout/stderr and getreent() for code compiled against Newlib.
ESPHome doesn't link against Newlib-built libraries that use stdio,
so the shim is unnecessary overhead. The cost is small (a few dozen
bytes of TLS per FreeRTOS task) but there's no reason to carry it.
Users linking precompiled Newlib binaries can re-enable via:
sdkconfig_options:
CONFIG_LIBC_PICOLIBC_NEWLIB_COMPATIBILITY: "y"
This commit is contained in:
@@ -1920,6 +1920,15 @@ async def to_code(config):
|
||||
add_idf_sdkconfig_option("CONFIG_MBEDTLS_SHA384_C", False)
|
||||
add_idf_sdkconfig_option("CONFIG_MBEDTLS_SHA512_C", False)
|
||||
|
||||
# Disable PicolibC Newlib compatibility shim on IDF 6.0+
|
||||
# IDF 6.0 switched from Newlib to PicolibC. The shim provides thread-local
|
||||
# stdin/stdout/stderr and getreent() for code compiled against Newlib.
|
||||
# ESPHome doesn't link against Newlib-built libraries that use stdio.
|
||||
# If a component needs it (e.g. precompiled Newlib binaries), re-enable via
|
||||
# sdkconfig_options: CONFIG_LIBC_PICOLIBC_NEWLIB_COMPATIBILITY: "y"
|
||||
if idf_version() >= cv.Version(6, 0, 0):
|
||||
add_idf_sdkconfig_option("CONFIG_LIBC_PICOLIBC_NEWLIB_COMPATIBILITY", False)
|
||||
|
||||
# Disable regi2c control functions in IRAM
|
||||
# Only needed if using analog peripherals (ADC, DAC, etc.) from ISRs while cache is disabled
|
||||
if advanced[CONF_DISABLE_REGI2C_IN_IRAM]:
|
||||
|
||||
Reference in New Issue
Block a user