From 79d733a1af1ec0e23b2dc76aecb63f0f021d0aaa Mon Sep 17 00:00:00 2001 From: Koen Zandberg Date: Tue, 7 Jul 2020 11:53:45 +0200 Subject: [PATCH] picolibc: glue sbrk to heap start/end [v2] --- v2: Squash fixes in --- makefiles/libc/picolibc.mk | 4 ++++ sys/picolibc_syscalls_default/syscalls.c | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/makefiles/libc/picolibc.mk b/makefiles/libc/picolibc.mk index 04055b4973..c7d1ba8b62 100644 --- a/makefiles/libc/picolibc.mk +++ b/makefiles/libc/picolibc.mk @@ -11,6 +11,10 @@ endif ifeq (1,$(USE_PICOLIBC)) LINKFLAGS += -specs=picolibc.specs + # RIOT uses _sheap and _eheap for heap start and end, PicoLIBC uses + # __heap_start and __heap_end. This glues these different names together. + LINKFLAGS += -Wl,--defsym=__heap_end=_eheap + LINKFLAGS += -Wl,--defsym=__heap_start=_sheap CFLAGS += -specs=picolibc.specs endif diff --git a/sys/picolibc_syscalls_default/syscalls.c b/sys/picolibc_syscalls_default/syscalls.c index a17be9b0b8..3baa9b3a54 100644 --- a/sys/picolibc_syscalls_default/syscalls.c +++ b/sys/picolibc_syscalls_default/syscalls.c @@ -28,8 +28,6 @@ #include "periph/pm.h" #include "stdio_base.h" -uint8_t sbrk[1]; - /** * @brief Exit a program without cleaning up files *