From 103a2827c5c17f6b2223be20d543f2f483618b6a Mon Sep 17 00:00:00 2001 From: jperkin Date: Thu, 30 Sep 2021 15:32:53 +0000 Subject: [PATCH] ghc90: Switch to fixed SunOS bootstrap. Also apply the "cp -p" fix from other versions, removing the need for ln workarounds on OmniOS. --- lang/ghc90/bootstrap.mk | 17 +++-------- lang/ghc90/distinfo | 14 ++++----- lang/ghc90/patches/patch-configure.ac | 39 +++++++++++++++++++++++-- lang/ghc90/patches/patch-rts_ProfHeap.c | 12 ++++---- 4 files changed, 54 insertions(+), 28 deletions(-) diff --git a/lang/ghc90/bootstrap.mk b/lang/ghc90/bootstrap.mk index 845c37b669bd..1dc9b0163ec1 100644 --- a/lang/ghc90/bootstrap.mk +++ b/lang/ghc90/bootstrap.mk @@ -1,4 +1,4 @@ -# $NetBSD: bootstrap.mk,v 1.10 2021/05/21 01:45:00 pho Exp $ +# $NetBSD: bootstrap.mk,v 1.11 2021/09/30 15:32:53 jperkin Exp $ # ----------------------------------------------------------------------------- # Select a bindist of bootstrapping compiler on a per-platform basis. # @@ -58,12 +58,10 @@ SITES.netbsd-9.0-amd64-libterminfo.tar.gz?= ${MASTER_SITE_LOCAL} .endif .if !empty(MACHINE_PLATFORM:MSunOS-*-x86_64) || make(distinfo) || make (makesum) || make(mdi) -# Built on OmniOS r151036-a13510b579 + gcc10. Hope it works on other -# Solaris-based platforms as well. -BOOT_VERSION:= 9.0.1 +BOOT_VERSION:= 8.10.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} # Available in LOCAL_PORTS +SITES.${BOOT_ARCHIVE}= https://us-east.manta.joyent.com/pkgsrc/public/pkg-bootstraps/ +DISTFILES:= ${DISTFILES} ${BOOT_ARCHIVE} .endif .if empty(BOOT_ARCHIVE) @@ -85,14 +83,7 @@ BUILD_DEPENDS+= libiconv>=1.9.1:../../converters/libiconv BUILD_DEPENDS+= ncurses>=6.0:../../devel/ncurses .endif -# On OmniOS, if one tries to create a hard link with the default ln(1) -# whose target is itself a symbolic link, it creates a hard link to -# the symbolic link without first resolving it. ${WRKSRC}/configure.ac -# doesn't work as expected in this case. Maybe we should do this in -# ../../mk/platform/SunOS.mk but I'm not sure if it's really safe to -# do. .if ${OPSYS} == "SunOS" && ${OS_VARIANT:U} == "OmniOS" -TOOLS_PLATFORM.ln= /usr/xpg4/bin/ln # Also cpp is missing from /usr/bin. Why? This leads # ${WRKSRC}/libffi/configure to fail. TOOLS_PLATFORM.cpp= /usr/lib/cpp diff --git a/lang/ghc90/distinfo b/lang/ghc90/distinfo index 8258b9af031d..be9cc67f97bf 100644 --- a/lang/ghc90/distinfo +++ b/lang/ghc90/distinfo @@ -1,9 +1,13 @@ -$NetBSD: distinfo,v 1.15 2021/05/22 09:11:07 pho Exp $ +$NetBSD: distinfo,v 1.16 2021/09/30 15:32:53 jperkin Exp $ SHA1 (ghc-8.10.4-boot-x86_64-unknown-netbsd.tar.xz) = 3ff01d768393b3866e7a7543f9f55646aaffce7a RMD160 (ghc-8.10.4-boot-x86_64-unknown-netbsd.tar.xz) = 39bf10b13054a6316c8477609fb98abe4277fa6c SHA512 (ghc-8.10.4-boot-x86_64-unknown-netbsd.tar.xz) = 730347bb5eaac4efac8ec487fafd2da6fe2932db45f59e324c83698eb0b0e8a6a4b4fd513de17fb9c152ccee328660cfe1638cad631ce5e35b2dbfddda0d8850 Size (ghc-8.10.4-boot-x86_64-unknown-netbsd.tar.xz) = 49500236 bytes +SHA1 (ghc-8.10.4-boot-x86_64-unknown-solaris2.tar.xz) = ef7ba2ff12f8d875809afd0e81ebeda2eebef687 +RMD160 (ghc-8.10.4-boot-x86_64-unknown-solaris2.tar.xz) = 640c3418ca7d728fc4e8c4bd0dc718cc4f5b521e +SHA512 (ghc-8.10.4-boot-x86_64-unknown-solaris2.tar.xz) = 3484e865b0b7c3fac4c56cdcee5e42e4579cea6a5fb527a894a9a8eba26a3bd0a691262dfb744c129f2be6bdc1d875756ffbba99fff49e1f19a10a567b4bdb12 +Size (ghc-8.10.4-boot-x86_64-unknown-solaris2.tar.xz) = 64361808 bytes SHA1 (ghc-9.0.1-boot-aarch64-unknown-netbsd.tar.xz) = db416c1e32a0b65e964aa80db3ecd4492a9e62d0 RMD160 (ghc-9.0.1-boot-aarch64-unknown-netbsd.tar.xz) = 29250c03e4d29a04f2904508cd0d87d47a0e4340 SHA512 (ghc-9.0.1-boot-aarch64-unknown-netbsd.tar.xz) = 6ae93b63ecaacc9740f88b0c78095ea660cdf3d7d30bf02b66da3d1a31ceaaf3fd33053b7863ced70ef8b4b844257e6bd856d44648e21876f802e395d265c4d6 @@ -20,10 +24,6 @@ SHA1 (ghc-9.0.1-boot-x86_64-unknown-freebsd.tar.xz) = 893871b70f5eb3cafdd8e6629b RMD160 (ghc-9.0.1-boot-x86_64-unknown-freebsd.tar.xz) = 33e89913fbb6307e229088fa700d78633dfea12e SHA512 (ghc-9.0.1-boot-x86_64-unknown-freebsd.tar.xz) = 1ec81c83e247855e6e67bca3529955a24d8a9213c2d2f22997bb5260e1119edd5a463e4ecd7d3d1ebf85dbd090a12f1c1ac9776ad14395742e1b20ae1e1a45a4 Size (ghc-9.0.1-boot-x86_64-unknown-freebsd.tar.xz) = 49606768 bytes -SHA1 (ghc-9.0.1-boot-x86_64-unknown-solaris2.tar.xz) = 19fa8860969d332baced6ea281616cdc5ec32d67 -RMD160 (ghc-9.0.1-boot-x86_64-unknown-solaris2.tar.xz) = deb39ae711a2cfa5cec9419e993d2be05e054770 -SHA512 (ghc-9.0.1-boot-x86_64-unknown-solaris2.tar.xz) = 92694ef783274f42800d899af4dd558087e3c2ce13e175558a23f5187c944333a2872cee1df9b14683903a0542954a8483c7413343aacaa2b1676d10a6d27a6d -Size (ghc-9.0.1-boot-x86_64-unknown-solaris2.tar.xz) = 59903112 bytes SHA1 (ghc-9.0.1-src.tar.xz) = adaec1c05cd03d6af02716d59ab5f597434b700b RMD160 (ghc-9.0.1-src.tar.xz) = 2bed45072ccb838418ae0405f5cfe64a237315e3 SHA512 (ghc-9.0.1-src.tar.xz) = bee7950a5118be8d8cefe0db5070139a5a93ca21c5bc6f8bf453429831f0c44f5e0fb5ee569865d6b8b92749044ee4123be06920928ac7a1ec9cffa9404a3e53 @@ -35,7 +35,7 @@ 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) = a67c57f39c152a9fc8af830045cf001e957590e2 +SHA1 (patch-configure.ac) = ba7762aa3dbd9757c155666a5fe957cae355bad6 SHA1 (patch-ghc.mk) = fdcbc5b0c48b616eb96868e49681536d773eaddd SHA1 (patch-libraries_Cabal_Cabal_Distribution_Simple_GHC.hs) = 6d2a9f238ce7a7551002f6da253eb536adcc4a43 SHA1 (patch-libraries_base_GHC_Event_KQueue.hsc) = 8ee5da667a241a05fde3c580d3dc9bdc05aa5f00 @@ -50,7 +50,7 @@ SHA1 (patch-libraries_unix_System_Posix_Files_Common.hsc) = 6efef280832d376915a8 SHA1 (patch-libraries_unix_System_Posix_Signals.hsc) = 49215dce493a6bbc440f91a3959e592f86fc779b SHA1 (patch-libraries_unix_include_execvpe.h) = 560c6e9b644687fad62e380f73f08359c48639a2 SHA1 (patch-llvm-targets) = cba672c60c9cb84e0347a3cd6e8770306542e5d8 -SHA1 (patch-rts_ProfHeap.c) = bc1492578eac7b194caaf1221586cd6c13aa9583 +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 diff --git a/lang/ghc90/patches/patch-configure.ac b/lang/ghc90/patches/patch-configure.ac index 8687b143add1..719078bf9fac 100644 --- a/lang/ghc90/patches/patch-configure.ac +++ b/lang/ghc90/patches/patch-configure.ac @@ -1,10 +1,45 @@ -$NetBSD: patch-configure.ac,v 1.2 2021/05/05 09:18:52 pho Exp $ +$NetBSD: patch-configure.ac,v 1.3 2021/09/30 15:32:53 jperkin Exp $ Disable DTrace support on solaris2. XXX: But why? ---- configure.ac.orig 2021-02-02 21:05:56.000000000 +0000 +--- configure.ac.orig 2021-09-30 13:46:21.920309978 +0000 +++ configure.ac +@@ -749,23 +749,23 @@ 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 ** Copy files for ghci wrapper C utilities. + dnl -------------------------------------------------------------- + dnl See Note [Hadrian's ghci-wrapper package] in hadrian/src/Packages.hs + AC_MSG_NOTICE([Creating links for ghci wrapper]) +-ln -f driver/utils/getLocation.c driver/ghci/ +-ln -f driver/utils/getLocation.h driver/ghci/ +-ln -f driver/utils/isMinTTY.c driver/ghci/ +-ln -f driver/utils/isMinTTY.h driver/ghci/ +-ln -f driver/utils/cwrapper.c driver/ghci/ +-ln -f driver/utils/cwrapper.h driver/ghci/ ++cp -p driver/utils/getLocation.c driver/ghci/ ++cp -p driver/utils/getLocation.h driver/ghci/ ++cp -p driver/utils/isMinTTY.c driver/ghci/ ++cp -p driver/utils/isMinTTY.h driver/ghci/ ++cp -p driver/utils/cwrapper.c driver/ghci/ ++cp -p driver/utils/cwrapper.h driver/ghci/ + AC_MSG_NOTICE([done.]) + + dnl -------------------------------------------------------------- @@ -888,7 +888,7 @@ if test "x$EnableDtrace" = "xyes"; then if test -n "$DtraceCmd"; then if test "x$TargetOS_CPP-$TargetVendor_CPP" = "xdarwin-apple" \ diff --git a/lang/ghc90/patches/patch-rts_ProfHeap.c b/lang/ghc90/patches/patch-rts_ProfHeap.c index 04e2bcccc5d6..74429f4a9c15 100644 --- a/lang/ghc90/patches/patch-rts_ProfHeap.c +++ b/lang/ghc90/patches/patch-rts_ProfHeap.c @@ -1,4 +1,4 @@ -$NetBSD: patch-rts_ProfHeap.c,v 1.4 2021/05/05 09:18:52 pho Exp $ +$NetBSD: patch-rts_ProfHeap.c,v 1.5 2021/09/30 15:32:53 jperkin Exp $ NetBSD does not have uselocale(3). @@ -7,7 +7,7 @@ https://gitlab.haskell.org/ghc/ghc/-/merge_requests/5677 --- rts/ProfHeap.c.orig 2021-01-25 16:30:28.000000000 +0000 +++ rts/ProfHeap.c -@@ -69,7 +69,7 @@ static locale_t prof_locale = 0, saved_locale = 0; +@@ -69,7 +69,7 @@ static locale_t prof_locale = 0, saved_l STATIC_INLINE void init_prof_locale( void ) { @@ -35,12 +35,12 @@ https://gitlab.haskell.org/ghc/ghc/-/merge_requests/5677 #else saved_locale = uselocale(prof_locale); #endif -@@ -108,6 +111,8 @@ restore_locale( void ) - { +@@ -109,6 +112,8 @@ restore_locale( void ) #if defined(mingw32_HOST_OS) _configthreadlocale(prof_locale_per_thread); -+ setlocale(LC_NUMERIC, saved_locale); -+#elif defined(netbsd_HOST_OS) setlocale(LC_NUMERIC, saved_locale); ++#elif defined(netbsd_HOST_OS) ++ setlocale(LC_NUMERIC, saved_locale); #else uselocale(saved_locale); + #endif