Hadrian-produced bindist uses lld by default
When trying to document the recent work on head.hackage
I found that the bindist from the deb9-hadrian
job is broken on Debian 9 if LLVM is not installed. Specifically linking failed with
Error (figuring out linker information): user error (invalid --version output, or linker is unsupported)
<no location info>: error:
Warning: Couldn't figure out linker information!
Make sure you're using GNU ld, GNU gold or the built in OS X linker, etc.
*** Linker:
cc '-fuse-ld=lld' -o Hello -lm -no-pie -fno-PIC -Wl,--gc-sections Hello.o -L/home/ben/tmp/prefix/lib/ghc-8.9.0.20190705/lib/../lib/x86_64-linux-ghc-8.9.0.20190705/base-4.13.0.0 -L/home/ben/tmp/prefix/lib/ghc-8.9.0.20190705/lib/../lib/x86_64-linux-ghc-8.9.0.20190705/integer-gmp-1.0.2.0 -L/home/ben/tmp/prefix/lib/ghc-8.9.0.20190705/lib/../lib/x86_64-linux-ghc-8.9.0.20190705/ghc-prim-0.6.1 -L/home/ben/tmp/prefix/lib/ghc-8.9.0.20190705/lib/../lib/x86_64-linux-ghc-8.9.0.20190705/rts-1.0 /tmp/ghc8401_0/ghc_2.o /tmp/ghc8401_0/ghc_5.o -Wl,-u,base_GHCziTopHandler_runIO_closure -Wl,-u,base_GHCziTopHandler_runNonIO_closure -Wl,-u,ghczmprim_GHCziTuple_Z0T_closure -Wl,-u,ghczmprim_GHCziTypes_True_closure -Wl,-u,ghczmprim_GHCziTypes_False_closure -Wl,-u,base_GHCziPack_unpackCString_closure -Wl,-u,base_GHCziWeak_runFinalizzerBatch_closure -Wl,-u,base_GHCziIOziException_stackOverflow_closure -Wl,-u,base_GHCziIOziException_heapOverflow_closure -Wl,-u,base_GHCziIOziException_allocationLimitExceeded_closure -Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnMVar_closure -Wl,-u,base_GHCziIOziException_blockedIndefinitelyOnSTM_closure -Wl,-u,base_GHCziIOziException_cannotCompactFunction_closure -Wl,-u,base_GHCziIOziException_cannotCompactPinned_closure -Wl,-u,base_GHCziIOziException_cannotCompactMutable_closure -Wl,-u,base_ControlziExceptionziBase_absentSumFieldError_closure -Wl,-u,base_ControlziExceptionziBase_nonTermination_closure -Wl,-u,base_ControlziExceptionziBase_nestedAtomically_closure -Wl,-u,base_GHCziEventziThread_blockedOnBadFD_closure -Wl,-u,base_GHCziConcziSync_runSparks_closure -Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure -Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure -Wl,-u,base_GHCziConcziSignal_runHandlersPtr_closure -Wl,-u,base_GHCziTopHandler_flushStdHandles_closure -Wl,-u,base_GHCziTopHandler_runMainIO_closure -Wl,-u,ghczmprim_GHCziTypes_Czh_con_info -Wl,-u,ghczmprim_GHCziTypes_Izh_con_info -Wl,-u,ghczmprim_GHCziTypes_Fzh_con_info -Wl,-u,ghczmprim_GHCziTypes_Dzh_con_info -Wl,-u,ghczmprim_GHCziTypes_Wzh_con_info -Wl,-u,base_GHCziPtr_Ptr_con_info -Wl,-u,base_GHCziPtr_FunPtr_con_info -Wl,-u,base_GHCziInt_I8zh_con_info -Wl,-u,base_GHCziInt_I16zh_con_info -Wl,-u,base_GHCziInt_I32zh_con_info -Wl,-u,base_GHCziInt_I64zh_con_info -Wl,-u,base_GHCziWord_W8zh_con_info -Wl,-u,base_GHCziWord_W16zh_con_info -Wl,-u,base_GHCziWord_W32zh_con_info -Wl,-u,base_GHCziWord_W64zh_con_info -Wl,-u,base_GHCziStable_StablePtr_con_info -Wl,-u,hs_atomic_add8 -Wl,-u,hs_atomic_add16 -Wl,-u,hs_atomic_add32 -Wl,-u,hs_atomic_sub8 -Wl,-u,hs_atomic_sub16 -Wl,-u,hs_atomic_sub32 -Wl,-u,hs_atomic_and8 -Wl,-u,hs_atomic_and16 -Wl,-u,hs_atomic_and32 -Wl,-u,hs_atomic_nand8 -Wl,-u,hs_atomic_nand16 -Wl,-u,hs_atomic_nand32 -Wl,-u,hs_atomic_or8 -Wl,-u,hs_atomic_or16 -Wl,-u,hs_atomic_or32 -Wl,-u,hs_atomic_xor8 -Wl,-u,hs_atomic_xor16 -Wl,-u,hs_atomic_xor32 -Wl,-u,hs_cmpxchg8 -Wl,-u,hs_cmpxchg16 -Wl,-u,hs_cmpxchg32 -Wl,-u,hs_atomicread8 -Wl,-u,hs_atomicread16 -Wl,-u,hs_atomicread32 -Wl,-u,hs_atomicwrite8 -Wl,-u,hs_atomicwrite16 -Wl,-u,hs_atomicwrite32 -lHSbase-4.13.0.0 -lHSinteger-gmp-1.0.2.0 -lHSghc-prim-0.6.1 -lHSrts-1.0 -lCffi -lgmp -lm -lrt -ldl -lpthread
collect2: fatal error: cannot find 'ld'
compilation terminated.
*** Deleting temp files:
Deleting: /tmp/ghc8401_0/ghc_1.c /tmp/ghc8401_0/ghc_3.rsp /tmp/ghc8401_0/ghc_4.s /tmp/ghc8401_0/ghc_6.rsp /tmp/ghc8401_0/ghc_7.rsp /tmp/ghc8401_0/ghc_2.o /tmp/ghc8401_0/ghc_5.o
*** Deleting temp dirs:
Deleting: /tmp/ghc8401_0
`cc' failed in phase `Linker'. (Exit code: 1)
Note the -fuse-ld=lld
. It seems that the compiler is insisting on using lld
, despite the fact that it is not installed.