soc/integration/cpu_interface: don't raise OSError if we are not going to compile...
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 11 Sep 2019 16:30:28 +0000 (18:30 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Wed, 11 Sep 2019 16:30:28 +0000 (18:30 +0200)
litex/soc/integration/builder.py
litex/soc/integration/cpu_interface.py

index 3c171950f16fb4306d387fe4d9b8466e17c38044..a103374e67b80d4b5ff4ea338b9156395836e117 100644 (file)
@@ -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")
index 238f5203b9e804e31c10567f2790d46ec8c68b7d..3ac6066efdf0283fc0cdc3845e42136efeb1040e 100644 (file)
@@ -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"