Skip to content
Snippets Groups Projects
Commit 9ef0694c authored by Niels Möller's avatar Niels Möller
Browse files

* 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
parent a58956e3
Branches
Tags
No related merge requests found
...@@ -181,6 +181,7 @@ AC_SUBST([CCPIC_MAYBE]) ...@@ -181,6 +181,7 @@ AC_SUBST([CCPIC_MAYBE])
ASM_SYMBOL_PREFIX='' ASM_SYMBOL_PREFIX=''
ASM_ELF_STYLE='no' ASM_ELF_STYLE='no'
ASM_MARK_NOEXEC_STACK=''
if test x$enable_assembler = xyes ; then if test x$enable_assembler = xyes ; then
AC_CACHE_CHECK([if globals are prefixed by underscore], AC_CACHE_CHECK([if globals are prefixed by underscore],
...@@ -201,6 +202,30 @@ if test x$enable_assembler = xyes ; then ...@@ -201,6 +202,30 @@ if test x$enable_assembler = xyes ; then
if test x$nettle_cv_asm_underscore = xyes ; then if test x$nettle_cv_asm_underscore = xyes ; then
ASM_SYMBOL_PREFIX='_' ASM_SYMBOL_PREFIX='_'
fi 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 <<EOF
int foo() { return 0; }
EOF
nettle_compile="$CC $CFLAGS $CPPFLAGS -c conftest.c >conftest.out 2>&1"
if AC_TRY_EVAL(nettle_compile); then
cat conftest.out >&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 # With inspiration from GMP_TRY_ASSEMBLE
AC_CACHE_CHECK([for ELF-style pseudo-ops], AC_CACHE_CHECK([for ELF-style pseudo-ops],
nettle_cv_asm_elf_style_pseudo_ops, nettle_cv_asm_elf_style_pseudo_ops,
...@@ -231,6 +256,7 @@ fi ...@@ -231,6 +256,7 @@ fi
AC_SUBST(ASM_SYMBOL_PREFIX) AC_SUBST(ASM_SYMBOL_PREFIX)
AC_SUBST(ASM_ELF_STYLE) AC_SUBST(ASM_ELF_STYLE)
AC_SUBST(ASM_MARK_NOEXEC_STACK)
AC_SUBST(SHLIBCFLAGS) AC_SUBST(SHLIBCFLAGS)
AC_SUBST(SHLIBMAJOR) AC_SUBST(SHLIBMAJOR)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment