Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
056f229
cmake: add MinGW CMake toolchains for cross-compilation
illwieckz Apr 7, 2025
7759493
cmake: add CMake scripts to build sel_ldr and nacl_helper_bootstrap
illwieckz Apr 7, 2025
b2e513f
cmake: use size optimization for nacl_helper_bootstrap, with toplevel…
illwieckz Oct 13, 2025
0137452
cmake: use path sanitization
illwieckz Jun 26, 2026
b81f158
cmake: add install target
illwieckz Jun 25, 2026
e4d94e4
cmake: NUKE ZERO_BASED_SANDBOX
illwieckz Oct 5, 2026
ededbf0
cmake: NUKE mipsel
illwieckz Oct 5, 2026
c198525
cmake: NUKE kernel check we will never do
illwieckz Oct 5, 2026
7d55dee
win32: silence the warning for the unused CheckCPUFeatureDetection() …
illwieckz Oct 5, 2026
20324a0
cmake: add the Yokai CMake framework
illwieckz Apr 7, 2025
eabf610
Use pre-built object files for tests/dynamic_code_loading/
slipher Oct 4, 2026
03df91a
Store Rosetta emulation detection result
slipher Oct 3, 2026
90ffb58
Minor cleanup in NaClFlushCacheForDoublyMappedCode
slipher Oct 4, 2026
fa4811e
Move NaClCopyCode function to nacl_text.c
slipher Oct 5, 2026
8dfe319
SysDyncodeModify: fix wrong instruction cache flush range
slipher Oct 5, 2026
ab09db9
Fix dyncode syscalls under Rosetta translation
slipher Oct 6, 2026
2b6293c
Fix a missing error check in nacl_tls_unittest
slipher Aug 17, 2026
bc997b5
Improve thread_exit syscall thread safety
slipher Aug 25, 2026
ce1db26
Don't run toolchain_build/ test
slipher Oct 13, 2026
65d1b6f
win32: skip some CPU detection on Windows with MinGW like amd64 MSVC
illwieckz Apr 8, 2025
69a746f
redo “Implement werror=0 for Windows” (e74712e7)
illwieckz Oct 23, 2026
89bc5d3
redo “Don't compile DEP check on 32-bit Windows” (7b000755)
illwieckz Oct 23, 2026
6c63057
somewhat redo “implement build with (mostly) MinGW” (d2351336)
illwieckz Oct 23, 2026
e51e0e2
redo “fix nacl_loader_bootstrap with GCC” (cedfe84a)
illwieckz Oct 23, 2026
4cc91a0
redo “Fix Mach crash forwarding on ARM Macs” (cf98ce25)
illwieckz Oct 23, 2026
822f7cb
redo “switch clock_gettime impl to POSIX backend” (583685e0)
illwieckz Oct 23, 2026
f4f7f8e
partially redo “Disable annoying MSVC warning in generated code” (c8e…
illwieckz Oct 23, 2026
ed51ac9
redo “Disable annoying maybe-uninitialized GCC warning” (6f5e7e11)
illwieckz Oct 23, 2026
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
4 changes: 2 additions & 2 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 medium_tests large_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 medium_tests large_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 Down
94 changes: 94 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
cmake_minimum_required(VERSION 3.12)

if (COMPILER_TARGET)
set(CMAKE_C_COMPILER_TARGET "${COMPILER_TARGET}")
set(CMAKE_CXX_COMPILER_TARGET "${COMPILER_TARGET}")
set(CMAKE_ASM_COMPILER_TARGET "${COMPILER_TARGET}")
endif()

project(native_client C CXX ASM)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

include(Yokai/Detection)
include(NaClFlags)

if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif()

option(BUILD_NACL_LOADER "Build the sel_ldr program." ON)

if (YOKAI_TARGET_SYSTEM_LINUX_COMPATIBILITY)
option(BUILD_NACL_HELPER_BOOTSTRAP "Build the nacl_helper_bootstrap program on platforms requiring it." ON)
endif()

if (BUILD_NACL_LOADER AND YOKAI_TARGET_SYSTEM_WINDOWS)
option(FORCE_NO_TRUSTED_BUILD "Prevent use of trusted toolchain." OFF)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to have any relevance when the build uses only one toolchain to begin with.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

endif()

if (BUILD_NACL_LOADER AND YOKAI_CXX_COMPILER_MSVC)
set(REQUIRE_MASM ON)
endif()

if (BUILD_NACL_LOADER AND YOKAI_TARGET_SYSTEM_MACOS)
set(REQUIRE_PYTHON ON)
endif()

if (BUILD_NACL_HELPER_BOOTSTRAP)
set(REQUIRE_PYTHON ON)
endif()

if (REQUIRE_PYTHON)
if (NOT PYTHON)
find_program(PATH_PYTHON NAMES "python3" DOC "Path to the python3 executable." REQUIRED)
endif()
endif()

if (REQUIRE_MASM)
enable_language(ASM_MASM)
# TODO: win64_asm_env = env.Clone(ASCOM='ml64 $ASFLAGS /c /Fo$TARGET $SOURCES')
# TODO: ldr_inputs += [win64_asm_env.ComponentObject('arch/x86_64/nacl_switch_unwind_win.asm')]
endif()

include_directories("include-hax")

if (YOKAI_TARGET_ARCH_I686)
set(VALIDATOR_ARCH_SUFFIX "_x86_32")
elseif (YOKAI_TARGET_ARCH_AMD64)
set(VALIDATOR_ARCH_SUFFIX "_x86_64")
elseif (YOKAI_TARGET_ARCH_ARMHF OR YOKAI_TARGET_ARCH_ARMEL)
set(VALIDATOR_ARCH_SUFFIX "_arm")
endif()

if (BUILD_NACL_LOADER)
add_subdirectory(src/shared/gio)
add_subdirectory(src/shared/imc)
add_subdirectory(src/shared/platform)
add_subdirectory(src/trusted/cpu_features)
add_subdirectory(src/trusted/debug_stub)
add_subdirectory(src/trusted/desc)
add_subdirectory(src/trusted/fault_injection)
add_subdirectory(src/trusted/interval_multiset)
add_subdirectory(src/trusted/nacl_base)
add_subdirectory(src/trusted/perf_counter)
add_subdirectory(src/trusted/platform_qualify)
add_subdirectory(src/trusted/validator)

if (YOKAI_TARGET_ARCH_I686 OR YOKAI_TARGET_ARCH_AMD64)
add_subdirectory(src/trusted/validator_x86)
add_subdirectory(src/trusted/validator_ragel)
elseif (YOKAI_TARGET_ARCH_ARMHF OR YOKAI_TARGET_ARCH_ARMEL)
add_subdirectory(src/trusted/validator_arm)
endif()
endif()

if (BUILD_NACL_LOADER)
add_subdirectory(src/trusted/service_runtime)
endif()

if (BUILD_NACL_HELPER_BOOTSTRAP)
add_subdirectory(src/trusted/service_runtime/linux)
endif()
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -2131,7 +2131,7 @@ def MakeBaseTrustedEnv(platform=None):
'tests/unittests/trusted/bits/build.scons',
'tests/unittests/trusted/platform_qualify/build.scons',
'tests/unittests/trusted/service_runtime/build.scons',
'toolchain_build/build.scons',
# 'toolchain_build/build.scons',
])

base_env.AddMethod(SDKInstallBin)
Expand Down
Loading
Loading