pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/ghc810 ghc810: Some fixes to SunOS build.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0794921ceadf
branches:  trunk
changeset: 459140:0794921ceadf
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Thu Sep 30 13:23:48 2021 +0000

description:
ghc810: Some fixes to SunOS build.

Switch to new 8.8.4 bootstrap that has been rebuilt after recent changes,
fix hardlink usage, and pull in upstream patch for thread CPU time.

diffstat:

 lang/ghc810/Makefile                          |   4 +--
 lang/ghc810/bootstrap.mk                      |  14 ++++++------
 lang/ghc810/distinfo                          |  11 +++++++--
 lang/ghc810/patches/patch-aclocal.m4          |  19 ++++++++++++----
 lang/ghc810/patches/patch-configure.ac        |  19 ++++++++++++++++-
 lang/ghc810/patches/patch-rts_posix_GetTime.c |  30 +++++++++++++++++++++++++++
 6 files changed, 78 insertions(+), 19 deletions(-)

diffs (195 lines):

diff -r acca22545bb5 -r 0794921ceadf lang/ghc810/Makefile
--- a/lang/ghc810/Makefile      Thu Sep 30 13:22:36 2021 +0000
+++ b/lang/ghc810/Makefile      Thu Sep 30 13:23:48 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2021/09/27 14:30:48 nia Exp $
+# $NetBSD: Makefile,v 1.8 2021/09/30 13:23:48 jperkin Exp $
 # -----------------------------------------------------------------------------
 # Package metadata
 #
@@ -14,8 +14,6 @@
 COMMENT=       Compiler for the functional language Haskell - 8.10 Release Series
 LICENSE=       modified-bsd
 
-MKPIE_SUPPORTED=       no
-
 UNLIMIT_RESOURCES=     datasize virtualsize
 
 # GHC requires GHC to build itself. We have to prepare stripped-down
diff -r acca22545bb5 -r 0794921ceadf lang/ghc810/bootstrap.mk
--- a/lang/ghc810/bootstrap.mk  Thu Sep 30 13:22:36 2021 +0000
+++ b/lang/ghc810/bootstrap.mk  Thu Sep 30 13:23:48 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bootstrap.mk,v 1.2 2021/05/01 04:43:57 pho Exp $
+# $NetBSD: bootstrap.mk,v 1.3 2021/09/30 13:23:48 jperkin Exp $
 # -----------------------------------------------------------------------------
 # Select a bindist of bootstrapping compiler on a per-platform basis.
 #
@@ -66,12 +66,12 @@
 #DISTFILES:=   ${DISTFILES} ${BOOT_ARCHIVE} # Available in LOCAL_PORTS
 #.endif
 
-#.if !empty(MACHINE_PLATFORM:MSunOS-*-x86_64) || make(distinfo) || make (makesum) || make(mdi)
-#BOOT_VERSION:=                8.4.4
-#BOOT_ARCHIVE:=                ghc-${BOOT_VERSION}-boot-x86_64-unknown-solaris2.tar.xz
-#SITES.${BOOT_ARCHIVE}=        https://us-east.manta.joyent.com/pkgsrc/public/pkg-bootstraps/
-#DISTFILES:=           ${DISTFILES} ${BOOT_ARCHIVE}
-#.endif
+.if !empty(MACHINE_PLATFORM:MSunOS-*-x86_64) || make(distinfo) || make (makesum) || make(mdi)
+BOOT_VERSION:=         8.8.4
+BOOT_ARCHIVE:=         ghc-${BOOT_VERSION}-boot-x86_64-unknown-solaris2.tar.xz
+SITES.${BOOT_ARCHIVE}= https://us-east.manta.joyent.com/pkgsrc/public/pkg-bootstraps/
+DISTFILES:=            ${DISTFILES} ${BOOT_ARCHIVE}
+.endif
 
 .if empty(BOOT_ARCHIVE)
 BOOT_ARCHIVE:=         ghc-${BOOT_VERSION}-boot-unknown.tar.xz
diff -r acca22545bb5 -r 0794921ceadf lang/ghc810/distinfo
--- a/lang/ghc810/distinfo      Thu Sep 30 13:22:36 2021 +0000
+++ b/lang/ghc810/distinfo      Thu Sep 30 13:23:48 2021 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.3 2021/05/01 04:43:57 pho Exp $
+$NetBSD: distinfo,v 1.4 2021/09/30 13:23:48 jperkin Exp $
 
 SHA1 (ghc-8.10.4-src.tar.xz) = 41f242d2bb2509c63bedbd6751b2b142ae65ba3e
 RMD160 (ghc-8.10.4-src.tar.xz) = 9b7ab19c21229f0c565c19e851323529c4184f4b
