Skip to content

Conversation

@slipher
Copy link
Member

@slipher slipher commented Oct 17, 2025

Get Linux cross-compile builds working to the x86 and armhf architectures. For x86 all the tests pass. For ARM I have the small_tests passing so far. The command for running the ARM tests (requires the QEMU user-mode emulator to be installed when cross compiling) is scons --mode=opt-linux,nacl saigo=1 platform=arm small_tests.

For Linux toolchains (except x86-64 where I previously commented it
out), there were hard-coded sysroot flags referring to the paths of
Chromium's bundled dependencies. Get rid of this. On my machine the
cross toolchains work fine without it. But I added a
a 'sysroot' command line argument, so if anyone needs it they can
pass sysroot=... on the scons command line to configure a --sysroot flag.
This one only seems to be triggered when a test fails.
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.
This fixes a NaCl syscall that only exists for a test. Fixes the
run_infoleak_test test target on ARM.
REGS_SAVER_FUNC is meant to work even if the stack pointer is
misaligned, but the multi-register PUSH instructions crash if the stack
is misaligned, as per the ARM documentation. I guess the old(?) bundled
QEMU used by upstream doesn't implement this faithfully. Fix it by using
a series of single-register pushes instead.

Fixes the run_register_set_test test target on ARM.
@slipher
Copy link
Member Author

slipher commented Oct 20, 2025

Added another bit to Make ARM tests runnable with QEMU to update the emulator command for run.py also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants