waf: added --save-temps configure option

linking fails with this option, but the ii files are produced, which
is what is needed for diagnosing cache issues
This commit is contained in:
Andrew Tridgell 2022-02-22 14:22:19 +11:00
parent 3e1ffa3769
commit ad88f3e1e8
2 changed files with 9 additions and 0 deletions

View File

@ -894,6 +894,9 @@ class chibios(Board):
cfg.msg("Enabling ChibiOS asserts", "no")
if cfg.env.SAVE_TEMPS:
env.CXXFLAGS += [ '-S', '-save-temps=obj' ]
if cfg.options.disable_watchdog:
cfg.msg("Disabling Watchdog", "yes")
env.CFLAGS += [ '-DDISABLE_WATCHDOG' ]

View File

@ -155,6 +155,11 @@ def options(opt):
default=False,
help='enable OS level asserts.')
g.add_option('--save-temps',
action='store_true',
default=False,
help='save compiler temporary files.')
g.add_option('--enable-malloc-guard',
action='store_true',
default=False,
@ -387,6 +392,7 @@ def configure(cfg):
cfg.env.BOOTLOADER = cfg.options.bootloader
cfg.env.ENABLE_MALLOC_GUARD = cfg.options.enable_malloc_guard
cfg.env.ENABLE_STATS = cfg.options.enable_stats
cfg.env.SAVE_TEMPS = cfg.options.save_temps
cfg.env.HWDEF_EXTRA = cfg.options.extra_hwdef
if cfg.env.HWDEF_EXTRA: