pkgsrc-Changes archive

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

CVS commit: pkgsrc/lang/ghc90



Module Name:    pkgsrc
Committed By:   pho
Date:           Tue Jan 18 02:22:50 UTC 2022

Modified Files:
        pkgsrc/lang/ghc90: Makefile buildlink3.mk distinfo options.mk
        pkgsrc/lang/ghc90/patches: patch-libraries_base_configure
            patch-rts_posix_OSThreads.c
Added Files:
        pkgsrc/lang/ghc90/patches: patch-m4_fptools.m4
Removed Files:
        pkgsrc/lang/ghc90/patches: patch-aclocal.m4

Log Message:
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


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 pkgsrc/lang/ghc90/Makefile
cvs rdiff -u -r1.4 -r1.5 pkgsrc/lang/ghc90/buildlink3.mk
cvs rdiff -u -r1.18 -r1.19 pkgsrc/lang/ghc90/distinfo
cvs rdiff -u -r1.3 -r1.4 pkgsrc/lang/ghc90/options.mk
cvs rdiff -u -r1.5 -r0 pkgsrc/lang/ghc90/patches/patch-aclocal.m4
cvs rdiff -u -r1.2 -r1.3 \
    pkgsrc/lang/ghc90/patches/patch-libraries_base_configure \
    pkgsrc/lang/ghc90/patches/patch-rts_posix_OSThreads.c
cvs rdiff -u -r0 -r1.1 pkgsrc/lang/ghc90/patches/patch-m4_fptools.m4

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

Modified files:

Index: pkgsrc/lang/ghc90/Makefile
diff -u pkgsrc/lang/ghc90/Makefile:1.16 pkgsrc/lang/ghc90/Makefile:1.17
--- pkgsrc/lang/ghc90/Makefile:1.16     Wed Dec  8 16:02:16 2021
+++ pkgsrc/lang/ghc90/Makefile  Tue Jan 18 02:22:49 2022
@@ -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 @@ HOMEPAGE=   https://www.haskell.org/ghc/
 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 @@ CONFIGURE_ARGS.common= \
        --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 @@ post-patch:
 # 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 @@ post-configure:
 # 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
 #

Index: pkgsrc/lang/ghc90/buildlink3.mk
diff -u pkgsrc/lang/ghc90/buildlink3.mk:1.4 pkgsrc/lang/ghc90/buildlink3.mk:1.5
--- pkgsrc/lang/ghc90/buildlink3.mk:1.4 Sat Dec 18 19:14:41 2021
+++ pkgsrc/lang/ghc90/buildlink3.mk     Tue Jan 18 02:22:49 2022
@@ -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 @@ BUILDLINK_TREE+=        ghc
 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"

Index: pkgsrc/lang/ghc90/distinfo
diff -u pkgsrc/lang/ghc90/distinfo:1.18 pkgsrc/lang/ghc90/distinfo:1.19
--- pkgsrc/lang/ghc90/distinfo:1.18     Sun Nov 21 03:38:10 2021
+++ pkgsrc/lang/ghc90/distinfo  Tue Jan 18 02:22:49 2022
@@ -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 @@ Size (ghc-9.0.1-boot-x86_64-apple-darwin
 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_Cabal_Cabal_Distri
 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_
 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

Index: pkgsrc/lang/ghc90/options.mk
diff -u pkgsrc/lang/ghc90/options.mk:1.3 pkgsrc/lang/ghc90/options.mk:1.4
--- pkgsrc/lang/ghc90/options.mk:1.3    Wed Jul 14 09:15:35 2021
+++ pkgsrc/lang/ghc90/options.mk        Tue Jan 18 02:22:49 2022
@@ -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+=     LLC=${PREFIX:Q}/bin/llc
 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).

Index: pkgsrc/lang/ghc90/patches/patch-libraries_base_configure
diff -u pkgsrc/lang/ghc90/patches/patch-libraries_base_configure:1.2 pkgsrc/lang/ghc90/patches/patch-libraries_base_configure:1.3
--- pkgsrc/lang/ghc90/patches/patch-libraries_base_configure:1.2        Wed May  5 09:18:52 2021
+++ pkgsrc/lang/ghc90/patches/patch-libraries_base_configure    Tue Jan 18 02:22:50 2022
@@ -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
Index: pkgsrc/lang/ghc90/patches/patch-rts_posix_OSThreads.c
diff -u pkgsrc/lang/ghc90/patches/patch-rts_posix_OSThreads.c:1.2 pkgsrc/lang/ghc90/patches/patch-rts_posix_OSThreads.c:1.3
--- pkgsrc/lang/ghc90/patches/patch-rts_posix_OSThreads.c:1.2   Wed May  5 09:18:52 2021
+++ pkgsrc/lang/ghc90/patches/patch-rts_posix_OSThreads.c       Tue Jan 18 02:22:50 2022
@@ -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
+--- rts/posix/OSThreads.c.orig 2021-09-15 15:27:32.000000000 +0000
 +++ rts/posix/OSThreads.c
-@@ -14,6 +14,11 @@
-  * DragonflyBSD, because of some specific types, like u_char, u_int, etc. */
+@@ -25,6 +25,11 @@
+ #if defined(freebsd_HOST_OS) || defined(dragonfly_HOST_OS)
  #define __BSD_VISIBLE   1
  #endif
 +#if defined(netbsd_HOST_OS)
@@ -17,9 +17,9 @@ https://gitlab.haskell.org/ghc/ghc/-/mer
 +#define _NETBSD_SOURCE 1
 +#endif
  #if defined(darwin_HOST_OS)
- /* Inclusion of system headers usually requires _DARWIN_C_SOURCE on Mac OS X
-  * because of some specific types like u_char, u_int, etc. */
-@@ -42,7 +47,7 @@
+ #define _DARWIN_C_SOURCE 1
+ #endif
+@@ -51,7 +56,7 @@
  #include <string.h>
  #endif
  
@@ -28,7 +28,7 @@ https://gitlab.haskell.org/ghc/ghc/-/mer
  #include <sys/types.h>
  #include <sys/sysctl.h>
  #endif
-@@ -279,6 +284,13 @@ getNumberOfProcessors (void)
+@@ -292,6 +297,13 @@ getNumberOfProcessors (void)
              if(sysctlbyname("hw.ncpu",&nproc,&size,NULL,0) != 0)
                  nproc = 1;
          }

Added files:

Index: pkgsrc/lang/ghc90/patches/patch-m4_fptools.m4
diff -u /dev/null pkgsrc/lang/ghc90/patches/patch-m4_fptools.m4:1.1
--- /dev/null   Tue Jan 18 02:22:50 2022
+++ pkgsrc/lang/ghc90/patches/patch-m4_fptools.m4       Tue Jan 18 02:22:50 2022
@@ -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).])],



Home | Main Index | Thread Index | Old Index