Browse Source

Fix Aarch64 architecture runtime issues

该问题由5b3320624da5149fc21c2d3e1f321d855e3d0dfe引入,导致工具链编译时加上了 -std=gnu99,其他架构是否出问题暂时未知
rcitach 1 week ago
parent
commit
5833e02e2f
1 changed files with 8 additions and 0 deletions
  1. 8 0
      libcpu/aarch64/SConscript

+ 8 - 0
libcpu/aarch64/SConscript

@@ -24,4 +24,12 @@ group = group + SConscript(os.path.join('common', 'SConscript'))
 if rtconfig.CPU != 'common':
     group = group + SConscript(os.path.join(rtconfig.CPU, 'SConscript'))
 
+def del_gnu99():
+    for g in Projects:
+        if g["name"] == "Kernel":
+            flags = re.sub(r'\s+', ' ', re.sub(r'\s*-std=gnu99\s*', ' ', g["LOCAL_CFLAGS"])).strip()
+            flags = re.sub(r'(?<!\s)(-Wunused)', r' \1', flags)
+            g["LOCAL_CFLAGS"] = flags
+
+RegisterPreBuildingAction(del_gnu99)
 Return('group')