soc/integration/cpu_interface: generate error if unable to find any of the cross...
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Sat, 6 Oct 2018 19:32:38 +0000 (21:32 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Sat, 6 Oct 2018 19:32:38 +0000 (21:32 +0200)
litex/soc/integration/cpu_interface.py

index 21cbd2725fb8a98253076dafabd202a561daa5c1..fb8c1017fe92e4fc01e2f210388a1d43f740f296 100644 (file)
@@ -31,13 +31,20 @@ def get_cpu_mak(cpu):
 
     # select triple when more than one
     def select_triple(triple):
-        if isinstance(triple, tuple):
+        r = None
+        if not isinstance(triple, tuple):
+            triple = (triple)
+        for i in range(len(triple)):
+            t = triple[i]
+            if which(t+"-gcc"):
+                r = t
+                break
+        if r is None:
+            msg = "Unable to find any of the cross compilation toolchains:\n"
             for i in range(len(triple)):
-                t = triple[i]
-                if which(t+"-gcc"):
-                    return t
-        else:
-            return triple
+                msg += "- " + triple[i] + "\n"
+            raise OSError(msg)
+        return r
 
     # return informations
     return [