Repository navigation
Rebasing slipher's work on my CMake and VirtualMachine code #2018
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
15
commits into
master
Choose a base branch
from
illwieckz/cmake-saigo
base: master
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
15 commits
Select commit
Hold shift + click to select a range
9d85206
Append the architecture name to loader binaries, implement box64 fall…
illwieckz 0d535d1
cmake,VirtualMachine: add architecture suffix to the loader
illwieckz b0db89b
cmake: use box64 on loong64
illwieckz 85d3a8e
cmake: rework the code enabling nexe build when there is an nacl sdk,…
illwieckz d0ff001
cmake: implement multi nexe
illwieckz 3941ebc
cmake: reword DaemonFlags a bit
illwieckz 5d1c0ab
cmake: deeply rewrite the NaCl toolchains
illwieckz 3d6d7a3
Refactor: function for Linux arm64 check for VM
slipher 95deecd
Get rid of nacl_multiarch executable
slipher c1514ed
Don't use nacl_helper_bootstrap with x86-64 loader
slipher f1f3337
Windows: block NaCl process from inheriting environment
slipher 6354bf7
Check mmap_min_addr only if using NaCl bootstrap
slipher c956e52
cmake: raise an error when the SDK prefix is not a directory
slipher 7d85e4e
Auto-download Saigo SDK for any supported host
slipher 5027c53
Add build script for Saigo SDK (host-mode deps)
slipher 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
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,74 @@ | ||
| # Daemon BSD Source Code | ||
| # Copyright (c) 2013-2026, Daemon Developers | ||
| # All rights reserved. | ||
| # | ||
| # Redistribution and use in source and binary forms, with or without | ||
| # modification, are permitted provided that the following conditions are met: | ||
| # * Redistributions of source code must retain the above copyright | ||
| # notice, this list of conditions and the following disclaimer. | ||
| # * Redistributions in binary form must reproduce the above copyright | ||
| # notice, this list of conditions and the following disclaimer in the | ||
| # documentation and/or other materials provided with the distribution. | ||
| # * Neither the name of the Daemon developers nor the | ||
| # names of its contributors may be used to endorse or promote products | ||
| # derived from this software without specific prior written permission. | ||
| # | ||
| # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
| # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| # DISCLAIMED. IN NO EVENT SHALL DAEMON DEVELOPERS BE LIABLE FOR ANY | ||
| # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
| # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
| # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
|
||
| # TODO: Move other deps downloading code in here. | ||
|
|
||
| set(SAIGOSDK_BASENAME "saigosdk-${DEPS_SYSTEM}-${DEPS_ARCH}_${SAIGOSDK_VERSION}") | ||
|
|
||
| # Warning: changing SAIGOSDK_PREFIX/SAIGOSDK_VERSION after subprojects have been configured WILL | ||
| # change the compiler, but it is a bad idea since flag tests and such (not to mention the actual | ||
| # compiled artifacts) will be out of date. | ||
| set(SAIGOSDK_PREFIX "${EXTERNAL_DEPS_DIR}/${SAIGOSDK_BASENAME}" CACHE PATH "PNaCl SDK path") | ||
| mark_as_advanced(SAIGOSDK_PREFIX) | ||
|
|
||
| # As an alternative to downloading, external_deps/sdk-build.sh can be used, to build the host-mode | ||
| # dependencies and install them in the expected path. | ||
| function(download_saigosdk) | ||
| if (NOT EXISTS "${SAIGOSDK_PREFIX}") | ||
| set(DEPS_FILENAME "${SAIGOSDK_BASENAME}.tar.xz") | ||
| set(REMOTE "https://github.com/DaemonEngine/saigo-nacl-sdk/releases/download/v${SAIGOSDK_VERSION}/${DEPS_FILENAME}") | ||
| message(STATUS "Downloading NaCl SDK from '${REMOTE}'") | ||
|
|
||
| file(DOWNLOAD "${REMOTE}" "${OBJ_DIR}/${DEPS_FILENAME}" | ||
| SHOW_PROGRESS | ||
| STATUS DOWNLOAD_RESULT | ||
| LOG DOWNLOAD_LOG | ||
| ) | ||
|
|
||
| list(GET DOWNLOAD_RESULT 0 DOWNLOAD_STATUS) | ||
| list(GET DOWNLOAD_RESULT 1 DOWNLOAD_STRING) | ||
|
|
||
| if (NOT DOWNLOAD_STATUS EQUAL 0) | ||
| message(FATAL_ERROR "Failed to download '${REMOTE}': This may be a network error, or your system may be an unsupported host platform. | ||
| Status code: ${DOWNLOAD_STATUS} | ||
| Error string: ${DOWNLOAD_STRING} | ||
| Download log: ${DOWNLOAD_LOG}" | ||
| ) | ||
| endif() | ||
|
|
||
| message(STATUS "SDK download completed successfully") | ||
|
|
||
| # Extract the downloaded archive | ||
| execute_process( | ||
| COMMAND ${CMAKE_COMMAND} -E tar xJf ${OBJ_DIR}/${DEPS_FILENAME} | ||
| WORKING_DIRECTORY ${EXTERNAL_DEPS_DIR} | ||
| RESULT_VARIABLE EXTRACT_RESULT | ||
| ) | ||
| if (NOT EXTRACT_RESULT EQUAL 0) | ||
| message(FATAL_ERROR "Could not extract ${DEPS_FILENAME}") | ||
| endif() | ||
| endif() | ||
| endfunction() | ||
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.
Uh oh!
There was an error while loading. Please reload this page.