@@ -8,12 +8,16 @@
 RMD160 (ghc-8.8.4-boot-x86_64-unknown-netbsd.tar.xz) = 5e7011aec3f0c02ebbe274e2424a1d482e9ddd90
 SHA512 (ghc-8.8.4-boot-x86_64-unknown-netbsd.tar.xz) = 3f68f15e106cfd6bd833dddc0c2c07fe3d1bae6db0f2e3680b69d18b07778e0d70be9c75285ad2d4faf0369b8b2142ce62cee6ae5ceb6aa4ca8d014525140927
 Size (ghc-8.8.4-boot-x86_64-unknown-netbsd.tar.xz) = 47574408 bytes
+SHA1 (ghc-8.8.4-boot-x86_64-unknown-solaris2.tar.xz) = fcd9ed1a416532722f7dfa6e63687355745aeacd
+RMD160 (ghc-8.8.4-boot-x86_64-unknown-solaris2.tar.xz) = ed0663e291b91f670af07e79b1ba229d93e78302
+SHA512 (ghc-8.8.4-boot-x86_64-unknown-solaris2.tar.xz) = 39dcff330e875b504df5ac4cedd0265ee78e153fea7d16646177ce85694d8960419a332530f5ad8c5874a5b53be51a4726f2521f212d9bd42c8526a07e2309cc
+Size (ghc-8.8.4-boot-x86_64-unknown-solaris2.tar.xz) = 61518048 bytes
 SHA1 (netbsd-9.0-amd64-libterminfo.tar.gz) = db6b385b8676efc135c08b06e3dd6fd11b926999
 RMD160 (netbsd-9.0-amd64-libterminfo.tar.gz) = 5a246633c90ee85f71efcc02d8280bd0c50ab5a7
 SHA512 (netbsd-9.0-amd64-libterminfo.tar.gz) = 79288d44b84df8848afc2cdfee628cc4fd1ec0334159403ef8ba994d617bc56a7114af3031198afb5f3b8f45c0463a848099431e32bc6725042908576b6f95b8
 Size (netbsd-9.0-amd64-libterminfo.tar.gz) = 27744 bytes
-SHA1 (patch-aclocal.m4) = 16ac8899a7d87cf93a6139edba9e5222eb4c5c66
-SHA1 (patch-configure.ac) = 5d33ac8e1a9ab2f729bf5580eddfd87c9fed386a
+SHA1 (patch-aclocal.m4) = c766a72973e630ec3da84f55b107074a2b490fdb
+SHA1 (patch-configure.ac) = 52c6df8f07d83f8bc7ee3c0dd71c6a70a03213e4
 SHA1 (patch-ghc.mk) = fdcbc5b0c48b616eb96868e49681536d773eaddd
 SHA1 (patch-libraries_Cabal_Cabal_Distribution_Simple_GHC.hs) = a4c82b1282c0580a7945be8c3b9d38bc760db99f
 SHA1 (patch-libraries_base_GHC_Event_KQueue.hsc) = 8ee5da667a241a05fde3c580d3dc9bdc05aa5f00
@@ -29,5 +33,6 @@
 SHA1 (patch-libraries_unix_include_execvpe.h) = 67dd9720a71a6a55bbe2b50e61621ca60187ef00
 SHA1 (patch-rts_StgCRun.c) = 121c7bd714725d5b14a3cbb03d81b1c769848824
 SHA1 (patch-rts_ghc.mk) = 6e3daf71fb7e656131aa2aeeb0346c651520216a
+SHA1 (patch-rts_posix_GetTime.c) = b02d26228a76cc999e1c6d60f5168d8313e44a65
 SHA1 (patch-rules_build-package-way.mk) = ec73df0bbc85e962f76a9068683879a1a1ba1815
 SHA1 (patch-rules_distdir-way-opts.mk) = a058c6428faf02ef94aab3336d2d2874f2726f4e
diff -r acca22545bb5 -r 0794921ceadf lang/ghc810/patches/patch-aclocal.m4
--- a/lang/ghc810/patches/patch-aclocal.m4      Thu Sep 30 13:22:36 2021 +0000
+++ b/lang/ghc810/patches/patch-aclocal.m4      Thu Sep 30 13:23:48 2021 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-aclocal.m4,v 1.1 2021/02/09 13:16:24 ryoon Exp $
+$NetBSD: patch-aclocal.m4,v 1.2 2021/09/30 13:23:48 jperkin Exp $
 
 Hunk #1:
   Remove _AC_PROG_CC_C99 macro that is removed in autoconf-2.71
@@ -11,9 +11,9 @@
   Canonicalize OS name netbsd* to "netbsd":
   https://gitlab.haskell.org/ghc/ghc/merge_requests/2496
 
---- aclocal.m4.orig    2020-07-08 16:43:03.000000000 +0000
+--- aclocal.m4.orig    2021-01-25 19:33:20.000000000 +0000
 +++ aclocal.m4
-@@ -611,17 +611,6 @@ AC_DEFUN([FP_SET_CFLAGS_C99],
+@@ -651,17 +651,6 @@ AC_DEFUN([FP_SET_CFLAGS_C99],
      CC="$$1"
      CFLAGS="$$2"
      CPPFLAGS="$$3"
@@ -31,7 +31,7 @@
      dnl restore saved state
      FP_COPY_SHELLVAR([fp_save_CC],[CC])
      FP_COPY_SHELLVAR([fp_save_CFLAGS],[CFLAGS])
-@@ -661,7 +650,7 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
+@@ -701,7 +690,7 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
      x86_64-unknown-solaris2)
          $2="$$2 -m64"
          $3="$$3 -m64"
@@ -40,7 +40,16 @@
          $5="$$5 -m64"
          ;;
      alpha-*)
