From 37253c13d98c1bd05f6c11b7cc6ec01435044378 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 4 Jul 2023 14:55:37 +1000 Subject: [PATCH] waf: wrap newlib alloc functions on ChibiOS this prevents scripting and string library functions from calling sbrk based alloction functions that are not thread safe --- Tools/ardupilotwaf/chibios.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tools/ardupilotwaf/chibios.py b/Tools/ardupilotwaf/chibios.py index af54fd3e7b..7f141d3c51 100644 --- a/Tools/ardupilotwaf/chibios.py +++ b/Tools/ardupilotwaf/chibios.py @@ -717,6 +717,7 @@ def build(bld): 'fopen', 'fflush', 'fwrite', 'fread', 'fputs', 'fgets', 'clearerr', 'fseek', 'ferror', 'fclose', 'tmpfile', 'getc', 'ungetc', 'feof', 'ftell', 'freopen', 'remove', 'vfprintf', 'fscanf', - '_gettimeofday', '_times', '_times_r', '_gettimeofday_r', 'time', 'clock' ] + '_gettimeofday', '_times', '_times_r', '_gettimeofday_r', 'time', 'clock', + '_sbrk_r', '_malloc_r', '_calloc_r', '_free_r'] for w in wraplist: bld.env.LINKFLAGS += ['-Wl,--wrap,%s' % w]