Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(684)

Unified Diff: pydir/build-runtime.py

Issue 1160873006: Set up crosstest to run simple loop in Om1 on ARM (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: xyz Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pydir/build-runtime.py
diff --git a/pydir/build-runtime.py b/pydir/build-runtime.py
index cc1054ff583fc9dcff6a45ef9dfed79bb62a8fc2..4010b51d7c065268c4ac6ae0e062ca1e15270724 100755
--- a/pydir/build-runtime.py
+++ b/pydir/build-runtime.py
@@ -1,13 +1,15 @@
#!/usr/bin/env python2
import argparse
-from collections import namedtuple
import os
import shutil
import tempfile
+
+import targets
from utils import shellcmd
from utils import FindBaseNaCl
+
def Translate(ll_files, extra_args, obj, verbose):
"""Translate a set of input bitcode files into a single object file.
@@ -29,6 +31,7 @@ def Translate(ll_files, extra_args, obj, verbose):
obj
], echo=verbose)
+
def PartialLink(obj_files, extra_args, lib, verbose):
"""Partially links a set of obj files into a final obj library."""
shellcmd(['le32-nacl-ld',
@@ -37,10 +40,6 @@ def PartialLink(obj_files, extra_args, lib, verbose):
] + extra_args + obj_files, echo=verbose)
-TargetInfo = namedtuple('TargetInfo',
- ['target', 'triple', 'llc_flags', 'ld_emu'])
-
-
def MakeRuntimesForTarget(target_info, ll_files,
srcdir, tempdir, rtdir, verbose):
def TmpFile(template):
@@ -72,7 +71,7 @@ def MakeRuntimesForTarget(target_info, ll_files,
# The sandboxed library does not get the profiler helper function as the
# binaries are linked with -nostdlib.
Translate(ll_files,
- ['-mtriple=' + target_info.triple.replace('linux', 'nacl')] +
+ ['-mtriple=' + targets.ConvertTripleToNaCl(target_info.triple)] +
target_info.llc_flags,
OutFile('{rtdir}/szrt_sb_{target}.o'),
verbose)
@@ -123,19 +122,9 @@ def main():
ll_files = ['{dir}/szrt.ll'.format(dir=tempdir),
'{srcdir}/szrt_ll.ll'.format(srcdir=srcdir)]
- x8632_target = TargetInfo(target='x8632',
- triple='i686-none-linux',
- llc_flags=['-mcpu=pentium4m'],
- ld_emu='elf_i386_nacl')
- MakeRuntimesForTarget(x8632_target, ll_files,
+ MakeRuntimesForTarget(targets.X8632Target, ll_files,
srcdir, tempdir, rtdir, args.verbose)
- arm32_target = TargetInfo(target='arm32',
- triple='armv7a-none-linux-gnueabihf',
- llc_flags=['-mcpu=cortex-a9',
- '-float-abi=hard',
- '-mattr=+neon'],
- ld_emu='armelf_nacl')
- MakeRuntimesForTarget(arm32_target, ll_files,
+ MakeRuntimesForTarget(targets.ARM32Target, ll_files,
srcdir, tempdir, rtdir, args.verbose)
finally:

Powered by Google App Engine
This is Rietveld 408576698