In-tree GMP broken on x86-64
Summary
GHC fails to build with in-tree GMP on x86-64 (link issue)
Steps to reproduce
> make distclean && ./boot && ./configure --with-intree-gmp && make -j
[...]
ld.lld: error: can't create dynamic relocation R_X86_64_64 against symbol: __gmp_binvert_limb_table in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in libraries/integer-gmp/gmp/objs/mp_minv_tab.o
>>> referenced by libraries/integer-gmp/gmp/objs/bdiv_q_1.o:(__gmpn_bdiv_q_1)
ld.lld: error: can't create dynamic relocation R_X86_64_64 against symbol: __gmp_binvert_limb_table in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in libraries/integer-gmp/gmp/objs/mp_minv_tab.o
>>> referenced by libraries/integer-gmp/gmp/objs/dive_1.o:(__gmpn_divexact_1)
ld.lld: error: can't create dynamic relocation R_X86_64_64 against local symbol in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in libraries/integer-gmp/gmp/objs/gcd_1.o
>>> referenced by libraries/integer-gmp/gmp/objs/gcd_1.o:(__gmpn_gcd_1)
ld.lld: error: can't create dynamic relocation R_X86_64_64 against symbol: __gmpn_invert_limb_table in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in libraries/integer-gmp/gmp/objs/invert_limb_table.o
>>> referenced by libraries/integer-gmp/gmp/objs/invert_limb.o:(__gmpn_invert_limb)
ld.lld: error: can't create dynamic relocation R_X86_64_64 against symbol: __gmp_binvert_limb_table in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in libraries/integer-gmp/gmp/objs/mp_minv_tab.o
>>> referenced by libraries/integer-gmp/gmp/objs/mode1o.o:(__gmpn_modexact_1_odd)
collect2: erreur: ld a retourné le statut de sortie 1
`cc' failed in phase `Linker'. (Exit code: 1)
make[1]: *** [libraries/integer-gmp/ghc.mk:4: libraries/integer-gmp/dist-install/build/libHSinteger-gmp-1.0.2.0-ghc8.11.0.20200205.so] Error 1
make[1]: *** Attente des tâches non terminées....
make: *** [Makefile:128: all] Error 2
Related: #4366 (closed) #8156 (closed) and #4022 (closed).
Environment
- GHC version used: HEAD
- Operating System: ArchLinux
- System Architecture: x86-64