pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/ghc90 Update to GHC 9.0.2



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7f12cf2b1cac
branches:  trunk
changeset: 372027:7f12cf2b1cac
user:      pho <pho%pkgsrc.org@localhost>
date:      Tue Jan 18 02:22:49 2022 +0000

description:
Update to GHC 9.0.2

* Now the package supports PKGSRC_MKPIE.
* The full list of changes is too long to paste here. See
  https://downloads.haskell.org/~ghc/9.0.2/docs/html/users_guide/9.0.2-notes.html

diffstat:

 lang/ghc90/Makefile                               |  38 +++++++++++++++----
 lang/ghc90/buildlink3.mk                          |   4 +-
 lang/ghc90/distinfo                               |  14 +++---
 lang/ghc90/options.mk                             |   7 ++-
 lang/ghc90/patches/patch-aclocal.m4               |  44 -----------------------
 lang/ghc90/patches/patch-libraries_base_configure |  12 +++---
 lang/ghc90/patches/patch-m4_fptools.m4            |  33 +++++++++++++++++
 lang/ghc90/patches/patch-rts_posix_OSThreads.c    |  16 ++++----
 8 files changed, 90 insertions(+), 78 deletions(-)

diffs (truncated from 331 to 300 lines):

diff -r 40b3a993b500 -r 7f12cf2b1cac lang/ghc90/Makefile
--- a/lang/ghc90/Makefile       Tue Jan 18 01:41:09 2022 +0000
+++ b/lang/ghc90/Makefile       Tue Jan 18 02:22:49 2022 +0000
@@ -1,9 +1,8 @@
-# $NetBSD: Makefile,v 1.16 2021/12/08 16:02:16 adam Exp $
+# $NetBSD: Makefile,v 1.17 2022/01/18 02:22:49 pho Exp $
 # -----------------------------------------------------------------------------
 # Package metadata
 #
