Browse Source

[Tools] Add _REENT_SMALL definition when enable nano-newlib

Bernard Xiong 7 years ago
parent
commit
c472533f02
1 changed files with 4 additions and 0 deletions
  1. 4 0
      tools/building.py

+ 4 - 0
tools/building.py

@@ -140,6 +140,10 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
         env['LIBLINKSUFFIX']   = '.lib'
         env['LIBDIRPREFIX'] = '--userlibpath '
 
+    if rtconfig.PLATFORM == 'gcc':
+        if env['LINKFLAGS'].find('nano.specs'):
+            env.AppendUnique(CPPDEFINES = ['_REENT_SMALL'])
+
     # patch for win32 spawn
     if env['PLATFORM'] == 'win32':
         win32_spawn = Win32Spawn()