mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2026-01-22 01:30:31 -05:00
Make a couple of demos build using picolibc (#1202)
* [RISC-V-Qemu-virt_GCC Demo] Add picolibc support Add minimal picolibc support: * Use --specs=picolibc.specs to direct gcc at picolibc * Use -DPICOLIBC_INTEGER_PRINTF_SCANF to enable smaller printf implementation * Enable configUSE_PICOLIBC_TLS for thread local storage * Add TLS section to linker script Signed-off-by: Keith Packard <keithpac@amazon.com> * [CORTEX_MPU_M3_MPS2_QEMU_GCC Demo] Add picolibc support Add minimal picolibc support to this demo * Use --specs=picolibc.specs to direct gcc at picolibc * Use -DPICOLIBC_INTEGER_PRINTF_SCANF to enable smaller printf implementation * Enable configUSE_PICOLIBC_TLS for thread local storage * Add TLS section to linker script * Replace newlib syscall hooks with picolibc ones Signed-off-by: Keith Packard <keithpac@amazon.com> --------- Signed-off-by: Keith Packard <keithpac@amazon.com> Co-authored-by: Keith Packard <keithpac@amazon.com>
This commit is contained in:
parent
7514cd3d54
commit
eb97c5d325
7 changed files with 89 additions and 2 deletions
|
|
@ -45,6 +45,10 @@
|
|||
#define configMTIME_BASE_ADDRESS ( CLINT_ADDR + CLINT_MTIME )
|
||||
#define configMTIMECMP_BASE_ADDRESS ( CLINT_ADDR + CLINT_MTIMECMP )
|
||||
|
||||
#ifdef PICOLIBC_TLS
|
||||
#define configUSE_PICOLIBC_TLS 1
|
||||
#endif
|
||||
|
||||
#define configUSE_PREEMPTION 1
|
||||
#define configUSE_IDLE_HOOK 0
|
||||
#define configUSE_TICK_HOOK 1
|
||||
|
|
|
|||
|
|
@ -43,6 +43,11 @@ else
|
|||
CFLAGS += -O2
|
||||
endif
|
||||
|
||||
ifeq ($(PICOLIBC), 1)
|
||||
CFLAGS += --specs=picolibc.specs -DPICOLIBC_INTEGER_PRINTF_SCANF
|
||||
LDFLAGS += --specs=picolibc.specs -DPICOLIBC_INTEGER_PRINTF_SCANF
|
||||
endif
|
||||
|
||||
SRCS = main.c main_blinky.c riscv-virt.c ns16550.c \
|
||||
$(DEMO_SOURCE_DIR)/EventGroupsDemo.c \
|
||||
$(DEMO_SOURCE_DIR)/TaskNotify.c \
|
||||
|
|
|
|||
|
|
@ -81,6 +81,25 @@ SECTIONS
|
|||
_edata = .;
|
||||
} >ram AT>rom
|
||||
|
||||
.tdata : {
|
||||
*(.tdata .tdata.*)
|
||||
} >rom AT>rom
|
||||
|
||||
.tbss (NOLOAD) : {
|
||||
*(.tbss .tbss.* .gnu.linkonce.tb.*)
|
||||
*(.tcommon)
|
||||
PROVIDE( __tbss_end = . );
|
||||
PROVIDE( __tls_end = . );
|
||||
} >rom AT>rom
|
||||
PROVIDE( __tdata_source = LOADADDR(.tdata) );
|
||||
PROVIDE( __tdata_source_end = LOADADDR(.tdata) + SIZEOF(.tdata) );
|
||||
PROVIDE( __tdata_size = SIZEOF(.tdata) );
|
||||
PROVIDE( __tbss_offset = ADDR(.tbss) - ADDR(.tdata) );
|
||||
PROVIDE( __tbss_start = ADDR(.tbss) );
|
||||
PROVIDE( __tbss_size = SIZEOF(.tbss) );
|
||||
PROVIDE( __tls_size = __tls_end - ADDR(.tdata) );
|
||||
PROVIDE( __tls_align = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)) );
|
||||
|
||||
.bss.align :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue