diff --git a/litex/soc/integration/builder.py b/litex/soc/integration/builder.py index 3c171950f..a103374e6 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 238f5203b..3ac6066ef 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"