Skip to content

Commit

Permalink
Temporary fix for ARMC6 WIn7 assembler issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
lrusinowicz committed Mar 20, 2019
1 parent ed972c4 commit fa10eb8
Showing 1 changed file with 37 additions and 9 deletions.
46 changes: 37 additions & 9 deletions tools/toolchains/arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,19 +575,47 @@ def get_compile_options(self, defines, includes, for_asm=False):
config_header = self.get_config_header()
if config_header:
opts.extend(self.get_config_option(config_header))
if for_asm:
return [
"--cpreproc",
"--cpreproc_opts=%s" % ",".join(self.flags['common'] + opts)
]
#if for_asm:
# return [
# "--cpreproc",
# "--cpreproc_opts=%s" % ",".join(self.flags['common'] + opts)
# ]
return opts

# def assemble(self, source, object, includes):
# # Preprocess first, then assemble
# dir = join(dirname(object), '.temp')
# mkdir(dir)
# tempfile = join(dir, basename(object) + '.E.s')
#
# # Build preprocess assemble command
# cmd_pre = copy(self.asm)
# cmd_pre.extend(self.get_compile_options(
# self.get_symbols(True), includes, True))
# cmd_pre.extend(["-E", "-o", tempfile, source])
#
# cmd = copy(self.asm)
# cmd.extend(self.get_compile_options(
# self.get_symbols(True), includes, for_asm=True))
# cmd.extend(["-o", object, tempfile])
# return [cmd_pre, cmd]
def assemble(self, source, object, includes):
cmd_pre = copy(self.asm)
# Preprocess first, then assemble
dir = join(dirname(object), '.temp')
mkdir(dir)
tempfile = join(dir, basename(object) + '.E.s')

# Build preprocess assemble command
cmd_pre = copy(self.cc)
cmd_pre.extend(self.get_compile_options(
self.get_symbols(True), includes, for_asm=True))
cmd_pre.extend(["-o", object, source])
return [cmd_pre]
self.get_symbols(True), includes, True))
cmd_pre.extend(["-E", "-o", tempfile, source])

# Build main assemble command
cmd = self.asm + ["-o", object, tempfile]

# Return command array, don't execute
return [cmd_pre, cmd]

def compile(self, cc, source, object, includes):
cmd = copy(cc)
Expand Down

0 comments on commit fa10eb8

Please sign in to comment.