[Git][haskell-team/DHG_packages][experimental] ghc: add upstream support for risc architecture
Gianfranco Costamagna
gitlab at salsa.debian.org
Thu Jul 19 18:32:30 BST 2018
Gianfranco Costamagna pushed to branch experimental at Debian Haskell Group / DHG_packages
Commits:
2b885c0d by Gianfranco Costamagna at 2018-07-19T19:29:47+02:00
ghc: add upstream support for risc architecture
- - - - -
4 changed files:
- p/ghc/debian/changelog
- + p/ghc/debian/patches/e175aaf6918bb2b497b83618dc4c270a0d231a1c.patch
- + p/ghc/debian/patches/risc-support.patch
- p/ghc/debian/patches/series
Changes:
=====================================
p/ghc/debian/changelog
=====================================
--- a/p/ghc/debian/changelog
+++ b/p/ghc/debian/changelog
@@ -1,3 +1,16 @@
+ghc (8.4.3-4) experimental; urgency=medium
+
+ * merge with unstable 8.2.2-6
+
+ -- Gianfranco Costamagna <locutusofborg at debian.org> Thu, 19 Jul 2018 18:15:59 +0200
+
+ghc (8.2.2-6) unstable; urgency=medium
+
+ * debian/patches/{risc-support,e175aaf6918bb2b497b83618dc4c270a0d231a1c}.patch
+ - add upstream patches to support risc* platforms (Closes: #904096)
+
+ -- Gianfranco Costamagna <locutusofborg at debian.org> Thu, 19 Jul 2018 19:24:01 +0200
+
ghc (8.4.3-3) experimental; urgency=medium
* Switch configure.ac to search for llvm 6.0
=====================================
p/ghc/debian/patches/e175aaf6918bb2b497b83618dc4c270a0d231a1c.patch
=====================================
--- /dev/null
+++ b/p/ghc/debian/patches/e175aaf6918bb2b497b83618dc4c270a0d231a1c.patch
@@ -0,0 +1,63 @@
+From: Sergei Trofimovich <slyfox at gentoo.org>
+Date: Wed, 18 Jul 2018 22:36:58 +0000 (+0100)
+Subject: fix osReserveHeapMemory block alignment
+X-Git-Url: https://git.haskell.org/ghc.git/commitdiff_plain/e175aaf6918bb2b497b83618dc4c270a0d231a1c
+
+fix osReserveHeapMemory block alignment
+
+Before the change osReserveHeapMemory() attempted
+to allocate chunks of memory via osTryReserveHeapMemory()
+not multiple of MBLOCK_SIZE in the following fallback code:
+
+```
+ if (at == NULL) {
+ *len -= *len / 8;
+```
+
+and caused assertion failure:
+
+```
+$ make fulltest TEST=T11607 WAY=threaded1
+T11607: internal error: ASSERTION FAILED: file rts/posix/OSMem.c, line 457
+ (GHC version 8.7.20180716 for riscv64_unknown_linux)
+
+```
+
+The change applies alignment mask before each MBLOCK allocation attempt
+and fixes WAY=threaded1 test failures on qemu-riscv64.
+
+Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>
+
+Test Plan: run 'make fulltest WAY=threaded1'
+
+Reviewers: simonmar, bgamari, erikd
+
+Reviewed By: simonmar
+
+Subscribers: rwbarton, thomie, carter
+
+Differential Revision: https://phabricator.haskell.org/D4982
+---
+
+Index: ghc-8.4.3/rts/posix/OSMem.c
+===================================================================
+--- ghc-8.4.3.orig/rts/posix/OSMem.c
++++ ghc-8.4.3/rts/posix/OSMem.c
+@@ -435,6 +435,8 @@
+ void *base, *top;
+ void *start, *end;
+
++ ASSERT((len & ~MBLOCK_MASK) == len);
++
+ /* We try to allocate len + MBLOCK_SIZE,
+ because we need memory which is MBLOCK_SIZE aligned,
+ and then we discard what we don't need */
+@@ -502,6 +504,8 @@
+
+ attempt = 0;
+ while (1) {
++ *len &= ~MBLOCK_MASK;
++
+ if (*len < MBLOCK_SIZE) {
+ // Give up if the system won't even give us 16 blocks worth of heap
+ barf("osReserveHeapMemory: Failed to allocate heap storage");
=====================================
p/ghc/debian/patches/risc-support.patch
=====================================
--- /dev/null
+++ b/p/ghc/debian/patches/risc-support.patch
@@ -0,0 +1,29 @@
+Description: cherry-pick of upstream commits
+ beba89a0f16681c85d39fc8a894bde4162ff492a.patch:
+ 5e63a25249f3cb07300258e115af9ff55079d2ea.patch:
+Last-Update: 2018-07-19
+
+--- ghc-8.4.3.orig/aclocal.m4
++++ ghc-8.4.3/aclocal.m4
+@@ -217,7 +217,7 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_V
+ mipsel)
+ test -z "[$]2" || eval "[$]2=ArchMipsel"
+ ;;
+- hppa|hppa1_1|ia64|m68k|rs6000|s390|s390x|sh4|vax)
++ hppa|hppa1_1|ia64|m68k|riscv32|riscv64|rs6000|s390|s390x|sh4|vax)
+ test -z "[$]2" || eval "[$]2=ArchUnknown"
+ ;;
+ *)
+@@ -1884,6 +1884,12 @@ case "$1" in
+ powerpc*)
+ $2="powerpc"
+ ;;
++ riscv64*)
++ $2="riscv64"
++ ;;
++ riscv|riscv32*)
++ $2="riscv32"
++ ;;
+ rs6000)
+ $2="rs6000"
+ ;;
=====================================
p/ghc/debian/patches/series
=====================================
--- a/p/ghc/debian/patches/series
+++ b/p/ghc/debian/patches/series
@@ -8,3 +8,5 @@ use-stage1-binaries-for-install.patch
llvm-targets-Add-versioned-ARM-targets.patch
bsymbolic-only-for-registerised.patch
use-llvm-6.0.patch
+e175aaf6918bb2b497b83618dc4c270a0d231a1c.patch
+risc-support.patch
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/commit/2b885c0d58fdba6bb6aa21dc250d07fa47b1d271
--
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/commit/2b885c0d58fdba6bb6aa21dc250d07fa47b1d271
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-commits/attachments/20180719/fc84e08a/attachment-0001.html>
More information about the Pkg-haskell-commits
mailing list