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

* configure.ac (ASM_ELF_STYLE): Check for %function and #function,

but not for @function.
(ASM_TYPE_FUNCTION): New substituted variable.

Rev: src/nettle/configure.ac:1.67
parent 4f4391f4
No related branches found
No related tags found
No related merge requests found
...@@ -182,6 +182,7 @@ AC_SUBST([CCPIC_MAYBE]) ...@@ -182,6 +182,7 @@ AC_SUBST([CCPIC_MAYBE])
ASM_SYMBOL_PREFIX='' ASM_SYMBOL_PREFIX=''
ASM_ELF_STYLE='no' ASM_ELF_STYLE='no'
ASM_TYPE_FUNCTION=''
ASM_MARK_NOEXEC_STACK='' ASM_MARK_NOEXEC_STACK=''
if test x$enable_assembler = xyes ; then if test x$enable_assembler = xyes ; then
...@@ -227,36 +228,49 @@ EOF ...@@ -227,36 +228,49 @@ EOF
ASM_MARK_NOEXEC_STACK='.section .note.GNU-stack,"",@progbits' ASM_MARK_NOEXEC_STACK='.section .note.GNU-stack,"",@progbits'
fi fi
# With inspiration from GMP_TRY_ASSEMBLE AC_CACHE_CHECK([for ELF-style .type,%function pseudo-ops],
AC_CACHE_CHECK([for ELF-style pseudo-ops], [nettle_cv_asm_type_percent_function],
nettle_cv_asm_elf_style_pseudo_ops, [GMP_TRY_ASSEMBLE([
[cat >conftest.s <<EOF
.text .text
.globl foo .globl foo
.type foo,@function .type foo,%function
foo: foo:
.Lend: .Lend:
.size foo, .Lend - foo .size foo, .Lend - foo
EOF ],
nettle_assemble="$CC $CFLAGS $CPPFLAGS -c conftest.s >conftest.out 2>&1" [nettle_cv_asm_type_percent_function=yes],
if AC_TRY_EVAL(nettle_assemble); then [nettle_cv_asm_type_percent_function=no])])
cat conftest.out >&AC_FD_CC
nettle_cv_asm_elf_style_pseudo_ops=yes dnl Needs double quote for the # character
else AC_CACHE_CHECK([[for ELF-style .type,#function pseudo-ops]],
cat conftest.out >&AC_FD_CC [nettle_cv_asm_type_hash_function],
echo "configure: failed program was:" >&AC_FD_CC [GMP_TRY_ASSEMBLE([
cat conftest.s >&AC_FD_CC .text
nettle_cv_asm_elf_style_pseudo_ops=no .globl foo
fi .type foo,#function
rm -f conftest.*]) foo:
if test x$nettle_cv_asm_elf_style_pseudo_ops = xyes ; then .Lend:
.size foo, .Lend - foo
],
[nettle_cv_asm_type_hash_function=yes],
[nettle_cv_asm_type_hash_function=no])])
if test x$nettle_cv_asm_type_percent_function = xyes ; then
ASM_ELF_STYLE='yes' ASM_ELF_STYLE='yes'
ASM_TYPE_FUNCTION='%function'
else
if test x$nettle_cv_asm_type_hash_function = xyes ; then
ASM_ELF_STYLE='yes'
ASM_TYPE_FUNCTION='#function'
fi
fi fi
fi fi
AC_SUBST(ASM_SYMBOL_PREFIX) AC_SUBST(ASM_SYMBOL_PREFIX)
AC_SUBST(ASM_ELF_STYLE) AC_SUBST(ASM_ELF_STYLE)
AC_SUBST(ASM_TYPE_FUNCTION)
AC_SUBST(ASM_MARK_NOEXEC_STACK) AC_SUBST(ASM_MARK_NOEXEC_STACK)
AC_SUBST(SHLIBCFLAGS) AC_SUBST(SHLIBCFLAGS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment