summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-06-10 22:39:56 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-09-03 17:31:47 -0400
commit397c2b03e90e74c94ff55849adb6aa2a84e3e783 (patch)
treecd8bd3085969050a792554643a9db8a11cc7fa99 /aclocal.m4
parent85e621234916e9b5d40174831a3b422bd99f8f83 (diff)
downloadhaskell-397c2b03e90e74c94ff55849adb6aa2a84e3e783.tar.gz
configure: Work around Raspbian's silly packaging decisions
See #17856.
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m453
1 files changed, 34 insertions, 19 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index f246301cba..1921304ed7 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -447,25 +447,40 @@ AC_DEFUN([GET_ARM_ISA],
#endif]
)],
[AC_DEFINE(arm_HOST_ARCH_PRE_ARMv7, 1, [ARM pre v7])
- ARM_ISA=ARMv6
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM(
- [],
- [#if defined(__VFP_FP__)
- return 0;
- #else
- no vfp
- #endif]
- )],
- [changequote(, )dnl
- ARM_ISA_EXT="[VFPv2]"
- changequote([, ])dnl
- ],
- [changequote(, )dnl
- ARM_ISA_EXT="[]"
- changequote([, ])dnl
- ]
- )],
+ if grep -q Raspbian /etc/issue && uname -m | grep -q armv7; then
+ # Raspbian unfortunately makes some extremely questionable
+ # packaging decisions, configuring gcc to compile for ARMv6
+ # despite the fact that the RPi4 is ARMv8. As ARMv8 doesn't
+ # support all instructions supported by ARMv6 this can
+ # break. Work around this by checking uname to verify
+ # that we aren't running on armv7.
+ # See #17856.
+ AC_MSG_NOTICE([Found compiler which claims to target ARMv6 running on ARMv7, assuming this is ARMv7 on Raspbian (see T17856)])
+ ARM_ISA=ARMv7
+ changequote(, )dnl
+ ARM_ISA_EXT="[VFPv2]"
+ changequote([, ])dnl
+ else
+ ARM_ISA=ARMv6
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [],
+ [#if defined(__VFP_FP__)
+ return 0;
+ #else
+ no vfp
+ #endif]
+ )],
+ [changequote(, )dnl
+ ARM_ISA_EXT="[VFPv2]"
+ changequote([, ])dnl
+ ],
+ [changequote(, )dnl
+ ARM_ISA_EXT="[]"
+ changequote([, ])dnl
+ ]
+ )
+ fi],
[changequote(, )dnl
ARM_ISA=ARMv7
ARM_ISA_EXT="[VFPv3,NEON]"