diff options
author | Thomas Miedema <thomasmiedema@gmail.com> | 2014-11-18 22:23:27 -0600 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-11-19 17:03:06 -0600 |
commit | 146dd138e2c3b4ec9b211dcbcedf752aeb79d3d1 (patch) | |
tree | 9d7edd78f805f2c2a695488f1d72ca04fd54922c /configure.ac | |
parent | b047733881cfd4b1d83dd856697c797701ee282a (diff) | |
download | haskell-146dd138e2c3b4ec9b211dcbcedf752aeb79d3d1.tar.gz |
Only test for bug #9439 when llvm is installed
Reviewers: bgamari, austin
Reviewed By: austin
Subscribers: thomie, carter
Differential Revision: https://phabricator.haskell.org/D500
GHC Trac Issues: #9807
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 103 |
1 files changed, 53 insertions, 50 deletions
diff --git a/configure.ac b/configure.ac index 7bd599fdd3..5dd3aaa5c3 100644 --- a/configure.ac +++ b/configure.ac @@ -187,56 +187,6 @@ AC_SUBST([WithGhc]) dnl ** Without optimization some INLINE trickery fails for GHCi SRC_CC_OPTS="-O" -dnl ** Bug 9439: Some GHC 7.8 releases had broken LLVM code generator. -dnl Unfortunately we don't know whether the user is going to request a -dnl build with the LLVM backend as this is only given in build.mk. -dnl -dnl Instead, we try to do as much work as possible here, checking -dnl whether -fllvm is the stage 0 compiler's default. If so we -dnl fail. If not, we check whether -fllvm is affected explicitly and -dnl if so set a flag. The build system will later check this flag -dnl after the desired build flags are known. -AC_MSG_CHECKING(whether bootstrap compiler is affected by bug 9439) -echo "main = putStrLn \"%function\"" > conftestghc.hs - -# Check whether LLVM backend is default for this platform -"${WithGhc}" conftestghc.hs 2>&1 >/dev/null -res=`./conftestghc` -if test "x$res" == "x%object" -then - AC_MSG_RESULT(yes) - echo "Buggy bootstrap compiler" - echo "" - echo "The stage 0 compiler $WithGhc is affected by GHC Bug \#9439" - echo "and therefore will miscompile the LLVM backend if -fllvm is" - echo "used." - echo - echo "Please use another bootstrap compiler" - exit 1 -fi - -# -fllvm is not the default, but set a flag so the Makefile can check -# -for it in the build flags later on -"${WithGhc}" -fforce-recomp -fllvm conftestghc.hs 2>&1 >/dev/null -if test $? == 0 -then - res=`./conftestghc` - if test "x$res" == "x%object" - then - AC_MSG_RESULT(yes) - GHC_LLVM_AFFECTED_BY_9439=1 - elif test "x$res" == "x%function" - then - AC_MSG_RESULT(no) - GHC_LLVM_AFFECTED_BY_9439=0 - else - AC_MSG_WARN(unexpected output $res) - fi -else - AC_MSG_RESULT(failed to compile, assuming no) -fi -AC_SUBST([GHC_LLVM_AFFECTED_BY_9439]) - dnl-------------------------------------------------------------------- dnl * Choose host(/target/build) platform dnl-------------------------------------------------------------------- @@ -593,6 +543,59 @@ dnl -------------------------------------------------------------- dnl * General configuration checks dnl -------------------------------------------------------------- +dnl ** Bug 9439: Some GHC 7.8 releases had broken LLVM code generator. +dnl Unfortunately we don't know whether the user is going to request a +dnl build with the LLVM backend as this is only given in build.mk. +dnl +dnl Instead, we try to do as much work as possible here, checking +dnl whether -fllvm is the stage 0 compiler's default. If so we +dnl fail. If not, we check whether -fllvm is affected explicitly and +dnl if so set a flag. The build system will later check this flag +dnl after the desired build flags are known. +if test -n "$LlcCmd" && test -n "$OptCmd" +then + AC_MSG_CHECKING(whether bootstrap compiler is affected by bug 9439) + echo "main = putStrLn \"%function\"" > conftestghc.hs + + # Check whether LLVM backend is default for this platform + "${WithGhc}" conftestghc.hs 2>&1 >/dev/null + res=`./conftestghc` + if test "x$res" == "x%object" + then + AC_MSG_RESULT(yes) + echo "Buggy bootstrap compiler" + echo "" + echo "The stage 0 compiler $WithGhc is affected by GHC Bug \#9439" + echo "and therefore will miscompile the LLVM backend if -fllvm is" + echo "used." + echo + echo "Please use another bootstrap compiler" + exit 1 + fi + + # -fllvm is not the default, but set a flag so the Makefile can check + # -for it in the build flags later on + "${WithGhc}" -fforce-recomp -fllvm conftestghc.hs 2>&1 >/dev/null + if test $? == 0 + then + res=`./conftestghc` + if test "x$res" == "x%object" + then + AC_MSG_RESULT(yes) + GHC_LLVM_AFFECTED_BY_9439=1 + elif test "x$res" == "x%function" + then + AC_MSG_RESULT(no) + GHC_LLVM_AFFECTED_BY_9439=0 + else + AC_MSG_WARN(unexpected output $res) + fi + else + AC_MSG_RESULT(failed to compile, assuming no) + fi +fi +AC_SUBST([GHC_LLVM_AFFECTED_BY_9439]) + dnl ** Can the unix package be built? dnl -------------------------------------------------------------- |