Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
sdk_platform: linux-amd64
apt_packages: g++-i686-linux-gnu libc6:i386
scons_build_args: platform=x86-32 --no-clang werror=0
scons_tests: small_tests medium_tests large_tests
scons_tests: small_tests{,_irt} medium_tests{,_irt} large_tests{,_irt}
vpython: pyenv/bin/python

- name: Linux armhf GCC
Expand All @@ -39,14 +39,14 @@ jobs:
sdk_platform: linux-amd64
apt_packages: g++-arm-linux-gnueabihf qemu-user
scons_build_args: platform=arm --no-clang werror=0
scons_tests: no_gdb_tests=1 small_tests medium_tests
scons_tests: no_gdb_tests=1 small_tests{,_irt} medium_tests{,_irt}
vpython: pyenv/bin/python

- name: Linux amd64 Clang
vm_image: ubuntu-22.04
sdk_platform: linux-amd64
scons_build_args: platform=x86-64 --clang werror=1
scons_tests: small_tests medium_tests large_tests
scons_tests: small_tests{,_irt} medium_tests{,_irt} large_tests{,_irt}
vpython: pyenv/bin/python

- name: macOS amd64 AppleClang
Expand All @@ -61,7 +61,7 @@ jobs:
vm_image: windows-2022
sdk_platform: windows-amd64
scons_build_args: platform=x86-64 --no-clang werror=1 mingw_dir=mingw/mingw
scons_tests: small_tests medium_tests large_tests disable_tests=run_toolchain_python_tests
scons_tests: small_tests{,_irt} medium_tests{,_irt} large_tests{,_irt} disable_tests=run_toolchain_python_tests
vpython: pyenv/Scripts/python
python_packages: pywin32
mingw_url: https://github.com/niXman/mingw-builds-binaries/releases/download/16.1.0-rt_v14-rev1/x86_64-16.1.0-release-posix-seh-msvcrt-rt_v14-rev1.7z
Expand All @@ -79,7 +79,7 @@ jobs:
vm_image: windows-2022
sdk_platform: windows-amd64
scons_build_args: platform=x86-64 --no-clang mingw=1 werror=1 mingw_dir=mingw/mingw
scons_tests: small_tests medium_tests large_tests disable_tests=run_toolchain_python_tests
scons_tests: small_tests{,_irt} medium_tests{,_irt} large_tests{,_irt} disable_tests=run_toolchain_python_tests
vpython: pyenv/Scripts/python
python_packages: pywin32
mingw_url: https://github.com/niXman/mingw-builds-binaries/releases/download/16.1.0-rt_v14-rev1/x86_64-16.1.0-release-posix-seh-msvcrt-rt_v14-rev1.7z
Expand All @@ -93,7 +93,6 @@ jobs:
NPROC_COMMAND: ${{ matrix.nproc_command }}
PYTHON_PACKAGES: ${{ matrix.python_packages }}
SCONS_BUILD_ARGS: ${{ matrix.scons_build_args }}
SCONS_TESTS: ${{ matrix.scons_tests }}
SDK_PLATFORM: ${{ matrix.sdk_platform }}
VPYTHON: ${{ matrix.vpython }}

Expand Down Expand Up @@ -144,11 +143,11 @@ jobs:
set -xue
parallelism="$(${NPROC_COMMAND:-nproc})"
echo "Build parallelism: ${parallelism}"
${VPYTHON} -m SCons --mode=opt-host,nacl saigo=1 saigo_newlib_dir=sdk/sdk ${SCONS_BUILD_ARGS} all_programs -j${parallelism} --verbose
${VPYTHON} -m SCons --mode=opt-host,nacl,nacl_irt_test saigo=1 saigo_newlib_dir=sdk/sdk ${SCONS_BUILD_ARGS} all_programs -j${parallelism} --verbose

- name: Test
if: success() && matrix.scons_tests != ''
run: |
set -xue
parallelism="$(${NPROC_COMMAND:-nproc})"
${VPYTHON} -m SCons --mode=opt-host,nacl saigo=1 saigo_newlib_dir=sdk/sdk ${SCONS_BUILD_ARGS} ${SCONS_TESTS} -j${parallelism} --verbose --keep-going disable_flaky_tests=1
${VPYTHON} -m SCons --mode=opt-host,nacl saigo=1 saigo_newlib_dir=sdk/sdk ${SCONS_BUILD_ARGS} ${{ matrix.scons_tests }} -j${parallelism} --verbose --keep-going disable_flaky_tests=1
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ used command line arguments for our build:
- `opt-host`: trusted code toolchain using optimization flags for the current OS
- `dbg-host`: trusted code toolchain with debugging flags for th ecurrent OS
- `nacl`: NaCl toolchain to build the sandboxed code
- `nacl_irt`, `nacl_irt_test`: NaCl toolchains with IRT enabled. (This is used in production.) Note that adding `nacl` automatically enables `nacl_irt`.
- `saigo=1` to use the Saigo NaCl toolchain. This is the only NaCl toolchain we support so you must always add this when using the `nacl` mode.
- `--platform=x86`, `--platform=x86-64`, or `--platform=arm`: choose target architecture.
- `--verbose`: show compiler and test command lines and other stuff
- `-j<N>` build parallelism
- Target names, e.g. `sel_ldr` (NaCl loader), `irt_core`, `small_tests`, `medium_tests`, `all_programs`, `large_tests`, `huge_tests`, `run_<something>_test`
- Target names, e.g. `sel_ldr` (NaCl loader), `irt_core`, `small_tests`, `small_tests_irt`, `medium_tests`, `all_programs`, `large_tests`, `huge_tests`, `run_<something>_test`

There is also a toolchain for host-mode tools. Its configuration is based on the same arguments
used for the trusted toolchain.
Expand Down
8 changes: 8 additions & 0 deletions tests/irt_ext/libc/thread_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ static int do_thread_creation_test(struct threading_environment *env) {
return 1;
}

/*
* The IRT thread exit hook is called near the end of pthread_exit, after
* the pthread implementation already marked the thread dead. So it can
* still be running after the thread was joined. Note: num_threads_exited
* is declared volatile.
*/
while (env->num_threads_exited == 0) {}

if (env->num_threads_exited != 1) {
irt_ext_test_print("do_thread_creation_test: Thread Exit was not"
" recorded in the environment.\n");
Expand Down
6 changes: 4 additions & 2 deletions tests/mmap_prot_exec/nacl.scons
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,11 @@ if (env.Bit('tests_use_irt') and env.Bit('nacl_static_link') and
datafile = asm_env.Command(
'exec_data', objfile,
'${OBJCOPY} -j .text -O binary ${SOURCES} ${TARGET}')
env.Alias('all_programs', datafile)
# FIXME: needs objdump
# env.Alias('all_programs', datafile)
node = env.CommandSelLdrTestNacl('mmap_code_data_alloc_test.out',
nexe, [datafile],
sel_ldr_flags=['-a'])
env.AddNodeToTestSuite(node, ['small_tests'],
'run_mmap_code_data_alloc_test')
'run_mmap_code_data_alloc_test',
is_broken=True)
Loading