summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithpac@amazon.com>2023-03-02 13:01:35 -0800
committerPaul Bartell <paul.bartell@gmail.com>2023-03-30 12:32:55 -0700
commit82e8d335b8816e26fed4ba4c7fef85ee85f6698c (patch)
tree3fdcd0670ef1e21192909419c721c7ec419a7c54
parent15826fe5cc0e4e4717a570c6098c403de7528eb2 (diff)
downloadfreertos-git-82e8d335b8816e26fed4ba4c7fef85ee85f6698c.tar.gz
Demo/CORTEX_M3_MPS2_QEMU_GCC: Add option to build with picolibc
When built with PICOLIBC=1, selects picolibc as the C library by removing the newlib-nano linker flags and adding --specs=picolibc.specs to the compiler flags. This also selects the integer-only printf variant provided within picolibc to reduce flash use by adding -DPICOLIBC_INTEGER_PRINTF_SCANF. Signed-off-by: Keith Packard <keithpac@amazon.com>
-rw-r--r--FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/Makefile b/FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/Makefile
index 9b5f240b9..d4a48ebdb 100644
--- a/FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/Makefile
+++ b/FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/Makefile
@@ -66,7 +66,10 @@ endif
DEFINES := -DQEMU_SOC_MPS2 -DHEAP3
-LDFLAGS = -T ./scripts/mps2_m3.ld -specs=nano.specs --specs=rdimon.specs -lc -lrdimon
+LDFLAGS = -T ./scripts/mps2_m3.ld
+ifneq ($(PICOLIBC), 1)
+LDFLAGS += -specs=nano.specs --specs=rdimon.specs -lc -lrdimon
+endif
LDFLAGS += -Xlinker -Map=${BUILD_DIR}/output.map
LDFLAGS += -Wl,--gc-sections
@@ -74,6 +77,9 @@ CFLAGS += -nostartfiles -mthumb -mcpu=cortex-m3 -Wno-error=implicit-function-dec
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