From 7f62257c4bfd5bc3267e2e780f59165702969afe Mon Sep 17 00:00:00 2001 From: VERA LVX Date: Mon, 31 Aug 2026 23:52:14 -0300 Subject: [PATCH] ARMJIT_Linkage.S: add .note.GNU-stack to the JIT linkage files Without the note, the linker marks the whole core as requiring an executable stack. glibc 2.41 and newer refuse to dlopen such objects instead of granting the request, so RetroArch cannot load the core: Failed to open libretro core: .../melonds_libretro.so Error(s): .../melonds_libretro.so: cannot enable executable stack as shared object requires: Invalid argument The requirement is spurious. The JIT allocates its executable memory with mmap (ARMJIT_Memory.cpp), never on the stack. Upstream melonDS added the same note to both files in 3ab752b and refined the guards in 2a86ee7 and 63e4b68. This uses the current upstream form. --- src/ARMJIT_A64/ARMJIT_Linkage.S | 4 ++++ src/ARMJIT_x64/ARMJIT_Linkage.S | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/ARMJIT_A64/ARMJIT_Linkage.S b/src/ARMJIT_A64/ARMJIT_Linkage.S index 37a83e9df5..cd35c4bb22 100644 --- a/src/ARMJIT_A64/ARMJIT_Linkage.S +++ b/src/ARMJIT_A64/ARMJIT_Linkage.S @@ -94,3 +94,7 @@ ARM_RestoreContext: mov sp, x17 br x18 + +#if !defined(__APPLE__) && !defined(__WIN32__) +.section .note.GNU-stack,"",@progbits +#endif diff --git a/src/ARMJIT_x64/ARMJIT_Linkage.S b/src/ARMJIT_x64/ARMJIT_Linkage.S index 650c93b68b..8f4bc49e04 100644 --- a/src/ARMJIT_x64/ARMJIT_Linkage.S +++ b/src/ARMJIT_x64/ARMJIT_Linkage.S @@ -104,3 +104,7 @@ ARM_Ret: #endif ret + +#if !defined(__APPLE__) && !defined(_WIN64) && !defined(_MSC_VER) +.section .note.GNU-stack,"",@progbits +#endif