Merge pull request #246 from gsomlo/gls-native-rv64
software: use native toolchain for same host, target architectures
This commit is contained in:
commit
d79cd87dd6
|
@ -15,6 +15,7 @@
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from shutil import which
|
from shutil import which
|
||||||
|
from sysconfig import get_platform
|
||||||
|
|
||||||
from migen import *
|
from migen import *
|
||||||
|
|
||||||
|
@ -58,8 +59,13 @@ def get_cpu_mak(cpu):
|
||||||
r = None
|
r = None
|
||||||
if not isinstance(triple, tuple):
|
if not isinstance(triple, tuple):
|
||||||
triple = (triple,)
|
triple = (triple,)
|
||||||
|
p = get_platform()
|
||||||
for i in range(len(triple)):
|
for i in range(len(triple)):
|
||||||
t = triple[i]
|
t = triple[i]
|
||||||
|
# use native toolchain if host and target platforms are the same
|
||||||
|
if t == 'riscv64-unknown-elf' and p == 'linux-riscv64':
|
||||||
|
r = '--native--'
|
||||||
|
break
|
||||||
if which(t+"-gcc"):
|
if which(t+"-gcc"):
|
||||||
r = t
|
r = t
|
||||||
break
|
break
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
|
ifeq ($(TRIPLE),--native--)
|
||||||
|
TARGET_PREFIX=
|
||||||
|
else
|
||||||
TARGET_PREFIX=$(TRIPLE)-
|
TARGET_PREFIX=$(TRIPLE)-
|
||||||
|
endif
|
||||||
|
|
||||||
RM ?= rm -f
|
RM ?= rm -f
|
||||||
PYTHON ?= python3
|
PYTHON ?= python3
|
||||||
|
|
Loading…
Reference in New Issue