Commit a58a7132 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Update to the latest GHC source tree.

parent 4d2b4bcc
......@@ -13,7 +13,7 @@ dnl
# see what flags are available. (Better yet, read the documentation!)
#
AC_INIT([The Glorious Glasgow Haskell Compilation System], [7.9], [glasgow-haskell-bugs@haskell.org], [ghc])
AC_INIT([The Glorious Glasgow Haskell Compilation System], [7.11], [glasgow-haskell-bugs@haskell.org], [ghc])
# Set this to YES for a released version, otherwise NO
: ${RELEASE=NO}
......@@ -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 --------------------------------------------------------------
......@@ -896,6 +899,22 @@ AC_TRY_LINK_FUNC(printf\$LDBLStub,
[Define to 1 if we have printf$LDBLStub (Apple Mac OS >= 10.4, PPC).])
])
dnl ** pthread_setname_np is a recent addition to glibc, and OS X has
dnl a different single-argument version.
AC_CHECK_LIB(pthread, pthread_setname_np)
AC_MSG_CHECKING(for pthread_setname_np)
AC_TRY_LINK(
[
#define _GNU_SOURCE
#include <pthread.h>
],
[pthread_setname_np(pthread_self(), "name");],
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_PTHREAD_SETNAME_NP], [1],
[Define to 1 if you have the glibc version of pthread_setname_np]),
AC_MSG_RESULT(no)
)
dnl ** check for eventfd which is needed by the I/O manager
AC_CHECK_HEADERS([sys/eventfd.h])
AC_CHECK_FUNCS([eventfd])
......@@ -986,6 +1005,7 @@ echo ["
Configure completed successfully.
Building GHC version : $ProjectVersion
Git commit id : $ProjectGitCommitId
Build platform : $BuildPlatform
Host platform : $HostPlatform
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment