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 committed by Randy Mackay
parent 837d490299
commit 7f83b233e3
1 changed files with 2 additions and 1 deletions

View File

@ -699,6 +699,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]