From 295e3b17d671fe4aad2a88d119c981a1fba0f8539e1d47d06c3fff0dcf6139d6 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Wed, 6 May 2020 13:42:15 +0000 Subject: [PATCH 1/3] osc copypac from project:devel:languages:haskell:ghc-8.10.x package:ghc revision:21, using keep-link OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc?expand=0&rev=332 --- ...ther-GCC-supports-__atomic_-builtins.patch | 60 +++++++++++++ D5212.patch | 23 +++++ _constraints | 12 +-- buildpath-abi-stability.patch | 12 +-- fix-build-using-unregisterized-v8.4.patch | 58 ++++++++++++ fix-unregisterised-v8.4-8.6.patch | 8 +- ghc-8.0.2-Cabal-dynlibdir.patch | 8 +- ghc-8.10.1-src.tar.xz | 3 + ghc-8.10.1-src.tar.xz.sig | Bin 0 -> 586 bytes ghc-8.8.3-src.tar.xz | 3 - ghc-8.8.3-src.tar.xz.sig | Bin 586 -> 0 bytes ghc-pie.patch | 8 +- ghc.changes | 14 +-- ghc.spec | 83 +++++++++++------- 14 files changed, 228 insertions(+), 64 deletions(-) create mode 100644 0001-Fix-check-whether-GCC-supports-__atomic_-builtins.patch create mode 100644 D5212.patch create mode 100644 fix-build-using-unregisterized-v8.4.patch create mode 100644 ghc-8.10.1-src.tar.xz create mode 100644 ghc-8.10.1-src.tar.xz.sig delete mode 100644 ghc-8.8.3-src.tar.xz delete mode 100644 ghc-8.8.3-src.tar.xz.sig diff --git a/0001-Fix-check-whether-GCC-supports-__atomic_-builtins.patch b/0001-Fix-check-whether-GCC-supports-__atomic_-builtins.patch new file mode 100644 index 0000000..2d1043b --- /dev/null +++ b/0001-Fix-check-whether-GCC-supports-__atomic_-builtins.patch @@ -0,0 +1,60 @@ +From ce3897ffd6e7c8b8f36b8e920168bac8c7f836ae Mon Sep 17 00:00:00 2001 +From: Ilias Tsitsimpis +Date: Tue, 18 Sep 2018 17:45:17 +0200 +Subject: [PATCH] Fix check whether GCC supports __atomic_ builtins + +Summary: +C11 atomics are never used because: + +* The program used for checking whether GCC supports +__atomic_ builtins fails with the following error: + +``` + error: size mismatch in argument 2 of `__atomic_load` + int test(int *x) { int y; __atomic_load(&x, &y, __ATOMIC_SEQ_CST); return x; } +``` + +* There is a typo when checking if CONF_GCC_SUPPORTS__ATOMICS equals YES, +resulting in PRIM_CFLAGS and PRIM_EXTRA_LIBRARIES never being set. + +Reviewers: bgamari + +Reviewed By: bgamari + +Subscribers: rwbarton, erikd, carter + +Differential Revision: https://phabricator.haskell.org/D5154 +--- + libraries/ghc-prim/aclocal.m4 | 2 +- + libraries/ghc-prim/configure.ac | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libraries/ghc-prim/aclocal.m4 b/libraries/ghc-prim/aclocal.m4 +index e5695385f2..81fc44c500 100644 +--- a/libraries/ghc-prim/aclocal.m4 ++++ b/libraries/ghc-prim/aclocal.m4 +@@ -5,7 +5,7 @@ AC_DEFUN([FP_GCC_SUPPORTS__ATOMICS], + [ + AC_REQUIRE([AC_PROG_CC]) + AC_MSG_CHECKING([whether GCC supports __atomic_ builtins]) +- echo 'int test(int *x) { int y; __atomic_load(&x, &y, __ATOMIC_SEQ_CST); return x; }' > conftest.c ++ echo 'int test(int *x) { int y; __atomic_load(x, &y, __ATOMIC_SEQ_CST); return y; }' > conftest.c + if $CC -c conftest.c > /dev/null 2>&1; then + CONF_GCC_SUPPORTS__ATOMICS=YES + AC_MSG_RESULT([yes]) +diff --git a/libraries/ghc-prim/configure.ac b/libraries/ghc-prim/configure.ac +index bacc89ccc8..8249be31a9 100644 +--- a/libraries/ghc-prim/configure.ac ++++ b/libraries/ghc-prim/configure.ac +@@ -8,7 +8,7 @@ dnl unregisterised, Sparc, and PPC backends. + FP_GCC_SUPPORTS__ATOMICS + AC_DEFINE([HAVE_C11_ATOMICS], [$CONF_GCC_SUPPORTS__ATOMICS], [Does GCC support __atomic primitives?]) + +-if test "x$CONF_GCC_SUPPORTS__ATOMICS" = YES ++if test "$CONF_GCC_SUPPORTS__ATOMICS" = "YES" + then PRIM_CFLAGS=-DHAVE_C11_ATOMICS + PRIM_EXTRA_LIBRARIES=atomic + fi +-- +2.13.7 + diff --git a/D5212.patch b/D5212.patch new file mode 100644 index 0000000..6272b02 --- /dev/null +++ b/D5212.patch @@ -0,0 +1,23 @@ +Index: ghc-8.6.1/libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc +=================================================================== +--- ghc-8.6.1.orig/libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc ++++ ghc-8.6.1/libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc +@@ -58,7 +58,7 @@ pokeItbl a0 itbl = do + #endif + (#poke StgInfoTable, layout.payload.ptrs) a0 (ptrs itbl) + (#poke StgInfoTable, layout.payload.nptrs) a0 (nptrs itbl) +- (#poke StgInfoTable, type) a0 (fromEnum (tipe itbl)) ++ (#poke StgInfoTable, type) a0 (toHalfWord (fromEnum (tipe itbl))) + #if __GLASGOW_HASKELL__ > 804 + (#poke StgInfoTable, srt) a0 (srtlen itbl) + #else +@@ -71,6 +71,9 @@ pokeItbl a0 itbl = do + Just (Left xs) -> pokeArray code_offset xs + Just (Right xs) -> pokeArray code_offset xs + #endif ++ where ++ toHalfWord :: Int -> HalfWord ++ toHalfWord i = fromIntegral i + + -- | Size in bytes of a standard InfoTable + itblSize :: Int diff --git a/_constraints b/_constraints index a1d81ee..2b5c1aa 100644 --- a/_constraints +++ b/_constraints @@ -9,13 +9,13 @@ - s390x aarch64 + s390x - + 10 - + @@ -23,9 +23,9 @@ riscv64 - - 17 - + + 20 + diff --git a/buildpath-abi-stability.patch b/buildpath-abi-stability.patch index 3e64079..d516980 100644 --- a/buildpath-abi-stability.patch +++ b/buildpath-abi-stability.patch @@ -1,8 +1,8 @@ -Index: ghc-8.8.1/compiler/iface/MkIface.hs +Index: ghc-8.10.0.20191210/compiler/iface/MkIface.hs =================================================================== ---- ghc-8.8.1.orig/compiler/iface/MkIface.hs -+++ ghc-8.8.1/compiler/iface/MkIface.hs -@@ -713,7 +713,7 @@ addFingerprints hsc_env mb_old_fingerpri +--- ghc-8.10.0.20191210.orig/compiler/iface/MkIface.hs ++++ ghc-8.10.0.20191210/compiler/iface/MkIface.hs +@@ -679,7 +679,7 @@ addFingerprints hsc_env iface0 iface_hash <- computeFingerprint putNameLiterally (mod_hash, ann_fn (mkVarOcc "module"), -- See mkIfaceAnnCache @@ -11,9 +11,9 @@ Index: ghc-8.8.1/compiler/iface/MkIface.hs sorted_deps, mi_hpc iface0) -@@ -748,6 +748,9 @@ addFingerprints hsc_env mb_old_fingerpri +@@ -714,6 +714,9 @@ addFingerprints hsc_env iface0 + (non_orph_rules, orph_rules) = mkOrphMap ifRuleOrph (mi_rules iface0) (non_orph_fis, orph_fis) = mkOrphMap ifFamInstOrph (mi_fam_insts iface0) - fix_fn = mi_fix_fn iface0 ann_fn = mkIfaceAnnCache (mi_anns iface0) + -- Do not allow filenames to affect the interface + usages = [ case u of UsageFile _ fp -> UsageFile "" fp; _ -> u | u <- mi_usages iface0 ] diff --git a/fix-build-using-unregisterized-v8.4.patch b/fix-build-using-unregisterized-v8.4.patch new file mode 100644 index 0000000..1cc9604 --- /dev/null +++ b/fix-build-using-unregisterized-v8.4.patch @@ -0,0 +1,58 @@ +Description: Allow unregisterised ghc-8.4 to build newer GHC + Commit 4075656e8bb introduced a regression stopping existing unregisteristed + compilers from being able to compile newer versions of GHC. The problem is + that the bootstrap compiler uses the newer `rts/storage/ClosureTypes.h` file + where some defines have been renamed, resulting in the following error: +. + error: ‘stg_MUT_ARR_PTRS_FROZEN0_info’ undeclared (first use in this function); did you mean ‘stg_MUT_ARR_PTRS_FROZEN_DIRTY_info’? +. + For more information, see https://gitlab.haskell.org/ghc/ghc/issues/15913. +. + This patch can be removed, once ghc-8.4 is no longer the bootstrap compiler. +Author: Ilias Tsitsimpis +Bug: https://gitlab.haskell.org/ghc/ghc/issues/15913 +Bug-Debian: https://bugs.debian.org/932941 + +Index: b/includes/rts/storage/ClosureTypes.h +=================================================================== +--- a/includes/rts/storage/ClosureTypes.h ++++ b/includes/rts/storage/ClosureTypes.h +@@ -82,5 +82,11 @@ + #define SMALL_MUT_ARR_PTRS_DIRTY 60 + #define SMALL_MUT_ARR_PTRS_FROZEN_DIRTY 61 + #define SMALL_MUT_ARR_PTRS_FROZEN_CLEAN 62 ++#if __GLASGOW_HASKELL__ < 806 ++#define SMALL_MUT_ARR_PTRS_FROZEN0 SMALL_MUT_ARR_PTRS_FROZEN_DIRTY ++#define SMALL_MUT_ARR_PTRS_FROZEN SMALL_MUT_ARR_PTRS_FROZEN_CLEAN ++#define MUT_ARR_PTRS_FROZEN0 MUT_ARR_PTRS_FROZEN_DIRTY ++#define MUT_ARR_PTRS_FROZEN MUT_ARR_PTRS_FROZEN_CLEAN ++#endif + #define COMPACT_NFDATA 63 + #define N_CLOSURE_TYPES 64 +Index: b/includes/stg/MiscClosures.h +=================================================================== +--- a/includes/stg/MiscClosures.h ++++ b/includes/stg/MiscClosures.h +@@ -116,12 +116,22 @@ RTS_ENTRY(stg_ARR_WORDS); + RTS_ENTRY(stg_MUT_ARR_WORDS); + RTS_ENTRY(stg_MUT_ARR_PTRS_CLEAN); + RTS_ENTRY(stg_MUT_ARR_PTRS_DIRTY); ++#if __GLASGOW_HASKELL__ < 806 ++RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN); ++RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN0); ++#else + RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN_CLEAN); + RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN_DIRTY); ++#endif + RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_CLEAN); + RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_DIRTY); ++#if __GLASGOW_HASKELL__ < 806 ++RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN); ++RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN0); ++#else + RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN_CLEAN); + RTS_ENTRY(stg_SMALL_MUT_ARR_PTRS_FROZEN_DIRTY); ++#endif + RTS_ENTRY(stg_MUT_VAR_CLEAN); + RTS_ENTRY(stg_MUT_VAR_DIRTY); + RTS_ENTRY(stg_END_TSO_QUEUE); diff --git a/fix-unregisterised-v8.4-8.6.patch b/fix-unregisterised-v8.4-8.6.patch index c9978f5..1d81893 100644 --- a/fix-unregisterised-v8.4-8.6.patch +++ b/fix-unregisterised-v8.4-8.6.patch @@ -1,8 +1,8 @@ -Index: ghc-8.8.2/includes/stg/MiscClosures.h +Index: ghc-8.10.0.20200123/includes/stg/MiscClosures.h =================================================================== ---- ghc-8.8.2.orig/includes/stg/MiscClosures.h -+++ ghc-8.8.2/includes/stg/MiscClosures.h -@@ -390,8 +390,12 @@ RTS_FUN_DECL(stg_copySmallMutableArrayzh +--- ghc-8.10.0.20200123.orig/includes/stg/MiscClosures.h ++++ ghc-8.10.0.20200123/includes/stg/MiscClosures.h +@@ -401,8 +401,12 @@ RTS_FUN_DECL(stg_copySmallMutableArrayzh RTS_FUN_DECL(stg_casSmallArrayzh); RTS_FUN_DECL(stg_newMutVarzh); diff --git a/ghc-8.0.2-Cabal-dynlibdir.patch b/ghc-8.0.2-Cabal-dynlibdir.patch index 1f1cce6..ae7cc51 100644 --- a/ghc-8.0.2-Cabal-dynlibdir.patch +++ b/ghc-8.0.2-Cabal-dynlibdir.patch @@ -1,8 +1,8 @@ -Index: ghc-8.8.1/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs +Index: ghc-8.10.0.20200123/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs =================================================================== ---- ghc-8.8.1.orig/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs -+++ ghc-8.8.1/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs -@@ -205,7 +205,7 @@ defaultInstallDirs' False comp userInsta +--- ghc-8.10.0.20200123.orig/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs ++++ ghc-8.10.0.20200123/libraries/Cabal/Cabal/Distribution/Simple/InstallDirs.hs +@@ -207,7 +207,7 @@ defaultInstallDirs' False comp userInsta _other -> "$abi" "$libname", dynlibdir = "$libdir" case comp of UHC -> "$pkgid" diff --git a/ghc-8.10.1-src.tar.xz b/ghc-8.10.1-src.tar.xz new file mode 100644 index 0000000..5513743 --- /dev/null +++ b/ghc-8.10.1-src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e3b07f83a266b3198310f19f71e371ebce97c769b14f0d688f4cbf2a2a1edf5 +size 19781652 diff --git a/ghc-8.10.1-src.tar.xz.sig b/ghc-8.10.1-src.tar.xz.sig new file mode 100644 index 0000000000000000000000000000000000000000000000000000000000000000..9402a28a2a49ff953af7280cae7035caec9e69573baa5841069482b4e16c6cc4 GIT binary patch literal 586 zcmV-Q0=4~#0!IV@0SEvw79j-x>wM@Q7NcuEE$weD;7v}K+hnZ;0$zEP>JuDdWo|%s zWo&FMba`-PWG-WGZ2$@h5G~+MPM6zct=z&7{x%mYzf=0^?*GNn8i<6A4F*RTVfcYK z7*2FiRTwEili{|@jZI+AN6vdDOMoZN^8~x(xns>OZU;_M3W5*3CYTPqFC4>dPF7Q) z_6J;ZSg?V>KqB(|(a&T)?=I2brLk=+2`bh0!1sUknm^Atk)wFs!glo&dPH=#n5?!^ zTETCB+O8%r0*9LLbvByqzHe@Y@$zZb- zP+Y>Nc83QB)2!YR#+5HE_>XdOhW=j!k?&ysZ3+q>eY>wQ4HnhZYv#_@Ld%DwH=5O(K15&|mHG@IpI?bYuPy61b+Mnm$_&B& zcFeF1i%ngh1oc#rs5yp-$5f}AZ z3Vb9AoKO}Oa+!mqe>*IsN^-1E@dJAkD)kOY$xBMfl;dpLH3mA;Xsnw)VXfT_ zWt`wDl%#D-H%MG-zSlN($l1Dgnvfafog$X1xQmtjso}eG+o>tfw1}C2P=dho8!jbl Ys3cl5M_}d6aWAK literal 0 HcmV?d00001 diff --git a/ghc-8.8.3-src.tar.xz b/ghc-8.8.3-src.tar.xz deleted file mode 100644 index 45a39e8..0000000 --- a/ghc-8.8.3-src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e0dcc0aaf3e234c5978f29e6df62947e97720ab404ec0158343df211c5480f89 -size 19343672 diff --git a/ghc-8.8.3-src.tar.xz.sig b/ghc-8.8.3-src.tar.xz.sig deleted file mode 100644 index 3c3d8df5bb8b4b6bee5a93e662f0f0d84f33eb966f268f521b9558322a6aead0..0000000000000000000000000000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 586 zcmV-Q0=4~#0!IV@0SEvw79j-x>wM@Q7NcuEE$weD;7v}K+hnZ;0$x;QR}&m!Wo|%s zWo&FMba`-PWG-WGZ2$@h5G~+MPM6zctrV#b{xCT*&U0@bK0}Os+I-OTcbtbC2#?Bi zk{752Cg}iY)<*zFczWW1h@{qjkol_&`8v>z5+7Cm1B$lhN?1E&Mh4q4*%_EKEZWM2 z@Df*u|D&LCyoIhp%PQF^)J~GK9IDp7>c-Dh8<8bpAM15=N zAu#jt;9oHQ*qDb3*fEpWW`YbRu@dEcP{$Mwg!8>pP0@HdjcHMe^O#yX?!>mQSz%)V zDiVVPE??$%EX}imVf61)aaA>{U2lfZ0PU1Rj*XK|z8KrW>`Ocw~qHF?& zE)&Wh+4T`Jpb;A^guTpCX0BJtT?n_#2@k+S14g2o4{q5LIqp~ALbWtljx`HD-Z5jG z*nFM>hfFowh*p#OGz3UXgEIxSt)f4v=|^Gr(Ns$zWpm);`>YV$tfTnorsQi5O!T|D Ya-H5S5BqzW>S)W7fIH)dgf|+)T@HL0&j0`b diff --git a/ghc-pie.patch b/ghc-pie.patch index d077cec..b316f70 100644 --- a/ghc-pie.patch +++ b/ghc-pie.patch @@ -1,8 +1,8 @@ -Index: ghc-8.8.1/compiler/main/DynFlags.hs +Index: ghc-8.10.0.20200123/compiler/main/DynFlags.hs =================================================================== ---- ghc-8.8.1.orig/compiler/main/DynFlags.hs -+++ ghc-8.8.1/compiler/main/DynFlags.hs -@@ -4511,6 +4511,7 @@ default_PIC :: Platform -> [GeneralFlag] +--- ghc-8.10.0.20200123.orig/compiler/main/DynFlags.hs ++++ ghc-8.10.0.20200123/compiler/main/DynFlags.hs +@@ -4624,6 +4624,7 @@ default_PIC :: Platform -> [GeneralFlag] default_PIC platform = case (platformOS platform, platformArch platform) of (OSDarwin, ArchX86_64) -> [Opt_PIC] diff --git a/ghc.changes b/ghc.changes index 60b393f..cae26db 100644 --- a/ghc.changes +++ b/ghc.changes @@ -21,7 +21,7 @@ Wed Feb 5 11:16:13 UTC 2020 - Andreas Schwab Thu Jan 23 09:41:53 UTC 2020 - Peter Trommler - use ghc-bootstrap-helpers on all archs -- lower build env requirements on riscv64 +- lower build env requirements on riscv64 * make sure we can build on smaller systems * adjust parallelism so we don't hog big workers for almost a week * many thanks to Stefan Bruens for pointing out the issue and @@ -64,27 +64,27 @@ Thu Jan 16 17:56:27 UTC 2020 - Ondřej Súkup Tue Dec 31 18:17:24 UTC 2019 - Peter Trommler - add fix-unregisterised-v8.4-8.6.patch -* fix build on s390x and riscv64 +* fix build on s390x and riscv64 ------------------------------------------------------------------- Mon Dec 30 12:08:41 UTC 2019 - Peter Trommler - refresh buildpath-abi-stability.patch - refresh ghc-8.0.2-Cabal-dynlibdir.patch -- refresh ghc-pie.patch +- refresh ghc-pie.patch - enable riscv64 ------------------------------------------------------------------- Sun Dec 29 13:10:39 UTC 2019 - Ondřej Súkup -- use prebuilt alex and happy on Tumbleweed to avoid buildcycle +- use prebuilt alex and happy on Tumbleweed to avoid buildcycle - Don't require llvm in ghc-compiler for other architectures than arm ------------------------------------------------------------------- Sat Dec 28 22:38:34 UTC 2019 - Ondřej Súkup - update to 8.8.1 -new stable release -- refresh Disable-unboxed-arrays.patch +- refresh Disable-unboxed-arrays.patch - drop allow-riscv-and-riscv64-CPU.patch - merged in upstream ------------------------------------------------------------------- @@ -92,7 +92,7 @@ Mon Sep 23 10:07:24 UTC 2019 - Peter Trommler - add fix-build-using-unregisterized-v8.4.patch * fixes unregisterised builds when bootstrap compiler is GHC 8.4 - * fixes build on s390x + * fixes build on s390x ------------------------------------------------------------------- Mon Sep 23 09:28:37 UTC 2019 - Andreas Schwab @@ -116,7 +116,7 @@ Wed Mar 13 14:35:13 UTC 2019 - Ondřej Súkup ------------------------------------------------------------------- Tue Mar 12 09:20:14 UTC 2019 - Ondřej Súkup -- bump llvm req to llvm6 +- bump llvm req to llvm6 ------------------------------------------------------------------- Wed Mar 6 08:49:44 UTC 2019 - Ondřej Súkup diff --git a/ghc.spec b/ghc.spec index 9f757e1..0b49e02 100644 --- a/ghc.spec +++ b/ghc.spec @@ -1,7 +1,7 @@ # # spec file for package ghc # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -27,13 +27,14 @@ %endif %global unregisterised_archs s390 s390x riscv64 +%define full_version 8.10.1 Name: ghc -Version: 8.8.3 +Version: 8.10.1 Release: 0 URL: https://www.haskell.org/ghc/ -Source: https://downloads.haskell.org/~ghc/8.8.3/ghc-%{version}-src.tar.xz -Source1: https://downloads.haskell.org/~ghc/8.8.3/ghc-%{version}-src.tar.xz.sig +Source: https://downloads.haskell.org/~ghc/%{full_version}/ghc-%{version}-src.tar.xz +Source1: https://downloads.haskell.org/~ghc/%{full_version}/ghc-%{version}-src.tar.xz.sig Source2: ghc-rpmlintrc Summary: The Glorious Glasgow Haskell Compiler License: BSD-3-Clause @@ -43,8 +44,7 @@ ExclusiveArch: aarch64 %{arm} %{ix86} x86_64 ppc64 ppc64le riscv64 s390x #!BuildIgnore: gcc-PIE BuildRequires: binutils-devel BuildRequires: gcc -BuildRequires: ghc-bootstrap >= 8.4 -BuildRequires: ghc-bootstrap-helpers +BuildRequires: ghc-bootstrap >= 8.6 BuildRequires: ghc-rpm-macros-extra BuildRequires: glibc-devel BuildRequires: gmp-devel @@ -69,11 +69,11 @@ BuildRequires: binutils-gold %endif %ifarch aarch64 %{arm} %{ix86} x86_64 %if 0%{?suse_version} >= 1550 -BuildRequires: llvm7 -Requires: llvm7 +BuildRequires: llvm9-devel +BuildRequires: clang9 %else -BuildRequires: llvm -Requires: llvm +BuildRequires: llvm-devel +BuildRequires: clang %endif %endif %if %{undefined without_manual} @@ -84,14 +84,30 @@ BuildRequires: python3-Sphinx BuildRequires: libnuma-devel %endif +# for patch 1 +# BuildRequires: python3 + +# bogus requires +%ifarch x86_64 +BuildRequires: ghc-bootstrap-helpers +%else +BuildRequires: alex +BuildRequires: happy +%endif + PreReq: update-alternatives Requires: ghc-compiler = %{version}-%{release} Requires: ghc-ghc-devel = %{version}-%{release} Requires: ghc-libraries = %{version}-%{release} - +# PATCH-FIX-UPSTREAM 0001-Fix-check-whether-GCC-supports-__atomic_-builtins.patch ptrommler@icloud.com -- Fix __atomic_builtin detection. Patch taken from upstream commit ce3897ff. +Patch1: 0001-Fix-check-whether-GCC-supports-__atomic_-builtins.patch +# PATCH-FIX-UPSTREAM D5212.patch ptrommler@icloud.com -- Fix GHCi on big endiansystems. Submitted for upstream review. +Patch2: D5212.patch # PATCH-FIX-UPSTREAM Disable-unboxed-arrays.patch ptrommler@icloud.com -- Do not use unboxed arrays on big-endian platforms. See Haskell Trac #15411. Patch3: Disable-unboxed-arrays.patch -# PATCH-FIX-UPSTREAM fix-unregisterised-v8.4-8.6.patch ptrommler@icloud.com -- Fix/workaround an issue with unregisterised builds bootstrapped with GHC 8.4 and 8.6. Similar to upstream ticket #15913. +# PATCH-FIX-UPSTREAM fix-build-using-unregisterized-v8.4.patch +Patch5: fix-build-using-unregisterized-v8.4.patch +# PATCH-FIX-UPSTREAM fix-unregisterised-v8.4-8.6.patch Patch6: fix-unregisterised-v8.4-8.6.patch # PATCH-FIX-UPSTREAM ghc-pie.patch - set linux as default PIE platform Patch35: ghc-pie.patch @@ -129,16 +145,20 @@ Requires: binutils-gold %endif %ifarch aarch64 %{arm} %if 0%{?suse_version} >= 1550 -Requires: llvm7 +Requires: clang9 +Requires: llvm9 %else Requires: llvm +Requires: clang %endif %endif %ifarch x86_64 %{ix86} %if 0%{?suse_version} >= 1550 -Suggests: llvm7 +Suggests: clang9 +Suggests: llvm9 %else Suggests: llvm +Suggests: clang %endif %endif @@ -159,14 +179,15 @@ To install all of GHC install package ghc. %endif %if %{defined ghclibdir} -%ghc_lib_subpackage -d Cabal-3.0.1.0 +%ghc_lib_subpackage -d Cabal-3.2.0.0 %ghc_lib_subpackage -d array-0.5.4.0 -%ghc_lib_subpackage -d -c gmp-devel,libffi-devel,libdw-devel,libelf-devel%{libnuma_dep} base-4.13.0.0 -%ghc_lib_subpackage -d binary-0.8.7.0 +%ghc_lib_subpackage -d -c gmp-devel,libffi-devel,libdw-devel,libelf-devel%{libnuma_dep} base-4.14.0.0 +%ghc_lib_subpackage -d binary-0.8.8.0 %ghc_lib_subpackage -d bytestring-0.10.10.0 %ghc_lib_subpackage -d containers-0.6.2.1 %ghc_lib_subpackage -d deepseq-1.4.4.0 %ghc_lib_subpackage -d directory-1.3.6.0 +%ghc_lib_subpackage -d exceptions-0.10.4 %ghc_lib_subpackage -d filepath-1.4.2.1 %ghc_lib_subpackage -d -x ghc-%{ghc_version_override} %ghc_lib_subpackage -d ghc-boot-%{ghc_version_override} @@ -174,19 +195,20 @@ To install all of GHC install package ghc. %ghc_lib_subpackage -d ghc-compact-0.1.0.0 %ghc_lib_subpackage -d ghc-heap-%{ghc_version_override} %ghc_lib_subpackage -d -x ghci-%{ghc_version_override} -%ghc_lib_subpackage -d haskeline-0.7.5.0 -%ghc_lib_subpackage -d hpc-0.6.0.3 +%ghc_lib_subpackage -d haskeline-0.8.0.0 +%ghc_lib_subpackage -d hpc-0.6.1.0 %ghc_lib_subpackage -d libiserv-%{ghc_version_override} %ghc_lib_subpackage -d mtl-2.2.2 %ghc_lib_subpackage -d parsec-3.1.14.0 %ghc_lib_subpackage -d pretty-1.1.3.6 -%ghc_lib_subpackage -d process-1.6.8.0 +%ghc_lib_subpackage -d process-1.6.8.2 %ghc_lib_subpackage -d stm-2.5.0.0 -%ghc_lib_subpackage -d template-haskell-2.15.0.0 +%ghc_lib_subpackage -d template-haskell-2.16.0.0 %ghc_lib_subpackage -d -c ncurses-devel terminfo-0.4.1.4 -%ghc_lib_subpackage -d text-1.2.4.0 +%ghc_lib_subpackage -d text-1.2.3.2 %ghc_lib_subpackage -d time-1.9.3 %ghc_lib_subpackage -d transformers-0.5.6.2 +# 2.8.0.0 %ghc_lib_subpackage -d unix-2.7.2.2 %ghc_lib_subpackage -d xhtml-3000.2.2.1 %endif @@ -209,15 +231,21 @@ except the ghc library, which is installed by the toplevel ghc metapackage. %prep %setup -q +#%%patch1 -p1 +#%%patch2 -p1 %ifarch ppc64 s390 s390x %patch3 -p1 %endif +%patch5 -p1 %patch6 -p1 %patch35 -p1 %patch100 -p1 %patch110 -p1 %build +# patch 1 modifies build system, we need to recreate configure +# ./boot + cat > mk/build.mk <> ghc-base.files %ghc_gen_filelists ghc %{ghc_version_override} %ghc_gen_filelists ghci %{ghc_version_override} -%ghc_gen_filelists ghc-prim 0.5.3 -%ghc_gen_filelists integer-gmp 1.0.2.0 +%ghc_gen_filelists ghc-prim 0.6.1 +%ghc_gen_filelists integer-gmp 1.0.3.0 %define merge_filelist()\ cat ghc-%1.files >> ghc-%2.files\ @@ -390,7 +418,6 @@ fi %files compiler %license LICENSE -%doc ANNOUNCE %{_bindir}/ghc %{_bindir}/ghc-%{version} %{_bindir}/ghc-pkg @@ -418,9 +445,6 @@ fi %{ghclibdir}/bin/hp2ps %{ghclibdir}/bin/hpc %{ghclibdir}/bin/hsc2hs -%ifnarch %{unregisterised_archs} -%{ghclibdir}/bin/ghc-split -%endif %{ghclibdir}/ghc-usage.txt %{ghclibdir}/ghci-usage.txt %dir %{ghclibdir}/package.conf.d @@ -449,8 +473,7 @@ fi %{ghcdocbasedir}/users_guide %endif %{ghcdocbasedir}/libraries/gen_contents_index -%{ghcdocbasedir}/libraries/linuwial.css -%{ghcdocbasedir}/libraries/quick-jump.css +%{ghcdocbasedir}/libraries/*.css %{ghcdocbasedir}/libraries/prologue.txt %{ghcdocbasedir}/libraries/synopsis.png %{ghcdocbasedir}/index.html From 5de888befb7cf0c5655654caa658421b2656f966b821f486b5799d3d70e3e5f4 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Thu, 7 May 2020 08:45:51 +0000 Subject: [PATCH 2/3] osc copypac from project:devel:languages:haskell:ghc-8.10.x package:ghc revision:22, using keep-link OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc?expand=0&rev=333 --- ghc.changes | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ghc.changes b/ghc.changes index cae26db..9c930c7 100644 --- a/ghc.changes +++ b/ghc.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Thu May 7 07:44:47 UTC 2020 - Peter Simons + +- Update ghc to version 8.10.1. Important changes are: + + * The UnliftedNewtypes extension, allowing newtypes to be wrap + types of kind other than Type. + + * The StandaloneKindSignatures extension, allowing explicit + signatures on type constructors. + + * A new, low-latency garbage collector for the oldest generation. + + Please refer to the compiler documentation for all details: + https://downloads.haskell.org/~ghc/8.10.1/docs/html/users_guide/8.10.1-notes.html + ------------------------------------------------------------------- Thu Feb 27 08:47:53 UTC 2020 - Ondřej Súkup From 964c0cca4a98ca1b49651a5c09d97b369a26b4dbce61d233589a2cd48ba6e16b Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Thu, 7 May 2020 09:04:26 +0000 Subject: [PATCH 3/3] osc copypac from project:devel:languages:haskell:ghc-8.10.x package:ghc revision:23, using keep-link OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc?expand=0&rev=334 --- ...ther-GCC-supports-__atomic_-builtins.patch | 60 ------------------- D5212.patch | 23 ------- ghc.spec | 4 -- 3 files changed, 87 deletions(-) delete mode 100644 0001-Fix-check-whether-GCC-supports-__atomic_-builtins.patch delete mode 100644 D5212.patch diff --git a/0001-Fix-check-whether-GCC-supports-__atomic_-builtins.patch b/0001-Fix-check-whether-GCC-supports-__atomic_-builtins.patch deleted file mode 100644 index 2d1043b..0000000 --- a/0001-Fix-check-whether-GCC-supports-__atomic_-builtins.patch +++ /dev/null @@ -1,60 +0,0 @@ -From ce3897ffd6e7c8b8f36b8e920168bac8c7f836ae Mon Sep 17 00:00:00 2001 -From: Ilias Tsitsimpis -Date: Tue, 18 Sep 2018 17:45:17 +0200 -Subject: [PATCH] Fix check whether GCC supports __atomic_ builtins - -Summary: -C11 atomics are never used because: - -* The program used for checking whether GCC supports -__atomic_ builtins fails with the following error: - -``` - error: size mismatch in argument 2 of `__atomic_load` - int test(int *x) { int y; __atomic_load(&x, &y, __ATOMIC_SEQ_CST); return x; } -``` - -* There is a typo when checking if CONF_GCC_SUPPORTS__ATOMICS equals YES, -resulting in PRIM_CFLAGS and PRIM_EXTRA_LIBRARIES never being set. - -Reviewers: bgamari - -Reviewed By: bgamari - -Subscribers: rwbarton, erikd, carter - -Differential Revision: https://phabricator.haskell.org/D5154 ---- - libraries/ghc-prim/aclocal.m4 | 2 +- - libraries/ghc-prim/configure.ac | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libraries/ghc-prim/aclocal.m4 b/libraries/ghc-prim/aclocal.m4 -index e5695385f2..81fc44c500 100644 ---- a/libraries/ghc-prim/aclocal.m4 -+++ b/libraries/ghc-prim/aclocal.m4 -@@ -5,7 +5,7 @@ AC_DEFUN([FP_GCC_SUPPORTS__ATOMICS], - [ - AC_REQUIRE([AC_PROG_CC]) - AC_MSG_CHECKING([whether GCC supports __atomic_ builtins]) -- echo 'int test(int *x) { int y; __atomic_load(&x, &y, __ATOMIC_SEQ_CST); return x; }' > conftest.c -+ echo 'int test(int *x) { int y; __atomic_load(x, &y, __ATOMIC_SEQ_CST); return y; }' > conftest.c - if $CC -c conftest.c > /dev/null 2>&1; then - CONF_GCC_SUPPORTS__ATOMICS=YES - AC_MSG_RESULT([yes]) -diff --git a/libraries/ghc-prim/configure.ac b/libraries/ghc-prim/configure.ac -index bacc89ccc8..8249be31a9 100644 ---- a/libraries/ghc-prim/configure.ac -+++ b/libraries/ghc-prim/configure.ac -@@ -8,7 +8,7 @@ dnl unregisterised, Sparc, and PPC backends. - FP_GCC_SUPPORTS__ATOMICS - AC_DEFINE([HAVE_C11_ATOMICS], [$CONF_GCC_SUPPORTS__ATOMICS], [Does GCC support __atomic primitives?]) - --if test "x$CONF_GCC_SUPPORTS__ATOMICS" = YES -+if test "$CONF_GCC_SUPPORTS__ATOMICS" = "YES" - then PRIM_CFLAGS=-DHAVE_C11_ATOMICS - PRIM_EXTRA_LIBRARIES=atomic - fi --- -2.13.7 - diff --git a/D5212.patch b/D5212.patch deleted file mode 100644 index 6272b02..0000000 --- a/D5212.patch +++ /dev/null @@ -1,23 +0,0 @@ -Index: ghc-8.6.1/libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc -=================================================================== ---- ghc-8.6.1.orig/libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc -+++ ghc-8.6.1/libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc -@@ -58,7 +58,7 @@ pokeItbl a0 itbl = do - #endif - (#poke StgInfoTable, layout.payload.ptrs) a0 (ptrs itbl) - (#poke StgInfoTable, layout.payload.nptrs) a0 (nptrs itbl) -- (#poke StgInfoTable, type) a0 (fromEnum (tipe itbl)) -+ (#poke StgInfoTable, type) a0 (toHalfWord (fromEnum (tipe itbl))) - #if __GLASGOW_HASKELL__ > 804 - (#poke StgInfoTable, srt) a0 (srtlen itbl) - #else -@@ -71,6 +71,9 @@ pokeItbl a0 itbl = do - Just (Left xs) -> pokeArray code_offset xs - Just (Right xs) -> pokeArray code_offset xs - #endif -+ where -+ toHalfWord :: Int -> HalfWord -+ toHalfWord i = fromIntegral i - - -- | Size in bytes of a standard InfoTable - itblSize :: Int diff --git a/ghc.spec b/ghc.spec index 0b49e02..0362522 100644 --- a/ghc.spec +++ b/ghc.spec @@ -99,10 +99,6 @@ PreReq: update-alternatives Requires: ghc-compiler = %{version}-%{release} Requires: ghc-ghc-devel = %{version}-%{release} Requires: ghc-libraries = %{version}-%{release} -# PATCH-FIX-UPSTREAM 0001-Fix-check-whether-GCC-supports-__atomic_-builtins.patch ptrommler@icloud.com -- Fix __atomic_builtin detection. Patch taken from upstream commit ce3897ff. -Patch1: 0001-Fix-check-whether-GCC-supports-__atomic_-builtins.patch -# PATCH-FIX-UPSTREAM D5212.patch ptrommler@icloud.com -- Fix GHCi on big endiansystems. Submitted for upstream review. -Patch2: D5212.patch # PATCH-FIX-UPSTREAM Disable-unboxed-arrays.patch ptrommler@icloud.com -- Do not use unboxed arrays on big-endian platforms. See Haskell Trac #15411. Patch3: Disable-unboxed-arrays.patch # PATCH-FIX-UPSTREAM fix-build-using-unregisterized-v8.4.patch