summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2010-10-04 20:57:12 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2010-10-04 20:57:12 +0000
commit3b5d770df23ada71d44daec3c74f3f37595acb10 (patch)
tree8bd17c4407cf25b2e7c601dd8f1c26f64a00820f /dev-lang
parentAdd myself as co-maintainer and version bump (diff)
downloadgentoo-2-3b5d770df23ada71d44daec3c74f3f37595acb10.tar.gz
gentoo-2-3b5d770df23ada71d44daec3c74f3f37595acb10.tar.bz2
gentoo-2-3b5d770df23ada71d44daec3c74f3f37595acb10.zip
Export typechecker internals for haddock (alpha, ia64, ppc64). Allow ghc-ia64 to link very large applications (haddock).
(Portage version: 2.1.8.3/cvs/Linux x86_64)
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/ghc/ChangeLog7
-rw-r--r--dev-lang/ghc/files/ghc-6.12.3-ghciless-haddock-3558.patch224
-rw-r--r--dev-lang/ghc/ghc-6.12.3.ebuild10
3 files changed, 239 insertions, 2 deletions
diff --git a/dev-lang/ghc/ChangeLog b/dev-lang/ghc/ChangeLog
index f3464bce7e3a..42770781605f 100644
--- a/dev-lang/ghc/ChangeLog
+++ b/dev-lang/ghc/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for dev-lang/ghc
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.193 2010/09/26 19:41:09 hwoarang Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ChangeLog,v 1.194 2010/10/04 20:57:12 slyfox Exp $
+
+ 04 Oct 2010; Sergei Trofimovich <slyfox@gentoo.org> ghc-6.12.3.ebuild,
+ +files/ghc-6.12.3-ghciless-haddock-3558.patch:
+ Export typechecker internals for haddock (alpha, ia64, ppc64). Allow
+ ghc-ia64 to link very large applications (haddock).
26 Sep 2010; Markos Chandras <hwoarang@gentoo.org> ghc-6.12.3.ebuild:
Stable on amd64 wrt bug #338652
diff --git a/dev-lang/ghc/files/ghc-6.12.3-ghciless-haddock-3558.patch b/dev-lang/ghc/files/ghc-6.12.3-ghciless-haddock-3558.patch
new file mode 100644
index 000000000000..0a25d72b5ad0
--- /dev/null
+++ b/dev-lang/ghc/files/ghc-6.12.3-ghciless-haddock-3558.patch
@@ -0,0 +1,224 @@
+commit c7d5e1322f54b5387767c15788d8372705b8981b
+Author: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Sun Oct 3 22:32:12 2010 +0300
+
+ Sat Jul 31 14:55:06 EEST 2010 Ian Lynagh <igloo@earth.li>
+ * Expose the functions haddock needs even when haddock is disabled; #3558
+---
+ compiler/main/GHC.hs | 13 +++++++++++--
+ compiler/main/InteractiveEval.hs | 9 ---------
+ compiler/typecheck/TcRnDriver.lhs | 24 +++++++++++++++---------
+ 3 files changed, 26 insertions(+), 20 deletions(-)
+
+diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs
+index be7d574..2f25cbe 100644
+--- a/compiler/main/GHC.hs
++++ b/compiler/main/GHC.hs
+@@ -111,13 +111,13 @@ module GHC (
+ showModule,
+ isModuleInterpreted,
+ InteractiveEval.compileExpr, HValue, dynCompileExpr,
+- lookupName,
+ GHC.obtainTermFromId, GHC.obtainTermFromVal, reconstructType,
+ modInfoModBreaks,
+ ModBreaks(..), BreakIndex,
+ BreakInfo(breakInfo_number, breakInfo_module),
+ BreakArray, setBreakOn, setBreakOff, getBreak,
+ #endif
++ lookupName,
+
+ -- * Abstract syntax elements
+
+@@ -243,9 +243,9 @@ import Linker ( HValue )
+ import ByteCodeInstr
+ import BreakArray
+ import InteractiveEval
+-import TcRnDriver
+ #endif
+
++import TcRnDriver
+ import TcIface
+ import TcRnTypes hiding (LIE)
+ import TcRnMonad ( initIfaceCheck )
+@@ -2711,3 +2711,12 @@ obtainTermFromId bound force id =
+ liftIO $ InteractiveEval.obtainTermFromId hsc_env bound force id
+
+ #endif
++
++-- | Returns the 'TyThing' for a 'Name'. The 'Name' may refer to any
++-- entity known to GHC, including 'Name's defined using 'runStmt'.
++lookupName :: GhcMonad m => Name -> m (Maybe TyThing)
++lookupName name = withSession $ \hsc_env -> do
++ mb_tything <- ioMsg $ tcRnLookupName hsc_env name
++ return mb_tything
++ -- XXX: calls panic in some circumstances; is that ok?
++
+diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs
+index 352fbf0..3339313 100644
+--- a/compiler/main/InteractiveEval.hs
++++ b/compiler/main/InteractiveEval.hs
+@@ -29,7 +29,6 @@ module InteractiveEval (
+ showModule,
+ isModuleInterpreted,
+ compileExpr, dynCompileExpr,
+- lookupName,
+ Term(..), obtainTermFromId, obtainTermFromVal, reconstructType,
+ skolemiseSubst, skolemiseTy
+ #endif
+@@ -922,14 +921,6 @@ parseName str = withSession $ \hsc_env -> do
+ (L _ rdr_name) <- hscParseIdentifier (hsc_dflags hsc_env) str
+ ioMsgMaybe $ tcRnLookupRdrName hsc_env rdr_name
+
+--- | Returns the 'TyThing' for a 'Name'. The 'Name' may refer to any
+--- entity known to GHC, including 'Name's defined using 'runStmt'.
+-lookupName :: GhcMonad m => Name -> m (Maybe TyThing)
+-lookupName name = withSession $ \hsc_env -> do
+- mb_tything <- ioMsg $ tcRnLookupName hsc_env name
+- return mb_tything
+- -- XXX: calls panic in some circumstances; is that ok?
+-
+ -- -----------------------------------------------------------------------------
+ -- Getting the type of an expression
+
+diff --git a/compiler/typecheck/TcRnDriver.lhs b/compiler/typecheck/TcRnDriver.lhs
+index 323a167..342763d 100644
+--- a/compiler/typecheck/TcRnDriver.lhs
++++ b/compiler/typecheck/TcRnDriver.lhs
+@@ -9,10 +9,10 @@ module TcRnDriver (
+ #ifdef GHCI
+ tcRnStmt, tcRnExpr, tcRnType,
+ tcRnLookupRdrName,
+- tcRnLookupName,
+- tcRnGetInfo,
+ getModuleExports,
+ #endif
++ tcRnLookupName,
++ tcRnGetInfo,
+ tcRnModule,
+ tcTopSrcDecls,
+ tcRnExtCore
+@@ -71,6 +71,7 @@ import Outputable
+ import DataCon
+ import Type
+ import Class
++import TcType
+ import Data.List ( sortBy )
+
+ #ifdef GHCI
+@@ -83,7 +84,6 @@ import IfaceEnv
+ import MkId
+ import BasicTypes
+ import TidyPgm ( globaliseAndTidyId )
+-import TcType ( isUnitTy, isTauTy, tyClsNamesOfDFunHead )
+ import TysWiredIn ( unitTy, mkListTy )
+ #endif
+
+@@ -1015,7 +1015,6 @@ get two defns for 'main' in the interface file!
+ %*********************************************************
+
+ \begin{code}
+-#ifdef GHCI
+ setInteractiveContext :: HscEnv -> InteractiveContext -> TcRn a -> TcRn a
+ setInteractiveContext hsc_env icxt thing_inside
+ = let -- Initialise the tcg_inst_env with instances from all home modules.
+@@ -1046,6 +1045,7 @@ setInteractiveContext hsc_env icxt thing_inside
+
+
+ \begin{code}
++#ifdef GHCI
+ tcRnStmt :: HscEnv
+ -> InteractiveContext
+ -> LStmt RdrName
+@@ -1401,6 +1401,7 @@ lookup_rdr_name rdr_name = do {
+
+ return good_names
+ }
++#endif
+
+ tcRnLookupName :: HscEnv -> Name -> IO (Messages, Maybe TyThing)
+ tcRnLookupName hsc_env name
+@@ -1421,8 +1422,8 @@ tcRnLookupName' name = do
+ _ -> panic "tcRnLookupName'"
+
+ tcRnGetInfo :: HscEnv
+- -> Name
+- -> IO (Messages, Maybe (TyThing, Fixity, [Instance]))
++ -> Name
++ -> IO (Messages, Maybe (TyThing, Fixity, [Instance]))
+
+ -- Used to implement :info in GHCi
+ --
+@@ -1432,8 +1433,14 @@ tcRnGetInfo :: HscEnv
+ -- *and* as a type or class constructor;
+ -- hence the call to dataTcOccs, and we return up to two results
+ tcRnGetInfo hsc_env name
+- = initTcPrintErrors hsc_env iNTERACTIVE $
+- let ictxt = hsc_IC hsc_env in
++ = initTcPrintErrors hsc_env iNTERACTIVE $
++ tcRnGetInfo' hsc_env name
++
++tcRnGetInfo' :: HscEnv
++ -> Name
++ -> TcRn (TyThing, Fixity, [Instance])
++tcRnGetInfo' hsc_env name
++ = let ictxt = hsc_IC hsc_env in
+ setInteractiveContext hsc_env ictxt $ do
+
+ -- Load the interface for all unqualified types and classes
+@@ -1482,7 +1489,6 @@ loadUnqualIfaces ictxt
+ isTcOcc (nameOccName name), -- Types and classes only
+ unQualOK gre ] -- In scope unqualified
+ doc = ptext (sLit "Need interface for module whose export(s) are in scope unqualified")
+-#endif /* GHCI */
+ \end{code}
+
+ %************************************************************************
+
+commit 83d056a7e15e3253c446d896707d0b012f9cf8b3
+Author: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Sun Oct 3 22:30:53 2010 +0300
+
+ Sat Jul 31 02:50:01 EEST 2010 Ian Lynagh <igloo@earth.li>
+
+ * Always haddock by default
+ Revert this patch:
+ Matthias Kilian <kili@outback.escape.de>**20090920181319
+ Don't build haddock if HADDOC_DOCS = NO, and disable HADDOC_DOCS
+ if GhcWithInterpreter = NO
+ Haddock uses TcRnDriver.tcRnGetInfo, which is only available if
+ GHCI is built. Set HADDOC_DOCS to NO if GhcWithInterpreter is NO,
+ and disable the haddock build if HADDOC_DOCS = NO.
+---
+ ghc.mk | 2 --
+ mk/config.mk.in | 2 +-
+ 2 files changed, 1 insertions(+), 3 deletions(-)
+
+diff --git a/ghc.mk b/ghc.mk
+index 9193f46..1b5d1f9 100644
+--- a/ghc.mk
++++ b/ghc.mk
+@@ -529,11 +529,9 @@ BUILD_DIRS += \
+ $(GHC_GENAPPLY_DIR)
+ endif
+
+-ifneq "$(HADDOCK_DOCS)" "NO"
+ BUILD_DIRS += \
+ utils/haddock \
+ utils/haddock/doc
+-endif
+
+ ifneq "$(CLEANING)" "YES"
+ BUILD_DIRS += \
+diff --git a/mk/config.mk.in b/mk/config.mk.in
+index 7399de0..55a9f19 100644
+--- a/mk/config.mk.in
++++ b/mk/config.mk.in
+@@ -736,7 +736,7 @@ SRC_ALEX_OPTS = -g
+ HSTAGS = @HstagsCmd@
+
+ # Should we build haddock docs?
+-HADDOCK_DOCS = $(GhcWithInterpreter)
++HADDOCK_DOCS = YES
+ # And HsColour the sources?
+ ifeq "$(HSCOLOUR)" ""
+ HSCOLOUR_SRCS = NO
diff --git a/dev-lang/ghc/ghc-6.12.3.ebuild b/dev-lang/ghc/ghc-6.12.3.ebuild
index c4b7f900b8d0..dc76ae370d5e 100644
--- a/dev-lang/ghc/ghc-6.12.3.ebuild
+++ b/dev-lang/ghc/ghc-6.12.3.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-6.12.3.ebuild,v 1.14 2010/09/26 19:41:09 hwoarang Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/ghc/ghc-6.12.3.ebuild,v 1.15 2010/10/04 20:57:12 slyfox Exp $
# Brief explanation of the bootstrap logic:
#
@@ -126,6 +126,10 @@ ghc_setup_cflags() {
# prevent from failind building unregisterised ghc:
# http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg171602.html
use ppc64 && append-ghc-cflags compile -mminimal-toc
+ # fix the similar issue as ppc64 TOC on ia64. ia64 has limited size of small data
+ # currently ghc fails to build haddock
+ # http://osdir.com/ml/gnu.binutils.bugs/2004-10/msg00050.html
+ use ia64 && append-ghc-cflags compile -G0
}
pkg_setup() {
@@ -227,6 +231,10 @@ src_unpack() {
# substitute outdated macros
epatch "${FILESDIR}/ghc-6.12.3-autoconf-2.66-4252.patch"
+ # export typechecker internals even if ghci is disabled
+ # http://hackage.haskell.org/trac/ghc/ticket/3558
+ epatch "${FILESDIR}/ghc-6.12.3-ghciless-haddock-3558.patch"
+
# as we have changed the build system
eautoreconf
fi