From 42c5533b06fba095d24b75a58863f635385209cc Mon Sep 17 00:00:00 2001 From: slipher Date: Sat, 7 Nov 2026 19:32:31 -0600 Subject: [PATCH 1/2] VirtualMachine: Remove broken armhf->box64 fallback code On arm64 Linux there is a half-attempt to fall back to box64 if the armhf loader can't start. This was merged by mistake; it depends on the double bootstrap loader which does not exist in the final version of https://github.com/DaemonEngine/Daemon/pull/2018. The process exit code detection junk which depended on that must be removed. I will add a working version of armhf->box64 fallback later. --- src/engine/framework/VirtualMachine.cpp | 149 ++---------------------- 1 file changed, 7 insertions(+), 142 deletions(-) diff --git a/src/engine/framework/VirtualMachine.cpp b/src/engine/framework/VirtualMachine.cpp index 76e9ac9dc3..5139284af0 100644 --- a/src/engine/framework/VirtualMachine.cpp +++ b/src/engine/framework/VirtualMachine.cpp @@ -358,86 +358,6 @@ static std::pair InternalLoadModule(std::pair(probe.data()), - nullptr, - }; - - execve(probe.data(), argv, environ); - - switch (errno) - { - case ENOEXEC: - // The kernel cannot execute the probe. - _exit(100); - - case ENOENT: - case EACCES: - // Missing or inaccessible probe. - _exit(101); - - default: - _exit(102); - } - } - - int status; - if (waitpid(pid, &status, 0) < 0) { - return ExeSupport::Unknown; - } - - if (!WIFEXITED(status)) { - return ExeSupport::Unknown; - } - - switch (WEXITSTATUS(status)) - { - case 100: - return ExeSupport::Unsupported; - - case 101: - case 102: - return ExeSupport::Unknown; - - default: - // The probe has been executed properly. - return ExeSupport::Supported; - } -} -#endif // defined(DAEMON_NACL_RUNTIME_LINUX) && defined(NACL_ARCH_ARM64) - #if defined(DAEMON_NACL_RUNTIME_ENABLED) static std::pair CreateNaClVM(std::pair pair, Str::StringRef name, bool debug, bool extract, int debugLoader) { const std::string& libPath = FS::GetLibPath(); @@ -462,12 +382,6 @@ static std::pair CreateNaClVM(std::pair CreateNaClVM(std::pair CreateNaClVM(std::pair CreateNaClVM(std::pair CreateNaClVM(std::pair Date: Sat, 7 Nov 2026 19:32:31 -0600 Subject: [PATCH 2/2] Clean up bootstrap handling for NaCl VMs Handle all setup of the NaCl bootstrap loader in a single block of code, instead of spraying little pieces and ifdefs all over the place. This was supposed to be merged as part of the "Don't use nacl_helper_bootstrap with x86-64 loader" commit in https://github.com/DaemonEngine/Daemon/pull/2001. --- src/engine/framework/VirtualMachine.cpp | 64 +++++++++---------------- 1 file changed, 23 insertions(+), 41 deletions(-) diff --git a/src/engine/framework/VirtualMachine.cpp b/src/engine/framework/VirtualMachine.cpp index 5139284af0..b4db6a1995 100644 --- a/src/engine/framework/VirtualMachine.cpp +++ b/src/engine/framework/VirtualMachine.cpp @@ -79,9 +79,6 @@ static Cvar::Cvar workaround_naclSystem_freebsd_disableQualification( // Many BSDs have a Linuxulator, for now we only tested one. #if defined(__linux__) || defined(__FreeBSD__) #define DAEMON_NACL_RUNTIME_LINUX -#if YOKAI_ARCH_I686 || YOKAI_ARCH_ARM64 || YOKAI_ARCH_ARMHF -#define DAEMON_NACL_BOOSTRAP_ENABLED -#endif // !(YOKAI_ARCH_I686 || YOKAI_ARCH_ARM64 || YOKAI_ARCH_ARMHF) #endif // defined(__linux__) || defined(DAEMON_LINUXULATOR) #endif // defined(DAEMON_NACL_RUNTIME_ENABLED) @@ -182,6 +179,7 @@ static Cvar::Cvar vm_nacl_qualification( namespace VM { +#if defined(DAEMON_NACL_RUNTIME_LINUX) // https://github.com/Unvanquished/Unvanquished/issues/944#issuecomment-744454772 static void CheckMinAddressSysctlTooLarge() { @@ -206,6 +204,7 @@ static void CheckMinAddressSysctlTooLarge() } #endif // __linux__ } +#endif // DAEMON_NACL_RUNTIME_LINUX #if defined(DAEMON_NACL_RUNTIME_LINUX) && (defined(YOKAI_ARCH_ARM64) || defined(YOKAI_ARCH_ARMHF)) static bool OnArm64() @@ -382,19 +381,6 @@ static std::pair CreateNaClVM(std::pair CreateNaClVM(std::pair CreateNaClVM(std::pair