Repository navigation
CMake plumbing to build the loader (2) #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
illwieckz
wants to merge
28
commits into
illwieckz/mingw-2
Choose a base branch
from
illwieckz/cmake
base: illwieckz/mingw-2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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 7759493
cmake: add CMake scripts to build sel_ldr and nacl_helper_bootstrap
illwieckz b2e513f
cmake: use size optimization for nacl_helper_bootstrap, with toplevel…
illwieckz 0137452
cmake: use path sanitization
illwieckz b81f158
cmake: add install target
illwieckz e4d94e4
cmake: NUKE ZERO_BASED_SANDBOX
illwieckz ededbf0
cmake: NUKE mipsel
illwieckz c198525
cmake: NUKE kernel check we will never do
illwieckz 7d55dee
win32: silence the warning for the unused CheckCPUFeatureDetection() …
illwieckz 20324a0
cmake: add the Yokai CMake framework
illwieckz eabf610
Use pre-built object files for tests/dynamic_code_loading/
slipher 03df91a
Store Rosetta emulation detection result
slipher 90ffb58
Minor cleanup in NaClFlushCacheForDoublyMappedCode
slipher fa4811e
Move NaClCopyCode function to nacl_text.c
slipher 8dfe319
SysDyncodeModify: fix wrong instruction cache flush range
slipher ab09db9
Fix dyncode syscalls under Rosetta translation
slipher 2b6293c
Fix a missing error check in nacl_tls_unittest
slipher bc997b5
Improve thread_exit syscall thread safety
slipher ce1db26
Don't run toolchain_build/ test
slipher 65d1b6f
win32: skip some CPU detection on Windows with MinGW like amd64 MSVC
illwieckz 69a746f
redo “Implement werror=0 for Windows” (e74712e7)
illwieckz 89bc5d3
redo “Don't compile DEP check on 32-bit Windows” (7b000755)
illwieckz 6c63057
somewhat redo “implement build with (mostly) MinGW” (d2351336)
illwieckz e51e0e2
redo “fix nacl_loader_bootstrap with GCC” (cedfe84a)
illwieckz 4cc91a0
redo “Fix Mach crash forwarding on ARM Macs” (cf98ce25)
illwieckz 822f7cb
redo “switch clock_gettime impl to POSIX backend” (583685e0)
illwieckz f4f7f8e
partially redo “Disable annoying MSVC warning in generated code” (c8e…
illwieckz ed51ac9
redo “Disable annoying maybe-uninitialized GCC warning” (6f5e7e11)
illwieckz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) | ||
| 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() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.