Skip to content

Commit 8d8cf1a

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 8d8cf1a

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

tools/toolchains/arm.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -583,11 +583,21 @@ def get_compile_options(self, defines, includes, for_asm=False):
583583
return opts
584584

585585
def assemble(self, source, object, includes):
586-
cmd_pre = copy(self.asm)
586+
# Preprocess first, then assemble
587+
root, _ = splitext(object)
588+
tempfile = root + '.E'
589+
590+
# Build preprocess assemble command
591+
cmd_pre = copy(self.cc)
587592
cmd_pre.extend(self.get_compile_options(
588-
self.get_symbols(True), includes, for_asm=True))
589-
cmd_pre.extend(["-o", object, source])
590-
return [cmd_pre]
593+
self.get_symbols(True), includes, for_asm=False))
594+
cmd_pre.extend(["-E", "-MT", object, "-o", tempfile, source])
595+
596+
# Build main assemble command
597+
cmd = self.asm + ["-o", object, tempfile]
598+
599+
# Return command array, don't execute
600+
return [cmd_pre, cmd]
591601

592602
def compile(self, cc, source, object, includes):
593603
cmd = copy(cc)

0 commit comments

Comments
 (0)