From: Niels Möller Date: Thu, 13 Oct 2005 15:12:13 +0000 (+0200) Subject: * configure.ac (ASM_MARK_NOEXEC_STACK): Check if the C compiler X-Git-Tag: nettle_1.14_release_20051205~165 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9ef0694cf0b06c148d3dcba315f2b94a1865a1dd;p=thirdparty%2Fnettle.git * configure.ac (ASM_MARK_NOEXEC_STACK): Check if the C compiler generates a .note.GNU-stack section. If so, we should do the same in our assembler files. Rev: src/nettle/configure.ac:1.63 --- diff --git a/configure.ac b/configure.ac index 411c0744..55fc3e30 100644 --- a/configure.ac +++ b/configure.ac @@ -181,6 +181,7 @@ AC_SUBST([CCPIC_MAYBE]) ASM_SYMBOL_PREFIX='' ASM_ELF_STYLE='no' +ASM_MARK_NOEXEC_STACK='' if test x$enable_assembler = xyes ; then AC_CACHE_CHECK([if globals are prefixed by underscore], @@ -201,6 +202,30 @@ if test x$enable_assembler = xyes ; then if test x$nettle_cv_asm_underscore = xyes ; then ASM_SYMBOL_PREFIX='_' fi + + AC_CACHE_CHECK([if we should use a .note.GNU-stack section], + nettle_cv_asm_gnu_stack, + [ # Default + nettle_cv_asm_gnu_stack=no + + cat >conftest.c <&AC_FD_CC + objdump -x conftest.o | grep '\.note\.GNU-stack' > /dev/null \ + && nettle_cv_asm_gnu_stack=yes + else + cat conftest.out >&AC_FD_CC + echo "configure: failed program was:" >&AC_FD_CC + cat conftest.s >&AC_FD_CC + fi + rm -f conftest.*]) + if test x$nettle_cv_asm_gnu_stack = xyes ; then + ASM_MARK_NOEXEC_STACK='.section .note.GNU-stack,"",@progbits' + fi + # With inspiration from GMP_TRY_ASSEMBLE AC_CACHE_CHECK([for ELF-style pseudo-ops], nettle_cv_asm_elf_style_pseudo_ops, @@ -231,6 +256,7 @@ fi AC_SUBST(ASM_SYMBOL_PREFIX) AC_SUBST(ASM_ELF_STYLE) +AC_SUBST(ASM_MARK_NOEXEC_STACK) AC_SUBST(SHLIBCFLAGS) AC_SUBST(SHLIBMAJOR)