2013-02-06 Niels Möller <nisse@lysator.liu.se>
+ * config.m4.in: Substitute ASM_TYPE_PROGBITS as TYPE_PROGBITS.
+
* config.make.in: Added .s to the suffix list.
* Makefile.in (.asm.s): Use a separate make target for .asm
(asm.d): Make config.status write dependencies for .s files into
asm.d.
(ASM_ALIGN_LOG): Set to "no" when appropriate.
+ (ASM_TYPE_FUNCTION): Default to "@function".
+ (ASM_TYPE_PROGBITS): New substituted variable, set in the same way
+ as ASM_TYPE_FUNCTION.
+ (ASM_MARK_NOEXEC_STACK): Use TYPE_PROGBITS.
* asm.m4: Use changecom to disable m4 quoting. Use divert to
suppress output.
define(<C_NAME>, <@ASM_SYMBOL_PREFIX@><$1>)dnl
define(<ELF_STYLE>, <@ASM_ELF_STYLE@>)dnl
define(<TYPE_FUNCTION>, <@ASM_TYPE_FUNCTION@>)dnl
+define(<TYPE_PROGBITS>, <@ASM_TYPE_PROGBITS@>)dnl
define(<ALIGN_LOG>, <@ASM_ALIGN_LOG@>)dnl
define(<ALIGNOF_UINT64_T>, <@ALIGNOF_UINT64_T@>)dnl
define(<W64_ABI>, <@W64_ABI@>)dnl
ASM_SYMBOL_PREFIX=''
ASM_ELF_STYLE='no'
-ASM_TYPE_FUNCTION=''
+# GNU as default is to use @
+ASM_TYPE_FUNCTION='@function'
+ASM_TYPE_PROGBITS='@progbits'
ASM_MARK_NOEXEC_STACK=''
ASM_ALIGN_LOG=''
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 <<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
-
AC_CACHE_CHECK([for ELF-style .type,%function pseudo-ops],
[nettle_cv_asm_type_percent_function],
[GMP_TRY_ASSEMBLE([
if test x$nettle_cv_asm_type_percent_function = xyes ; then
ASM_ELF_STYLE='yes'
ASM_TYPE_FUNCTION='%function'
+ ASM_TYPE_PROGBITS='%progbits'
else
if test x$nettle_cv_asm_type_hash_function = xyes ; then
ASM_ELF_STYLE='yes'
ASM_TYPE_FUNCTION='#function'
+ ASM_TYPE_PROGBITS='#progbits'
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,"",TYPE_PROGBITS'
+ fi
+
AC_CACHE_CHECK([if .align assembly directive is logarithmic],
[nettle_cv_asm_align_log],
[GMP_TRY_ASSEMBLE([
AC_SUBST(ASM_SYMBOL_PREFIX)
AC_SUBST(ASM_ELF_STYLE)
AC_SUBST(ASM_TYPE_FUNCTION)
+AC_SUBST(ASM_TYPE_PROGBITS)
AC_SUBST(ASM_MARK_NOEXEC_STACK)
AC_SUBST(ASM_ALIGN_LOG)
AC_SUBST(W64_ABI)