Export linker flags so that bootloader projects build correctly

pull/5030/head
Chris Snow 2017-09-05 22:00:42 +01:00
parent 5bddd881e9
commit e783e98066
2 changed files with 3 additions and 1 deletions

View File

@ -172,6 +172,7 @@ class Uvision(Exporter):
flags['asm_flags'] = asm_flag_string
# All non-asm flags are in one template field
c_flags = list(set(flags['c_flags'] + flags['cxx_flags'] +flags['common_flags']))
ld_flags = list(set(flags['ld_flags'] ))
# These flags are in template to be set by user i n IDE
template = ["--no_vla", "--cpp", "--c99"]
# Flag is invalid if set in template
@ -179,6 +180,7 @@ class Uvision(Exporter):
invalid_flag = lambda x: x in template or re.match("-O(\d|time)", x)
flags['c_flags'] = [flag.replace('"','\\"') for flag in c_flags if not invalid_flag(flag)]
flags['c_flags'] = " ".join(flags['c_flags'])
flags['ld_flags'] = " ".join(flags['ld_flags'])
return flags
def format_src(self, srcs):

View File

@ -410,7 +410,7 @@
<ScatterFile>{{linker_script}}</ScatterFile>
<IncludeLibs></IncludeLibs>
<IncludeLibsPath></IncludeLibsPath>
<Misc></Misc>
<Misc>{{ld_flags}}</Misc>
<LinkerInputFile></LinkerInputFile>
<DisabledWarnings></DisabledWarnings>
</LDads>