Your message dated Sun, 06 Nov 2016 22:50:33 +0000
with message-id <e1c3wgn-0009sx...@fasolo.debian.org>
and subject line Bug#814657: fixed in ghc 8.0.1-11
has caused the Debian Bug report #814657,
regarding ghc: Please add initial platform support for x32
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
814657: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=814657
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Source: ghc
Version: 7.10.3-7
Severity: normal
Tags: patch

Hi!

I recently bootstrapped ghc on x32.

To achieve that, the following changes were necessary:

 * patch rts/Linker.c to use native 64-bit integer instructions on x32
 * build the compiler unregisterised even though x86_64 has a NCG
   which needs some work to support x32 though
 * use integer-simple by default on x32 since integer-gmp currently
   has issues on x32 (sizeof(mp_limb_t) != sizeof(void *) is unsupported)

The first patch is more discussed by upstream in detail in [1], since they
were not sure yet whether the simple patch that I am using is safe not to
break anything on other platforms.

Attaching a debdiff with my changes in any case so that a discussion can
be started.

Cheers,
Adrian

> [1] https://ghc.haskell.org/trac/ghc/ticket/11571

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
diff -Nru old/ghc-7.10.3/debian/patches/series new/ghc-7.10.3/debian/patches/series
--- old/ghc-7.10.3/debian/patches/series       2015-12-18 13:25:32.000000000 +0100
+++ new/ghc-7.10.3/debian/patches/series       2016-02-10 19:11:01.378870044 +0100
@@ -7,3 +7,4 @@
 cabal-show-detail-direct.patch
 sh4-platform-detection-support.patch
 sparc64-initial-platform-support.patch
+x32-use-native-x86_64-insn.patch
diff -Nru old/ghc-7.10.3/debian/patches/x32-use-native-x86_64-insn.patch new/ghc-7.10.3/debian/patches/x32-use-native-x86_64-insn.patch
--- old/ghc-7.10.3/debian/patches/x32-use-native-x86_64-insn.patch	 1970-01-01 01:00:00.000000000 +0100
+++ new/ghc-7.10.3/debian/patches/x32-use-native-x86_64-insn.patch	 2016-02-13 19:27:46.250266694 +0100
@@ -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-7.10.3.orig/rts/Linker.c
++++ ghc-7.10.3/rts/Linker.c
+@@ -1432,7 +1432,7 @@ typedef struct _RtsSymbolVal {
+ 
+ 
+ // 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(__ILP32__)
+ #define RTS_LIBGCC_SYMBOLS                             \
+       SymI_NeedsProto(__divdi3)                        \
+       SymI_NeedsProto(__udivdi3)                       \
diff -Nru old/ghc-7.10.3/debian/rules new/ghc-7.10.3/debian/rules
--- old/ghc-7.10.3/debian/rules	      2016-01-05 11:09:35.000000000 +0100
+++ new/ghc-7.10.3/debian/rules	      2016-02-13 19:33:46.001814498 +0100
@@ -43,6 +43,10 @@
 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 $@ --with autotools-dev
 
@@ -64,6 +68,9 @@
   echo "SRC_CC_OPTS += -fno-PIE" >> mk/build.mk
   echo "SRC_LD_OPTS += -no-pie" >> 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

--- End Message ---
--- Begin Message ---
Source: ghc
Source-Version: 8.0.1-11

We believe that the bug you reported is fixed in the latest version of
ghc, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 814...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Gianfranco Costamagna <locutusofb...@debian.org> (supplier of updated ghc 
package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sun, 06 Nov 2016 23:31:09 +0100
Source: ghc
Binary: ghc ghc-prof ghc-doc
Architecture: source
Version: 8.0.1-11
Distribution: unstable
Urgency: medium
Maintainer: Debian Haskell Group 
<pkg-haskell-maintainers@lists.alioth.debian.org>
Changed-By: Gianfranco Costamagna <locutusofb...@debian.org>
Description:
 ghc        - The Glasgow Haskell Compilation system
 ghc-doc    - Documentation for the Glasgow Haskell Compilation system
 ghc-prof   - Profiling libraries for the Glasgow Haskell Compilation system
Closes: 814657
Changes:
 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)
Checksums-Sha1:
 af25cac3cc6aa768c87d47f3a24e7c5d724a1a8c 2336 ghc_8.0.1-11.dsc
 6eccc5cfd3079424dea47723cd283def2b64566f 49836 ghc_8.0.1-11.debian.tar.xz
Checksums-Sha256:
 94d206523da8ea1470fd7b5981b7c70e18791ac7741e79026a14d29b4201fa65 2336 
ghc_8.0.1-11.dsc
 a8e44b9dbdd66217cbe9b7fb804d5ff0cb11f5b2bf9da6d5252e737d8b4050ff 49836 
ghc_8.0.1-11.debian.tar.xz
Files:
 fd53c8b436affb69ab4d06d7695de483 2336 haskell extra ghc_8.0.1-11.dsc
 77a72fadcda37564fae6ed471ff2ea86 49836 haskell extra ghc_8.0.1-11.debian.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJYH6+DAAoJEPNPCXROn13Zz80P/1is9Ux8gj1ZVqAcMS69zJb1
gmzcdIjo+x75KpGVDfQtSFvB6YwDt142S0S+qFE/BywPpP2vCIgMyfr6z/4yPp2g
lPtU7bT2zQWzfNnhXWv87QgYTnHhvOEKHgDlv/DrLYRm3AP3Yh0FlR1sCLIyw9pQ
eIoqdPJUJP8Z88HlKzI8aVRhFeoditOXansJIHfiIBn1OOHmTsQZfyMSHjqLhAZD
OgA6xCqbLjI81CYjJM4e/JLVTyRzHzWMpKtPNEDV/YnGdCgiSJq8oICZR4Y8nW25
Ox/4f9FXHJTvKIVccoKi+K00H2wP/b3PrVKNxbsrtiEQRr7glKq4AJp3KubkiYXY
Oqsqnu2x9nPCqdUVu1gl19vMCgFmkDeic0hgr3uZ2AzlTuH77DUB5sIga9qpV2aS
CJ0vdoA2LaFgDkOBKavtrd85dBKrOBTfe68L/7+veHeSI3v74TMjhbgNODK1oEPL
qHaq75ZYXgBY0Ze2cZwLzKAPApYb86T557K2eHfF53nKNCTIxGCc1P/+OU0o7/M0
zSku0qgdPaDuO2wrYtinWZSbZuvPceklqXV1KGIqkVDERLkSVtU1gaFK1wh54nvO
CJSt1snyncilYAY/VkQOsxjloTLKs8CACc6doOHGNIHBWJ8ekWU+WT+DCfJEXZ2X
S1ZzL1abZcm9KmO9DpKF
=0Mlg
-----END PGP SIGNATURE-----

--- End Message ---
_______________________________________________
Pkg-haskell-maintainers mailing list
Pkg-haskell-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-haskell-maintainers

Reply via email to