-DISTNAME=      ghc-9.0.1-src
-PKGREVISION=   6
+DISTNAME=      ghc-9.0.2-src
 PKGNAME=       ${DISTNAME:S/-src$//}
 CATEGORIES=    lang
 MASTER_SITES=  https://downloads.haskell.org/~ghc/${PKGVERSION_NOREV}/
@@ -14,12 +13,10 @@
 COMMENT=       Compiler for the functional language Haskell - 9.0 Release Series
 LICENSE=       modified-bsd
 
-MKPIE_SUPPORTED=       no
-
 UNLIMIT_RESOURCES=     datasize virtualsize
 
 # GHC requires GHC to build itself. We have to prepare stripped-down
-# binaries sufficient to bootstrap compilers for each platforms. If
+# binaries sufficient to bootstrap compilers for each platform. If
 # you want to build them yourself, follow instructions in
 # BOOTSTRAP.txt and ./bootstrap.mk
 BROKEN_EXCEPT_ON_PLATFORM+=    Darwin-*-x86_64
@@ -64,6 +61,18 @@
        --with-ffi-includes=${BUILDLINK_PREFIX.libffi}/${BUILDLINK_INCDIRS.libffi:Q} \
        --with-ffi-libraries=${BUILDLINK_PREFIX.libffi}/${BUILDLINK_LIBDIRS.libffi:Q}
 
+.include "../../mk/bsd.prefs.mk"
+.if ${OPSYS} == "NetBSD"
+# The GHC rts, by default, creates executable objects on the heap by first
+# mmap(2)'ing an anonymous memory with PROT_READ|PROT_WRITE and then calling
+# mprotect(2) with PROT_READ|PROT_EXEC after filling its content. However,
+# NetBSD PaX mprotect doesn't allow this practice. That is, turning pages that
+# have been initially mapped as non-executable into something executable is a
+# no-no. We must therefore take a different path although it might be a bit slower.
+CONFIGURE_ARGS.common+=        --enable-libffi-adjustors
+# See rts/adjustor/NativeAmd64.c and rts/adjustor/LibffiAdjustor.c
+.endif
+
 CONFIGURE_ARGS+=       ${CONFIGURE_ARGS.common}
 
 # We must pass non-wrapper tools to ./configure because they will be
@@ -135,7 +144,6 @@
 # The version restriction on Sphinx in ${WRKSRC}/configure.ac is too
 # loose, and building docs/users_guide rarely succeeds. We don't know
 # which version is actually required for it.
-.include "../../mk/bsd.prefs.mk"
 BUILD_SPHINX_HTML?=    no
 
 # Here we generate mk/build.mk dynamically.
@@ -154,11 +162,25 @@
 # Don't even think of PDF.
        ${RUN} ${ECHO} "BUILD_SPHINX_PDF  = NO" >> ${WRKSRC}/mk/build.mk
 
-# https://gitlab.haskell.org/ghc/ghc/issues/13542
+# SplitSections is only enabled by default on platforms with GNU ld. On SunOS,
+# whose ld is not the GNU one, it can however be used as well.
 .if ${OPSYS} == "SunOS"
        ${RUN} ${ECHO} "SplitSections  = YES" >> ${WRKSRC}/mk/build.mk
 .endif
 
+# The use of internal variable in mk/bsd.prefs.mk is not very satisfying, but
+# the current infrastructure does not export a public variable indicating
+# whether a PIE build is requested or not. Note that we can't build stage-1
+# compiler as PIE, because our bootkit libraries aren't built as PIC.
+.if ${_PKGSRC_MKPIE} == "yes"
+       ${RUN} ${ECHO} "SRC_HC_OPTS_STAGE1 += -fPIC -pie" >> ${WRKSRC}/mk/build.mk
+       ${RUN} ${ECHO} "SRC_HC_OPTS_STAGE2 += -fPIC -pie" >> ${WRKSRC}/mk/build.mk
+.endif
+
+# We are going to do a PIE build on our responsibility. Do not put -pie in
+# wrappers, as that would prevent us from building stage-1 compiler.
+PKGSRC_OVERRIDE_MKPIE= yes
+
 # -----------------------------------------------------------------------------
 # Installation/removal hooks
 #
diff -r 40b3a993b500 -r 7f12cf2b1cac lang/ghc90/buildlink3.mk
--- a/lang/ghc90/buildlink3.mk  Tue Jan 18 01:41:09 2022 +0000
+++ b/lang/ghc90/buildlink3.mk  Tue Jan 18 02:22:49 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.4 2021/12/18 19:14:41 pho Exp $
+# $NetBSD: buildlink3.mk,v 1.5 2022/01/18 02:22:49 pho Exp $
 
 BUILDLINK_TREE+=       ghc
 
@@ -6,7 +6,7 @@
 GHC_BUILDLINK3_MK:=
 
 BUILDLINK_API_DEPENDS.ghc+=    ghc>=9.0
-BUILDLINK_ABI_DEPENDS.ghc+=    ghc>=9.0.1nb6
+BUILDLINK_ABI_DEPENDS.ghc+=    ghc>=9.0.2
 BUILDLINK_PKGSRCDIR.ghc?=      ../../lang/ghc90
 
 .include "../../converters/libiconv/buildlink3.mk"
diff -r 40b3a993b500 -r 7f12cf2b1cac lang/ghc90/distinfo
--- a/lang/ghc90/distinfo       Tue Jan 18 01:41:09 2022 +0000
+++ b/lang/ghc90/distinfo       Tue Jan 18 02:22:49 2022 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.18 2021/11/21 03:38:10 pho Exp $
+$NetBSD: distinfo,v 1.19 2022/01/18 02:22:49 pho Exp $
 
 BLAKE2s (ghc-8.10.4-boot-x86_64-unknown-netbsd.tar.xz) = 03efbb455a52d0dbc246b1c8b30f82121f5354a1ca0eb1b08b6225b90286a18f
 SHA512 (ghc-8.10.4-boot-x86_64-unknown-netbsd.tar.xz) = 730347bb5eaac4efac8ec487fafd2da6fe2932db45f59e324c83698eb0b0e8a6a4b4fd513de17fb9c152ccee328660cfe1638cad631ce5e35b2dbfddda0d8850
@@ -18,13 +18,12 @@
 BLAKE2s (ghc-9.0.1-boot-x86_64-unknown-freebsd.tar.xz) = 4957b6df3c21773d16477ff2d9fc6c4d41e3dee574a39d4672677cbea4f1aa64
 SHA512 (ghc-9.0.1-boot-x86_64-unknown-freebsd.tar.xz) = 01b196eca0a23b64687cb795601ca02a409ea0a1b2db48f5b9ab90a95a1db05a254ac92db43726f15382f4cc9e54052685959467a2925fb67ebe5f68570c1eca
 Size (ghc-9.0.1-boot-x86_64-unknown-freebsd.tar.xz) = 49644112 bytes
-BLAKE2s (ghc-9.0.1-src.tar.xz) = 2433c0c01218556d02e040c356aebf51cfd09d72a3d997f948f38d32c750a266
-SHA512 (ghc-9.0.1-src.tar.xz) = bee7950a5118be8d8cefe0db5070139a5a93ca21c5bc6f8bf453429831f0c44f5e0fb5ee569865d6b8b92749044ee4123be06920928ac7a1ec9cffa9404a3e53
-Size (ghc-9.0.1-src.tar.xz) = 20782336 bytes
+BLAKE2s (ghc-9.0.2-src.tar.xz) = 4eb3786588735780f27926a60438f109f1ebef6291edd9717eb20a67bb3c679b
+SHA512 (ghc-9.0.2-src.tar.xz) = 32994c7d2b8f47bae604cd825bfcf9c788d79ce26d1d5f58bd73a7093e11ae6c3c17b31dc0c9e454dbf67ca169b942f92213c388d615768cae86055bf6094dee
+Size (ghc-9.0.2-src.tar.xz) = 27270396 bytes
 BLAKE2s (netbsd-9.0-amd64-libterminfo.tar.gz) = cf57e942d3331df269d8668bc09c59e8a81fbdfa5bb6c671d758d367a23c84ce
 SHA512 (netbsd-9.0-amd64-libterminfo.tar.gz) = 79288d44b84df8848afc2cdfee628cc4fd1ec0334159403ef8ba994d617bc56a7114af3031198afb5f3b8f45c0463a848099431e32bc6725042908576b6f95b8
 Size (netbsd-9.0-amd64-libterminfo.tar.gz) = 27744 bytes
-SHA1 (patch-aclocal.m4) = 8a21585c1b6a35020c5dec577ee0c7ed3bd7d0af
 SHA1 (patch-compiler_GHC_Driver_Pipeline.hs) = cc2c53f14420b8b75bd70b73e2c95bb52a10cd0c
 SHA1 (patch-compiler_GHC_SysTools_Process.hs) = 36d7171e571d56c4e6ae1ed99d2851c0b0dac084
 SHA1 (patch-configure.ac) = ba7762aa3dbd9757c155666a5fe957cae355bad6
@@ -33,7 +32,7 @@
 SHA1 (patch-libraries_base_GHC_Event_KQueue.hsc) = 8ee5da667a241a05fde3c580d3dc9bdc05aa5f00
 SHA1 (patch-libraries_base_System_CPUTime_Posix_Times.hsc) = 2bfb779d534d12073287274ce5e90b99e457a860
 SHA1 (patch-libraries_base_System_Environment.hs) = 7d79a91f295915b4408d5f41d5405739d7189215
-SHA1 (patch-libraries_base_configure) = d31034fcc2e2132961c707d8e55bf7a160eebd63
+SHA1 (patch-libraries_base_configure) = d45f6e899bbbc3cae2eda608f9cd9311bdda18ad
 SHA1 (patch-libraries_time_lib_Data_Time_Clock_Internal_CTimespec.hsc) = 588270767f8a9cbde0648fc99807891fef65d721
 SHA1 (patch-libraries_time_lib_Data_Time_Clock_Internal_CTimeval.hs) = b2811ec4a845e6b2b44414e940b6108178b597c5
 SHA1 (patch-libraries_unix_System_Posix_Env.hsc) = e94936c139ca15d45cac4a7feb74a601567913ab
@@ -42,10 +41,11 @@
 SHA1 (patch-libraries_unix_System_Posix_Signals.hsc) = 49215dce493a6bbc440f91a3959e592f86fc779b
 SHA1 (patch-libraries_unix_include_execvpe.h) = 560c6e9b644687fad62e380f73f08359c48639a2
 SHA1 (patch-llvm-targets) = cba672c60c9cb84e0347a3cd6e8770306542e5d8
+SHA1 (patch-m4_fptools.m4) = 856cc02ab583ddbfd81ae2818f344566547740aa
 SHA1 (patch-rts_ProfHeap.c) = fafbb740ee87949da12749834478769548322993
 SHA1 (patch-rts_ghc.mk) = 6e3daf71fb7e656131aa2aeeb0346c651520216a
 SHA1 (patch-rts_posix_GetTime.c) = 036e09510c893ab8677a2b4add0193e7f811bb82
-SHA1 (patch-rts_posix_OSThreads.c) = 4fe5fb21021de05d9803ccbf1715de98ebd55206
+SHA1 (patch-rts_posix_OSThreads.c) = 8f88fb2ae7caa910986aba9e1fba75ef564d0e15
 SHA1 (patch-rules_build-package-way.mk) = ec73df0bbc85e962f76a9068683879a1a1ba1815
 SHA1 (patch-rules_distdir-way-opts.mk) = a058c6428faf02ef94aab3336d2d2874f2726f4e
 SHA1 (patch-utils_haddock_driver_Main.hs) = 26b015d3aef9fdff66e66c8e3d9a370a2dbd7067
diff -r 40b3a993b500 -r 7f12cf2b1cac lang/ghc90/options.mk
--- a/lang/ghc90/options.mk     Tue Jan 18 01:41:09 2022 +0000
+++ b/lang/ghc90/options.mk     Tue Jan 18 02:22:49 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.3 2021/07/14 09:15:35 jperkin Exp $
+# $NetBSD: options.mk,v 1.4 2022/01/18 02:22:49 pho Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.ghc
 
@@ -27,12 +27,13 @@
 CONFIGURE_ENV+=        OPT=${PREFIX:Q}/bin/opt
 
 # Maybe GHC doesn't like this but it's the only option available to us.
-.  include "../../lang/llvm/version.mk"
+LLVM_VERSION_CMD=      ${PKG_INFO} -E llvm | ${SED} -E 's/^llvm-([0-9]*)\..*/\1/'
+LLVM_MAX_VERSION_CMD=  ${EXPR} ${LLVM_VERSION_CMD:sh} + 1
 SUBST_CLASSES+=                llvm
 SUBST_STAGE.llvm=      post-extract
 SUBST_MESSAGE.llvm=    Accept whichever version of LLVM installed via pkgsrc
 SUBST_FILES.llvm=      configure.ac
-SUBST_SED.llvm=                -e 's/LlvmVersion=[0-9]*/LlvmVersion=${LLVM_VERSION:C/^([0-9]*)\..*/\1/}/'
+SUBST_SED.llvm=                -e 's/LlvmMaxVersion=[0-9]*/LlvmMaxVersion=${LLVM_MAX_VERSION_CMD:sh}/'
 
 # Clang is also required on Darwin.
 # See compiler/GHC/SysTools/Tasks.hs (runClang).
diff -r 40b3a993b500 -r 7f12cf2b1cac lang/ghc90/patches/patch-aclocal.m4
--- a/lang/ghc90/patches/patch-aclocal.m4       Tue Jan 18 01:41:09 2022 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-$NetBSD: patch-aclocal.m4,v 1.5 2021/05/22 09:10:36 pho Exp $
-
-Hunk #0:
-  Remove _AC_PROG_CC_C99 macro that is removed in autoconf-2.71 to fix
-  build failure.
-
-  Already fixed in the upstream:
-  https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4987
-
-Hunk #1:
-  Mark the stack as non-executable on NetBSD/aarch64.
-  https://gitlab.haskell.org/ghc/ghc/-/merge_requests/5805
-
---- aclocal.m4.orig    2021-01-26 14:49:54.000000000 +0000
-+++ aclocal.m4
-@@ -656,17 +656,6 @@ AC_DEFUN([FP_SET_CFLAGS_C99],
-     CC="$$1"
-     CFLAGS="$$2"
-     CPPFLAGS="$$3"
--    unset ac_cv_prog_cc_c99
--    dnl perform detection
--    _AC_PROG_CC_C99
--    fp_cc_c99="$ac_cv_prog_cc_c99"
--    case "x$ac_cv_prog_cc_c99" in
--      x)   ;; # noop
--      xno) AC_MSG_ERROR([C99-compatible compiler needed]) ;;
--      *)   $2="$$2 $ac_cv_prog_cc_c99"
--           $3="$$3 $ac_cv_prog_cc_c99"
--           ;;
--    esac
-     dnl restore saved state
-     FP_COPY_SHELLVAR([fp_save_CC],[CC])
-     FP_COPY_SHELLVAR([fp_save_CFLAGS],[CFLAGS])
-@@ -759,6 +748,10 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
-         $3="$$3 -Wl,-z,noexecstack"
-         $4="$$4 -z noexecstack"
-         ;;
-+    aarch64*netbsd*)
-+        $3="$$3 -Wl,-z,noexecstack"
-+      $4="$$4 -z noexecstack"
-+      ;;
- 
-     powerpc-ibm-aix*)
-         # We need `-D_THREAD_SAFE` to unlock the thread-local `errno`.
diff -r 40b3a993b500 -r 7f12cf2b1cac lang/ghc90/patches/patch-libraries_base_configure
--- a/lang/ghc90/patches/patch-libraries_base_configure Tue Jan 18 01:41:09 2022 +0000
+++ b/lang/ghc90/patches/patch-libraries_base_configure Tue Jan 18 02:22:49 2022 +0000
@@ -1,18 +1,18 @@
-$NetBSD: patch-libraries_base_configure,v 1.2 2021/05/05 09:18:52 pho Exp $
+$NetBSD: patch-libraries_base_configure,v 1.3 2022/01/18 02:22:50 pho Exp $
 
 Ensure libiconv can be found at runtime.
 
 XXX: I don't think this is needed because rpath flags are handled by
 Cabal. LDFLAGS is not used anyway. (pho@)
 
