Browse Source

waftools: pebble_arm_gcc: allow building with 'modern' GCC

Signed-off-by: Joshua Wise <joshua@accelerated.tech>
Joshua Wise 6 months ago
parent
commit
7da47b70ab
2 changed files with 19 additions and 5 deletions
  1. 10 3
      waftools/pebble_arm_gcc.py
  2. 9 2
      wscript

+ 10 - 3
waftools/pebble_arm_gcc.py

@@ -130,7 +130,8 @@ def configure(conf):
                    '-Wno-missing-field-initializers',
                    '-Wno-error=unused-function',
                    '-Wno-error=unused-variable',
-                   '-Wno-error=unused-parameter' ]
+                   '-Wno-error=unused-parameter',
+                   '-Wno-error=unused-const-variable', ]
 
     if conf.using_clang_compiler():
       sysroot_path = find_sysroot_path(conf)
@@ -155,8 +156,14 @@ def configure(conf):
       # These warnings only exist in GCC
       c_warnings.append('-Wno-error=unused-but-set-variable')
       c_warnings.append('-Wno-packed-bitfield-compat')
-
-      if not ('4', '8') <= conf.env.CC_VERSION <= ('4', '9', '3'):
+      
+      # compatibility with the future; at some point we should take this out
+      c_warnings.append('-Wno-address-of-packed-member')
+      c_warnings.append('-Wno-enum-int-mismatch')
+      c_warnings.append('-Wno-expansion-to-defined')
+      c_warnings.append('-Wno-enum-conversion')
+
+      if not ('13', '0') <= conf.env.CC_VERSION <= ('14', '0', '0'):
         # Verify the toolchain we're using is allowed. This is to prevent us from accidentally
         # building and releasing firmwares that are built in ways we haven't tested.
 

+ 9 - 2
wscript

@@ -379,7 +379,12 @@ def _create_cm0_env(conf):
                '-Wall', '-Wextra', '-Werror', '-Wpointer-arith',
                '-Wno-unused-parameter', '-Wno-missing-field-initializers',
                '-Wno-error=unused-parameter',
-               '-Wno-packed-bitfield-compat']
+               '-Wno-error=unused-const-variable',
+               '-Wno-packed-bitfield-compat',
+               '-Wno-address-of-packed-member',
+               '-Wno-expansion-to-defined',
+               '-Wno-enum-int-mismatch',
+               '-Wno-enum-conversion']
 
     conf.find_program('arm-none-eabi-gcc', var='CC', mandatory=True)
     conf.env.AS = conf.env.CC
@@ -553,12 +558,14 @@ def configure(conf):
 
     conf.env.CLAR_DIR = conf.path.make_node('tools/clar/').abspath()
     conf.env.CFLAGS = [ '-std=c11',
-
                         '-Wall',
                         '-Werror',
                         '-Wno-error=unused-variable',
                         '-Wno-error=unused-function',
                         '-Wno-error=missing-braces',
+                        '-Wno-error=unused-const-variable',
+                        '-Wno-error=address-of-packed-member',
+                        '-Wno-enum-conversion',
 
                         '-g3',
                         '-gdwarf-4',