pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Update ghc to 7.10.2.



Module Name:	pkgsrc-wip
Committed By:	Jonathan Perkin <jperkin%joyent.com@localhost>
Pushed By:	jperkin
Date:		Mon Nov 9 17:05:03 2015 +0000
Changeset:	876f41817d53dbed187f86c7cdf9f7df9d680a49

Modified Files:
	ghc/DEINSTALL
	ghc/INSTALL
	ghc/Makefile
	ghc/TODO
	ghc/bootstrap.mk
	ghc/buildlink3.mk
	ghc/distinfo
Removed Files:
	ghc/patches/patch-Makefile
	ghc/patches/patch-ghc.mk
	ghc/patches/patch-libraries_integer-gmp_configure.ac
	ghc/patches/patch-libraries_integer-simple_GHC_Integer.hs
	ghc/patches/patch-libraries_integer-simple_GHC_Integer_Type.hs
	ghc/patches/patch-rts_StgCRun.c
	ghc/patches/patch-rts_ghc.mk

Log Message:
Update ghc to 7.10.2.

Currently bootstrap kits exist for SunOS-5.11 and Darwin x86_64.  I took the
opportunity to clean things up a bit, and merge changes in from pkgsrc.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=876f41817d53dbed187f86c7cdf9f7df9d680a49

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 ghc/DEINSTALL                                      |  12 +-
 ghc/INSTALL                                        |  11 +-
 ghc/Makefile                                       | 194 ++++------------
 ghc/TODO                                           |  13 --
 ghc/bootstrap.mk                                   | 250 ++++++++++++++++-----
 ghc/buildlink3.mk                                  |   8 +-
 ghc/distinfo                                       |  39 ++--
 ghc/patches/patch-Makefile                         |  16 --
 ghc/patches/patch-ghc.mk                           |  23 --
 .../patch-libraries_integer-gmp_configure.ac       |  42 ----
 .../patch-libraries_integer-simple_GHC_Integer.hs  |  15 --
 ...ch-libraries_integer-simple_GHC_Integer_Type.hs |  24 --
 ghc/patches/patch-rts_StgCRun.c                    |  31 ---
 ghc/patches/patch-rts_ghc.mk                       |  22 --
 14 files changed, 272 insertions(+), 428 deletions(-)

diffs:
diff --git a/ghc/DEINSTALL b/ghc/DEINSTALL
index 14c866d..03f30c5 100644
--- a/ghc/DEINSTALL
+++ b/ghc/DEINSTALL
@@ -1,9 +1,11 @@
-#!/bin/sh
+#!@SH@
 #
+# $NetBSD$
+
 DISTNAME="@DISTNAME@"
 
-case ${STAGE} in
-    DEINSTALL)
-        ${RM} -f ${PKG_PREFIX}/lib/${DISTNAME}/package.conf.d/package.cache
-        ;;
+case "${STAGE}" in
+DEINSTALL)
+	${RM} -f ${PKG_PREFIX}/lib/${DISTNAME}/package.conf.d/package.cache
+	;;
 esac
diff --git a/ghc/INSTALL b/ghc/INSTALL
index a1c8ec4..9ea0add 100644
--- a/ghc/INSTALL
+++ b/ghc/INSTALL
@@ -1,8 +1,9 @@
-#!/bin/sh
+#!@SH@
 #
+# $NetBSD$
 
-case ${STAGE} in
-    POST-INSTALL)
-        ${PKG_PREFIX}/bin/ghc-pkg recache
-        ;;
+case "${STAGE}" in
+POST-INSTALL)
+	${PKG_PREFIX}/bin/ghc-pkg recache
+	;;
 esac
