Created attachment 256212 [details] Simple patch to give bin/jt9 an executable stack gfortran puts trampolines on the stack and marks decoder.f90.o as needing an executable stack, but the linker on FreeBSD ignores this and make the stack NX. I've done two different patches depending on the maintainers appetite for maintaining them. The first simply marks jt9 as needing an executable stack, and the second uses mprotect() to dynamically mark the trampolines RX then set back to RW after the call. Reference: https://github.com/llvm/llvm-project/issues/121234
Created attachment 256213 [details] Complex patch to not need executable stack
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=cbc58c695e8029da1779cb4bc05c70986af1c22d commit cbc58c695e8029da1779cb4bc05c70986af1c22d Author: Stephen Hurd <shurd@FreeBSD.org> AuthorDate: 2024-12-27 22:31:50 +0000 Commit: Stephen Hurd <shurd@FreeBSD.org> CommitDate: 2025-02-09 03:47:37 +0000 comms/wsjtz: Give bin/jt9 an executable stack jt9 is supposed to have an executable stack, but a bug in lld (now fixed upstream) prevents that. This change explicitly sets the required exectuable stack for jt9. Much simpler than using mprotect et. al. PR: 283670 Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D48573 comms/wsjtz/files/patch-CMakeLists.txt | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)