]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
regtest: add check for -Wl,--no-warn-execstack
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 22 Dec 2024 15:49:11 +0000 (16:49 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 22 Dec 2024 15:49:11 +0000 (16:49 +0100)
configure.ac
none/tests/Makefile.am

index 7c417eb9d708eb2a7e93d0f6d1da9850b849e74b..cb1dc69d3585e15a90b30a0778a6ea6a2499f157 100755 (executable)
@@ -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])
 
index 76825b9478d5bee751a14577d06fd5a3eb34d682..3dc8762514c89a9f29f38e66481d440e4c82a636 100644 (file)
@@ -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.