diff --git a/ghc/Makefile b/ghc/Makefile
index cc8f7ba..08f7d12 100644
--- a/ghc/Makefile
+++ b/ghc/Makefile
@@ -1,131 +1,69 @@
-# $NetBSD: Makefile,v 1.36 2015/08/23 20:33:34 thomasklausner Exp $
-# -----------------------------------------------------------------------------
-# Package metadata
-#
-DISTNAME=	ghc-${VERSION}
-VERSION=	7.6.2
+# $NetBSD$
+
+DISTNAME=	ghc-7.10.2-src
+PKGNAME=	${DISTNAME:S/-src$//}
 CATEGORIES=	lang
-MASTER_SITES=	http://www.haskell.org/ghc/dist/${VERSION}/
+MASTER_SITES=	http://www.haskell.org/ghc/dist/${PKGVERSION_NOREV}/
+EXTRACT_SUFX=	.tar.bz2
+
 MAINTAINER=	pho%cielonero.org@localhost
 HOMEPAGE=	http://www.haskell.org/ghc/
 COMMENT=	Compiler for the functional language Haskell
 LICENSE=	modified-bsd
 
-# GHC requires GHC to build itself. Formerly we could work around this
-# bootstrapping problem by creating a special archive containing C
-# sources compiled from Haskell sources, but that's no longer
-# possible. So we have to prepare stripped-down binaries sufficient to
-# bootstrap compilers for each platforms. If you want to build them
-# yourself, follow an instruction in the ./TODO file.
-ONLY_FOR_PLATFORM= \
-	Darwin-*-powerpc \
-	FreeBSD-*-i386 \
-	Linux-*-x86_64 \
-	NetBSD-*-i386 \
-	NetBSD-*-x86_64
-
 BUILD_DEPENDS+=	docbook-xsl-[0-9]*:../../textproc/docbook-xsl
+BUILD_DEPENDS+=	libxslt-[0-9]*:../../textproc/libxslt
 
-# -----------------------------------------------------------------------------
-# Distfiles
-#
-DISTFILES=	${DISTNAME}-src.tar.bz2
-DISTFILES+=	${DISTNAME}-boot-i386-unknown-freebsd.tar.xz
-DISTFILES+=	${DISTNAME}-boot-i386-unknown-netbsd.tar.xz
-DISTFILES+=	${DISTNAME}-boot-powerpc-apple-darwin.tar.xz
-DISTFILES+=	${DISTNAME}-boot-x86_64-unknown-linux.tar.xz
-DISTFILES+=	${DISTNAME}-boot-x86_64-unknown-netbsd.tar.xz
+# By default only extract the primary source, not all of the bootstrap kits.
+DISTFILES=	${DEFAULT_DISTFILES}
+EXTRACT_ONLY=	${DEFAULT_DISTFILES}
+WRKSRC=		${WRKDIR}/${PKGNAME_NOREV}
 
-.for i in ${DISTFILES:M*-boot-*}
-SITES.${i}=	http://static.cielonegro.org/archive/
+GNU_CONFIGURE=		yes
+USE_GNU_CONFIGURE_HOST=	no
+USE_LIBTOOL=		yes
+USE_TOOLS+=		autoconf gmake patch perl:run
+
+CONFIGURE_ARGS+= 	--with-gcc=${CC:Q}
+CONFIGURE_ARGS+= 	--with-gmp-includes=${BUILDLINK_PREFIX.gmp:Q}/${BUILDLINK_INCDIRS.gmp:Q}
+CONFIGURE_ARGS+= 	--with-gmp-libraries=${BUILDLINK_PREFIX.gmp:Q}/${BUILDLINK_LIBDIRS.gmp:Q}
+CONFIGURE_ARGS+= 	--with-iconv-includes=${BUILDLINK_PREFIX.iconv:Q}/${BUILDLINK_INCDIRS.iconv:Q}
+CONFIGURE_ARGS+= 	--with-iconv-libraries=${BUILDLINK_PREFIX.iconv:Q}/${BUILDLINK_LIBDIRS.iconv:Q}
+
+CONFIGURE_ENV+=		PerlCmd=${PERL5:Q}
+.for stage in 0 1 2
+CONFIGURE_ENV+=		CONF_CC_OPTS_STAGE${stage}=${CFLAGS:Q}
+CONFIGURE_ENV+=		CONF_GCC_LINKER_OPTS_STAGE${stage}=${LDFLAGS:Q}
 .endfor
 
-# We don't want to extract all of the DISTFILEs.
-EXTRACT_ONLY=	${DISTNAME}-src.tar.bz2
-
-
-# -----------------------------------------------------------------------------
-# Tools
-#
-USE_TOOLS+=			autoconf gmake perl:run
-GNU_CONFIGURE=			yes
-USE_GNU_CONFIGURE_HOST=	no
+.include "../../mk/bsd.prefs.mk"
 
-# We must provide the real path to gcc to the ./configure script,
-# because GHC has a runtime dependency on it. Aren't there any ways
-# better than this?
-.include "../../mk/compiler.mk"
-.if empty(CCPATH)
-CCPATH=	/usr/bin/gcc
-WARNINGS+="This package depends on pkgsrc's undocumented variable\
-CCPATH but it disappeared somehow."
-WARNINGS+="Using hard-coded ${CCPATH:Q} as the C compiler..."
+# Darwin's /usr/lib/libffi.dylib is picked up and used, but is the wrong
+# version so we force the "system" (pkgsrc) one to be used.  This needs to
+# be fixed properly, figuring out how to exclude /usr/lib from the @rpath
+# search instead.
+.if ${OPSYS} == "Darwin"
+CONFIGURE_ARGS+= 	--with-system-libffi
+CONFIGURE_ARGS+= 	--with-ffi-includes=${BUILDLINK_PREFIX.libffi:Q}/${BUILDLINK_INCDIRS.libffi:Q}
+CONFIGURE_ARGS+= 	--with-ffi-libraries=${BUILDLINK_PREFIX.libffi:Q}/${BUILDLINK_LIBDIRS.libffi:Q}
+.include "../../devel/libffi/buildlink3.mk"
 .endif
 
-CONFIGURE_ARGS+= \
-	--with-gcc=${CCPATH:Q} \
-	--with-gmp-includes=${PREFIX:Q}/include \
-	--with-gmp-libraries=${PREFIX:Q}/lib \
-	--with-iconv-includes=${PREFIX:Q}/include \
-	--with-iconv-libraries=${PREFIX:Q}/lib
-
-CONFIGURE_ENV+= \
-	PerlCmd=${PERL5:Q}
-
-
-# -----------------------------------------------------------------------------
-# Build hooks
-#
-
-# We patch configure.ac in some directories.
-post-patch:
-	@${PHASE_MSG} "Regenerating configuration scripts for ${PKGNAME}"
-	${RUN} cd ${WRKSRC:Q}/libraries/integer-gmp && autoconf
-
-
 # Define the target "pre-configure" and non-standard "bootstrap".
 .include "../../wip/ghc/bootstrap.mk"
 
-
 # Our pre-configure phase installs a bindist of bootstrapping compiler
 # directly into TOOLS_DIR so that ./configure can find it.
 do-configure:
 	${RUN} cd ${WRKSRC:Q} && \
 		${SETENV} ${CONFIGURE_ENV} ${SH} ./configure ${CONFIGURE_ARGS}
-
-# Here we generate mk/build.mk dynamically.
 	${RUN} ${RM} -f ${WRKSRC:Q}/mk/build.mk
-
-# We need to tell the libraries/terminfo/configure that our ncurses is
-# in a non-standard path. Without that, the resulting GHC tries to
-# link programs by executing ld(1) without passing it -L${PREFIX:Q}/lib.
+	${RUN} ${ECHO} "BuildFlavour = quick" >${WRKSRC:Q}/mk/build.mk
+	${RUN} ${ECHO} "DYNAMIC_GHC_PROGRAMS = NO" >>${WRKSRC:Q}/mk/build.mk
+	${RUN} ${CAT} ${WRKSRC:Q}/mk/build.mk.sample >>${WRKSRC:Q}/mk/build.mk
 	${RUN} ${ECHO} "libraries/terminfo_CONFIGURE_OPTS += \
-		--configure-option=--with-curses-includes=${PREFIX:Q}/include \
-		--configure-option=--with-curses-libraries=${PREFIX:Q}/lib" >> ${WRKSRC:Q}/mk/build.mk
-
-# The ghc compiler does normally split the generated asm files into small
-# parts before sending them to gcc, to enable the linker to eliminate
-# unused parts.  This does however not play nice with the pkgsrc
-# framework, and the result is that the build takes more than 5 times
-# as long than when the files are not split.  See
-#    http://mail-index.netbsd.org/tech-pkg/2006/07/30/0005.html
-# for a description of the problem.
-# Disable file splitting until pkgsrc gets improved.
-	${RUN} ${ECHO} "SplitObjs         = NO" >> ${WRKSRC:Q}/mk/build.mk
-
-# If there is HsColour is in the PATH, GHC's build system tries to use
-# it without even checking if it really works. That's not what we
-# appreciate.
-	${RUN} ${ECHO} "HSCOLOUR_SRCS     = NO" >> ${WRKSRC:Q}/mk/build.mk
-
-# Don't even think of PDF.
-	${RUN} ${ECHO} "BUILD_DOCBOOK_PS  = NO" >> ${WRKSRC:Q}/mk/build.mk
-	${RUN} ${ECHO} "BUILD_DOCBOOK_PDF = NO" >> ${WRKSRC:Q}/mk/build.mk
-
-
-# -----------------------------------------------------------------------------
-# Installation/removal hooks
-#
+	    --configure-option=--with-curses-includes=${BUILDLINK_PREFIX.curses}/${BUILDLINK_INCDIRS.curses} \
+	    --configure-option=--with-curses-libraries=${BUILDLINK_PREFIX.curses}/${BUILDLINK_LIBDIRS.curses}" >> ${WRKSRC:Q}/mk/build.mk
 
 # Substitutions for INSTALL and DEINSTALL that handles package.cache.
 FILES_SUBST+=	DISTNAME=${DISTNAME}
@@ -134,54 +72,14 @@ FILES_SUBST+=	DISTNAME=${DISTNAME}
 post-install:
 	${RM} -f ${DESTDIR:Q}${PREFIX:Q}/lib/${DISTNAME}/package.conf.d/package.cache
 
-
-# -----------------------------------------------------------------------------
-# PLIST
-#
-# We can't use static PLIST because the package installs some files
-# whose names are randomly generated, namely
-# lib/${PKGNAME}/package.conf.d/*.conf
-#
-
-# If we were lucky we could just use "PLIST_TYPE = dynamic", but the
-# feature has seemingly bitrotted.
-.include "../../mk/bsd.prefs.mk"
-.if empty(DESTDIR)
-PKG_FAIL_REASON+="This package can not be built without using DESTDIR.\
-You need to set USE_DESTDIR to \"yes\"."
-.else
+# We can't use static PLIST because the package installs some files whose
+# names are randomly generated (e.g. lib/${PKGNAME}/package.conf.d/*.conf)
 GENERATE_PLIST+= \
 	cd ${DESTDIR:Q}${PREFIX:Q} && \
-		${FIND} * \( -type f -or -type l \) | ${SORT} -d;
-.endif
-
-
-# -----------------------------------------------------------------------------
-# Sanity checks
-#
-
-# There is an unused script which don't pass the portability test.
-CHECK_PORTABILITY_SKIP+=	distrib/prep-bin-dist-mingw
-
-# GHC currently *requires* ${PREFIX}/lib to be in
-# "/etc/ld-elf.so.conf". See
-# http://hackage.haskell.org/trac/ghc/ticket/2933
-CHECK_SHLIBS_SUPPORTED=	no
-
-
-# -----------------------------------------------------------------------------
-# Dependencies
-#
-
-# I guess pdcurses works well but not tested.
-USE_NCURSES=	yes
+		${FIND} * \( -type f -o -type l \) | ${SORT} -d;
 
-BUILDLINK_DEPMETHOD.libxslt=		build
-BUILDLINK_DEPMETHOD.xz=		build
-.include "../../archivers/xz/buildlink3.mk"
 .include "../../converters/libiconv/buildlink3.mk"
 .include "../../devel/gmp/buildlink3.mk"
-.include "../../devel/ncurses/buildlink3.mk"
-.include "../../textproc/libxslt/buildlink3.mk"
+.include "../../mk/curses.buildlink3.mk"
 .include "../../mk/pthread.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/ghc/TODO b/ghc/TODO
index 31d0f86..06fecdb 100644
--- a/ghc/TODO
+++ b/ghc/TODO
@@ -3,21 +3,8 @@
 wip/ghc TODO
 ============
 
-* Modify configure.ac and rules/build-package-data.mk to allow
-  ``--with-curses-{includes,libraries}`` to be passed to the top-level
-  ``configure``, and send a patch to the upstream.
-* Add the following ``./configure`` flags to eliminate
-  ``patch-Makefile`` and ``patch-ghc.mk``:
-
-  * ``--with-dist-archiver={bzip2,xz} [default=bzip2]``
-  * ``BZIP2FLAGS``
-  * ``XZFLAGS``
-
-* Let ``./configure`` check for broken binutils and provide a better
-  fix for ``patch-rts_StgCRun.c``.
 * Build more bootstrapping compilers to support more platforms.
 
-
 How to build a bootstrapping compiler
 -------------------------------------
 
diff --git a/ghc/bootstrap.mk b/ghc/bootstrap.mk
index 64e502b..40f579b 100644
--- a/ghc/bootstrap.mk
+++ b/ghc/bootstrap.mk
@@ -1,41 +1,66 @@
-# $NetBSD: bootstrap.mk,v 1.3 2013/02/23 12:24:07 phonohawk Exp $
+# $NetBSD$
 # -----------------------------------------------------------------------------
-# Select a bindist of bootstrapping compiler based on a per-platform
-# basis.
+# Select a bindist of bootstrapping compiler on a per-platform basis.
 #
 # BOOT_ARCHIVE
 #   This variable is set to the name of compressed archive file of a
 #   bootstrapping compiler for the current platform.
 #
-# BOOT_TARBALL
-#   Similar to BOOT_ARCHIVE, but "*.tar" not "*.tar.xz".
+# BOOT_VERSION
+#   Version of the bootstrapping compiler to use. This can be
+#   overriden for specific platforms.
 #
 .include "../../mk/bsd.prefs.mk"
-.if ${MACHINE_ARCH} == "i386" && ${OPSYS} == "FreeBSD"
-BOOT_ARCHIVE=	${DISTNAME}-boot-i386-unknown-freebsd.tar.xz
 
-.elif ${MACHINE_ARCH} == "i386" && ${OPSYS} == "NetBSD"
-BOOT_ARCHIVE=	${DISTNAME}-boot-i386-unknown-netbsd.tar.xz
+# Use the same version as the package itself by default.
+BOOT_VERSION:=	${PKGNAME:C/^.*-//}
 
-.elif ${MACHINE_ARCH} == "powerpc" && ${OPSYS} == "Darwin"
-BOOT_ARCHIVE=	${DISTNAME}-boot-powerpc-apple-darwin.tar.xz
-# Existence of libelf makes LeadingUnderscore being "NO", which is
-# incorrect for this platform. See ${WRKSRC}/aclocal.m4
-# (FP_LEADING_UNDERSCORE)
-CONFLICTS+=	libelf-[0-9]*
+.if !empty(MACHINE_PLATFORM:MDarwin-*-x86_64) || make(distinfo)
+BOOT_ARCHIVE:=		ghc-${BOOT_VERSION}-boot-x86_64-apple-darwin.tar.xz
+DISTFILES:=		${DISTFILES} ${BOOT_ARCHIVE}
+SITES.${BOOT_ARCHIVE}=  https://us-east.manta.joyent.com/pkgsrc/public/distfiles-local/
+.endif
 
-.elif ${MACHINE_ARCH} == "x86_64" && ${OPSYS} == "Linux"
-BOOT_ARCHIVE=	${DISTNAME}-boot-x86_64-unknown-linux.tar.xz
+.if !empty(MACHINE_PLATFORM:MSunOS-5.11-i386) || make(distinfo)
+BOOT_ARCHIVE:=		ghc-${BOOT_VERSION}-boot-i386-unknown-solaris2.tar.xz
+DISTFILES:=		${DISTFILES} ${BOOT_ARCHIVE}
+SITES.${BOOT_ARCHIVE}=  https://us-east.manta.joyent.com/pkgsrc/public/distfiles-local/
+.endif
 
-.elif ${MACHINE_ARCH} == "x86_64" && ${OPSYS} == "NetBSD"
-BOOT_ARCHIVE=	${DISTNAME}-boot-x86_64-unknown-netbsd.tar.xz
+.if !empty(MACHINE_PLATFORM:MSunOS-5.11-x86_64) || make(distinfo)
+BOOT_ARCHIVE:=		ghc-${BOOT_VERSION}-boot-x86_64-unknown-solaris2.tar.xz
+DISTFILES:=		${DISTFILES} ${BOOT_ARCHIVE}
+SITES.${BOOT_ARCHIVE}=  https://us-east.manta.joyent.com/pkgsrc/public/distfiles-local/
+.endif
 
-.else
-PKG_FAIL_REASON+=	"internal error: unsupported platform"
+.if empty(BOOT_ARCHIVE)
+BOOT_ARCHIVE:=		ghc-${BOOT_VERSION}-boot-unknown.tar.xz
+PKG_FAIL_REASON+=	"Unsupported platform, please generate bootstrap kit"
 .endif
 
-BOOT_TARBALL=	${BOOT_ARCHIVE:C/\.xz$//}
+# For package developers, please do not upload any bootkits unsafely
+# built. That is, machines shared with someone or on a cloud hosting
+# service should be avoided for building bootkits.
+.for i in ${DISTFILES:M*-boot-*}
+SITES.${i}?=	${MASTER_SITE_LOCAL}
+.endfor
+
+# Existence of libelf makes LeadingUnderscore being "NO", which is
+# incorrect for this platform. See ${WRKSRC}/aclocal.m4
+# (FP_LEADING_UNDERSCORE)
+.if ${OPSYS} == "Darwin"
+CONFLICTS+=	libelf-[0-9]*
+.endif
 
+# FreeBSD < 10 surprisingly doesn't have a native iconv so we need to
+# use pkgsrc libiconv for this OPSYS. And if a bootkit depends on
+# pkgsrc libiconv, the "normal" build must do the same because GHC
+# always needs to link executables with libiconv, just like libgmp
+# when integer-gmp is used. For this reason it might be desirable to
+# create two separate bootkits, one for < 10 and another for >= 10.
+.if ${OPSYS} == "FreeBSD"
+USE_BUILTIN.iconv=	no
+.endif
 
 # -----------------------------------------------------------------------------
 # The "pre-configure" hook
@@ -43,19 +68,24 @@ BOOT_TARBALL=	${BOOT_ARCHIVE:C/\.xz$//}
 # Install a bootstrapping compiler directly into TOOLS_DIR so that
 # ./configure can find it.
 #
-USE_TOOLS+=	gmake xzcat
+USE_TOOLS+=	gmake xzcat xz
 
 pre-configure:
+	@${TEST} -f ${DISTDIR:Q}/${DIST_SUBDIR:Q}/${BOOT_ARCHIVE} || \
+	${FAIL_MSG}  "Put your trusted bootstrap archive as ${DISTDIR}/${DIST_SUBDIR}/${BOOT_ARCHIVE}"
+
 	@${PHASE_MSG} "Extracting bootstrapping compiler for ${PKGNAME}"
 	${RUN} ${MKDIR} ${WRKDIR:Q}/build-extract
 	${RUN} cd ${WRKDIR:Q}/build-extract && \
 		${EXTRACT_CMD_DEFAULT} ${DISTDIR:Q}/${DIST_SUBDIR:Q}/${BOOT_ARCHIVE}
 
+# It is important to install the stage-0 compiler with our rpath flags
+# configured, otherwise it will produce executables with no rpath and
+# fail in the configure phase.
 	@${PHASE_MSG} "Preparing bootstrapping compiler for ${PKGNAME}"
-	${RUN} cd ${WRKDIR:Q}/build-extract/${DISTNAME}-boot && \
-		${SH} ./configure \
-			--prefix=${TOOLS_DIR:Q} \
-			--with-gcc=${CCPATH:Q} && \
+	${RUN} cd ${WRKDIR:Q}/build-extract/${PKGNAME_NOREV}-boot && \
+		${PKGSRC_SETENV} ${CONFIGURE_ENV} ${SH} ./configure \
+			--prefix=${TOOLS_DIR:Q} && \
 		${MAKE_PROGRAM} install
 
 
@@ -68,54 +98,166 @@ pre-configure:
 # dependencies, otherwise the resulting binary can easily get
 # unusable.
 #
-.PHONY: bootstrap
 
-.if exists(${WRKDIR}/${DISTNAME}/mk/config.mk)
-bootstrap:
-	@${ERROR_MSG} "You have already configured the package in a way\
-	that building bootstrapping compiler is impossible."
-	@${FAIL_MSG}  "Please run \"${MAKE} clean patch\" first."
+# We don't want our bootkits to have a run-time dependency on
+# libgcc. In fact GHC's implementation of Haskell exception handling
+# does not depend on libgcc's facilities so it is attractive to do the
+# same for "normal" build... but we can't. This is because Haskell
+# programs may call C functions via FFI, and those C functions may
+# call C++ functions in turn, possibly in a different shared library.
+.include "../../mk/compiler.mk"
+.if make(bootstrap) && !empty(CC_VERSION:Mgcc-*)
+# But on some platforms, gcc automagically inserts a dependency on a
+# shared libgcc when -lpthread is given, which is seemingly
+# unavoidable.
+LDFLAGS+=	-static-libgcc
+.endif
+
+# Gather information about packages on which bootkit depends. It will
+# be used in the post-bootstrap phase.
+BOOT_GHC_DEPS:=		curses iconv
+BOOT_GHC_PKGSRC_DEPS:=	# empty
+.for pkg in ${BOOT_GHC_DEPS}
+
+# NOTE: pkglint(1) complains for including these builtin.mk files,
+# telling that we must include buildlink3.mk instead. But then how do
+# we get variables like USE_BUILTIN.${pkg} defined before including
+# ../../mk/bsd.pkg.mk, given that ../../mk/bsd.buildlink3.mk isn't
+# protected against multiple inclusion?
+CHECK_BUILTIN.${pkg}:=	yes
+.  if ${pkg} == "curses"
+.    include "../../mk/curses.builtin.mk"
+.  elif ${pkg} == "iconv"
+.    include "../../converters/libiconv/builtin.mk"
+.  endif
+CHECK_BUILTIN.${pkg}:=	no
+
+# BOOT_GHC_PKGSRC_DEPS is a list of packages whose pkgsrc version is
+# preferred over native one, either by user or ../../mk/platform
+.  if ${PREFER.${pkg}} == "pkgsrc"
+BOOT_GHC_PKGSRC_DEPS+=	${pkg}
+.  endif
+.endfor
 
-.elif !exists(${WRKDIR}/${DISTNAME}/rts/ghc.mk.orig)
-bootstrap:
-	@${FAIL_MSG} "Please run \"${MAKE} patch\" first."
+# Compiler wrappers must not remove -I/-L flags for the installed
+# GHC's libdir, otherwise the GHC we are going to use for building our
+# bootstraping kit will not work at all. Ideally it should be added to
+# BUILDLINK_PASSTHRU_DIRS only .if make(bootstrap), but then running
+# "${MAKE} wrapper" before "${MAKE} bootstrap" will result in a
+# cryptic error which we can't easily catch.
+BOOT_GHC_LIBDIR_CMD=		ghc --print-libdir
+.if !defined(BOOT_GHC_LIBDIR)
+BOOT_GHC_LIBDIR!=		(${BOOT_GHC_LIBDIR_CMD}) 2>/dev/null || ${ECHO}
+.endif
+MAKEVARS+=			BOOT_GHC_LIBDIR
+BUILDLINK_PASSTHRU_DIRS+=	${BOOT_GHC_LIBDIR}
 
+# Default values for BUILDLINK_INCDIRS.<pkg> are only generated in the
+# barrier. See ../../mk/buildlink3/bsd.buildlink3.mk and
+# ../../mk/bsd.pkg.barrier.mk
+.PHONY: bootstrap
+.if make(bootstrap)
+_BARRIER_CMDLINE_TARGETS+=	bootstrap
+.endif
+.if !defined(_PKGSRC_BARRIER)
+bootstrap: barrier
 .else
-bootstrap: ${WRKDIR}/${BOOT_ARCHIVE}
-	@${PHASE_MSG} "Done creating" ${WRKDIR}/${BOOT_ARCHIVE}
+bootstrap: pre-bootstrap .WAIT ${WRKDIR}/${BOOT_ARCHIVE} .WAIT post-bootstrap
+.endif
+
+.PHONY: pre-bootstrap
+pre-bootstrap: wrapper
+.if empty(BOOT_GHC_LIBDIR)
+	@if ${BOOT_GHC_LIBDIR_CMD} 2>/dev/null 1>&2; then \
+		${ERROR_MSG} "Running \"${BOOT_GHC_LIBDIR_CMD}\" has failed during wrapper phase."; \
+		${FAIL_MSG}  "Plase run \"${MAKE} clean\" and try again."; \
+	else \
+		${ERROR_MSG} "Failed to run \"${BOOT_GHC_LIBDIR_CMD}\":"; \
+		${BOOT_GHC_LIBDIR_CMD}; \
+		${ERROR_MSG} "You don't seem to have a working GHC in your PATH."; \
+		${FAIL_MSG}  "Please install one and then run \"${MAKE} clean bootstrap\"."; \
+	fi
+.endif
+# ${_COOKIE.configure} is not defined yet so we can't use .if here.
+	@if ${TEST} -f ${_COOKIE.configure}; then \
+		${ERROR_MSG} "You have already configured the package in a way\
+		that building bootstrapping compiler is impossible."; \
+		${FAIL_MSG}  "Please run \"${MAKE} clean\" first."; \
+	fi
 
 ${WRKDIR}/lndir:
 	@${PHASE_MSG} "Building lndir(1) to duplicate the source tree."
 	cd ${WRKSRC:Q}/utils/lndir && \
-		${CCPATH:Q} lndir.c -o ${.TARGET}
+		${PKG_CC:Q} lndir.c -o ${.TARGET}
 
 ${WRKDIR}/stamp-lndir-boot: ${WRKDIR}/lndir
-	@${PHASE_MSG} "Duplicating the source tree for bootstrapping ${DISTNAME}"
+	@${PHASE_MSG} "Duplicating the source tree for bootstrapping ${PKGNAME_NOREV}"
 	${MKDIR} ${WRKDIR:Q}/build-boot
 	cd ${WRKDIR:Q}/build-boot && \
-		${WRKDIR}/lndir -silent ../${DISTNAME:Q}
+		${WRKDIR}/lndir -silent ../${PKGNAME_NOREV:Q}
 	${TOUCH} ${.TARGET}
 
+# For terminfo_CONFIGURE_OPTS, see
+# https://ghc.haskell.org/trac/ghc/ticket/10096
 ${WRKDIR}/stamp-configure-boot: ${WRKDIR}/stamp-lndir-boot
-	@${PHASE_MSG} "Configuring bootstrapping compiler ${DISTNAME}"
+	@${PHASE_MSG} "Configuring bootstrapping compiler ${PKGNAME_NOREV}"
 	${MKDIR} ${WRKDIR:Q}/build-boot
 	cd ${WRKDIR:Q}/build-boot && \
-		${SH} ./configure --with-gcc=${CCPATH:Q} && \
-		${LN} -f ${FILESDIR:Q}/bootstrap.build.mk mk/build.mk
+		${PKGSRC_SETENV} ${CONFIGURE_ENV} ${SH} ./configure ${CONFIGURE_ARGS}
 	${TOUCH} ${.TARGET}
 
-${WRKDIR}/stamp-build-boot: ${WRKDIR}/stamp-configure-boot
-	@${PHASE_MSG} "Building bootstrapping compiler ${DISTNAME}"
+${WRKDIR}/build-boot/mk/build.mk: ${WRKDIR}/stamp-configure-boot
+	@${PHASE_MSG} "Configuring ${.TARGET}"
+	${ECHO} "BuildFlavour = quick" >${.TARGET}
+	${ECHO} "DYNAMIC_GHC_PROGRAMS = NO" >>${.TARGET}
+	${CAT} ${WRKDIR:Q}/build-boot/mk/build.mk.sample >>${.TARGET}
+	${ECHO} "INTEGER_LIBRARY = integer-simple" >>${.TARGET}
+	${ECHO} "BIN_DIST_NAME = ghc-\$$(ProjectVersion)-boot" >>${.TARGET}
+	${ECHO} "libraries/terminfo_CONFIGURE_OPTS += \
+	    --configure-option=--with-curses-includes=${BUILDLINK_PREFIX.curses}/${BUILDLINK_INCDIRS.curses} \
+	    --configure-option=--with-curses-libraries=${BUILDLINK_PREFIX.curses}/${BUILDLINK_LIBDIRS.curses}" >>${.TARGET}
+
+${WRKDIR}/stamp-build-boot: ${WRKDIR}/build-boot/mk/build.mk
+	@${PHASE_MSG} "Building bootstrapping compiler ${PKGNAME_NOREV}"
 	${RUN} cd ${WRKDIR:Q}/build-boot && ${BUILD_MAKE_CMD}
 	${TOUCH} ${.TARGET}
 
-${WRKDIR}/${BOOT_TARBALL}: ${WRKDIR}/stamp-build-boot
-	@${PHASE_MSG} "Creating binary distribution of bootstrapping ${DISTNAME}"
-	${RUN} cd ${WRKDIR:Q}/build-boot && ${BUILD_MAKE_CMD} binary-dist
-	${MV} -f ${WRKDIR:Q}/build-boot/${BOOT_TARBALL} ${.TARGET}
+${WRKDIR}/${BOOT_ARCHIVE}: ${WRKDIR}/stamp-build-boot
+	@${PHASE_MSG} "Creating binary distribution of bootstrapping ${PKGNAME_NOREV}"
+	${RUN} cd ${WRKDIR:Q}/build-boot && \
+		${BUILD_MAKE_CMD} TAR_COMP=xz XZ_CMD="xz -9ev" binary-dist
+	${MV} -f ${WRKDIR:Q}/build-boot/${BOOT_ARCHIVE} ${.TARGET}
 
-# This can take up half an hour. Memory usage is also very high, about 680 MiB.
-${WRKDIR}/${BOOT_ARCHIVE}: ${WRKDIR}/${BOOT_TARBALL}
-	@${PHASE_MSG} "Compressing binary distribution of bootstrapping ${DISTNAME}"
-	${PREFIX:Q}/bin/xz --verbose -9 --extreme ${WRKDIR:Q}/${BOOT_TARBALL}
+.PHONY: post-bootstrap
+post-bootstrap:
+	@${ECHO} "=========================================================================="
+	@${ECHO} "Done creating ${BOOT_ARCHIVE}"
+	@${ECHO} "  in ${WRKDIR}"
+	@${ECHO}
+	@${ECHO} "Now you can copy it into ${DISTDIR}/${DIST_SUBDIR} to use it as your"
+	@${ECHO} "bootstrap kit. You may want to take a backup in case \"lintpkgsrc -r\""
+	@${ECHO} "removes it."
+	@${ECHO}
+	@${ECHO} "Your bootstrap kit has the following run-time dependencies:"
+.for pkg in ${BOOT_GHC_DEPS}
+	@${PRINTF} "  * %-8s" "${pkg}:"
+.  if !empty(USE_BUILTIN.${pkg}:M[nN][oO])
+	@${ECHO_N} " pkgsrc ${BUILDLINK_PKGNAME.${pkg}}"
+.  else
+	@${ECHO_N} " native"
+.    if empty(BUILTIN_PKG.${pkg})
+	@${ECHO_N} " (version/variant unknown)"
+.    else
+	@${ECHO_N} " ${BUILTIN_PKG.${pkg}}"
+.    endif
+.  endif
+	@${ECHO}
+.endfor
+.if !empty(BOOT_GHC_PKGSRC_DEPS)
+	@${ECHO}
+	@${ECHO} "Please note that it is generally not a good idea for a bootkit to depend"
+	@${ECHO} "on pkgsrc packages, as pkgsrc tends to move faster than operating systems"
+	@${ECHO} "so your bootkit may bitrot more quickly. You may want to rebuild it"
+	@${ECHO} "without setting PREFER_PKGSRC to \"yes\"."
 .endif
+	@${ECHO} "=========================================================================="
diff --git a/ghc/buildlink3.mk b/ghc/buildlink3.mk
index 230f46b..b34fb7e 100644
--- a/ghc/buildlink3.mk
+++ b/ghc/buildlink3.mk
@@ -1,17 +1,17 @@
-# $NetBSD: buildlink3.mk,v 1.14 2014/08/29 14:09:59 szptvlfn Exp $
+# $NetBSD$
 
 BUILDLINK_TREE+=	ghc
 
 .if !defined(GHC_BUILDLINK3_MK)
 GHC_BUILDLINK3_MK:=
 
-BUILDLINK_API_DEPENDS.ghc+=	ghc>=7.6.2
-BUILDLINK_ABI_DEPENDS.ghc+=	ghc>=7.6.2
+BUILDLINK_API_DEPENDS.ghc+=	ghc>=7.10.2
+BUILDLINK_ABI_DEPENDS.ghc+=	ghc>=7.10.2
 BUILDLINK_PKGSRCDIR.ghc?=	../../wip/ghc
 
 .include "../../converters/libiconv/buildlink3.mk"
 .include "../../devel/gmp/buildlink3.mk"
-.include "../../devel/ncurses/buildlink3.mk"
+.include "../../mk/curses.buildlink3.mk"
 .endif	# GHC_BUILDLINK3_MK
 
 BUILDLINK_TREE+=	-ghc
diff --git a/ghc/distinfo b/ghc/distinfo
index f6857b3..e3e63b8 100644
--- a/ghc/distinfo
+++ b/ghc/distinfo
@@ -1,27 +1,14 @@
-$NetBSD: distinfo,v 1.18 2013/02/23 12:24:07 phonohawk Exp $
+$NetBSD$
 
-SHA1 (ghc-7.6.2-boot-i386-unknown-freebsd.tar.xz) = b7a286b89ffd39dde789776fd925efb452e75233
-RMD160 (ghc-7.6.2-boot-i386-unknown-freebsd.tar.xz) = 707ad61207e8caad6d06a65fbe87447798d153f6
-Size (ghc-7.6.2-boot-i386-unknown-freebsd.tar.xz) = 27926040 bytes
-SHA1 (ghc-7.6.2-boot-i386-unknown-netbsd.tar.xz) = 0786ea45e68a9aecc46799c893aa666eb02f5878
-RMD160 (ghc-7.6.2-boot-i386-unknown-netbsd.tar.xz) = 57db9cc16ff78c7e410d653b74d885bf2c69e13d
-Size (ghc-7.6.2-boot-i386-unknown-netbsd.tar.xz) = 28261476 bytes
-SHA1 (ghc-7.6.2-boot-powerpc-apple-darwin.tar.xz) = 90a4e64842426dd956650e8ef2e17e9ef0b9a69b
-RMD160 (ghc-7.6.2-boot-powerpc-apple-darwin.tar.xz) = fb1b85b25195846f260b4f8082908e80bc7a6d0f
-Size (ghc-7.6.2-boot-powerpc-apple-darwin.tar.xz) = 33635664 bytes
-SHA1 (ghc-7.6.2-boot-x86_64-unknown-linux.tar.xz) = 3cb91c05cd1c0f12e3420d466636e110934a11ac
-RMD160 (ghc-7.6.2-boot-x86_64-unknown-linux.tar.xz) = 4a57fcbe2c7b99371f61e3a8f4bfdc4e9aae4339
-Size (ghc-7.6.2-boot-x86_64-unknown-linux.tar.xz) = 28837552 bytes
-SHA1 (ghc-7.6.2-boot-x86_64-unknown-netbsd.tar.xz) = 3d3e29ea427c9b26760fb232b77772bc63dd8938
-RMD160 (ghc-7.6.2-boot-x86_64-unknown-netbsd.tar.xz) = b1325b7ae4d39362073c24a226b6bd86d124569e
-Size (ghc-7.6.2-boot-x86_64-unknown-netbsd.tar.xz) = 28778048 bytes
-SHA1 (ghc-7.6.2-src.tar.bz2) = 17329b0f1a401f3402cce13ba5e4cf8fbfa41a1d
-RMD160 (ghc-7.6.2-src.tar.bz2) = 3aa6cc4daaba1f14f28a7720d6d39cf1d9f982f2
-Size (ghc-7.6.2-src.tar.bz2) = 110778081 bytes
-SHA1 (patch-Makefile) = a6692a4a90b8003a8719c51d82d15f5af0ba1907
-SHA1 (patch-ghc.mk) = c4210aaa3e2b4a319b0b70da375ac89fddde5cb7
-SHA1 (patch-libraries_integer-gmp_configure.ac) = bc5ce3a6c39d681c413eb08b66e7287e39406fe0
-SHA1 (patch-libraries_integer-simple_GHC_Integer.hs) = f079285bc489c194959b9bee2aa5c977ec77ae1e
-SHA1 (patch-libraries_integer-simple_GHC_Integer_Type.hs) = b3140e169726f78f6d3b4edcd4cc119b6f767bfa
-SHA1 (patch-rts_StgCRun.c) = dcbc883cb4826aeccac0be09647b7889c7809271
-SHA1 (patch-rts_ghc.mk) = 4dd33c5ac593736a9fa0fdbdd65df90549fac771
+SHA1 (ghc-7.10.2-boot-i386-unknown-solaris2.tar.xz) = 39880e0dc1c39292c03af753e9877ee1213a8852
+RMD160 (ghc-7.10.2-boot-i386-unknown-solaris2.tar.xz) = 4d5d12744d67ecd67bdccb3688335129040df703
+Size (ghc-7.10.2-boot-i386-unknown-solaris2.tar.xz) = 40445420 bytes
+SHA1 (ghc-7.10.2-boot-x86_64-apple-darwin.tar.xz) = b2f99710933c275d10ea08961f313077574cc567
+RMD160 (ghc-7.10.2-boot-x86_64-apple-darwin.tar.xz) = f08f19cdbcda38cede85f78631a04dd9611be6b2
+Size (ghc-7.10.2-boot-x86_64-apple-darwin.tar.xz) = 52981452 bytes
+SHA1 (ghc-7.10.2-boot-x86_64-unknown-solaris2.tar.xz) = 3257a8e659521e7dbc9e7441e602a8a1fe9b35f9
+RMD160 (ghc-7.10.2-boot-x86_64-unknown-solaris2.tar.xz) = 11c45b1c1d15b130f980e7db2e96235ab6f6c49a
+Size (ghc-7.10.2-boot-x86_64-unknown-solaris2.tar.xz) = 48986488 bytes
+SHA1 (ghc-7.10.2-src.tar.bz2) = aead70af50fa1f24b38a0a03182f9583aac9803a
+RMD160 (ghc-7.10.2-src.tar.bz2) = cad56e1cb2574aded0b7a57dc575390024b5919e
+Size (ghc-7.10.2-src.tar.bz2) = 12536999 bytes
diff --git a/ghc/patches/patch-Makefile b/ghc/patches/patch-Makefile
deleted file mode 100644
index f643011..0000000
--- a/ghc/patches/patch-Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD: patch-Makefile,v 1.1 2013/02/23 12:24:07 phonohawk Exp $
-
-Required by patches/patch-ghc.mk
-
-
---- Makefile.orig	2013-02-14 02:53:07.000000000 +0000
-+++ Makefile
-@@ -75,7 +75,7 @@ binary-dist: binary-dist-prep
- ifeq "$(mingw32_TARGET_OS)" "1"
- 	mv bindistprep/*.exe .
- endif
--	mv bindistprep/*.tar.bz2 .
-+	mv bindistprep/*.tar .
- 
- binary-dist-prep:
- ifeq "$(mingw32_TARGET_OS)" "1"
diff --git a/ghc/patches/patch-ghc.mk b/ghc/patches/patch-ghc.mk
deleted file mode 100644
index f9875ef..0000000
--- a/ghc/patches/patch-ghc.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-ghc.mk,v 1.1 2013/02/23 12:24:08 phonohawk Exp $
-
-We want bootstrapping bindists to be as small as possible, and bzip2
-is not enough:
-
-  % du -sh ghc-*.tar*
-  291M    ghc-7.6.2-boot-powerpc-apple-darwin.tar
-   60M    ghc-7.6.2-boot-powerpc-apple-darwin.tar.bz2
-   32M    ghc-7.6.2-boot-powerpc-apple-darwin.tar.xz
-
-
---- ghc.mk.orig	2013-02-14 02:24:35.000000000 +0000
-+++ ghc.mk
-@@ -1009,7 +1009,8 @@ unix-binary-dist-prep:
- 	$(call removeFiles,$(BIN_DIST_PREP_TAR))
- # h means "follow symlinks", e.g. if aclocal.m4 is a symlink to a source
- # tree then we want to include the real file, not a symlink to it
--	cd bindistprep && "$(TAR_CMD)" hcf - -T ../$(BIN_DIST_LIST) | bzip2 -c > ../$(BIN_DIST_PREP_TAR_BZ2)
-+	"$(MKDIRHIER)" compiler/stage2/doc # Workaround needed when building no docs.
-+	cd bindistprep && "$(TAR_CMD)" hcf ../$(BIN_DIST_PREP_TAR) -T ../$(BIN_DIST_LIST)
- 
- windows-binary-dist-prep:
- 	$(call removeTrees,bindistprep/)
diff --git a/ghc/patches/patch-libraries_integer-gmp_configure.ac b/ghc/patches/patch-libraries_integer-gmp_configure.ac
deleted file mode 100644
index 44800e5..0000000
--- a/ghc/patches/patch-libraries_integer-gmp_configure.ac
+++ /dev/null
@@ -1,42 +0,0 @@
-$NetBSD: patch-libraries_integer-gmp_configure.ac,v 1.2 2013/02/23 12:24:08 phonohawk Exp $
-
-In Darwin, integer-gmp prefers GMP.framework when it happens to be
-installed somewhere in the system, even though it doesn't come with
-Darwin. Let it stop that. (Already fixed in the upstream.)
-
-
---- libraries/integer-gmp/configure.ac.orig	2013-01-27 13:36:41.000000000 +0000
-+++ libraries/integer-gmp/configure.ac
-@@ -45,18 +45,20 @@ dnl-------------------------------------
- dnl * Mac OS X only: check for GMP.framework
- dnl--------------------------------------------------------------------
- 
--case $target_os in
--  darwin*)
--    AC_MSG_CHECKING([for GMP.framework])
--    save_libs="$LIBS"
--    LIBS="-framework GMP"
--    AC_TRY_LINK_FUNC(__gmpz_fdiv_qr,
--      [HaveFrameworkGMP=YES; GMP_FRAMEWORK=GMP; GMP_LIBS=],
--      [HaveFrameworkGMP=NO])
--    LIBS="$save_libs"
--    AC_MSG_RESULT([$HaveFrameworkGMP])
--    ;;
--esac
-+if test "$HaveLibGmp" = "NO"; then
-+  case $target_os in
-+    darwin*)
-+      AC_MSG_CHECKING([for GMP.framework])
-+      save_libs="$LIBS"
-+      LIBS="-framework GMP"
-+      AC_TRY_LINK_FUNC(__gmpz_fdiv_qr,
-+        [HaveFrameworkGMP=YES; GMP_FRAMEWORK=GMP],
-+        [HaveFrameworkGMP=NO])
-+      LIBS="$save_libs"
-+      AC_MSG_RESULT([$HaveFrameworkGMP])
-+      ;;
-+  esac
-+fi
- 
- AC_CHECK_HEADER([gmp.h], , [HaveFrameworkGMP=NO; HaveLibGmp=NO; GMP_LIBS=])
- 
diff --git a/ghc/patches/patch-libraries_integer-simple_GHC_Integer.hs b/ghc/patches/patch-libraries_integer-simple_GHC_Integer.hs
deleted file mode 100644
index 45a1053..0000000
--- a/ghc/patches/patch-libraries_integer-simple_GHC_Integer.hs
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-libraries_integer-simple_GHC_Integer.hs,v 1.1 2013/02/23 12:24:08 phonohawk Exp $
-
-Missing functions: already fixed in the upstream.
-
-
---- libraries/integer-simple/GHC/Integer.hs.orig	2013-02-13 18:50:32.000000000 +0000
-+++ libraries/integer-simple/GHC/Integer.hs
-@@ -27,6 +27,7 @@ module GHC.Integer (
-     plusInteger, minusInteger, timesInteger, negateInteger,
-     eqInteger, neqInteger, absInteger, signumInteger,
-     leInteger, gtInteger, ltInteger, geInteger, compareInteger,
-+    divInteger, modInteger,
-     divModInteger, quotRemInteger, quotInteger, remInteger,
-     encodeFloatInteger, decodeFloatInteger, floatFromInteger,
-     encodeDoubleInteger, decodeDoubleInteger, doubleFromInteger,
diff --git a/ghc/patches/patch-libraries_integer-simple_GHC_Integer_Type.hs b/ghc/patches/patch-libraries_integer-simple_GHC_Integer_Type.hs
deleted file mode 100644
index da86b55..0000000
--- a/ghc/patches/patch-libraries_integer-simple_GHC_Integer_Type.hs
+++ /dev/null
@@ -1,24 +0,0 @@
-$NetBSD: patch-libraries_integer-simple_GHC_Integer_Type.hs,v 1.1 2013/02/23 12:24:08 phonohawk Exp $
-
-Missing functions: already fixed in the upstream.
-
-
---- libraries/integer-simple/GHC/Integer/Type.hs.orig	2013-02-13 18:45:55.000000000 +0000
-+++ libraries/integer-simple/GHC/Integer/Type.hs
-@@ -370,6 +370,16 @@ n `divModInteger` d =
-             then (# q `minusInteger` oneInteger, r `plusInteger` d #)
-             else (# q, r #)
- 
-+{-# NOINLINE divInteger #-}
-+divInteger :: Integer -> Integer -> Integer
-+n `divInteger` d = quotient
-+    where (# quotient, _ #) = n `divModInteger` d
-+
-+{-# NOINLINE modInteger #-}
-+modInteger :: Integer -> Integer -> Integer
-+n `modInteger` d = modulus
-+    where (# _, modulus #) = n `divModInteger` d
-+
- {-# NOINLINE quotRemInteger #-}
- quotRemInteger :: Integer -> Integer -> (# Integer, Integer #)
- Naught      `quotRemInteger` (!_)        = (# Naught, Naught #)
diff --git a/ghc/patches/patch-rts_StgCRun.c b/ghc/patches/patch-rts_StgCRun.c
deleted file mode 100644
index f6833a6..0000000
--- a/ghc/patches/patch-rts_StgCRun.c
+++ /dev/null
@@ -1,31 +0,0 @@
-$NetBSD: patch-rts_StgCRun.c,v 1.2 2013/02/23 12:24:08 phonohawk Exp $
-
-We have to make the visiblity of StgRun and StgReturn to "hidden" not
-to trigger a bug in old binutils which results in:
-
-   ld: rts/dist/build/RtsStartup.dyn_o: relocation R_X86_64_PC32
-   against `StgRun' can not be used when making a shared object;
-   recompile with -fPIC
-
-With this workaround we can no longer override those two symbols using
-LD_PRELOAD, but I think there is no reason to do so anyway.
-
-
---- rts/StgCRun.c.orig	2013-01-27 13:21:52.000000000 +0000
-+++ rts/StgCRun.c
-@@ -246,6 +246,7 @@ StgRunIsImplementedInAssembler(void)
-          * save callee-saves registers on behalf of the STG code.
-          */
-         ".globl " STG_RUN "\n"
-+        ".hidden " STG_RUN "\n"
-         STG_RUN ":\n\t"
-         "subq %1, %%rsp\n\t"
-         "movq %%rsp, %%rax\n\t"
-@@ -280,6 +281,7 @@ StgRunIsImplementedInAssembler(void)
-         "jmp *%%rax\n\t"
- 
-         ".globl " STG_RETURN "\n"
-+        ".hidden " STG_RETURN "\n"
-          STG_RETURN ":\n\t"
- 
-         "movq %%rbx, %%rax\n\t"   /* Return value in R1  */
diff --git a/ghc/patches/patch-rts_ghc.mk b/ghc/patches/patch-rts_ghc.mk
deleted file mode 100644
index 15be314..0000000
--- a/ghc/patches/patch-rts_ghc.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-rts_ghc.mk,v 1.4 2013/02/23 12:24:08 phonohawk Exp $
-
-This is pkgsrc specific: dtrace(1) gets confused when we have gcc
-wrappers in the PATH so we have to hide them:
-
-  gcc: installation problem, cannot exec '/usr/pkgsrc/wip/ghc/work/.gcc/bin/p
-  owerpc-apple-darwin9-gcc-4.0.1': No such file or directory
-  dtrace: failed to compile script rts/RtsProbes.d: Preprocessor failed to pr
-  ocess input program
-
-
---- rts/ghc.mk.orig	2013-01-27 13:21:52.000000000 +0000
-+++ rts/ghc.mk
-@@ -484,7 +484,7 @@ endif
- 
- DTRACEPROBES_SRC = rts/RtsProbes.d
- $(DTRACEPROBES_H): $(DTRACEPROBES_SRC) includes/ghcplatform.h | $$(dir $$@)/.
--	"$(DTRACE)" $(filter -I%,$(rts_CC_OPTS)) -C $(DTRACE_FLAGS) -h -o $@ -s $<
-+	env PATH="/usr/bin" "$(DTRACE)" $(filter -I%,$(rts_CC_OPTS)) -C $(DTRACE_FLAGS) -h -o $@ -s $<
- endif
- 
- # -----------------------------------------------------------------------------



Home | Main Index | Thread Index | Old Index