esp-idf/components/esp_rom
Darian Leung a45fcce631 newlib: Add workaround for printf functions using 32-bit time_t on first call
sizeof(time_t) was previously switched from 4 to 8, ROM functions that use
time_t or dependent types (such as "struct stat") are no longer called due as
they still treat sizeof(time_t) as 4 (see commit
24c20d18).

However, there is a ROM callpath that was left out. If putchar is the first
stdio print related call, the call path will result in cantwrite() ->
__swsetup_r() -> __smakebuf_r() -> __swhatbuf_r() using the ROM "struct stat"
(where sizeof(time_t)==4).

Instead of removing all printf related ROM newlib functions (which will result
in increased binary size), this commit adds a workaround to setup the stdio
files before any print related calls occur.

This results in cantwrite() always returning false, thus the callpath described
above never being reached.

Closes https://github.com/espressif/esp-idf/issues/9269
2022-08-22 11:56:51 +08:00
..
esp32 newlib: Add workaround for printf functions using 32-bit time_t on first call 2022-08-22 11:56:51 +08:00
esp32c3 newlib: Add workaround for printf functions using 32-bit time_t on first call 2022-08-22 11:56:51 +08:00
esp32h2 efuse: update efuse name (backport v4.4) 2022-05-30 11:15:16 +08:00
esp32s2 newlib: Add workaround for printf functions using 32-bit time_t on first call 2022-08-22 11:56:51 +08:00
esp32s3 newlib: Add workaround for printf functions using 32-bit time_t on first call 2022-08-22 11:56:51 +08:00
host_test/rom_test [build system]: Fixed common requirement for Linux 2021-08-13 16:50:29 +08:00
include further fix spi flash/ram current leakage 2022-07-28 13:11:55 +08:00
linux further fix spi flash/ram current leakage 2022-07-28 13:11:55 +08:00
patches further fix spi flash/ram current leakage 2022-07-28 13:11:55 +08:00
test rom/tjpgd: unify library & add rom patch 2021-09-01 14:42:17 +08:00
CMakeLists.txt further fix spi flash/ram current leakage 2022-07-28 13:11:55 +08:00
component.mk [esp_rom]: fixed S3 longjmp patch 2021-06-18 15:47:41 +08:00
Kconfig.projbuild efuse: can disable boot ROM log from Kconfig 2021-02-22 20:56:43 +08:00