Skip to content

Commit cfdb72b

Browse files
author
Cruz Monrreal
authored
Merge pull request #10182 from lrusinowicz/armc6_assembler_win7_workaround
Workaround for ARMC6 Windows 7 assembler issue
2 parents fcf4999 + 8d8cf1a commit cfdb72b

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
@@ -638,11 +638,21 @@ def get_compile_options(self, defines, includes, for_asm=False):
638638
return opts
639639

640640
def assemble(self, source, object, includes):
641-
cmd_pre = copy(self.asm)
641+
# Preprocess first, then assemble
642+
root, _ = splitext(object)
643+
tempfile = root + '.E'
644+
645+
# Build preprocess assemble command
646+
cmd_pre = copy(self.cc)
642647
cmd_pre.extend(self.get_compile_options(
643-
self.get_symbols(True), includes, for_asm=True))
644-
cmd_pre.extend(["-o", object, source])
645-
return [cmd_pre]
648+
self.get_symbols(True), includes, for_asm=False))
649+
cmd_pre.extend(["-E", "-MT", object, "-o", tempfile, source])
650+
651+
# Build main assemble command
652+
cmd = self.asm + ["-o", object, tempfile]
653+
654+
# Return command array, don't execute
655+
return [cmd_pre, cmd]
646656

647657
def compile(self, cc, source, object, includes):
648658
cmd = copy(cc)

0 commit comments

Comments
 (0)