Skip to content

Commit 1397b4c

Browse files
committed
Make ARM tests runnable with QEMU
Use system qemu-armhf for the emulator for tests. The command here basically matches what the run_under_qemu_arm script (which can be seen at tools/trusted_cross_toolchains/qemu_tool_arm.sh) was doing. Also change the emulator in run.py.
1 parent 0eb0ca4 commit 1397b4c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

SConstruct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2484,7 +2484,7 @@ def SetUpLinuxEnvArm(env):
24842484
jail = env.GetToolchainDir(toolchain_name='arm_trusted')
24852485
if not platform.machine().startswith('arm'):
24862486
# Allow emulation on non-ARM hosts.
2487-
env.Replace(EMULATOR=jail + '/run_under_qemu_arm')
2487+
env.Replace(EMULATOR='qemu-armhf -L /usr/arm-linux-gnueabihf/ -cpu cortex-a9')
24882488
if env.Bit('built_elsewhere'):
24892489
def FakeInstall(dest, source, env):
24902490
print('Not installing', dest)

run.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ def SetupEnvironment():
3535
env.pnacl_base = os.path.join(env.toolchain_base, 'pnacl_newlib')
3636

3737
# QEMU
38-
env.arm_root = os.path.join(env.toolchain_base, 'arm_trusted')
39-
env.qemu_arm = os.path.join(env.arm_root, 'run_under_qemu_arm')
38+
env.qemu_arm_args = ['qemu-armhf', '-L', '/usr/arm-linux-gnueabihf/']
4039

4140
env.mips32_root = os.path.join(env.toolchain_base, 'mips_trusted')
4241
env.qemu_mips32 = os.path.join(env.mips32_root, 'run_under_qemu_mips32')
@@ -262,7 +261,7 @@ def RunSelLdr(args, quiet_args=[], collate=False, stdin_string=None):
262261
bootstrap_loader_args = []
263262
arch = pynacl.platform.GetArch3264()
264263
if arch != pynacl.platform.ARCH3264_ARM and env.arch == 'arm':
265-
prefix = [ env.qemu_arm, '-cpu', 'cortex-a9']
264+
prefix = env.qemu_arm_args + ['-cpu', 'cortex-a9']
266265
if env.trace:
267266
prefix += ['-d', 'in_asm,op,exec,cpu']
268267
args = ['-Q'] + args

0 commit comments

Comments
 (0)