Enable newlib and picolibc thread local storage

This commit is contained in:
Paul Bartell 2023-03-20 11:42:52 -07:00 committed by Paul Bartell
parent c6325a02ff
commit 63cfc621ed
2 changed files with 24 additions and 15 deletions

View file

@ -53,15 +53,16 @@ extern void vAssertCalled( const char * pcFileName,
} \
} while( 0 )
#define configQUEUE_REGISTRY_SIZE 20
#ifdef PICOLIBC_TLS
#ifdef __PICOLIBC__
#define configUSE_PICOLIBC_TLS 1
#endif
#endif /* __PICOLIBC__ */
#ifdef __NEWLIB__
#define configUSE_NEWLIB_REENTRANT 1
#endif /* __NEWLIB__ */
#define configUSE_PREEMPTION 1
#define configUSE_TIME_SLICING 0
#define configUSE_TIME_SLICING 1
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
#define configUSE_IDLE_HOOK 1
@ -82,8 +83,10 @@ extern void vAssertCalled( const char * pcFileName,
#define configUSE_COUNTING_SEMAPHORES 1
#define configSUPPORT_DYNAMIC_ALLOCATION 1
#define configSUPPORT_STATIC_ALLOCATION 1
#define configNUM_TX_DESCRIPTORS 15
#define configNUM_TX_DESCRIPTORS 15
#define configSTREAM_BUFFER_TRIGGER_LEVEL_TEST_MARGIN 2
#define configQUEUE_REGISTRY_SIZE 20
#define configUSE_QUEUE_SETS 1
/* Set the following definitions to 1 to include the API function, or zero
* to exclude the API function. */

View file

@ -67,26 +67,33 @@ endif
DEFINES := -DQEMU_SOC_MPS2 -DHEAP3
LDFLAGS = -T ./scripts/mps2_m3.ld
ifneq ($(PICOLIBC), 1)
LDFLAGS += -specs=nano.specs --specs=rdimon.specs -lc -lrdimon
ifeq ($(PICOLIBC), 1)
LDFLAGS += -lc
CFLAGS += -specs=picolibc.specs --oslib=semihost -DPICOLIBC_INTEGER_PRINTF_SCANF -DPICOLIBC_TLS --include picolibc.h
else
LDFLAGS += -lc -lrdimon
CFLAGS += -specs=nano.specs --specs=rdimon.specs --include newlib.h
endif
LDFLAGS += -Xlinker -Map=${BUILD_DIR}/output.map
LDFLAGS += -Wl,--gc-sections
CFLAGS += -nostartfiles -mthumb -mcpu=cortex-m3 -Wno-error=implicit-function-declaration
CFLAGS += -nostartfiles
CFLAGS += -mthumb
CFLAGS += -mcpu=cortex-m3
CFLAGS += -Wno-error=implicit-function-declaration
CFLAGS += -Wno-builtin-declaration-mismatch -Werror
CFLAGS += -Wall -Wextra
CFLAGS += -ffunction-sections -fdata-sections
ifeq ($(PICOLIBC), 1)
CFLAGS += -specs=picolibc.specs -DPICOLIBC_INTEGER_PRINTF_SCANF
endif
ifeq ($(DEBUG), 1)
CFLAGS += -ggdb3 -Og
else
CFLAGS += -O3
endif
CFLAGS += -fstrict-aliasing -Wstrict-aliasing -Wno-error=address-of-packed-member
CFLAGS += -fstrict-aliasing -Wstrict-aliasing -Wno-error=address-of-packed-member
OBJ_FILES := $(SOURCE_FILES:%.c=$(BUILD_DIR)/%.o)
@ -113,4 +120,3 @@ ${BUILD_DIR}/%.o : %.c Makefile
clean:
-rm -rf build