---- libraries/base/configure.orig      2020-09-15 12:39:44.549328929 +0000
+--- libraries/base/configure.orig      2021-12-25 13:14:24.000000000 +0000
 +++ libraries/base/configure
-@@ -4459,7 +4459,7 @@ fi
- 
+@@ -4944,7 +4944,7 @@ fi
  # Check whether --with-iconv-libraries was given.
- if test "${with_iconv_libraries+set}" = set; then :
+ if test ${with_iconv_libraries+y}
+ then :
 -  withval=$with_iconv_libraries; ICONV_LIB_DIRS=$withval; LDFLAGS="-L$withval $LDFLAGS"
 +  withval=$with_iconv_libraries; ICONV_LIB_DIRS=$withval; LDFLAGS="-L$withval ${COMPILER_RPATH_FLAG}$withval $LDFLAGS"
- else
+ else $as_nop
    ICONV_LIB_DIRS=
  fi
diff -r 40b3a993b500 -r 7f12cf2b1cac lang/ghc90/patches/patch-m4_fptools.m4
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/ghc90/patches/patch-m4_fptools.m4    Tue Jan 18 02:22:49 2022 +0000
@@ -0,0 +1,33 @@
+$NetBSD: patch-m4_fptools.m4,v 1.1 2022/01/18 02:22:50 pho Exp $
+
+Hunk #0:
+  Mark the stack as non-executable on NetBSD/aarch64.
+  https://gitlab.haskell.org/ghc/ghc/-/merge_requests/5805
+
+Hunk #1
+  Abolish the bash-ism. Not upstreamed. I'm honestly tired of upstreaming this
+  specific kind of patch because this is never the first time they made this
+  mistake. (pho@)
+
+--- m4/fptools.m4.orig 2021-12-25 13:13:59.000000000 +0000
++++ m4/fptools.m4
+@@ -761,6 +761,10 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
+         $3="$$3 -Wl,-z,noexecstack"
+         $4="$$4 -z noexecstack"
+         ;;
++    aarch64*netbsd*)
++        $3="$$3 -Wl,-z,noexecstack"
++        $4="$$4 -z noexecstack"
++        ;;
+ 
+     powerpc-ibm-aix*)
+         # We need `-D_THREAD_SAFE` to unlock the thread-local `errno`.
+@@ -2242,7 +2246,7 @@ AC_DEFUN([FIND_LLVM_PROG],[
+     AC_CHECK_TOOLS([$1], [$PROG_VERSION_CANDIDATES $2], [])
+     AS_IF([test x"$$1" != x],[
+         PROG_VERSION=`$$1 --version | awk '/.*version [[0-9\.]]+/{for(i=1;i<=NF;i++){ if(\$i ~ /^[[0-9\.]]+$/){print \$i}}}'`
+-        AS_IF([test x"$PROG_VERSION" == x],
++        AS_IF([test x"$PROG_VERSION" = x],
+           [AC_MSG_RESULT(no)
+            $1=""
+            AC_MSG_NOTICE([We only support llvm $3 to $4 (no version found).])],
diff -r 40b3a993b500 -r 7f12cf2b1cac lang/ghc90/patches/patch-rts_posix_OSThreads.c
--- a/lang/ghc90/patches/patch-rts_posix_OSThreads.c    Tue Jan 18 01:41:09 2022 +0000
+++ b/lang/ghc90/patches/patch-rts_posix_OSThreads.c    Tue Jan 18 02:22:49 2022 +0000
@@ -1,14 +1,14 @@
-$NetBSD: patch-rts_posix_OSThreads.c,v 1.2 2021/05/05 09:18:52 pho Exp $
+$NetBSD: patch-rts_posix_OSThreads.c,v 1.3 2022/01/18 02:22:50 pho Exp $
 
 Implementation of getNumberOfProcessors() for NetBSD
 
 Sent to the upstream:
 https://gitlab.haskell.org/ghc/ghc/-/merge_requests/5679
 
---- rts/posix/OSThreads.c.orig 2021-04-22 12:36:33.476115260 +0000



Home | Main Index | Thread Index | Old Index