From: Paul F. <pa...@so...> - 2024-12-22 15:49:44
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=7deeb51a44392f26712f3a429813491423c405e9 commit 7deeb51a44392f26712f3a429813491423c405e9 Author: Paul Floyd <pj...@wa...> Date: Sun Dec 22 16:49:11 2024 +0100 regtest: add check for -Wl,--no-warn-execstack Diff: --- configure.ac | 16 ++++++++++++++++ none/tests/Makefile.am | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7c417eb9d7..cb1dc69d35 100755 --- a/configure.ac +++ b/configure.ac @@ -3100,6 +3100,22 @@ AC_LINK_IFELSE( CFLAGS=$safe_CFLAGS fi +# check if linker accepts --no-warn-execstack +AC_MSG_CHECKING([if the linker accepts -Wl,--no-warn-execstack]) +safe_CFLAGS=$CFLAGS +CFLAGS="-Wl,--no-warn-execstack" + +AC_LINK_IFELSE( +[AC_LANG_PROGRAM([ ], [return 0;])], +[ + AC_SUBST([FLAG_NO_WARN_EXECSTACK], ["-Wl,--no-warn-execstack"]) + AC_MSG_RESULT([yes]) +], [ + AC_SUBST([FLAG_NO_WARN_EXECSTACK], [""]) + AC_MSG_RESULT([no]) +]) +CFLAGS=$safe_CFLAGS + # does the ppc assembler support "mtocrf" et al? AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf]) diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 76825b9478..3dc8762514 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -335,7 +335,7 @@ endif if HAVE_NESTED_FUNCTIONS check_PROGRAMS += nestedfns - nestedfns_LDFLAGS = -Wl,--no-warn-execstack + nestedfns_LDFLAGS = @FLAG_NO_WARN_EXECSTACK@ endif # This doesn't appear to be compilable on Darwin. |