pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/lang/ghc7
Module Name: pkgsrc
Committed By: pho
Date: Sun Dec 29 16:59:09 UTC 2019
Modified Files:
pkgsrc/lang/ghc7: DESCR Makefile bootstrap.mk buildlink3.mk distinfo
pkgsrc/lang/ghc7/files: bootstrap.build.mk
pkgsrc/lang/ghc7/patches: patch-ghc.mk
patch-libraries_unix_System_Posix_Signals.hsc
patch-libraries_unix_include_execvpe.h patch-rts_PosixSource.h
Added Files:
pkgsrc/lang/ghc7: BOOTSTRAP.txt
pkgsrc/lang/ghc7/patches: patch-libraries_base_GHC_Event_KQueue.hsc
patch-libraries_base_System_Environment.hs
patch-libraries_time_lib_Data_Time_Clock_CTimeval.hs
patch-libraries_unix_System_Posix_Files_Common.hsc
Removed Files:
pkgsrc/lang/ghc7: PLIST TODO
pkgsrc/lang/ghc7/patches: patch-Makefile patch-libffi_ghc.mk
patch-libraries_integer-gmp_configure.ac
patch-libraries_integer-simple_GHC_Integer.hs
patch-libraries_integer-simple_GHC_Integer_Type.hs
patch-libraries_time_Data_Time_Clock_CTimeval.hs
patch-libraries_unix_System_Posix_Files.hsc
patch-libraries_unix_cbits_execvpe.c patch-mk_config.mk.in
patch-rts_Linker.c patch-rts_StgCRun.c patch-rts_ghc.mk
Log Message:
Update to GHC 7.10.3
Changes from 7.6.3 are as follows:
* https://www.haskell.org/ghc/docs/7.8.1/html/users_guide/release-7-8-1.html
* https://www.haskell.org/ghc/docs/7.8.2/html/users_guide/release-7-8-2.html
* https://www.haskell.org/ghc/docs/7.8.3/html/users_guide/release-7-8-3.html
* https://www.haskell.org/ghc/docs/7.8.4/html/users_guide/release-7-8-4.html
* https://www.haskell.org/ghc/docs/7.10.1/html/users_guide/release-7-10-1.html
* https://downloads.haskell.org/~ghc/7.10.2/docs/html/users_guide/release-7-10-2.html
* https://downloads.haskell.org/~ghc/7.10.3/docs/html/users_guide/release-7-10-3.html
To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/lang/ghc7/BOOTSTRAP.txt
cvs rdiff -u -r1.1 -r1.2 pkgsrc/lang/ghc7/DESCR
cvs rdiff -u -r1.36 -r1.37 pkgsrc/lang/ghc7/Makefile
cvs rdiff -u -r1.2 -r0 pkgsrc/lang/ghc7/PLIST
cvs rdiff -u -r1.4 -r0 pkgsrc/lang/ghc7/TODO
cvs rdiff -u -r1.26 -r1.27 pkgsrc/lang/ghc7/bootstrap.mk
cvs rdiff -u -r1.8 -r1.9 pkgsrc/lang/ghc7/buildlink3.mk
cvs rdiff -u -r1.16 -r1.17 pkgsrc/lang/ghc7/distinfo
cvs rdiff -u -r1.4 -r1.5 pkgsrc/lang/ghc7/files/bootstrap.build.mk
cvs rdiff -u -r1.1 -r0 pkgsrc/lang/ghc7/patches/patch-Makefile \
pkgsrc/lang/ghc7/patches/patch-libffi_ghc.mk \
pkgsrc/lang/ghc7/patches/patch-libraries_integer-gmp_configure.ac \
pkgsrc/lang/ghc7/patches/patch-libraries_integer-simple_GHC_Integer.hs \
pkgsrc/lang/ghc7/patches/patch-libraries_integer-simple_GHC_Integer_Type.hs \
pkgsrc/lang/ghc7/patches/patch-libraries_time_Data_Time_Clock_CTimeval.hs \
pkgsrc/lang/ghc7/patches/patch-libraries_unix_System_Posix_Files.hsc \
pkgsrc/lang/ghc7/patches/patch-libraries_unix_cbits_execvpe.c \
pkgsrc/lang/ghc7/patches/patch-mk_config.mk.in
cvs rdiff -u -r1.1 -r1.2 pkgsrc/lang/ghc7/patches/patch-ghc.mk \
pkgsrc/lang/ghc7/patches/patch-libraries_unix_System_Posix_Signals.hsc \
pkgsrc/lang/ghc7/patches/patch-libraries_unix_include_execvpe.h \
pkgsrc/lang/ghc7/patches/patch-rts_PosixSource.h
cvs rdiff -u -r0 -r1.1 \
pkgsrc/lang/ghc7/patches/patch-libraries_base_GHC_Event_KQueue.hsc \
pkgsrc/lang/ghc7/patches/patch-libraries_base_System_Environment.hs \
pkgsrc/lang/ghc7/patches/patch-libraries_time_lib_Data_Time_Clock_CTimeval.hs \
pkgsrc/lang/ghc7/patches/patch-libraries_unix_System_Posix_Files_Common.hsc
cvs rdiff -u -r1.2 -r0 pkgsrc/lang/ghc7/patches/patch-rts_Linker.c \
pkgsrc/lang/ghc7/patches/patch-rts_StgCRun.c
cvs rdiff -u -r1.6 -r0 pkgsrc/lang/ghc7/patches/patch-rts_ghc.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/lang/ghc7/DESCR
diff -u pkgsrc/lang/ghc7/DESCR:1.1 pkgsrc/lang/ghc7/DESCR:1.2
--- pkgsrc/lang/ghc7/DESCR:1.1 Thu Dec 12 12:47:17 2013
+++ pkgsrc/lang/ghc7/DESCR Sun Dec 29 16:59:08 2019
@@ -8,3 +8,8 @@ Haskell, including concurrency, a foreig
type-system extensions, exceptions, and so on. GHC comes with a
generational garbage collector, a space and time profiler, and a
comprehensive set of libraries.
+
+This package provides the 7.10.x release series, which is the last
+version that can bootstrap with 7.6.x. It will probably be removed
+once we make a separate package for GHC 8.0.x and get enough bootstrap
+kits for it.
Index: pkgsrc/lang/ghc7/Makefile
diff -u pkgsrc/lang/ghc7/Makefile:1.36 pkgsrc/lang/ghc7/Makefile:1.37
--- pkgsrc/lang/ghc7/Makefile:1.36 Fri Nov 1 06:10:23 2019
+++ pkgsrc/lang/ghc7/Makefile Sun Dec 29 16:59:08 2019
@@ -1,32 +1,33 @@
-# $NetBSD: Makefile,v 1.36 2019/11/01 06:10:23 gutteridge Exp $
+# $NetBSD: Makefile,v 1.37 2019/12/29 16:59:08 pho Exp $
# -----------------------------------------------------------------------------
# Package metadata
#
-DISTNAME= ghc-7.6.3-src
+DISTNAME= ghc-7.10.3-src
PKGNAME= ${DISTNAME:S/-src$//}
-PKGREVISION= 14
CATEGORIES= lang
-MASTER_SITES= https://www.haskell.org/ghc/dist/${PKGVERSION_NOREV}/
-EXTRACT_SUFX= .tar.bz2
+MASTER_SITES= https://downloads.haskell.org/~ghc/${PKGVERSION_NOREV}/
+EXTRACT_SUFX= .tar.xz
MAINTAINER= pho%cielonegro.org@localhost
HOMEPAGE= https://www.haskell.org/ghc/
-COMMENT= Compiler for the functional language Haskell
+COMMENT= Compiler for the functional language Haskell - 7.10 Release Series
LICENSE= modified-bsd
+# TODO: We should be using the alternatives framework.
+CONFLICTS+= ghc-[0-9]*
+
# 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.
+# yourself, follow instructions in ./bootstrap.mk
BROKEN_EXCEPT_ON_PLATFORM+= \
Darwin-*-powerpc \
FreeBSD-*-i386 \
- Linux-*-x86_64 \
- NetBSD-*-i386 \
NetBSD-*-x86_64 \
- SunOS-5.11-*
+ SunOS-*-i386 \
+ SunOS-*-x86_64
# -----------------------------------------------------------------------------
@@ -42,31 +43,39 @@ EXTRACT_ONLY= ${DEFAULT_DISTFILES}
# -----------------------------------------------------------------------------
# Tools
#
+# The runtime dependency on perl is due to the evil splitter
+# (lib/${PKGNAME_NOREV}/ghc-split).
USE_TOOLS+= autoconf gmake gzip perl:run
GNU_CONFIGURE= yes
USE_GNU_CONFIGURE_HOST= no
USE_LIBTOOL= yes
-CONFIGURE_ARGS+= \
+CONFIGURE_ARGS.common= \
--with-gcc=${CC:Q} \
+ --with-curses-includes=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_INCDIRS.curses:Q} \
+ --with-curses-libraries=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_LIBDIRS.curses:Q} \
--with-gmp-includes=${BUILDLINK_PREFIX.gmp:Q}/${BUILDLINK_INCDIRS.gmp:Q} \
--with-gmp-libraries=${BUILDLINK_PREFIX.gmp:Q}/${BUILDLINK_LIBDIRS.gmp:Q} \
--with-iconv-includes=${BUILDLINK_PREFIX.iconv:Q}/${BUILDLINK_INCDIRS.iconv:Q} \
- --with-iconv-libraries=${BUILDLINK_PREFIX.iconv:Q}/${BUILDLINK_LIBDIRS.iconv:Q}
+ --with-iconv-libraries=${BUILDLINK_PREFIX.iconv:Q}/${BUILDLINK_LIBDIRS.iconv:Q} \
+ --with-system-libffi \
+ --with-ffi-includes=${BUILDLINK_PREFIX.libffi:Q}/${BUILDLINK_INCDIRS.libffi:Q} \
+ --with-ffi-libraries=${BUILDLINK_PREFIX.libffi:Q}/${BUILDLINK_LIBDIRS.libffi:Q}
+
+CONFIGURE_ARGS+= ${CONFIGURE_ARGS.common}
CONFIGURE_ENV+= \
ac_cv_path_fp_prog_ar=${AR:Q} \
PerlCmd=${PERL5:Q}
-# CFLAGS and LDFLAGS are currently not honored by "./configure". Since
-# LDFLAGS contains rpath flags it's very important to force GHC to
-# honor it. Otherwise neither GHC itself nor executables it produces
-# will have any rpaths so users will have to put "${PREFIX}/lib" into
-# their "/etc/ld-elf.so.conf". See
+# LDFLAGS is currently not honored by "./configure". Since LDFLAGS
+# contains rpath flags it's very important to force GHC to honor
+# it. Otherwise neither GHC itself nor executables it produces will
+# have any rpaths so users will have to put "${PREFIX}/lib" into their
+# "/etc/ld-elf.so.conf". See
# http://hackage.haskell.org/trac/ghc/ticket/2933
.for stage in 0 1 2
CONFIGURE_ENV+= \
- CONF_CC_OPTS_STAGE${stage}=${CFLAGS:Q} \
CONF_GCC_LINKER_OPTS_STAGE${stage}=${LDFLAGS:Q}
# Note that CONF_LD_LINKER_OPTS_STAGE{0,1,2} are only used for
# creating static GHCi libraries (HS*.o). Setting them to ${LDFLAGS}
@@ -77,10 +86,19 @@ CONFIGURE_ENV+= \
# the buildlink.
.endfor
-NOT_PAX_MPROTECT_SAFE+= lib/${PKGNAME_NOREV}/ghc
-NOT_PAX_MPROTECT_SAFE+= lib/${PKGNAME_NOREV}/ghc-pkg
-NOT_PAX_ASLR_SAFE+= lib/${PKGNAME_NOREV}/ghc
-NOT_PAX_ASLR_SAFE+= lib/${PKGNAME_NOREV}/ghc-pkg
+# The runtime system of GHC (rts) tends to conflict with PaX MPROTECT
+# because it needs to generate various kinds of code at run time. The
+# RTS linker, whose job is to load *static* objects at run time,
+# doesn't play nice with ASLR either. This means most executables
+# produced by GHC need them to be disabled. Perhaps we should patch
+# rts/sm/Storage.c so that it uses ffi_closure_alloc(3) on every
+# platform, not just Linux, and also drop support for static library
+# loading and switch to dynamic libraries entirely.
+.for f in ghc ghc-pkg haddock hpc hsc2hs runghc
+NOT_PAX_MPROTECT_SAFE+= lib/${PKGNAME_NOREV}/bin/${f}
+NOT_PAX_ASLR_SAFE+= lib/${PKGNAME_NOREV}/bin/${f}
+.endfor
+
# -----------------------------------------------------------------------------
# Build hooks
@@ -92,34 +110,16 @@ post-patch:
${RUN} cd ${WRKSRC:Q}/libraries/base && autoconf
${RUN} cd ${WRKSRC:Q}/libraries/integer-gmp && autoconf
-
# Define the target "pre-configure" and non-standard "bootstrap".
.include "../../lang/ghc7/bootstrap.mk"
# Our pre-configure phase installs a bindist of bootstrapping compiler
# directly into TOOLS_DIR so that ./configure can find it.
-
# Here we generate mk/build.mk dynamically.
post-configure:
${RUN} ${RM} -f ${WRKSRC:Q}/mk/build.mk
-# See https://ghc.haskell.org/trac/ghc/ticket/10096
- ${RUN} ${ECHO} "libraries/terminfo_CONFIGURE_OPTS += \
- --configure-option=--with-curses-includes=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_INCDIRS.curses:Q} \
- --configure-option=--with-curses-libraries=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_LIBDIRS.curses:Q}" \
- >> ${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 in the PATH, GHC's build system tries to use it
# without even checking if it really works. That's not what we
# appreciate.
@@ -145,18 +145,13 @@ post-install:
# -----------------------------------------------------------------------------
# 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
-#
-PRINT_PLIST_AWK+= /lib\/${PKGNAME_NOREV}\/package\.conf\.d/ { next; }
-
-# If we were lucky we could just use "PLIST_TYPE = dynamic", but the
-# feature has seemingly bitrotted.
-.include "../../mk/bsd.prefs.mk"
+# We can't use static PLIST because the package installs files with a
+# hashed name. And "PLIST_TYPE = dynamic" appears to be broken atm
+# [2019-12-27; pho].
GENERATE_PLIST+= \
- cd ${DESTDIR}${PREFIX} && \
- ${FIND} lib/${PKGNAME_NOREV}/package.conf.d -xdev -newer ${_COOKIE.extract} \! -type d -print | ${SORT} -d;
+ cd ${DESTDIR:Q}${PREFIX:Q} && \
+ ${FIND} * \( -type f -o -type l \) | ${SORT};
+
# -----------------------------------------------------------------------------
# Sanity checks
@@ -165,26 +160,25 @@ GENERATE_PLIST+= \
# There is an unused script which don't pass the portability test.
CHECK_PORTABILITY_SKIP+= distrib/prep-bin-dist-mingw
-# Dynamic Haskell libraries currently have no rpaths to any dependent
-# Haskell libraries so we must skip shlibs check for them. Note that
-# the situation seems to be changed in GHC 7.8.1 so we should
-# readdress this later. See
-# https://ghc.haskell.org/trac/ghc/ticket/8266 (slightly off-topic but
-# pho@ found no description for the -fuse-rpath flag.)
-.if !empty(PKGNAME:Mghc-7.6.*)
+# Dynamically linked Haskell executables and libraries have rpaths to
+# dependent Haskell libraries, but the problem is that they are
+# specified with $ORIGIN, which isn't currently supported by
+# ../../mk/check/check-shlibs-elf.awk.
CHECK_SHLIBS_SKIP+= */libHS*-ghc${PKGVERSION_NOREV}.*
-.endif
+.for f in ghc ghc-pkg haddock hpc hsc2hs runghc
+CHECK_SHLIBS_SKIP+= lib/${PKGNAME_NOREV}/bin/${f}
+.endfor
# ghc57207_0.s: failed to add inputs for merge: Resource temporarily unavailable
-CTF_FILES_SKIP+= */libHSghc-7.6.3-ghc7.6.3.so
+CTF_FILES_SKIP+= */libHS*-ghc${PKGVERSION_NOREV}.*
# ld: fatal: relocation error ... relocation requires reference symbol
STRIP_FILES_SKIP+= lib/${PKGNAME_NOREV}/libHSrts.a
+
# -----------------------------------------------------------------------------
# Dependencies
#
-
BUILD_DEPENDS+= libxslt-[0-9]*:../../textproc/libxslt
BUILD_DEPENDS+= docbook-xsl-[0-9]*:../../textproc/docbook-xsl
@@ -196,10 +190,11 @@ BUILD_DEPENDS+= compat80-[0-9]*:../../em
# In a sandboxed build environment, we have to reach over to the
# installed libraries themselves, since the symlinks compat80 adds
# to the /usr tree can't be applied.
-MAKE_ENV+= LD_LIBRARY_PATH=${LOCALBASE}/emul/netbsd/usr/lib
+MAKE_ENV+= LD_LIBRARY_PATH=${PREFIX:Q}/emul/netbsd/usr/lib
.endif
.include "../../converters/libiconv/buildlink3.mk"
+.include "../../devel/libffi/buildlink3.mk"
.include "../../devel/gmp/buildlink3.mk"
.include "../../mk/curses.buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
Index: pkgsrc/lang/ghc7/bootstrap.mk
diff -u pkgsrc/lang/ghc7/bootstrap.mk:1.26 pkgsrc/lang/ghc7/bootstrap.mk:1.27
--- pkgsrc/lang/ghc7/bootstrap.mk:1.26 Sun Nov 3 19:04:00 2019
+++ pkgsrc/lang/ghc7/bootstrap.mk Sun Dec 29 16:59:08 2019
@@ -1,4 +1,4 @@
-# $NetBSD: bootstrap.mk,v 1.26 2019/11/03 19:04:00 rillig Exp $
+# $NetBSD: bootstrap.mk,v 1.27 2019/12/29 16:59:08 pho Exp $
# -----------------------------------------------------------------------------
# Select a bindist of bootstrapping compiler on a per-platform basis.
#
@@ -6,51 +6,46 @@
# 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"
-# Use the same version as the package itself by default.
-BOOT_VERSION:= ${PKGNAME:C/^.*-//}
+# Notes on version dependencies:
+# * GHC 8.8.1 requires 8.4 or later to bootstrap.
+# * GHC 8.4.4 requires 8.0 or later to bootstrap.
+# * GHC 8.0.2 requires 7.8 or later to bootstrap.
+# * GHC 7.10.3 requires 7.6 or later to bootstrap.
-.if !empty(MACHINE_PLATFORM:MDarwin-*-powerpc) || make(distinfo)
+.if !empty(MACHINE_PLATFORM:MDarwin-*-powerpc) || make(distinfo) || make (makesum) || make(mdi)
+BOOT_VERSION:= 7.6.3
BOOT_ARCHIVE:= ghc-${BOOT_VERSION}-boot-powerpc-apple-darwin.tar.xz
DISTFILES:= ${DISTFILES} ${BOOT_ARCHIVE} # Available in LOCAL_PORTS
.endif
-.if !empty(MACHINE_PLATFORM:MFreeBSD-*-i386) || make(distinfo)
+.if !empty(MACHINE_PLATFORM:MFreeBSD-*-i386) || make(distinfo) || make (makesum) || make(mdi)
+BOOT_VERSION:= 7.6.3
BOOT_ARCHIVE:= ghc-${BOOT_VERSION}-boot-i386-unknown-freebsd.tar.xz
DISTFILES:= ${DISTFILES} ${BOOT_ARCHIVE} # Available in LOCAL_PORTS
.endif
-.if !empty(MACHINE_PLATFORM:MLinux-*-x86_64) || make(distinfo)
-BOOT_ARCHIVE:= ghc-${BOOT_VERSION}-boot-x86_64-unknown-linux.tar.xz
-#DISTFILES:= ${DISTFILES} ${BOOT_ARCHIVE}
-.endif
-
-.if !empty(MACHINE_PLATFORM:MNetBSD-*-i386) || make(distinfo)
-BOOT_ARCHIVE:= ghc-${BOOT_VERSION}-boot-i386-unknown-netbsd.tar.xz
-#DISTFILES:= ${DISTFILES} ${BOOT_ARCHIVE}
-.endif
-
-.if !empty(MACHINE_PLATFORM:MNetBSD-*-x86_64) || make(distinfo)
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-x86_64) || make(distinfo) || make (makesum) || make(mdi)
+BOOT_VERSION:= 7.10.3
BOOT_ARCHIVE:= ghc-${BOOT_VERSION}-boot-x86_64-unknown-netbsd.tar.xz
DISTFILES:= ${DISTFILES} ${BOOT_ARCHIVE} # Available in LOCAL_PORTS
.endif
-.if !empty(MACHINE_PLATFORM:MSunOS-5.11-i386) || make(distinfo)
+.if !empty(MACHINE_PLATFORM:MSunOS-*-i386) || make(distinfo) || make (makesum) || make(mdi)
+BOOT_VERSION:= 7.6.3
BOOT_ARCHIVE:= ghc-${BOOT_VERSION}-boot-i386-unknown-solaris2.tar.xz
-#DISTFILES:= ${DISTFILES} ${BOOT_ARCHIVE}
+DISTFILES:= ${DISTFILES} ${BOOT_ARCHIVE} # Available in LOCAL_PORTS
.endif
-.if !empty(MACHINE_PLATFORM:MSunOS-5.11-x86_64) || make(distinfo)
+.if !empty(MACHINE_PLATFORM:MSunOS-*-x86_64) || make(distinfo) || make (makesum) || make(mdi)
+BOOT_VERSION:= 7.6.3
BOOT_ARCHIVE:= ghc-${BOOT_VERSION}-boot-x86_64-unknown-solaris2.tar.xz
-#DISTFILES:= ${DISTFILES} ${BOOT_ARCHIVE}
+DISTFILES:= ${DISTFILES} ${BOOT_ARCHIVE} # Available in LOCAL_PORTS
.endif
.if empty(BOOT_ARCHIVE)
@@ -65,8 +60,6 @@ PKG_FAIL_REASON+= "internal error: unsup
SITES.${i}?= ${MASTER_SITE_LOCAL}
.endfor
-BOOT_TARBALL= ${BOOT_ARCHIVE:C/\.xz$//}
-
# Existence of libelf makes LeadingUnderscore being "NO", which is
# incorrect for this platform. See ${WRKSRC}/aclocal.m4
# (FP_LEADING_UNDERSCORE)
@@ -85,7 +78,7 @@ USE_BUILTIN.iconv= no
.endif
# current bootstrap binary kit for SmartOS is built with ncurses5
-.if !empty(MACHINE_PLATFORM:MSunOS-5.11-*) && !empty(OS_VARIANT:U:MSmartOS)
+.if !empty(MACHINE_PLATFORM:MSunOS-*) && !empty(OS_VARIANT:U:MSmartOS)
BUILD_DEPENDS+= ncurses>=5.0:../../devel/ncurses
.endif
@@ -96,22 +89,23 @@ BUILD_DEPENDS+= ncurses>=5.0:../../devel
# Install a bootstrapping compiler directly into TOOLS_DIR so that
# ./configure can find it.
#
-USE_TOOLS+= gmake xzcat xz
+USE_TOOLS+= gmake xzcat xz gtar
pre-configure:
- @${TEST} -f ${DISTDIR:Q}/${DIST_SUBDIR:Q}/${BOOT_ARCHIVE} || \
+ ${RUN}${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}
+ ${RUN}${MKDIR} ${WRKDIR:Q}/build-extract
+ ${RUN}cd ${WRKDIR:Q}/build-extract && \
+ ${XZCAT} ${DISTDIR:Q}/${DIST_SUBDIR:Q}/${BOOT_ARCHIVE} | \
+ ${GTAR} -xf -
# 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/${PKGNAME_NOREV}-boot && \
+ ${RUN}cd ${WRKDIR:Q}/build-extract/${PKGNAME_NOREV}-boot && \
${PKGSRC_SETENV} ${CONFIGURE_ENV} ${SH} ./configure \
--prefix=${TOOLS_DIR:Q} && \
${MAKE_PROGRAM} install
@@ -125,7 +119,6 @@ pre-configure:
# important to build it with the fewest possible run-time
# dependencies, otherwise the resulting binary can easily get
# unusable.
-#
# We don't want our bootkits to have a run-time dependency on
# libgcc. In fact GHC's implementation of Haskell exception handling
@@ -184,19 +177,26 @@ BUILDLINK_PASSTHRU_DIRS+= ${BOOT_GHC_LIB
# barrier. See ../../mk/buildlink3/bsd.buildlink3.mk and
# ../../mk/bsd.pkg.barrier.mk
.PHONY: bootstrap
+BOOT_ARCHIVE.new= ${BOOT_ARCHIVE:S/-${BOOT_VERSION}-/-${PKGVERSION_NOREV}-/}
.if make(bootstrap)
_BARRIER_CMDLINE_TARGETS+= bootstrap
.endif
.if !defined(_PKGSRC_BARRIER)
bootstrap: barrier
.else
-bootstrap: pre-bootstrap .WAIT ${WRKDIR}/${BOOT_ARCHIVE} .WAIT post-bootstrap
+bootstrap: pre-bootstrap .WAIT ${WRKDIR}/stamp-dist-boot .WAIT post-bootstrap
.endif
+# For normal build we use pkgsrc libffi, but for bootkits we can't do
+# that because that would mean bootkits have run-time dependency on
+# it. So we build the bundled one and statically link with it.
+CONFIGURE_ARGS.boot= ${CONFIGURE_ARGS.common}
+CONFIGURE_ARGS.boot+= --without-system-libffi
+
.PHONY: pre-bootstrap
pre-bootstrap: wrapper
.if empty(BOOT_GHC_LIBDIR)
- @if ${BOOT_GHC_LIBDIR_CMD} 2>/dev/null 1>&2; then \
+ ${RUN}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} "Please run \"${MAKE} clean\" and try again."; \
else \
@@ -207,7 +207,7 @@ pre-bootstrap: wrapper
fi
.endif
# ${_COOKIE.configure} is not defined yet so we can't use .if here.
- @if ${TEST} -f ${_COOKIE.configure}; then \
+ ${RUN}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."; \
@@ -225,40 +225,28 @@ ${WRKDIR}/stamp-lndir-boot: ${WRKDIR}/ln
${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 ${PKGNAME_NOREV}"
${MKDIR} ${WRKDIR:Q}/build-boot
cd ${WRKDIR:Q}/build-boot && \
- ${PKGSRC_SETENV} ${CONFIGURE_ENV} ${SH} ./configure ${CONFIGURE_ARGS} && \
- ${CP} -f ${FILESDIR:Q}/bootstrap.build.mk mk/build.mk && \
- ${ECHO} >> mk/build.mk && \
- ${ECHO} "libraries/terminfo_CONFIGURE_OPTS += \
- --configure-option=--with-curses-includes=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_INCDIRS.curses:Q} \
- --configure-option=--with-curses-libraries=${BUILDLINK_PREFIX.curses:Q}/${BUILDLINK_LIBDIRS.curses:Q}" \
- >> mk/build.mk
+ ${PKGSRC_SETENV} ${CONFIGURE_ENV} ${SH} ./configure ${CONFIGURE_ARGS.boot} && \
+ ${CP} -f ${FILESDIR:Q}/bootstrap.build.mk mk/build.mk
${TOUCH} ${.TARGET}
${WRKDIR}/stamp-build-boot: ${WRKDIR}/stamp-configure-boot
@${PHASE_MSG} "Building bootstrapping compiler ${PKGNAME_NOREV}"
- ${RUN} cd ${WRKDIR:Q}/build-boot && ${BUILD_MAKE_CMD}
+ ${RUN}cd ${WRKDIR:Q}/build-boot && ${BUILD_MAKE_CMD}
${TOUCH} ${.TARGET}
-${WRKDIR}/${BOOT_TARBALL}: ${WRKDIR}/stamp-build-boot
+${WRKDIR}/stamp-dist-boot: ${WRKDIR}/stamp-build-boot
@${PHASE_MSG} "Creating binary distribution of bootstrapping ${PKGNAME_NOREV}"
- ${RUN} cd ${WRKDIR:Q}/build-boot && ${BUILD_MAKE_CMD} binary-dist
- ${MV} -f ${WRKDIR:Q}/build-boot/${BOOT_TARBALL} ${.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 ${PKGNAME_NOREV}"
- ${XZ} --verbose -9 --extreme ${WRKDIR:Q}/${BOOT_TARBALL}
+ ${RUN}cd ${WRKDIR:Q}/build-boot && ${BUILD_MAKE_CMD} binary-dist
+ ${MV} -f ${WRKDIR:Q}/build-boot/${BOOT_ARCHIVE.new} ${WRKDIR:Q}/${BOOT_ARCHIVE.new}
.PHONY: post-bootstrap
post-bootstrap:
@${ECHO} "=========================================================================="
- @${ECHO} "Done creating ${BOOT_ARCHIVE}"
+ @${ECHO} "Done creating ${BOOT_ARCHIVE.new}"
@${ECHO} " in ${WRKDIR}"
@${ECHO}
@${ECHO} "Now you can copy it into ${DISTDIR}/${DIST_SUBDIR} to use it as your"
Index: pkgsrc/lang/ghc7/buildlink3.mk
diff -u pkgsrc/lang/ghc7/buildlink3.mk:1.8 pkgsrc/lang/ghc7/buildlink3.mk:1.9
--- pkgsrc/lang/ghc7/buildlink3.mk:1.8 Tue Aug 18 07:31:01 2015
+++ pkgsrc/lang/ghc7/buildlink3.mk Sun Dec 29 16:59:08 2019
@@ -1,12 +1,12 @@
-# $NetBSD: buildlink3.mk,v 1.8 2015/08/18 07:31:01 wiz Exp $
+# $NetBSD: buildlink3.mk,v 1.9 2019/12/29 16:59:08 pho Exp $
BUILDLINK_TREE+= ghc
.if !defined(GHC_BUILDLINK3_MK)
GHC_BUILDLINK3_MK:=
-BUILDLINK_API_DEPENDS.ghc+= ghc>=7.6.3
-BUILDLINK_ABI_DEPENDS.ghc+= ghc>=7.6.3nb8
+BUILDLINK_API_DEPENDS.ghc+= ghc>=7.10.3
+BUILDLINK_ABI_DEPENDS.ghc+= ghc>=7.10.3
BUILDLINK_PKGSRCDIR.ghc?= ../../lang/ghc7
# On FreeBSD we need pkgsrc libiconv. See bootstrap.mk for details.
@@ -16,6 +16,7 @@ USE_BUILTIN.iconv= no
.endif
.include "../../converters/libiconv/buildlink3.mk"
+.include "../../devel/libffi/buildlink3.mk"
.include "../../devel/gmp/buildlink3.mk"
.include "../../mk/curses.buildlink3.mk"
.endif # GHC_BUILDLINK3_MK
Index: pkgsrc/lang/ghc7/distinfo
diff -u pkgsrc/lang/ghc7/distinfo:1.16 pkgsrc/lang/ghc7/distinfo:1.17
--- pkgsrc/lang/ghc7/distinfo:1.16 Thu May 2 08:21:49 2019
+++ pkgsrc/lang/ghc7/distinfo Sun Dec 29 16:59:08 2019
@@ -1,35 +1,35 @@
-$NetBSD: distinfo,v 1.16 2019/05/02 08:21:49 wiz Exp $
+$NetBSD: distinfo,v 1.17 2019/12/29 16:59:08 pho Exp $
+SHA1 (ghc-7.10.3-boot-x86_64-unknown-netbsd.tar.xz) = 2e054dea1d6ad9871774b157939d73df22a82b75
+RMD160 (ghc-7.10.3-boot-x86_64-unknown-netbsd.tar.xz) = ca78f280a02302ac5056e503a01d79bd5e5c1e81
+SHA512 (ghc-7.10.3-boot-x86_64-unknown-netbsd.tar.xz) = fc00c383062f1506f437f9282ee81a076baad3d569266e1e626cc0f6f7e512f6169f0e60b402cc4a176cfa770c29a132ce1f8cf0aefb1c989824541255fb7643
+Size (ghc-7.10.3-boot-x86_64-unknown-netbsd.tar.xz) = 38203656 bytes
+SHA1 (ghc-7.10.3-src.tar.xz) = 471a3df55c7f5ac6be75109d0c29de97842b98e9
+RMD160 (ghc-7.10.3-src.tar.xz) = 993a69f761e608fa2424d72a48509ff6247a2ed9
+SHA512 (ghc-7.10.3-src.tar.xz) = a39700ec6cb3396639c8d5349590d56d685777adabdec8ff6877dbce9f5f66daaab27fce205fdf3cceb6219b0a901b7cbe25b6fa228f765c725423b3c36e52b1
+Size (ghc-7.10.3-src.tar.xz) = 11731468 bytes
SHA1 (ghc-7.6.3-boot-i386-unknown-freebsd.tar.xz) = aea6224f30aa52d9998f2c77f473902179f03b8c
RMD160 (ghc-7.6.3-boot-i386-unknown-freebsd.tar.xz) = 39a588cac4a0411db45ef269fbe6a63c6cb428ee
SHA512 (ghc-7.6.3-boot-i386-unknown-freebsd.tar.xz) = 7b83ef8d1bdd9cd311e5791abc40f68528cbf0ee32dd2bc762a86439d8b722b9d45a8a01f1e557f71ed854d53eff4c405f07e05ba98aa1bbb4f36d4f7d860fb1
Size (ghc-7.6.3-boot-i386-unknown-freebsd.tar.xz) = 28097800 bytes
+SHA1 (ghc-7.6.3-boot-i386-unknown-solaris2.tar.xz) = 80eb45ed3bcf1ff7a81662ff8c1c209df4fd350a
+RMD160 (ghc-7.6.3-boot-i386-unknown-solaris2.tar.xz) = 3e936bed64c44c172b76728796bcafd318921fc8
+SHA512 (ghc-7.6.3-boot-i386-unknown-solaris2.tar.xz) = 75df37e649f7d1467fffee1c7d74281dd91d56934537621d4e9f00e6447a45f0f87e91b5e136b1581a9346149e29122fb0a0780ed0b1ddce091c4de44636ba59
+Size (ghc-7.6.3-boot-i386-unknown-solaris2.tar.xz) = 29895032 bytes
SHA1 (ghc-7.6.3-boot-powerpc-apple-darwin.tar.xz) = 420be0242c6a57af58e1d2ff7e1997616777cdbb
RMD160 (ghc-7.6.3-boot-powerpc-apple-darwin.tar.xz) = 7d4ab57dc6054cbd67b07e64b2142fded3121f09
SHA512 (ghc-7.6.3-boot-powerpc-apple-darwin.tar.xz) = 5cb62b1571f197d85e6e0506c0fc4fa4d9d5f53405bfd0d8ba1df3bad857710ae818048aa6002df184139d73ab556e1226eb648394c7f9dbe170e540ea8a4cb6
Size (ghc-7.6.3-boot-powerpc-apple-darwin.tar.xz) = 33660776 bytes
-SHA1 (ghc-7.6.3-boot-x86_64-unknown-netbsd.tar.xz) = 82378c9a172aef10d4cf277967dbf97a0fc2e190
-RMD160 (ghc-7.6.3-boot-x86_64-unknown-netbsd.tar.xz) = c502da9c64f2a58b1af7f98fb90c1110d6a5fff5
-SHA512 (ghc-7.6.3-boot-x86_64-unknown-netbsd.tar.xz) = ce5df38c05df31ef0e2ec7266d6de2a29c6b6dc662f344d07e871916fd6780205482b33e9ebb19408ba54f499e20cc63cd71d022c37ada80d059de56a9f9cc4b
-Size (ghc-7.6.3-boot-x86_64-unknown-netbsd.tar.xz) = 28768864 bytes
-SHA1 (ghc-7.6.3-src.tar.bz2) = 8938e1ef08b37a4caa071fa169e79a3001d065ff
-RMD160 (ghc-7.6.3-src.tar.bz2) = 82a673ed38b7cf9a59afeb01057625fc761a822b
-SHA512 (ghc-7.6.3-src.tar.bz2) = ac86f18b4feeb0bdc9e867261600b210caf62740d73ae657259bbe8149b8c2c4f5a73d09d74d944d4e50f85cc87503485365f0a0ae65befe8d2b6844e5e1253a
-Size (ghc-7.6.3-src.tar.bz2) = 110763823 bytes
-SHA1 (patch-Makefile) = a6692a4a90b8003a8719c51d82d15f5af0ba1907
-SHA1 (patch-ghc.mk) = c4210aaa3e2b4a319b0b70da375ac89fddde5cb7
-SHA1 (patch-libffi_ghc.mk) = 68f3c9c25b93fc3debac75ae8e37535f11a44731
+SHA1 (ghc-7.6.3-boot-x86_64-unknown-solaris2.tar.xz) = 359b41cedf3b6194b7c0ca2241b37ea8db289cf6
+RMD160 (ghc-7.6.3-boot-x86_64-unknown-solaris2.tar.xz) = 5f26dd0beb7c884c445790aa47e7b62a30c52de7
+SHA512 (ghc-7.6.3-boot-x86_64-unknown-solaris2.tar.xz) = 8c4646942827cd38e15b9767967b687246d130dff2085a72ff4c193a58eb9fc15270dfd56c7f3368d3ca61c7c366bb6f701d01a60881d518d8649a39b43c08d9
+Size (ghc-7.6.3-boot-x86_64-unknown-solaris2.tar.xz) = 30357832 bytes
+SHA1 (patch-ghc.mk) = 542e3c8a2cd61eeeee6588ff62203c9c1074025d
+SHA1 (patch-libraries_base_GHC_Event_KQueue.hsc) = 8ee5da667a241a05fde3c580d3dc9bdc05aa5f00
+SHA1 (patch-libraries_base_System_Environment.hs) = fd786a7aa2058b5d86d4646e3816fb53ea0bf59f
SHA1 (patch-libraries_base_configure.ac) = dd6132c5335d7e0421ec2181ebb5a34bb162e255
-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-libraries_time_Data_Time_Clock_CTimeval.hs) = acc2a2255f53fbe55d91004f9d843ae249dad206
-SHA1 (patch-libraries_unix_System_Posix_Files.hsc) = f2e0892f9ebb9d82ddaf71b014d9af33967848dc
-SHA1 (patch-libraries_unix_System_Posix_Signals.hsc) = 3fbb8cff53b342dd69efa186ad8b86718a101a79
-SHA1 (patch-libraries_unix_cbits_execvpe.c) = 7e1464f9db0839221252a5328c170248fe21e727
-SHA1 (patch-libraries_unix_include_execvpe.h) = 4c48b72f74d360e925528ecce95baa8a2ae923d7
-SHA1 (patch-mk_config.mk.in) = 90a156f6c455d4b2c5d10fdf65b3a170dcfc4892
-SHA1 (patch-rts_Linker.c) = 39d1ca7a856a3ec25e493e97832ef255562c0719
-SHA1 (patch-rts_PosixSource.h) = 417481d506929be8b27bb106eefc5df2901ebe95
-SHA1 (patch-rts_StgCRun.c) = 5d4010dc250af25db0b5b2717c510752f4813e73
-SHA1 (patch-rts_ghc.mk) = 6a43e6e2a58793ba4ff309012c3e24114ccde1e2
+SHA1 (patch-libraries_time_lib_Data_Time_Clock_CTimeval.hs) = 79f17fe77cc5469a90c811682a937c8d711d59c5
+SHA1 (patch-libraries_unix_System_Posix_Files_Common.hsc) = a80945863d7bd8f5f65af5371d3ab090071ea24e
+SHA1 (patch-libraries_unix_System_Posix_Signals.hsc) = 6a2b9a527730ec593b70e827fdc1aaeccc575dad
+SHA1 (patch-libraries_unix_include_execvpe.h) = a134be89b4bdd49eb5c5ed45756eb3a4ce5951a5
+SHA1 (patch-rts_PosixSource.h) = 604608791f33245d9305dcbd6d9d5979fe162f21
Index: pkgsrc/lang/ghc7/files/bootstrap.build.mk
diff -u pkgsrc/lang/ghc7/files/bootstrap.build.mk:1.4 pkgsrc/lang/ghc7/files/bootstrap.build.mk:1.5
--- pkgsrc/lang/ghc7/files/bootstrap.build.mk:1.4 Tue Feb 3 02:32:05 2015
+++ pkgsrc/lang/ghc7/files/bootstrap.build.mk Sun Dec 29 16:59:09 2019
@@ -29,3 +29,13 @@ INTEGER_LIBRARY = integer-simple
# We'd like to distinguish bootstrapping bindists from normal ones.
BIN_DIST_NAME = ghc-$(ProjectVersion)-boot
+
+# Don't build or use dynamic Haskell libraries.
+DYNAMIC_GHC_PROGRAMS = NO
+
+# We want our bootkits to be as small as possible, even though `xz
+# -9e' is very slow and consumes about 680 MiB of memory.
+TAR_COMP = xz
+TAR_COMP_CMD = $(XZ_CMD)
+TAR_COMP_EXT = xz
+XZ_CMD = xz --verbose -9 --extreme
Index: pkgsrc/lang/ghc7/patches/patch-ghc.mk
diff -u pkgsrc/lang/ghc7/patches/patch-ghc.mk:1.1 pkgsrc/lang/ghc7/patches/patch-ghc.mk:1.2
--- pkgsrc/lang/ghc7/patches/patch-ghc.mk:1.1 Thu Dec 12 12:47:17 2013
+++ pkgsrc/lang/ghc7/patches/patch-ghc.mk Sun Dec 29 16:59:09 2019
@@ -1,23 +1,14 @@
-$NetBSD: patch-ghc.mk,v 1.1 2013/12/12 12:47:17 obache Exp $
+$NetBSD: patch-ghc.mk,v 1.2 2019/12/29 16:59:09 pho Exp $
-We want bootstrapping bindists to be as small as possible, and bzip2
-is not enough:
+Fix building bootkits: we don't generate documentation for them.
- % 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.orig 2019-12-27 02:36:02.858039422 +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/)
+@@ -989,7 +989,6 @@ $(eval $(call bindist,.,\
+ $(INSTALL_LIBRARY_DOCS) \
+ $(addsuffix /*,$(INSTALL_HTML_DOC_DIRS)) \
+ docs/index.html \
+- compiler/stage2/doc \
+ $(wildcard libraries/*/dist-install/doc/) \
+ $(wildcard libraries/*/*/dist-install/doc/) \
+ $(filter-out settings,$(INSTALL_LIBS)) \
Index: pkgsrc/lang/ghc7/patches/patch-libraries_unix_System_Posix_Signals.hsc
diff -u pkgsrc/lang/ghc7/patches/patch-libraries_unix_System_Posix_Signals.hsc:1.1 pkgsrc/lang/ghc7/patches/patch-libraries_unix_System_Posix_Signals.hsc:1.2
--- pkgsrc/lang/ghc7/patches/patch-libraries_unix_System_Posix_Signals.hsc:1.1 Fri Feb 13 19:28:40 2015
+++ pkgsrc/lang/ghc7/patches/patch-libraries_unix_System_Posix_Signals.hsc Sun Dec 29 16:59:09 2019
@@ -1,4 +1,4 @@
-$NetBSD: patch-libraries_unix_System_Posix_Signals.hsc,v 1.1 2015/02/13 19:28:40 pho Exp $
+$NetBSD: patch-libraries_unix_System_Posix_Signals.hsc,v 1.2 2019/12/29 16:59:09 pho Exp $
Suppress linker warnings about compatibility syscall wrappers by using
"capi" instead of "ccall". In Haskell FFI, "ccall" is actually an
@@ -18,9 +18,9 @@ In other words, you can safely use "ccal
symbol you want to import is actually a symbol in the ABI sense, which
is not always the case for the POSIX API.
---- libraries/unix/System/Posix/Signals.hsc.orig 2015-02-13 15:40:27.000000000 +0000
+--- libraries/unix/System/Posix/Signals.hsc.orig 2015-07-23 22:04:56.000000000 +0000
+++ libraries/unix/System/Posix/Signals.hsc
-@@ -598,7 +598,7 @@ awaitSignal maybe_sigset = do
+@@ -603,7 +603,7 @@ awaitSignal maybe_sigset = do
-- XXX My manpage says it can also return EFAULT. And why is ignoring
-- EINTR the right thing to do?
@@ -29,11 +29,10 @@ is not always the case for the POSIX API
c_sigsuspend :: Ptr CSigset -> IO CInt
#endif
-@@ -622,6 +622,6 @@ foreign import capi unsafe "signal.h sig
+@@ -638,5 +638,5 @@ foreign import capi unsafe "signal.h sig
c_sigismember :: Ptr CSigset -> CInt -> IO CInt
#endif /* __HUGS__ */
-foreign import ccall unsafe "sigpending"
+foreign import capi unsafe "signal.h sigpending"
c_sigpending :: Ptr CSigset -> IO CInt
-
Index: pkgsrc/lang/ghc7/patches/patch-libraries_unix_include_execvpe.h
diff -u pkgsrc/lang/ghc7/patches/patch-libraries_unix_include_execvpe.h:1.1 pkgsrc/lang/ghc7/patches/patch-libraries_unix_include_execvpe.h:1.2
--- pkgsrc/lang/ghc7/patches/patch-libraries_unix_include_execvpe.h:1.1 Fri Oct 23 20:46:22 2015
+++ pkgsrc/lang/ghc7/patches/patch-libraries_unix_include_execvpe.h Sun Dec 29 16:59:09 2019
@@ -1,27 +1,15 @@
-$NetBSD: patch-libraries_unix_include_execvpe.h,v 1.1 2015/10/23 20:46:22 tnn Exp $
+$NetBSD: patch-libraries_unix_include_execvpe.h,v 1.2 2019/12/29 16:59:09 pho Exp $
Don't conflict with builtin execvpe(3).
---- libraries/unix/include/execvpe.h.orig 2013-04-18 21:36:40.000000000 +0000
+--- libraries/unix/include/execvpe.h.orig 2015-07-23 22:04:56.000000000 +0000
+++ libraries/unix/include/execvpe.h
-@@ -19,7 +19,19 @@
+@@ -16,8 +16,6 @@ __hsunix_execvpe(const char *name, char
+ #if HAVE_EXECVPE
+ # define _GNU_SOURCE
+ # include <unistd.h>
+-extern int
+-execvpe(const char *name, char *const argv[], char *const envp[]);
+ #else
+ # define execvpe(name,argv,envp) __hsunix_execvpe(name,argv,envp)
#endif
-
- #if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(_WIN32)
-+#ifdef __NetBSD__
-+# include <sys/param.h>
-+# if __NetBSD_Version__ > 799000000
-+# define HAVE_EXECVPE 1
-+# endif
-+#elif defined(__GLIBC__)
-+# define HAVE_EXECVPE 1
-+#endif
-+
-+#ifdef HAVE_EXECVPE
-+#include <unistd.h>
-+#else
- extern int execvpe(char *name, char *const argv[], char **envp);
- extern void pPrPr_disableITimers (void);
-+#endif /* HAVE_EXECVPE */
- #endif
--
Index: pkgsrc/lang/ghc7/patches/patch-rts_PosixSource.h
diff -u pkgsrc/lang/ghc7/patches/patch-rts_PosixSource.h:1.1 pkgsrc/lang/ghc7/patches/patch-rts_PosixSource.h:1.2
--- pkgsrc/lang/ghc7/patches/patch-rts_PosixSource.h:1.1 Fri May 25 15:24:02 2018
+++ pkgsrc/lang/ghc7/patches/patch-rts_PosixSource.h Sun Dec 29 16:59:09 2019
@@ -1,6 +1,6 @@
-$NetBSD: patch-rts_PosixSource.h,v 1.1 2018/05/25 15:24:02 jperkin Exp $
+$NetBSD: patch-rts_PosixSource.h,v 1.2 2019/12/29 16:59:09 pho Exp $
-Set _XOPEN_SOURCE correctly on SunOS.
+Set _XOPEN_SOURCE correctly on SunOS. Fixed in later versions.
--- rts/PosixSource.h.orig 2013-04-18 21:22:46.000000000 +0000
+++ rts/PosixSource.h
Added files:
Index: pkgsrc/lang/ghc7/BOOTSTRAP.txt
diff -u /dev/null pkgsrc/lang/ghc7/BOOTSTRAP.txt:1.1
--- /dev/null Sun Dec 29 16:59:09 2019
+++ pkgsrc/lang/ghc7/BOOTSTRAP.txt Sun Dec 29 16:59:08 2019
@@ -0,0 +1,20 @@
+GHC requires itself to build, and unfortunately the only way to get a
+working GHC for a foreign target is to do a cross-compilation.
+
+In order to build a bootkit for a new platform, you need to manually
+set up a cross-building C compiler and binutils, libc, libterminfo,
+and libiconv for the target. Then you can follow instructions in
+https://gitlab.haskell.org/ghc/ghc/wikis/building/cross-compiling
+
+Once you get a working GHC for the target platform, install it
+somewhere in your PATH, run "cd lang/ghc7; make clean; make bootstrap"
+on the target platform and you'll have a bootkit for the target.
+
+--
+
+GHC in fact has never supported bootstrapping only with a C compiler.
+Prior to GHC 7, it had a thing called "HC source", which was a set of
+C source files compiled from Haskell source, but it wasn't actually
+cross-platform. It was because HC files were generated with many
+assumptions about the platform, such as the layout of libc structs,
+the size of off_t and time_t, byte-order, word size, etc.
Index: pkgsrc/lang/ghc7/patches/patch-libraries_base_GHC_Event_KQueue.hsc
diff -u /dev/null pkgsrc/lang/ghc7/patches/patch-libraries_base_GHC_Event_KQueue.hsc:1.1
--- /dev/null Sun Dec 29 16:59:09 2019
+++ pkgsrc/lang/ghc7/patches/patch-libraries_base_GHC_Event_KQueue.hsc Sun Dec 29 16:59:09 2019
@@ -0,0 +1,16 @@
+$NetBSD: patch-libraries_base_GHC_Event_KQueue.hsc,v 1.1 2019/12/29 16:59:09 pho Exp $
+
+Suppress linker warnings about compatibility syscall wrappers by using
+"capi" instead of "ccall".
+
+--- libraries/base/GHC/Event/KQueue.hsc.orig 2019-12-26 18:05:56.276488590 +0000
++++ libraries/base/GHC/Event/KQueue.hsc
+@@ -284,7 +284,7 @@ foreign import capi safe "sys/event.h ke
+ c_kevent :: KQueueFd -> Ptr Event -> CInt -> Ptr Event -> CInt
+ -> Ptr TimeSpec -> IO CInt
+
+-foreign import ccall unsafe "kevent"
++foreign import capi unsafe "sys/event.h kevent"
+ c_kevent_unsafe :: KQueueFd -> Ptr Event -> CInt -> Ptr Event -> CInt
+ -> Ptr TimeSpec -> IO CInt
+ #else
Index: pkgsrc/lang/ghc7/patches/patch-libraries_base_System_Environment.hs
diff -u /dev/null pkgsrc/lang/ghc7/patches/patch-libraries_base_System_Environment.hs:1.1
--- /dev/null Sun Dec 29 16:59:09 2019
+++ pkgsrc/lang/ghc7/patches/patch-libraries_base_System_Environment.hs Sun Dec 29 16:59:09 2019
@@ -0,0 +1,23 @@
+$NetBSD: patch-libraries_base_System_Environment.hs,v 1.1 2019/12/29 16:59:09 pho Exp $
+
+Suppress linker warnings about compatibility syscall wrappers by using
+"capi" instead of "ccall".
+
+--- libraries/base/System/Environment.hs.orig 2019-12-26 18:13:03.344291616 +0000
++++ libraries/base/System/Environment.hs
+@@ -1,5 +1,6 @@
+ {-# LANGUAGE Safe #-}
+ {-# LANGUAGE CPP #-}
++{-# LANGUAGE CApiFFI #-}
+
+ -----------------------------------------------------------------------------
+ -- |
+@@ -302,7 +303,7 @@ putEnv keyvalue = do
+ -- enviroment.
+ throwErrnoIf_ (/= 0) "putenv" (c_putenv s)
+
+-foreign import ccall unsafe "putenv" c_putenv :: CString -> IO CInt
++foreign import capi unsafe "stdlib.h putenv" c_putenv :: CString -> IO CInt
+ #endif
+
+ -- | @unSet name@ removes the specified environment variable from the
Index: pkgsrc/lang/ghc7/patches/patch-libraries_time_lib_Data_Time_Clock_CTimeval.hs
diff -u /dev/null pkgsrc/lang/ghc7/patches/patch-libraries_time_lib_Data_Time_Clock_CTimeval.hs:1.1
--- /dev/null Sun Dec 29 16:59:09 2019
+++ pkgsrc/lang/ghc7/patches/patch-libraries_time_lib_Data_Time_Clock_CTimeval.hs Sun Dec 29 16:59:09 2019
@@ -0,0 +1,33 @@
+$NetBSD: patch-libraries_time_lib_Data_Time_Clock_CTimeval.hs,v 1.1 2019/12/29 16:59:09 pho Exp $
+
+Suppress linker warnings about compatibility syscall wrappers by using
+"capi" instead of "ccall". In Haskell FFI, "ccall" is actually an
+interface to C ABI rather than C API. That is, GHC generates direct
+references to the symbol even if it's actually defined as a cpp macro
+or something like that, because GHC knows nothing about those macros
+in foreign headers. Hence the following warnings:
+
+ .../libHStime-1.4.0.1.a(CTimeval.o): In function `s1Kp_info':
+ (.text+0x2f): warning: warning: reference to compatibility
+ gettimeofday(); include <sys/time.h> to generate correct reference
+
+In other words, you can safely use "ccall" only when you are sure the
+symbol you want to import is actually a symbol in the ABI sense, which
+is not always the case for the POSIX API.
+
+--- libraries/time/lib/Data/Time/Clock/CTimeval.hs.orig 2015-07-23 22:04:53.000000000 +0000
++++ libraries/time/lib/Data/Time/Clock/CTimeval.hs
+@@ -1,3 +1,4 @@
++{-# LANGUAGE CApiFFI #-}
+ -- #hide
+ module Data.Time.Clock.CTimeval where
+
+@@ -24,7 +25,7 @@ instance Storable CTimeval where
+ pokeElemOff (castPtr p) 0 s
+ pokeElemOff (castPtr p) 1 mus
+
+-foreign import ccall unsafe "time.h gettimeofday" gettimeofday :: Ptr CTimeval -> Ptr () -> IO CInt
++foreign import capi unsafe "sys/time.h gettimeofday" gettimeofday :: Ptr CTimeval -> Ptr () -> IO CInt
+
+ -- | Get the current POSIX time from the system clock.
+ getCTimeval :: IO CTimeval
Index: pkgsrc/lang/ghc7/patches/patch-libraries_unix_System_Posix_Files_Common.hsc
diff -u /dev/null pkgsrc/lang/ghc7/patches/patch-libraries_unix_System_Posix_Files_Common.hsc:1.1
--- /dev/null Sun Dec 29 16:59:09 2019
+++ pkgsrc/lang/ghc7/patches/patch-libraries_unix_System_Posix_Files_Common.hsc Sun Dec 29 16:59:09 2019
@@ -0,0 +1,35 @@
+$NetBSD: patch-libraries_unix_System_Posix_Files_Common.hsc,v 1.1 2019/12/29 16:59:09 pho Exp $
+
+Suppress linker warnings about compatibility syscall wrappers by using
+"capi" instead of "ccall".
+
+--- libraries/unix/System/Posix/Files/Common.hsc.orig 2019-12-26 18:14:23.311242161 +0000
++++ libraries/unix/System/Posix/Files/Common.hsc
+@@ -1,6 +1,7 @@
+ #ifdef __GLASGOW_HASKELL__
+ {-# LANGUAGE Trustworthy #-}
+ #endif
++{-# LANGUAGE CApiFFI #-}
+ -----------------------------------------------------------------------------
+ -- |
+ -- Module : System.Posix.Files.Common
+@@ -456,16 +457,16 @@ toCTimeVal t = CTimeVal sec (truncate $
+ (sec, frac) = if (frac' < 0) then (sec' - 1, frac' + 1) else (sec', frac')
+ (sec', frac') = properFraction $ toRational t
+
+-foreign import ccall unsafe "utimes"
++foreign import capi unsafe "sys/time.h utimes"
+ c_utimes :: CString -> Ptr CTimeVal -> IO CInt
+
+ #ifdef HAVE_LUTIMES
+-foreign import ccall unsafe "lutimes"
++foreign import capi unsafe "sys/time.h lutimes"
+ c_lutimes :: CString -> Ptr CTimeVal -> IO CInt
+ #endif
+
+ #if HAVE_FUTIMES
+-foreign import ccall unsafe "futimes"
++foreign import capi unsafe "sys/time.h futimes"
+ c_futimes :: CInt -> Ptr CTimeVal -> IO CInt
+ #endif
+
Home |
Main Index |
Thread Index |
Old Index