-@@ -2047,6 +2036,9 @@ AC_DEFUN([GHC_CONVERT_OS],[
+@@ -1360,7 +1349,7 @@ AC_DEFUN([FP_GCC_VERSION], [
+     AC_MSG_ERROR([C compiler is required])
+   fi
+ 
+-  if $CC --version | grep --quiet gcc; then
++  if $CC --version | grep gcc >/dev/null; then
+     AC_CACHE_CHECK([version of gcc], [fp_cv_gcc_version],
+     [
+         # Be sure only to look at the first occurrence of the "version " string;
+@@ -2106,6 +2095,9 @@ AC_DEFUN([GHC_CONVERT_OS],[
        openbsd*)
          $3="openbsd"
          ;;
diff -r acca22545bb5 -r 0794921ceadf lang/ghc810/patches/patch-configure.ac
--- a/lang/ghc810/patches/patch-configure.ac    Thu Sep 30 13:22:36 2021 +0000
+++ b/lang/ghc810/patches/patch-configure.ac    Thu Sep 30 13:23:48 2021 +0000
@@ -1,10 +1,27 @@
-$NetBSD: patch-configure.ac,v 1.1 2021/02/09 13:16:24 ryoon Exp $
+$NetBSD: patch-configure.ac,v 1.2 2021/09/30 13:23:48 jperkin Exp $
 
 Don't use non-portable operator ==:
 https://gitlab.haskell.org/ghc/ghc/merge_requests/2497
 
 --- configure.ac.orig  2021-02-04 05:28:14.000000000 +0000
 +++ configure.ac
+@@ -723,11 +723,11 @@ dnl ------------------------------------
+ dnl ** Copy the files from the "fs" utility into the right folders.
+ dnl --------------------------------------------------------------
+ AC_MSG_NOTICE([Creating links for in-tree file handling routines.])
+-ln -f utils/fs/fs.* utils/lndir/
+-ln -f utils/fs/fs.* utils/unlit/
+-ln -f utils/fs/fs.* rts/
+-ln -f utils/fs/fs.h libraries/base/include/
+-ln -f utils/fs/fs.c libraries/base/cbits/
++cp -p utils/fs/fs.* utils/lndir/
++cp -p utils/fs/fs.* utils/unlit/
++cp -p utils/fs/fs.* rts/
++cp -p utils/fs/fs.h libraries/base/include/
++cp -p utils/fs/fs.c libraries/base/cbits/
+ AC_MSG_NOTICE([Routines in place. Packages can now be build normally.])
+ 
+ dnl --------------------------------------------------------------
 @@ -848,7 +848,7 @@ if test "x$EnableDtrace" = "xyes"; then
    if test -n "$DtraceCmd"; then
      if test "x$TargetOS_CPP-$TargetVendor_CPP" = "xdarwin-apple" \
diff -r acca22545bb5 -r 0794921ceadf lang/ghc810/patches/patch-rts_posix_GetTime.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ghc810/patches/patch-rts_posix_GetTime.c     Thu Sep 30 13:23:48 2021 +0000
@@ -0,0 +1,30 @@
+$NetBSD: patch-rts_posix_GetTime.c,v 1.1 2021/09/30 13:23:48 jperkin Exp $
+
+Backport SunOS fix from trunk.
+
+--- rts/posix/GetTime.c.orig   2020-12-04 20:04:01.000000000 +0000
++++ rts/posix/GetTime.c
+@@ -32,6 +32,10 @@
+ #include <mach/mach_port.h>
+ #endif
+ 
++#if defined(solaris2_HOST_OS)
++#include <sys/time.h>
++#endif
++
+ #if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_GETRUSAGE)
+ // we'll implement getProcessCPUTime() and getProcessElapsedTime()
+ // separately, using getrusage() and gettimeofday() respectively
+@@ -81,6 +85,12 @@ Time getCurrentThreadCPUTime(void)
+         sysErrorBelch("getThreadCPUTime");
+         stg_exit(EXIT_FAILURE);
+     }
++#elif defined(solaris2_HOST_OS)
++    // On OpenSolaris derivatives, the constant CLOCK_THREAD_CPUTIME_ID is
++    // defined in a system header but it isn't actually usable. clock_gettime(2)
++    // always returns EINVAL. Use solaris-specific gethrvtime(3) as an
++    // alternative.
++    return NSToTime(gethrvtime());
+ #elif defined(HAVE_CLOCK_GETTIME)        &&  \
+        defined(CLOCK_PROCESS_CPUTIME_ID) &&  \
+        defined(HAVE_SYSCONF)



Home | Main Index | Thread Index | Old Index