Skip to content

Commit

Permalink
waf: fix build issue on cygwin after changes for external flash
Browse files Browse the repository at this point in the history
  • Loading branch information
bugobliterator authored and tridge committed Sep 6, 2021
1 parent 8a5ade1 commit 948a001
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Tools/ardupilotwaf/chibios.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def run(self):
if 'AP_OVERRIDE_UPLOAD_CMD' in os.environ:
cmd = "{} '{}'".format(os.environ['AP_OVERRIDE_UPLOAD_CMD'], src.abspath())
else:
cmd = "{} '{}/uploader.py' '{}'".format(self.env.get_flat('PYTHON'), upload_tools, src)
cmd = "{} '{}/uploader.py' '{}'".format(self.env.get_flat('PYTHON'), upload_tools, src.abspath())
if upload_port is not None:
cmd += " '--port' '%s'" % upload_port
return self.exec_command(cmd)
Expand Down Expand Up @@ -106,14 +106,14 @@ def run(self):
return ret
return ret
else:
cmd = "{} -O binary {} {}".format(self.env.get_flat('OBJCOPY'), self.inputs[0], self.outputs[0])
cmd = [self.env.get_flat('OBJCOPY'), '-O', 'binary', self.inputs[0].relpath(), self.outputs[0].relpath()]
self.exec_command(cmd)

'''list sections and split into two binaries based on section's location in internal, external or in ram'''
def split_sections(self):
# get a list of sections
cmd = "{} -A -x {}".format(self.env.get_flat('SIZE'), self.inputs[0])
out = self.generator.bld.cmd_and_log(cmd, quiet=Context.BOTH)
cmd = "'{}' -A -x {}".format(self.env.get_flat('SIZE'), self.inputs[0].relpath())
out = self.generator.bld.cmd_and_log(cmd, quiet=Context.BOTH, cwd=self.env.get_flat('BUILDROOT'))
extf_sections = []
intf_sections = []
is_text_in_extf = False
Expand Down Expand Up @@ -153,16 +153,16 @@ def split_sections(self):
Logs.error("Couldn't find .text section")
# create intf binary
if len(intf_sections):
cmd = "{} {} -O binary {} {}".format(self.env.get_flat('OBJCOPY'),
' '.join(intf_sections), self.inputs[0], self.outputs[0])
cmd = "'{}' {} -O binary {} {}".format(self.env.get_flat('OBJCOPY'),
' '.join(intf_sections), self.inputs[0].relpath(), self.outputs[0].relpath())
else:
cmd = "cp /dev/null {}".format(self.outputs[0])
cmd = "cp /dev/null {}".format(self.outputs[0].relpath())
ret = self.exec_command(cmd)
if (ret < 0):
return ret
# create extf binary
cmd = "{} {} -O binary {} {}".format(self.env.get_flat('OBJCOPY'),
' '.join(extf_sections), self.inputs[0], self.outputs[1])
cmd = "'{}' {} -O binary {} {}".format(self.env.get_flat('OBJCOPY'),
' '.join(extf_sections), self.inputs[0].relpath(), self.outputs[1].relpath())
return self.exec_command(cmd)

def __str__(self):
Expand Down

0 comments on commit 948a001

Please sign in to comment.