From: Martin Storsjö <martin@martin.st> Before ac1761d1dae8bf114a05e28ed6886deba6c2c860, the preloader was linked with the flags "-static [..] -Wl,-Ttext=0x7d400000" on aarch64 - with a fixed load address with a 31 bit address. After that change, we try to use "-static-pie", and if that isn't supported, we fall back on "-static -Wl,-Ttext=<address>" - like before. However the fixed address used in this codepath was expanded to a 47 bit address, on 64 bit architectures. On aarch64, some kernels (in particular for smaller devices?) are configured with CONFIG_ARM64_VA_BITS=39 (which causes it to only use 3 levels of translation tables, instead of 4 levels). Such kernels can't use virtual addresses over 39 bits, while the fixed address we use in the fallback path is 47 bits. In the fallback case, when -static-pie isn't supported, use a 39 bit address instead of a 47 bit one, on aarch64. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59898 --- configure.ac | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index a8e3bf77076..1059da94871 100644 --- a/configure.ac +++ b/configure.ac @@ -1104,7 +1104,16 @@ case $host_os in *) WINE_TRY_CFLAGS([-static-pie], [AS_VAR_APPEND([WINEPRELOADER_LDFLAGS],[" -static-pie"])], - [AS_VAR_APPEND([WINEPRELOADER_LDFLAGS],[" -static -Wl,-Ttext=0x7d7d00000000"])]) + [ + case $HOST_ARCH in + aarch64) + dnl AArch64 kernels may be limited to 39 bits of address + dnl space; limit the text section load address to that. + AS_VAR_APPEND([WINEPRELOADER_LDFLAGS],[" -static -Wl,-Ttext=0x7d7d000000"]) ;; + *) + AS_VAR_APPEND([WINEPRELOADER_LDFLAGS],[" -static -Wl,-Ttext=0x7d7d00000000"]) ;; + esac + ]) ;; esac ;; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11270