From https://codeberg.org/fogti/portage-zscheile/raw/branch/main/dev-lang/ijs/files/9.5.1-noexecstack.patch

diff --git a/make2/build_libj.sh b/make2/build_libj.sh
index 6cb2fdb..c55191d 100755
--- a/make2/build_libj.sh
+++ b/make2/build_libj.sh
@@ -324,7 +324,7 @@ case $jplatform64 in
   CFLAGS="$common -m32 -msse2 -mfpmath=sse "
   # slower, use 387 fpu and truncate extra precision
   # CFLAGS="$common -m32 -ffloat-store "
-  LDFLAGS=" -shared -Wl,-soname,libj.so -m32 -lm -ldl $LDOPENMP32 $LDTHREAD "
+  LDFLAGS=" -shared -Wl,-soname,libj.so -m32 -lm -ldl -z noexecstack $LDOPENMP32 $LDTHREAD "
   OBJS_AESNI=" aes-ni.o "
   SRC_ASM="${SRC_ASM_LINUX32}"
   GASM_FLAGS="-m32"
@@ -335,7 +335,7 @@ case $jplatform64 in
  linux/j64avx512*) # linux intel 64bit avx512
   TARGET=libj.so
   CFLAGS="$common -DC_AVX2=1 -DC_AVX512=1 "
-  LDFLAGS=" -shared -Wl,-soname,libj.so -lm -ldl $LDOPENMP $LDTHREAD "
+  LDFLAGS=" -shared -Wl,-soname,libj.so -lm -ldl -z noexecstack $LDOPENMP $LDTHREAD "
   CFLAGS_SIMD=" -march=skylake-avx512 -mavx2 -mfma -mbmi -mbmi2 -mlzcnt -mmovbe -mpopcnt -mno-vzeroupper "
   OBJS_FMA=" gemm_int-fma.o "
   OBJS_AESNI=" aes-ni.o "
@@ -349,7 +349,7 @@ case $jplatform64 in
  linux/j64avx2*) # linux intel 64bit avx2
   TARGET=libj.so
   CFLAGS="$common -DC_AVX2=1 "
-  LDFLAGS=" -shared -Wl,-soname,libj.so -lm -ldl $LDOPENMP $LDTHREAD "
+  LDFLAGS=" -shared -Wl,-soname,libj.so -lm -ldl -z noexecstack $LDOPENMP $LDTHREAD "
   CFLAGS_SIMD=" -march=haswell -mavx2 -mfma -mbmi -mbmi2 -mlzcnt -mmovbe -mpopcnt -mno-vzeroupper "
   OBJS_FMA=" gemm_int-fma.o "
   OBJS_AESNI=" aes-ni.o "
@@ -362,7 +362,7 @@ case $jplatform64 in
  linux/j64*) # linux intel 64bit nonavx
   TARGET=libj.so
   CFLAGS="$common -msse3 "
-  LDFLAGS=" -shared -Wl,-soname,libj.so -lm -ldl $LDOPENMP $LDTHREAD "
+  LDFLAGS=" -shared -Wl,-soname,libj.so -lm -ldl -z noexecstack $LDOPENMP $LDTHREAD "
   OBJS_AESNI=" aes-ni.o "
   SRC_ASM="${SRC_ASM_LINUX}"
   GASM_FLAGS=""
@@ -373,7 +373,7 @@ case $jplatform64 in
  raspberry/j32*) # linux raspbian arm
   TARGET=libj.so
   CFLAGS="$common -std=gnu99 -Wno-overflow -marm -march=armv6 -mfloat-abi=hard -mfpu=vfp -DRASPI "
-  LDFLAGS=" -shared -Wl,-soname,libj.so -lm -ldl $LDOPENMP $LDTHREAD "
+  LDFLAGS=" -shared -Wl,-soname,libj.so -lm -ldl -z noexecstack $LDOPENMP $LDTHREAD "
   SRC_ASM="${SRC_ASM_RASPI32}"
   GASM_FLAGS=""
   FLAGS_SLEEF=" -DENABLE_VECEXT "    # broken in upstream
@@ -383,7 +383,7 @@ case $jplatform64 in
  raspberry/j64*) # linux arm64
   TARGET=libj.so
   CFLAGS="$common -march=armv8-a+crc -DRASPI -DC_CRC32C=1 "    # mno-outline-atomics unavailable on clang-7
-  LDFLAGS=" -shared -Wl,-soname,libj.so -lm -ldl $LDOPENMP $LDTHREAD "
+  LDFLAGS=" -shared -Wl,-soname,libj.so -lm -ldl -z noexecstack $LDOPENMP $LDTHREAD "
   OBJS_AESARM=" aes-arm.o "
   SRC_ASM="${SRC_ASM_RASPI}"
   GASM_FLAGS=""
