summaryrefslogtreecommitdiff
path: root/sci-mathematics/gmp-ecm/files/gmp-ecm-7.0.4-execstack.patch
diff options
context:
space:
mode:
Diffstat (limited to 'sci-mathematics/gmp-ecm/files/gmp-ecm-7.0.4-execstack.patch')
-rw-r--r--sci-mathematics/gmp-ecm/files/gmp-ecm-7.0.4-execstack.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/sci-mathematics/gmp-ecm/files/gmp-ecm-7.0.4-execstack.patch b/sci-mathematics/gmp-ecm/files/gmp-ecm-7.0.4-execstack.patch
new file mode 100644
index 000000000000..6cca19161911
--- /dev/null
+++ b/sci-mathematics/gmp-ecm/files/gmp-ecm-7.0.4-execstack.patch
@@ -0,0 +1,49 @@
+diff --git a/acinclude.m4 b/acinclude.m4
+index e92d2c9..b602f12 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -604,32 +604,3 @@ AC_SUBST(CUDALDFLAGS)
+ AC_SUBST(CUDARPATH)
+
+ ])
+-
+-dnl Checks whether the stack can be marked nonexecutable by passing an option
+-dnl to the C-compiler when acting on .s files. Appends that option to ASMFLAGS.
+-dnl This macro is adapted from one found in GMP 6.1.1.
+-dnl FIXME: This test looks broken. It tests that a file with .note.GNU-stack...
+-dnl can be compiled/assembled with -Wa,--noexecstack. It does not determine
+-dnl if that command-line option has any effect on general asm code.
+-AC_DEFUN([CL_AS_NOEXECSTACK],[
+-dnl AC_REQUIRE([AC_PROG_CC]) GMP uses something else
+-AC_CACHE_CHECK([whether assembler supports --noexecstack option],
+-cl_cv_as_noexecstack, [dnl
+- cat > conftest.c <<EOF
+-void foo() {}
+-EOF
+- if AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS
+- -S -o conftest.s conftest.c >/dev/null]) \
+- && grep .note.GNU-stack conftest.s >/dev/null \
+- && AC_TRY_COMMAND([${CC} $CFLAGS $CPPFLAGS -Wa,--noexecstack
+- -c -o conftest.o conftest.s >/dev/null])
+- then
+- cl_cv_as_noexecstack=yes
+- else
+- cl_cv_as_noexecstack=no
+- fi
+- rm -f conftest*])
+- if test "$cl_cv_as_noexecstack" = yes; then
+- LIBECM_LDFLAGS="$LIBECM_LDFLAGS -Wl,-znoexecstack"
+- fi
+-])
+diff --git a/configure.ac b/configure.ac
+index 66a18dc..25b9aba 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -590,7 +590,6 @@ error
+ fi
+ ;;
+ esac
+-CL_AS_NOEXECSTACK
+ AC_SUBST([LIBECM_LDFLAGS])
+
+