[DHG_packages] 01/01: Add patch from John Paul Adrian Glaubitz to fix x32 port (Closes: #814657)
Gianfranco Costamagna
locutusofborg at moszumanska.debian.org
Sun Nov 6 22:35:05 UTC 2016
This is an automated email from the git hooks/post-receive script.
locutusofborg pushed a commit to branch master
in repository DHG_packages.
commit ded176741899181993ef8a74c62504aaf51350d0
Author: Gianfranco Costamagna <costamagnagianfranco at yahoo.it>
Date: Sun Nov 6 23:33:41 2016 +0100
Add patch from John Paul Adrian Glaubitz to fix x32 port (Closes: #814657)
---
p/ghc/debian/changelog | 10 +++++++++
p/ghc/debian/patches/series | 1 +
.../patches/x32-use-native-x86_64-insn.patch | 25 ++++++++++++++++++++++
p/ghc/debian/rules | 7 ++++++
p/ghc/debian/{rules => rules.orig} | 0
5 files changed, 43 insertions(+)
diff --git a/p/ghc/debian/changelog b/p/ghc/debian/changelog
index 3ee4766..f7a8e29 100644
--- a/p/ghc/debian/changelog
+++ b/p/ghc/debian/changelog
@@ -1,3 +1,13 @@
+ghc (8.0.1-11) unstable; urgency=medium
+
+ * Team upload.
+
+ [ John Paul Adrian Glaubitz ]
+ * Add patch x32-use-native-x86_64-insn.patch to support
+ x32 architecture (Closes: #814657)
+
+ -- Gianfranco Costamagna <locutusofborg at debian.org> Sun, 06 Nov 2016 23:31:09 +0100
+
ghc (8.0.1-10) unstable; urgency=medium
[ Emilio Pozuelo Monfort ]
diff --git a/p/ghc/debian/patches/series b/p/ghc/debian/patches/series
index d7dedf7..59f3847 100644
--- a/p/ghc/debian/patches/series
+++ b/p/ghc/debian/patches/series
@@ -11,3 +11,4 @@ no-pie
find-tycon-panic
compiler-cmm-PprC-sparc-alignment.patch
get-linker-flags-correctly
+x32-use-native-x86_64-insn.patch
diff --git a/p/ghc/debian/patches/x32-use-native-x86_64-insn.patch b/p/ghc/debian/patches/x32-use-native-x86_64-insn.patch
new file mode 100644
index 0000000..0abe8d6
--- /dev/null
+++ b/p/ghc/debian/patches/x32-use-native-x86_64-insn.patch
@@ -0,0 +1,25 @@
+Description: Use native x86_64 instructions on x32
+ This patch enables a few native 64-bit integer instructions
+ on x32 which are available on this architecture despite using
+ 32-bit pointers. These instructions are present on x86_64 but
+ not on x86 and ghc checks the size of (void *) to determine
+ that. This method fails on x32 since despite using 32-bit
+ pointers and hence sizeof(void *) == 4, it still uses the
+ full x86_64 instruction set and software-emulated variants
+ of the aforementioned 64-bit integer instructions are
+ therefore not present in the toolchain which will make ghc
+ fail to build on x32.
+ See: https://ghc.haskell.org/trac/ghc/ticket/11571
+ .
+
+--- ghc-8.0.1.orig/rts/RtsSymbols.c
++++ ghc-8.0.1/rts/RtsSymbols.c
+@@ -737,7 +737,7 @@
+
+
+ // 64-bit support functions in libgcc.a
+-#if defined(__GNUC__) && SIZEOF_VOID_P <= 4 && !defined(_ABIN32)
++#if defined(__GNUC__) && SIZEOF_VOID_P <= 4 && !defined(_ABIN32) && !(defined(__x86_64__) && defined(__ILP32__))
+ #define RTS_LIBGCC_SYMBOLS \
+ SymI_NeedsProto(__divdi3) \
+ SymI_NeedsProto(__udivdi3) \
diff --git a/p/ghc/debian/rules b/p/ghc/debian/rules
index ed6786a..b5ddfb8 100755
--- a/p/ghc/debian/rules
+++ b/p/ghc/debian/rules
@@ -38,6 +38,10 @@ EXTRA_CONFIGURE_FLAGS=--with-ghc="$(GHC)"
BUILD_HADDOCK_DOCS=YES
DEB_HOOGLE_TXT_DIR = /usr/lib/ghc-doc/hoogle/
+ifeq (x32,$(DEB_HOST_ARCH))
+ EXTRA_CONFIGURE_FLAGS += --enable-unregisterised
+endif
+
%:
dh $@ --parallel --with autotools-dev
@@ -59,6 +63,9 @@ endif
ifneq (,$(findstring $(DEB_HOST_ARCH), mips mipsel))
echo "SRC_HC_OPTS += -optc--param -optcggc-min-expand=10" >> mk/build.mk
endif
+ifeq (x32,$(DEB_HOST_ARCH))
+ echo "INTEGER_LIBRARY = integer-simple" >> mk/build.mk
+endif
ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
# echo "GhcStage1HcOpts += -DDEBUG" >> mk/build.mk
# echo "GhcStage2HcOpts += -DDEBUG" >> mk/build.mk
diff --git a/p/ghc/debian/rules b/p/ghc/debian/rules.orig
similarity index 100%
copy from p/ghc/debian/rules
copy to p/ghc/debian/rules.orig
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/DHG_packages.git
More information about the Pkg-haskell-commits
mailing list