Skip to content

Commit

Permalink
soc/integration/cpu_interface: generate error if unable to find any o…
Browse files Browse the repository at this point in the history
…f the cross compilation toolchains
  • Loading branch information
enjoy-digital committed Oct 6, 2018
1 parent 168b07b commit 3b27d2a
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions litex/soc/integration/cpu_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
Expand Down

0 comments on commit 3b27d2a

Please sign in to comment.