From 8a71ae75ade43c8d580252469f3635cc1cbc4d21 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Thu, 29 Dec 2022 15:18:36 +0800 Subject: [BSP][smart] fix link script for smart in vexpress-a9 (#6764) --- bsp/qemu-vexpress-a9/SConstruct | 4 + bsp/qemu-vexpress-a9/link-lwp.lds | 111 --------------------- bsp/qemu-vexpress-a9/link_smart.lds | 111 +++++++++++++++++++++ bsp/qemu-vexpress-a9/rtconfig.py | 4 +- .../libc/compilers/common/include/sys/time.h | 2 + 5 files changed, 119 insertions(+), 113 deletions(-) delete mode 100644 bsp/qemu-vexpress-a9/link-lwp.lds create mode 100644 bsp/qemu-vexpress-a9/link_smart.lds diff --git a/bsp/qemu-vexpress-a9/SConstruct b/bsp/qemu-vexpress-a9/SConstruct index 287bb0fa2e..aa95fff7df 100644 --- a/bsp/qemu-vexpress-a9/SConstruct +++ b/bsp/qemu-vexpress-a9/SConstruct @@ -28,5 +28,9 @@ Export('rtconfig') # prepare building environment objs = PrepareBuilding(env, RTT_ROOT) +if GetDepend('RT_USING_SMART'): + # use smart link.lds + env['LINKFLAGS'] = env['LINKFLAGS'].replace('link.lds', 'link_smart.lds') + # make a building DoBuilding(TARGET, objs) diff --git a/bsp/qemu-vexpress-a9/link-lwp.lds b/bsp/qemu-vexpress-a9/link-lwp.lds deleted file mode 100644 index 04e3eb3a92..0000000000 --- a/bsp/qemu-vexpress-a9/link-lwp.lds +++ /dev/null @@ -1,111 +0,0 @@ -OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") -OUTPUT_ARCH(arm) -SECTIONS -{ - /*. = 0x60010000; */ - . = 0xc0010000; - - __text_start = .; - .text : - { - *(.vectors) - *(.text) - *(.text.*) - - /* section information for utest */ - . = ALIGN(4); - __rt_utest_tc_tab_start = .; - KEEP(*(UtestTcTab)) - __rt_utest_tc_tab_end = .; - - /* section information for finsh shell */ - . = ALIGN(4); - __fsymtab_start = .; - KEEP(*(FSymTab)) - __fsymtab_end = .; - . = ALIGN(4); - __vsymtab_start = .; - KEEP(*(VSymTab)) - __vsymtab_end = .; - - /* section information for var export */ - . = ALIGN(4); - __ve_table_start = .; - KEEP(*(SORT(*.VarExpTab.*))) - __ve_table_end = .; - - /* section information for modules */ - . = ALIGN(4); - __rtmsymtab_start = .; - KEEP(*(RTMSymTab)) - __rtmsymtab_end = .; - - /* section information for initialization */ - . = ALIGN(4); - __rt_init_start = .; - KEEP(*(SORT(.rti_fn*))) - __rt_init_end = .; - } =0 - __text_end = .; - - .ARM.exidx : - { - __exidx_start = .; - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - __exidx_end = .; - } - - __rodata_start = .; - .rodata : { *(.rodata) *(.rodata.*) } - __rodata_end = .; - - . = ALIGN(4); - .ctors : - { - PROVIDE(__ctors_start__ = .); - /* new GCC version uses .init_array */ - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE(__ctors_end__ = .); - } - - .dtors : - { - PROVIDE(__dtors_start__ = .); - KEEP(*(SORT(.fini_array.*))) - KEEP(*(.fini_array)) - PROVIDE(__dtors_end__ = .); - } - - . = ALIGN(8); - __data_start = .; - .data : - { - *(.data) - *(.data.*) - } - __data_end = .; - - . = ALIGN(4); - __bss_start = .; - .bss : - { - *(.bss) - *(.bss.*) - *(COMMON) - . = ALIGN(4); - } - . = ALIGN(4); - __bss_end = .; - - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - - _end = .; -} diff --git a/bsp/qemu-vexpress-a9/link_smart.lds b/bsp/qemu-vexpress-a9/link_smart.lds new file mode 100644 index 0000000000..04e3eb3a92 --- /dev/null +++ b/bsp/qemu-vexpress-a9/link_smart.lds @@ -0,0 +1,111 @@ +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +SECTIONS +{ + /*. = 0x60010000; */ + . = 0xc0010000; + + __text_start = .; + .text : + { + *(.vectors) + *(.text) + *(.text.*) + + /* section information for utest */ + . = ALIGN(4); + __rt_utest_tc_tab_start = .; + KEEP(*(UtestTcTab)) + __rt_utest_tc_tab_end = .; + + /* section information for finsh shell */ + . = ALIGN(4); + __fsymtab_start = .; + KEEP(*(FSymTab)) + __fsymtab_end = .; + . = ALIGN(4); + __vsymtab_start = .; + KEEP(*(VSymTab)) + __vsymtab_end = .; + + /* section information for var export */ + . = ALIGN(4); + __ve_table_start = .; + KEEP(*(SORT(*.VarExpTab.*))) + __ve_table_end = .; + + /* section information for modules */ + . = ALIGN(4); + __rtmsymtab_start = .; + KEEP(*(RTMSymTab)) + __rtmsymtab_end = .; + + /* section information for initialization */ + . = ALIGN(4); + __rt_init_start = .; + KEEP(*(SORT(.rti_fn*))) + __rt_init_end = .; + } =0 + __text_end = .; + + .ARM.exidx : + { + __exidx_start = .; + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + __exidx_end = .; + } + + __rodata_start = .; + .rodata : { *(.rodata) *(.rodata.*) } + __rodata_end = .; + + . = ALIGN(4); + .ctors : + { + PROVIDE(__ctors_start__ = .); + /* new GCC version uses .init_array */ + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__ctors_end__ = .); + } + + .dtors : + { + PROVIDE(__dtors_start__ = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE(__dtors_end__ = .); + } + + . = ALIGN(8); + __data_start = .; + .data : + { + *(.data) + *(.data.*) + } + __data_end = .; + + . = ALIGN(4); + __bss_start = .; + .bss : + { + *(.bss) + *(.bss.*) + *(COMMON) + . = ALIGN(4); + } + . = ALIGN(4); + __bss_end = .; + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + + _end = .; +} diff --git a/bsp/qemu-vexpress-a9/rtconfig.py b/bsp/qemu-vexpress-a9/rtconfig.py index 5aa123823b..9707400629 100644 --- a/bsp/qemu-vexpress-a9/rtconfig.py +++ b/bsp/qemu-vexpress-a9/rtconfig.py @@ -37,7 +37,7 @@ BUILD = 'debug' LINK_SCRIPT = 'link.lds' if PLATFORM == 'gcc': - PREFIX = os.getenv('RTT_EXEC_PREFIX') or 'arm-none-eabi-' + PREFIX = os.getenv('RTT_CC_PREFIX') or 'arm-none-eabi-' CC = PREFIX + 'gcc' CXX = PREFIX + 'g++' AS = PREFIX + 'gcc' @@ -66,7 +66,7 @@ if PLATFORM == 'gcc': else: CFLAGS += ' -Os' CXXFLAGS += ' -Os' - CXXFLAGS += ' -Woverloaded-virtual -fno-exceptions -fno-rtti' + CXXFLAGS += ' -Woverloaded-virtual -fno-rtti' M_CFLAGS = CFLAGS + ' -mlong-calls -fPIC ' M_CXXFLAGS = CXXFLAGS + ' -mlong-calls -fPIC' diff --git a/components/libc/compilers/common/include/sys/time.h b/components/libc/compilers/common/include/sys/time.h index 8a1ae60909..87be959715 100644 --- a/components/libc/compilers/common/include/sys/time.h +++ b/components/libc/compilers/common/include/sys/time.h @@ -40,6 +40,8 @@ extern "C" { #define DST_TUR 9 /* Turkey */ #define DST_AUSTALT 10 /* Australian style with shift in 1986 */ +struct itimerspec; + struct timezone { int tz_minuteswest; /* minutes west of Greenwich */ -- cgit v1.3.1