Skip to content

Commit da090fa

Browse files
committed
Workaround for ARMC6 Windows 7 assembler issue
On Windows 7 using --preproc option in ARMC6 assembler doesn't work when -MD option is also specified. Compiler creates incorrect filename for dependency file and compilation files. To workaround this issue, this change returns to using a temporary file and separately calling preprocessor and assembler (as in a case of ARMC5).
1 parent 014a5ec commit da090fa

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

tools/toolchains/arm.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -575,19 +575,24 @@ def get_compile_options(self, defines, includes, for_asm=False):
575575
config_header = self.get_config_header()
576576
if config_header:
577577
opts.extend(self.get_config_option(config_header))
578-
if for_asm:
579-
return [
580-
"--cpreproc",
581-
"--cpreproc_opts=%s" % ",".join(self.flags['common'] + opts)
582-
]
583578
return opts
584579

585580
def assemble(self, source, object, includes):
586-
cmd_pre = copy(self.asm)
581+
# Preprocess first, then assemble
582+
root, _ = splitext(object)
583+
tempfile = root + '.E'
584+
585+
# Build preprocess assemble command
586+
cmd_pre = copy(self.cc)
587587
cmd_pre.extend(self.get_compile_options(
588588
self.get_symbols(True), includes, for_asm=True))
589-
cmd_pre.extend(["-o", object, source])
590-
return [cmd_pre]
589+
cmd_pre.extend(["-E", "-MT", object, "-o", tempfile, source])
590+
591+
# Build main assemble command
592+
cmd = self.asm + ["-o", object, tempfile]
593+
594+
# Return command array, don't execute
595+
return [cmd_pre, cmd]
591596

592597
def compile(self, cc, source, object, includes):
593598
cmd = copy(cc)

0 commit comments

Comments
 (0)