mirror of https://github.com/ARMmbed/mbed-os.git
Export linker flags so that bootloader projects build correctly
parent
5bddd881e9
commit
e783e98066
|
@ -172,6 +172,7 @@ class Uvision(Exporter):
|
||||||
flags['asm_flags'] = asm_flag_string
|
flags['asm_flags'] = asm_flag_string
|
||||||
# All non-asm flags are in one template field
|
# All non-asm flags are in one template field
|
||||||
c_flags = list(set(flags['c_flags'] + flags['cxx_flags'] +flags['common_flags']))
|
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
|
# These flags are in template to be set by user i n IDE
|
||||||
template = ["--no_vla", "--cpp", "--c99"]
|
template = ["--no_vla", "--cpp", "--c99"]
|
||||||
# Flag is invalid if set in template
|
# 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)
|
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'] = [flag.replace('"','\\"') for flag in c_flags if not invalid_flag(flag)]
|
||||||
flags['c_flags'] = " ".join(flags['c_flags'])
|
flags['c_flags'] = " ".join(flags['c_flags'])
|
||||||
|
flags['ld_flags'] = " ".join(flags['ld_flags'])
|
||||||
return flags
|
return flags
|
||||||
|
|
||||||
def format_src(self, srcs):
|
def format_src(self, srcs):
|
||||||
|
|
|
@ -410,7 +410,7 @@
|
||||||
<ScatterFile>{{linker_script}}</ScatterFile>
|
<ScatterFile>{{linker_script}}</ScatterFile>
|
||||||
<IncludeLibs></IncludeLibs>
|
<IncludeLibs></IncludeLibs>
|
||||||
<IncludeLibsPath></IncludeLibsPath>
|
<IncludeLibsPath></IncludeLibsPath>
|
||||||
<Misc></Misc>
|
<Misc>{{ld_flags}}</Misc>
|
||||||
<LinkerInputFile></LinkerInputFile>
|
<LinkerInputFile></LinkerInputFile>
|
||||||
<DisabledWarnings></DisabledWarnings>
|
<DisabledWarnings></DisabledWarnings>
|
||||||
</LDads>
|
</LDads>
|
||||||
|
|
Loading…
Reference in New Issue