From 948a0012c5b181292d78a9e82c72bd625b684843 Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Mon, 6 Sep 2021 08:40:59 +0530 Subject: [PATCH] waf: fix build issue on cygwin after changes for external flash --- Tools/ardupilotwaf/chibios.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Tools/ardupilotwaf/chibios.py b/Tools/ardupilotwaf/chibios.py index cf652408f7309..f3d9feade4e97 100644 --- a/Tools/ardupilotwaf/chibios.py +++ b/Tools/ardupilotwaf/chibios.py @@ -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) @@ -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 @@ -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):