Repository navigation
Conversation
…, implement box64 fallback, detect armhf multiarch support
… taking saigo in account
This reverts commit e65b2650069a9550b885c6fe3249902a439cf137.
Co-authored-by: Thomas Debesse <dev@illwieckz.net>
Set up the chdir and environment variable in posix_spawn. Fixes #1336. Co-authored-by: Thomas Debesse <dev@illwieckz.net>
Remove cvars controlling whether the Linux bootstrap loader is used. Never use bootstrap with the amd64 loader. Always use bootstrap with 32-bit loaders. Co-authored-by: Thomas Debesse <dev@illwieckz.net>
When creating a NaCl (or native exe) VM on Windows, block evironment variables from being passed through to the subprocess as is done on *nix. Probably we do this since there are NACL* variables that can disable secure sandboxing. inheritEnvironment is always false on Windows, but I implemented the true case anyway since it's less code than having the Q_UNUSED and asserting it's false.
Check the Linux sysctl vm.mmap_min_addr only when using the NaCl bootstrap (rather than always when using NaCl). Or equivalently, check it only with 32-bit NaCl runtimes. The bootstrap fails to start when the value is too high to due low fixed address mappings. On ARM at least, sel_ldr proper would also fail with a too-high min address since that disturbs the address space layout. On 64-bit there is neither the bootstrap nor 0-based address space layout so it always works. Co-authored-by: Thomas Debesse <dev@illwieckz.net>
Co-authored-by: Thomas Debesse <dev@illwieckz.net>
The old PNaCl toolchain has been being shipped as part of the deps package, with the host platform for the compilers assumed to be the same as the target platform of the deps package. Experimental Saigo support has thus far required manually downloading the SDK. Now, make the Saigo toolchain auto-downloadable (if USE_NACL_SAIGO=1) independently from the target platform dependencies. This has several advantages: - No need to download the NaCl toolchain if you are not building NaCl. - No need to download a useless NaCl toolchain when cross-compiling. - Toolchain can be downloaded for host systems that don't have a deps package, or where the deps package being used doesn't match the real host system. (The SDK is available for more systems than the deps package.) The toolchain is downloaded from Github and then, like the deps package, extracted into external_deps/.
Add external_deps/sdk-build.sh which can be used as an alternative to auto-downloading Saigo. Like external_deps/build.sh, it builds the dependency package and installs it to the expected location. It is a thin wrapper around the saigo-nacl-sdk CMake build; if you need more control it is better to use CMake directly.
| echo "If you want to build only a subset of packages, prefer using the" | ||
| echo "${REPO_URL} CMake build directly." | ||
| echo "Some global configuration options are available via environment" | ||
| echo "variables; see ${REPO_URL}/tree/master/tools/release/build" |
There was a problem hiding this comment.
By using tab as indentation instead of spaces we would be able to rely on bash indented heredoc.
| Log::Warn("Disabling NaCL platform qualification on arm64 kernel architecture."); | ||
| enableQualification = false; | ||
| } | ||
| if (onArm64()) { |
There was a problem hiding this comment.
I have a fix for that in #1986, to be imported soon.
| #if defined(DAEMON_NACL_RUNTIME_LINUX) && defined(YOKAI_ARCH_ARM64) | ||
| /* We later turn this boolean off when we detect armhf support is not | ||
| provided on arm64. */ | ||
| bool hasArmhf = true; |
There was a problem hiding this comment.
Should also exists on armhf, I have a fix for that in #1986, to be imported soon.
| SYSTEM_INFO systemInfo; | ||
| GetNativeSystemInfo(&systemInfo); | ||
| const bool win32Force64Bit = systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64; | ||
| constexpr bool i686ForceAmd64 = systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64; |
There was a problem hiding this comment.
/Unvanquished/daemon/src/engine/framework/VirtualMachine.cpp:467:41: error: the value of 'systemInfo' is not usable in a constant expression
467 | constexpr bool i686ForceAmd64 = systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64;
| ^~~~~~~~~~
/Unvanquished/daemon/src/engine/framework/VirtualMachine.cpp:465:21: note: 'systemInfo' was not declared 'constexpr'
465 | SYSTEM_INFO systemInfo;
| ^~~~~~~~~~
There was a problem hiding this comment.
I'll test removing the constexpr in #1986 when testing the release build with Unvanquished/release-scripts#46 and import when fixed.
|
This is so big that I can't imagine how to review it. Is there no subset that makes sense on its own? At least |
| add_custom_command(TARGET runtime_deps PRE_BUILD | ||
| COMMAND ${CMAKE_COMMAND} -E copy_if_different | ||
| ${DEPS_DIR}/nacl_loader${CMAKE_EXECUTABLE_SUFFIX} | ||
| ${DEPS_DIR}/nacl_loader-${DAEMON_NACL_ARCH_NAME}${CMAKE_EXECUTABLE_SUFFIX} |
There was a problem hiding this comment.
How can you change the name of the file in the deps archive while using the same old package? I don't understand how this builds.
There was a problem hiding this comment.
This is something I need to fix and add temporary backport code. At first all this code was living was posterior to my external_deps rework, so I'm still tracking those leftovers I have to retrofit.
|
What is |
Generic code to make it straightforward to distribute multiple nexe and loader per engine. Like in the arm64 case where both amd64 and armhf nexes and loader are shipped. Everything works in my complete branch. |
e33a414 to
e5fa711
Compare
Each commits will be reviewable and mergeable one by one, but I need this branch to exist to be able to test your commits once rebased (and the rebase done in this order is the least effort). |
e5fa711 to
a89c459
Compare
|
@slipher, this can be merged beforehand: |
adf91ba to
2aa4bb3
Compare
|
So, with that branch, I managed to build a release unizip, everything built and packaged properly. I also testing running them, I tested all but So I'm now ready to go through the merge process. Each commits should be reviewable and mergeable one by one, I'll do similar tests on each step. This is just to make sure one thing required from a commit is not mistakenly present in a next one. |
814d459 to
4872437
Compare
So in #1986 I implemented a lot of refactors meant to makes things easier for Saigo and other things (like the ability to fallback on amd64 on box64 when armhf on arm64 doesn't work, etc.):
This deeply reworked the CMake code, and also deeply reworked the VirtualMachine code, and a whole month has been invested in that effort.
In the meantime @slipher implemented those very appreciated and very wanted and very needed PRs:
It was infinitely less constly to rebase this work over mine than the other way, so that's what this branch does: rebase @slipher's work over my branch.
So I rebased #1998, #2001, #2010 over #1986 then removed every change touching
external_deps/build.shand that made this branch. It also mean that some commits by @slipher touchingexternal_deps/build.shwere split to only keep what was not touching it. The part touchingexternal_deps/build.shwas also rebased but is stored in #1986.Doing this rebasing took me 10 hours of work, doing it the other way would take many days non-stop.
Because about 5 months have passed, one thing in my commits is now useless: the work I did to turn the
multiarchlauncher into a generic launcher not specific to armhf or even the nacl loader. Ssuch launcher is then entirely NUKED by some greatly appreciated @slipher's commit rebased here.Because of how intricated all those changes are, that touch the same code base, I don't want to fight the war of removing that multiarch work under the feet of the later commits just because it turned useless. Cleaning-up such mess would take additional days I don't have. Those commits are following each others properly and that's what matters the most.
Some of the work in some @slipher's commit was already done in my branch, for example almost nothing is left from the commit
cmake: SAIGOSDK_ROOT configures NaCl toolchain pathfrom #2010, because it was redundant.