--- /dev/null
+import os
+
+# set up environment variable overrides, can use for different versions
+# as well as native (TALOS-II POWER9) builds.
+cmds = {}
+for cmd in ['objcopy', 'as', 'ld', 'gcc', 'ar', 'gdb']:
+ cmds[cmd] = os.environ.get(cmd.upper(), "powerpc64-linux-gnu-%s" % cmd)
+
+
import sys
from io import BytesIO
+from soc.simulator.envcmds import cmds
filedir = os.path.dirname(os.path.realpath(__file__))
memmap = os.path.join(filedir, "memmap")
def _get_binary(self, elffile):
self.binfile = tempfile.NamedTemporaryFile(suffix=".bin")
- args = ["powerpc64-linux-gnu-objcopy",
+ args = [cmds['objcopy'],
"-O", "binary",
"-I", self.endian_fmt,
elffile.name,
def _link(self, ofile):
with tempfile.NamedTemporaryFile(suffix=".elf") as elffile:
- args = ["powerpc64-linux-gnu-ld",
+ args = [cmds['ld'],
self.ld_fmt,
"-o", elffile.name,
"-T", memmap,
def _assemble(self):
with tempfile.NamedTemporaryFile(suffix=".o") as outfile:
- args = ["powerpc64-linux-gnu-as",
+ args = [cmds['as'],
'-mpower9',
'-mregnames',
self.obj_fmt,