From 32a7fafe093d9d3a84eca63a6e4aad02c508539f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 31 May 2006 00:07:58 -0700 Subject: Bug#12096 "Add line for non-executable stack in .s files" Fix so that configure will use "--noexecstack" for assembler if gcc supports option and compiled C doesn't need executable stack. config/ac-macros/compiler_flag.m4: Bug#12096 Add macro to check if "--noexecstack" should be used when compiling assembler configure.in: Bug#12096 Add macro to check if "--noexecstack" should be used when compiling assembler strings/Makefile.am: Bug#12096 Automake knows how to handle assembler --- config/ac-macros/compiler_flag.m4 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'config/ac-macros') diff --git a/config/ac-macros/compiler_flag.m4 b/config/ac-macros/compiler_flag.m4 index a236f61a198..9dda6da72fa 100644 --- a/config/ac-macros/compiler_flag.m4 +++ b/config/ac-macros/compiler_flag.m4 @@ -38,3 +38,25 @@ AC_DEFUN([AC_SYS_OS_COMPILER_FLAG], fi ]) +AC_DEFUN([AC_CHECK_NOEXECSTACK], +[ + AC_CACHE_CHECK(whether --noexecstack is desirable for .S files, + mysql_cv_as_noexecstack, [dnl + cat > conftest.c <&AS_MESSAGE_LOG_FD]) \ + && grep -q .note.GNU-stack conftest.s \ + && AC_TRY_COMMAND([${CC-cc} $CCASFLAGS $CPPFLAGS -Wa,--noexecstack + -c -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD]) + then + mysql_cv_as_noexecstack=yes + else + mysql_cv_as_noexecstack=no + fi + rm -f conftest*]) + if test $mysql_cv_as_noexecstack = yes; then + CCASFLAGS="$CCASFLAGS -Wa,--noexecstack" + fi +]) -- cgit v1.2.1