1 Description: Use native x86_64 instructions on x32
2 This patch enables a few native 64-bit integer instructions
3 on x32 which are available on this architecture despite using
4 32-bit pointers. These instructions are present on x86_64 but
5 not on x86 and ghc checks the size of (void *) to determine
6 that. This method fails on x32 since despite using 32-bit
7 pointers and hence sizeof(void *) == 4, it still uses the
8 full x86_64 instruction set and software-emulated variants
9 of the aforementioned 64-bit integer instructions are
10 therefore not present in the toolchain which will make ghc
12 See: https://ghc.haskell.org/trac/ghc/ticket/11571
15 Index: ghc-8.8.1+dfsg1/rts/RtsSymbols.c
16 ===================================================================
17 --- ghc-8.8.1+dfsg1.orig/rts/RtsSymbols.c
18 +++ ghc-8.8.1+dfsg1/rts/RtsSymbols.c
22 // 64-bit support functions in libgcc.a
23 -#if defined(__GNUC__) && SIZEOF_VOID_P <= 4 && !defined(_ABIN32)
24 +#if defined(__GNUC__) && SIZEOF_VOID_P <= 4 && !defined(_ABIN32) && !(defined(__x86_64__) && defined(__ILP32__))
25 #define RTS_LIBGCC_SYMBOLS \
26 SymI_NeedsProto(__divdi3) \
27 SymI_NeedsProto(__udivdi3) \