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 58d66d7a1e
commit e922d6225f
1 changed files with 2 additions and 1 deletions

View File

@ -699,6 +699,7 @@ def build(bld):
'fopen', 'fflush', 'fwrite', 'fread', 'fputs', 'fgets', 'fopen', 'fflush', 'fwrite', 'fread', 'fputs', 'fgets',
'clearerr', 'fseek', 'ferror', 'fclose', 'tmpfile', 'getc', 'ungetc', 'feof', 'clearerr', 'fseek', 'ferror', 'fclose', 'tmpfile', 'getc', 'ungetc', 'feof',
'ftell', 'freopen', 'remove', 'vfprintf', 'fscanf', '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: for w in wraplist:
bld.env.LINKFLAGS += ['-Wl,--wrap,%s' % w] bld.env.LINKFLAGS += ['-Wl,--wrap,%s' % w]