esp_rom: remove newlib-time.ld from ROM built with 64-bit time_t

This commit is contained in:
jiangguangming 2023-01-29 10:09:02 +08:00
parent 236fa5e669
commit 4731d4322e
5 changed files with 15 additions and 77 deletions

View File

@ -224,16 +224,9 @@ else() # Regular app build
rom_linker_script("version")
rom_linker_script("mbedtls")
if(time_t_size EQUAL 8)
# The ROM functions listed in this linker script depend on sizeof(time_t).
# Since ROM for ESP32-C2 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(CONFIG_NEWLIB_NANO_FORMAT)
# nano formatting functions in ROM are also built for 64-bit time_t.
rom_linker_script("newlib-nano")
endif()
if(CONFIG_NEWLIB_NANO_FORMAT)
# nano formatting functions in ROM are also built for 64-bit time_t.
rom_linker_script("newlib-nano")
endif()
elseif(target STREQUAL "esp32c6")
@ -254,17 +247,9 @@ else() # Regular app build
rom_linker_script("wdt")
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()
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()
elseif(target STREQUAL "esp32h2")
@ -279,16 +264,9 @@ 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).
# Since ROM for ESP32-H2 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(CONFIG_NEWLIB_NANO_FORMAT)
# nano formatting functions in ROM are also built for 64-bit time_t.
rom_linker_script("newlib-nano")
endif()
if(CONFIG_NEWLIB_NANO_FORMAT)
# nano formatting functions in ROM are also built for 64-bit time_t.
rom_linker_script("newlib-nano")
endif()
endif()

View File

@ -1,16 +0,0 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* These are the newlib functions and the .bss/.data symbols which are related to 'time_t'
or other structures which include 'time_t' (like 'struct stat').
These ROM functions were compiled with sizeof(time_t) == 8.
When compiling with sizeof(time_t) == 4, these functions should be excluded from the build.
*/
asctime = 0x40000638;
asctime_r = 0x4000063c;
_isatty_r = 0x400004b4;
PROVIDE( __smakebuf_r = 0x400005a0 );
PROVIDE( __swhatbuf_r = 0x400005a4 );
PROVIDE( __swsetup_r = 0x400005b0 );

View File

@ -30,6 +30,7 @@ strncmp = 0x400004a4;
strlen = 0x400004a8;
strstr = 0x400004ac;
bzero = 0x400004b0;
_isatty_r = 0x400004b4;
sbrk = 0x400004b8;
isalnum = 0x400004bc;
isalpha = 0x400004c0;
@ -88,8 +89,11 @@ fflush = 0x40000590;
_fflush_r = 0x40000594;
_fwalk = 0x40000598;
_fwalk_reent = 0x4000059c;
__smakebuf_r = 0x400005a0;
__swhatbuf_r = 0x400005a4;
__swbuf_r = 0x400005a8;
__swbuf = 0x400005ac;
__swsetup_r = 0x400005b0;
_strtod_l = 0x400005b4;
_strtod_r = 0x400005b8;
strtod_l = 0x400005bc;
@ -123,6 +127,8 @@ __ratio = 0x40000628;
_mprec_log10 = 0x4000062c;
__copybits = 0x40000630;
__any_on = 0x40000634;
asctime = 0x40000638;
asctime_r = 0x4000063c;
atof = 0x40000640;
atoff = 0x40000644;
_dtoa_r = 0x40000648;

View File

@ -1,15 +0,0 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* These are the newlib functions and the .bss/.data symbols which are related to 'time_t'
or other structures which include 'time_t' (like 'struct stat').
These ROM functions were compiled with sizeof(time_t) == 4.
When compiling with sizeof(time_t) == 8, these functions should be excluded from the build.
*/
_isatty_r = 0x40000380;
PROVIDE( __smakebuf_r = 0x4000046c );
PROVIDE( __swhatbuf_r = 0x40000470 );
PROVIDE( __swsetup_r = 0x4000047c );

View File

@ -1,15 +0,0 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* These are the newlib functions and the .bss/.data symbols which are related to 'time_t'
or other structures which include 'time_t' (like 'struct stat').
These ROM functions were compiled with sizeof(time_t) == 4.
When compiling with sizeof(time_t) == 8, these functions should be excluded from the build.
*/
_isatty_r = 0x40000380;
PROVIDE( __smakebuf_r = 0x4000046c );
PROVIDE( __swhatbuf_r = 0x40000470 );
PROVIDE( __swsetup_r = 0x4000047c );