[PATCH v3 0/2] MR7204: Fix running arm+arm64 in old wow64 mode
This allows using one single wineprefix, one wineserver and one single wine executable for running both arm and arm64 executables. This setup actually has worked earlier; Ubuntu 22.04 packages Wine 6.0, where the wine32 + wine64 packages together end up working this way. However, since Wine 6.0, a couple of refactorings has broken this setup along the way; reinstate this way of working. The new wow64 mode probably won't work on arm, as it's not easily possible to switch between 32 and 64 bit execution mode within a process, as far as I know, but the old wow64 mode is still a great convenience - especially considering distro-packaged use for users who aren't familiar with the particular quirks on this architecture. -- v3: server: Include ARMNT as one of the supported architectures on aarch64 ntdll: Allow running arm/aarch64 in (old) wow64 mode https://gitlab.winehq.org/wine/wine/-/merge_requests/7204
From: Martin Storsjö <martin(a)martin.st> The new wow64 mode probably won't work though, as it's not easily doable to switch between arm and aarch64 execution modes within a process. Since 8ac411ed6dc7a9390178a01e6f07a963a593d406, the get_{native,wow}_context functions exist and need to return the right thing in the arm implementation. Since ae8562ed2277a5c051e131dc317e94aa3d5413c8 and 1456b31eecfef91fc8ffc8c2de29ab69c5b5463b we need to include the arm+arm64 case for starting the right wineloader; this was implemented in 7ce83f154a554b1e746b7146feeff1eb68d0f177 and surrounding commits. --- dlls/ntdll/unix/signal_arm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c index c9ae492597d..d9bda6a8d2c 100644 --- a/dlls/ntdll/unix/signal_arm.c +++ b/dlls/ntdll/unix/signal_arm.c @@ -409,7 +409,7 @@ NTSTATUS signal_set_full_context( CONTEXT *context ) */ void *get_native_context( CONTEXT *context ) { - return context; + return is_old_wow64() ? NULL : context; } @@ -418,7 +418,7 @@ void *get_native_context( CONTEXT *context ) */ void *get_wow_context( CONTEXT *context ) { - return NULL; + return is_old_wow64() ? context : NULL; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7204
From: Martin Storsjö <martin(a)martin.st> Since 4022fb9ba3eacd6b09d35b457754a7e17c67564e, we need to reinclude ARMNT as one of the supported architectures in an aarch64 wineprefix. --- server/registry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/registry.c b/server/registry.c index 3f02faaaefd..c60c737feff 100644 --- a/server/registry.c +++ b/server/registry.c @@ -1859,7 +1859,7 @@ static void init_supported_machines(void) { supported_machines[count++] = IMAGE_FILE_MACHINE_ARM64; supported_machines[count++] = IMAGE_FILE_MACHINE_I386; - /* supported_machines[count++] = IMAGE_FILE_MACHINE_ARMNT; not supported yet */ + supported_machines[count++] = IMAGE_FILE_MACHINE_ARMNT; } #else #error Unsupported machine -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7204
On Fri Feb 14 11:48:23 2025 +0000, Alexandre Julliard wrote:
Like Jacek said, we'd want to do this a bit differently. I'm working on it. Thanks for the proper fix for the loader across multiple architectures!
With this in place, there's only two minor changes left that are needed; I updated this MR with what's left. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7204#note_94586
participants (1)
-
Martin Storsjö