From 7deeb51a44392f26712f3a429813491423c405e9 Mon Sep 17 00:00:00 2001 From: Paul Floyd Date: Sun, 22 Dec 2024 16:49:11 +0100 Subject: [PATCH] regtest: add check for -Wl,--no-warn-execstack --- configure.ac | 16 ++++++++++++++++ none/tests/Makefile.am | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7c417eb9d..cb1dc69d3 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 76825b947..3dc876251 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. -- 2.47.2