build: Ensure mandatory compiler/linker flags

Make sure the flags are present in all build configurations.
This commit is contained in:
Sebastian Huber
2022-02-24 14:56:15 +01:00
parent 117e0cdafd
commit 3f0f73956d

View File

@@ -194,16 +194,16 @@ class Builder(builder.ModuleManager):
conf.env['HAVE_%s' % l.upper()] = True
else:
bld.fatal('invalid config test: %s' % (configTest))
section_flags = ["-fdata-sections", "-ffunction-sections"]
_add_flags_if_not_present(conf.env.CFLAGS, section_flags)
_add_flags_if_not_present(conf.env.CXXFLAGS, section_flags)
_add_flags_if_not_present(conf.env.LINKFLAGS, ["-Wl,--gc-sections"])
conf.env.CFLAGS = _remove_bsp_include_path(conf.env.IFLAGS,
conf.env.CFLAGS)
conf.env.CXXFLAGS = _remove_bsp_include_path(conf.env.IFLAGS,
conf.env.CXXFLAGS)
conf.env.LINKFLAGS = _remove_bsp_include_path(conf.env.IFLAGS,
conf.env.LINKFLAGS)
section_flags = ["-fdata-sections", "-ffunction-sections"]
_add_flags_if_not_present(conf.env.CFLAGS, section_flags)
_add_flags_if_not_present(conf.env.CXXFLAGS, section_flags)
_add_flags_if_not_present(conf.env.LINKFLAGS, ["-Wl,--gc-sections"])
def build(self, bld):
#