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
This commit is contained in:
Andrew Tridgell 2023-07-04 14:55:37 +10:00
parent e05700e10d
commit 37253c13d9
1 changed files with 2 additions and 1 deletions

View File

@ -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]