From 16b6b357ca74bcae2c91b4011aafb9b0326a834f Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 11 Sep 2019 18:30:28 +0200 Subject: [PATCH] soc/integration/cpu_interface: don't raise OSError if we are not going to compile software and compilation toolchain is not found --- litex/soc/integration/builder.py | 2 +- litex/soc/integration/cpu_interface.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/litex/soc/integration/builder.py b/litex/soc/integration/builder.py index 3c171950..a103374e 100644 --- a/litex/soc/integration/builder.py +++ b/litex/soc/integration/builder.py @@ -80,7 +80,7 @@ class Builder: variables_contents = [] def define(k, v): variables_contents.append("{}={}\n".format(k, _makefile_escape(v))) - for k, v in cpu_interface.get_cpu_mak(self.soc.cpu): + for k, v in cpu_interface.get_cpu_mak(self.soc.cpu, self.compile_software): define(k, v) # Distinguish between LiteX and MiSoC. define("LITEX", "1") diff --git a/litex/soc/integration/cpu_interface.py b/litex/soc/integration/cpu_interface.py index 238f5203..3ac6066e 100644 --- a/litex/soc/integration/cpu_interface.py +++ b/litex/soc/integration/cpu_interface.py @@ -30,7 +30,7 @@ def get_constant(name, constants): return v return None -def get_cpu_mak(cpu): +def get_cpu_mak(cpu, compile_software): # select between clang and gcc clang = os.getenv("CLANG", "") if clang != "": @@ -70,6 +70,8 @@ def get_cpu_mak(cpu): r = t break if r is None: + if not compile_software: + return "--not-found--" msg = "Unable to find any of the cross compilation toolchains:\n" for i in range(len(triple)): msg += "- " + triple[i] + "\n" -- 2.30.2