summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-07-11 15:41:55 -0400
committerBen Gamari <ben@smart-cactus.org>2017-07-11 16:32:43 -0400
commit9b9f978fdcd13ff7b2a9b7391e02dff06da622a0 (patch)
tree23221a07613b0866727026b201778eb5bc3d08b4 /aclocal.m4
parent4befb415d7ee63d2b0ecdc2384310dc4b3ccc90a (diff)
downloadhaskell-9b9f978fdcd13ff7b2a9b7391e02dff06da622a0.tar.gz
Use correct section types syntax for architecture
Previously GHC would always assume that section types began with `@` while producing assembly, which is not true. For instance, in ARM assembly syntax section types begin with `%`. This abstracts out section type pretty-printing and adjusts it to correctly account for the target architectures assembly flavor. Reviewers: austin, hvr, Phyx Reviewed By: Phyx Subscribers: Phyx, rwbarton, thomie, erikd GHC Trac Issues: #13937 Differential Revision: https://phabricator.haskell.org/D3712
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m411
1 files changed, 10 insertions, 1 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index c31c881466..71a874fa78 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -321,9 +321,18 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
dnl so we empty CFLAGS while running this test
CFLAGS2="$CFLAGS"
CFLAGS=
+ case $TargetArch in
+ arm)
+ dnl See #13937.
+ progbits="%progbits"
+ ;;
+ *)
+ progbits="@progbits"
+ ;;
+ esac
AC_MSG_CHECKING(for GNU non-executable stack support)
AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([__asm__ (".section .note.GNU-stack,\"\",@progbits");], [0])],
+ [AC_LANG_PROGRAM([__asm__ (".section .note.GNU-stack,\"\",$progbits");], [0])],
[AC_MSG_RESULT(yes)
HaskellHaveGnuNonexecStack=True],
[AC_MSG_RESULT(no)