diff --git a/components/esp_libc/project_include.cmake b/components/esp_libc/project_include.cmake index 42c0c49af10..e862160aa42 100644 --- a/components/esp_libc/project_include.cmake +++ b/components/esp_libc/project_include.cmake @@ -50,6 +50,9 @@ if(CONFIG_IDF_TOOLCHAIN_GCC) # --gc-sections option. get_picolibc_specs_path(picolibc_specs_path) idf_toolchain_add_flags(COMPILE_OPTIONS "\"-specs=${picolibc_specs_path}\"") + if(LIBC_PICOLIBC_NEWLIB_COMPATIBILITY) + idf_toolchain_add_flags(COMPILE_OPTIONS "-D__STDC_WANT_LIB_EXT1__=0") + endif() else() idf_toolchain_remove_flags(COMPILE_OPTIONS "-specs=.*picolibc.*") endif()