Blame SOURCES/ghc-Debian-x32-use-native-x86_64-insn.patch

a43873
Description: Use native x86_64 instructions on x32
a43873
 This patch enables a few native 64-bit integer instructions
a43873
 on x32 which are available on this architecture despite using
a43873
 32-bit pointers. These instructions are present on x86_64 but
a43873
 not on x86 and ghc checks the size of (void *) to determine
a43873
 that. This method fails on x32 since despite using 32-bit
a43873
 pointers and hence sizeof(void *) == 4, it still uses the
a43873
 full x86_64 instruction set and software-emulated variants
a43873
 of the aforementioned 64-bit integer instructions are
a43873
 therefore not present in the toolchain which will make ghc
a43873
 fail to build on x32.
a43873
 See: https://ghc.haskell.org/trac/ghc/ticket/11571
a43873
 .
a43873
a43873
Index: ghc-8.0.2/rts/RtsSymbols.c
a43873
===================================================================
a43873
--- ghc-8.0.2.orig/rts/RtsSymbols.c
a43873
+++ ghc-8.0.2/rts/RtsSymbols.c
a43873
@@ -857,7 +857,7 @@
a43873
 
a43873
 
a43873
 // 64-bit support functions in libgcc.a
a43873
-#if defined(__GNUC__) && SIZEOF_VOID_P <= 4 && !defined(_ABIN32)
a43873
+#if defined(__GNUC__) && SIZEOF_VOID_P <= 4 && !defined(_ABIN32) && !(defined(__x86_64__) && defined(__ILP32__))
a43873
 #define RTS_LIBGCC_SYMBOLS                             \
a43873
       SymI_NeedsProto(__divdi3)                        \
a43873
       SymI_NeedsProto(__udivdi3)                       \