diff options
author | unknown <acurtis@xiphis.org> | 2006-05-31 00:07:58 -0700 |
---|---|---|
committer | unknown <acurtis@xiphis.org> | 2006-05-31 00:07:58 -0700 |
commit | 32a7fafe093d9d3a84eca63a6e4aad02c508539f (patch) | |
tree | a62e725116c91213516881c9fbd73b92e0db774f /config/ac-macros/compiler_flag.m4 | |
parent | 4121c1ca1f950d02f990b74d2de79400b9e8eeee (diff) | |
download | mariadb-git-32a7fafe093d9d3a84eca63a6e4aad02c508539f.tar.gz |
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
Diffstat (limited to 'config/ac-macros/compiler_flag.m4')
-rw-r--r-- | config/ac-macros/compiler_flag.m4 | 22 |
1 files changed, 22 insertions, 0 deletions
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 <<EOF +void foo (void) { } +EOF + if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS + -S -o conftest.s conftest.c 1>&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 +]) |