[PATCH 0/2] MR11114: ntdll: Fix building for arm64 with (really) old headers
One fixes building without `HWCAP_CPUID`, and one without `ESR_MAGIC`/`esr_context`. The case with `HWCAP_CPUID` is quite recent. The one about `ESR_MAGIC`/`esr_context` has been around for many years. I submitted a patch about it to wine-devel in 2020, but that patch was much more complex (bringing back the old codepath from before 85c01202ac70af0c83f894d7a8986adf66983459, and a configure test). In the simplest form, just omit the reference to `esr_context` and `ESR_MAGIC` and return 0, instead of attempting any heuristics about the kind of access violation. It's not perfect, but should hopefully be less of a burden to carry around, for being able to build with ancient headers. (In this case, I'm building with an old cross sysroot, for an old SBC, with an old distribution, where I run wine. The install on the SBC is new enough to have `esr_context` itself, but the cross sysroot/toolchain happens to bundle even older kernel headers.) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11114
From: Martin Storsjö <martin@martin.st> This define was added in the linux kernel in 77c97b4ee21290f5f083173d957843b615abbff2 in 2017, available since kernel headers v4.11 and newer. --- dlls/ntdll/unix/system.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index bcfb3306aea..cf2883f05ae 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -1966,6 +1966,7 @@ static DWORD get_core_id_regs_arm64( struct smbios_wine_id_reg_value_arm64 *regs regs[regidx++] = (struct smbios_wine_id_reg_value_arm64){ 0x4000, value }; } +#ifdef HWCAP_CPUID if (!(getauxval(AT_HWCAP) & HWCAP_CPUID)) { WARN( "Skipping ID register population as kernel is missing emulation support.\n" ); @@ -1998,6 +1999,9 @@ static DWORD get_core_id_regs_arm64( struct smbios_wine_id_reg_value_arm64 *regs READ_ID_REG( 0x5801 ); /* CTR_EL0 */ /* Windows exposes SCTLR_EL1, ACTLR_EL1, TTBR0_EL1 and MAIR_EL1, but these are inaccessible under * linux so leave them unpopulated. */ +#else + WARN( "Skipping ID register population as HWCAP_CPUID isn't supported.\n" ); +#endif #undef READ_ID_REG #undef STR -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11114
From: Martin Storsjö <martin@martin.st> This define and accompanying structure was added in linux kernel 15af1942dd61ee236a48b3de14d6f31c0b9e8116 in 2013, available since kernel headers v3.16. --- dlls/ntdll/unix/signal_arm64.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c index 5a56c2d7d64..522ade368f0 100644 --- a/dlls/ntdll/unix/signal_arm64.c +++ b/dlls/ntdll/unix/signal_arm64.c @@ -110,8 +110,10 @@ static struct fpsimd_context *get_fpsimd_context( const ucontext_t *sigcontext ) static DWORD64 get_fault_esr( ucontext_t *sigcontext ) { +#ifdef ESR_MAGIC struct esr_context *esr = (struct esr_context *)get_extended_sigcontext( sigcontext, ESR_MAGIC ); if (esr) return esr->esr; +#endif return 0; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11114
participants (2)
-
Martin Storsjö -
Martin Storsjö (@mstorsjo)