From a8df72745b15c5b3df73203d19f60ebfcc5ffaaf Mon Sep 17 00:00:00 2001 From: jiangguangming Date: Wed, 2 Nov 2022 19:49:48 +0800 Subject: [PATCH] esp_rom: esp32c6 rom newlib support normal-formatting version --- components/esp_rom/CMakeLists.txt | 12 +++++++ .../esp32c6/ld/esp32c6.rom.newlib-nano.ld | 32 ------------------- 2 files changed, 12 insertions(+), 32 deletions(-) delete mode 100644 components/esp_rom/esp32c6/ld/esp32c6.rom.newlib-nano.ld diff --git a/components/esp_rom/CMakeLists.txt b/components/esp_rom/CMakeLists.txt index a687bd600f..4ec45e00dc 100644 --- a/components/esp_rom/CMakeLists.txt +++ b/components/esp_rom/CMakeLists.txt @@ -237,6 +237,18 @@ else() # Regular app build rom_linker_script("spiflash") endif() + if(time_t_size EQUAL 8) + # The ROM functions listed in this linker script depend on sizeof(time_t). + # ESP32-C6 ROM was compiled for 64-bit time_t, only link these functions + # if the toolchain is also using 64-bit time_t. + rom_linker_script("newlib-time") + + if(NOT CONFIG_NEWLIB_NANO_FORMAT) + # Normal(Non-nano) formatting functions in ROM are also built for 64-bit time_t. + rom_linker_script("newlib-normal") + endif() + endif() + endif() if(CONFIG_HEAP_TLSF_USE_ROM_IMPL) diff --git a/components/esp_rom/esp32c6/ld/esp32c6.rom.newlib-nano.ld b/components/esp_rom/esp32c6/ld/esp32c6.rom.newlib-nano.ld deleted file mode 100644 index ceb70b0fd5..0000000000 --- a/components/esp_rom/esp32c6/ld/esp32c6.rom.newlib-nano.ld +++ /dev/null @@ -1,32 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ -/* ROM function interface esp32c6.rom.newlib-nano.ld for esp32c6 - * - * - * Generated from ./target/esp32c6/interface-esp32c6.yml md5sum ff3b116f1987b5a5433645b8f7947f32 - * - * Compatible with ROM where ECO version equal or greater to 0. - * - * THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT EDIT. - */ - -/*************************************** - Group newlib_nano_format - ***************************************/ - -/* Functions */ -__sprint_r = 0x400005c8; -_fiprintf_r = 0x400005cc; -_fprintf_r = 0x400005d0; -_printf_common = 0x400005d4; -_printf_i = 0x400005d8; -_vfiprintf_r = 0x400005dc; -_vfprintf_r = 0x400005e0; -fiprintf = 0x400005e4; -fprintf = 0x400005e8; -printf = 0x400005ec; -vfiprintf = 0x400005f0; -vfprintf = 0x400005f4;