Skip to content

Commit 814eaa9

Browse files
authored
Merge pull request #5030 from chrissnow/uVision-LDFlags
Export uVision linker flags so that bootloader projects build correctly
2 parents 8dfb491 + e783e98 commit 814eaa9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tools/export/uvision/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,15 @@ def format_flags(self):
172172
flags['asm_flags'] = asm_flag_string
173173
# All non-asm flags are in one template field
174174
c_flags = list(set(flags['c_flags'] + flags['cxx_flags'] +flags['common_flags']))
175+
ld_flags = list(set(flags['ld_flags'] ))
175176
# These flags are in template to be set by user i n IDE
176177
template = ["--no_vla", "--cpp", "--c99"]
177178
# Flag is invalid if set in template
178179
# Optimizations are also set in the template
179180
invalid_flag = lambda x: x in template or re.match("-O(\d|time)", x)
180181
flags['c_flags'] = [flag.replace('"','\\"') for flag in c_flags if not invalid_flag(flag)]
181182
flags['c_flags'] = " ".join(flags['c_flags'])
183+
flags['ld_flags'] = " ".join(flags['ld_flags'])
182184
return flags
183185

184186
def format_src(self, srcs):

tools/export/uvision/uvision.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@
410410
<ScatterFile>{{linker_script}}</ScatterFile>
411411
<IncludeLibs></IncludeLibs>
412412
<IncludeLibsPath></IncludeLibsPath>
413-
<Misc></Misc>
413+
<Misc>{{ld_flags}}</Misc>
414414
<LinkerInputFile></LinkerInputFile>
415415
<DisabledWarnings></DisabledWarnings>
416416
</LDads>

0 commit comments

Comments
 (0)