X-Git-Url: https://git.tld-linux.org/?p=packages%2Fghc.git;a=blobdiff_plain;f=x32-use-native-x86_64-insn.patch;fp=x32-use-native-x86_64-insn.patch;h=f329f93937d0ebd1aa0fbfb247f8785db6b7168d;hp=0000000000000000000000000000000000000000;hb=9429bba41e65f6da4bac83ad70c061ef939f57e4;hpb=e16e56b007134db40e0590ba2306285cce8cb3cf diff --git a/x32-use-native-x86_64-insn.patch b/x32-use-native-x86_64-insn.patch new file mode 100644 index 0000000..f329f93 --- /dev/null +++ b/x32-use-native-x86_64-insn.patch @@ -0,0 +1,27 @@ +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 + . + +Index: ghc-8.8.1+dfsg1/rts/RtsSymbols.c +=================================================================== +--- ghc-8.8.1+dfsg1.orig/rts/RtsSymbols.c ++++ ghc-8.8.1+dfsg1/rts/RtsSymbols.c +@@ -939,7 +939,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) \