Hadrian: quickest flavour fails with a linker error
Summary
Stage 2 build fails with a linker error:
| Run Ghc LinkHs Stage1: _build/stage1/ghc/build/c/hschooks.o (and 7 more) => _build/stage1/bin/ghc
ld.lld: error: undefined symbol: ghc_CoreMonad_zdfxMonadCoreM_closure
>>> referenced by Plugins.o:(.text+0x207C) in archive _build/stage1/lib/../lib/x86_64-linux-ghc-8.9.0.20190717/ghc-8.9.0.20190717/li
bHSghc-8.9.0.20190717.a
ld.lld: error: undefined symbol: ghc_CoreMonad_zdfxMonadCoreM_closure
>>> referenced by Plugins.o:(.text+0x20B4) in archive _build/stage1/lib/../lib/x86_64-linux-ghc-8.9.0.20190717/ghc-8.9.0.20190717/li
bHSghc-8.9.0.20190717.a
collect2: error: ld returned 1 exit status
`cc' failed in phase `Linker'. (Exit code: 1)
Error when running Shake build system:
at action, called at src/Rules.hs:68:19 in main:Rules
at need, called at src/Rules.hs:90:5 in main:Rules
* Depends on: _build/stage1/bin/ghc
* Raised the exception:
user error (Development.Shake.cmd, system command failed
Command line: _build/stage0/bin/ghc -Wall -hisuf hi -osuf o -hcsuf hc -static -hide-all-packages -no-user-package-db '-package-db _b
uild/stage1/lib/package.conf.d' '-package-id array-0.5.4.0' '-package-id base-4.13.0.0' '-package-id bytestring-0.10.9.0' '-package-
id containers-0.6.2.1' '-package-id deepseq-1.4.4.0' '-package-id directory-1.3.3.2' '-package-id filepath-1.4.2.1' '-package-id ghc
-8.9.0.20190717' '-package-id ghc-boot-8.9.0.20190717' '-package-id ghc-prim-0.6.1' '-package-id ghci-8.9.0.20190717' '-package-id h
askeline-0.7.5.0' '-package-id process-1.6.5.1' '-package-id time-1.9.3' '-package-id transformers-0.5.6.2' '-package-id unix-2.7.2.
2' -i -i_build/stage1/ghc/build -i_build/stage1/ghc/build/ghc/autogen -ighc/. -Iincludes -I_build/generated -I_build/stage1/ghc/buil
d -I/home/zubin/ghc/_build/stage1/lib/x86_64-linux-ghc-8.9.0.20190717/ghc-8.9.0.20190717/include -I/home/zubin/ghc/_build/stage1/lib
/x86_64-linux-ghc-8.9.0.20190717/process-1.6.5.1/include -I/home/zubin/ghc/_build/stage1/lib/x86_64-linux-ghc-8.9.0.20190717/unix-2.
7.2.2/include -I/home/zubin/ghc/_build/stage1/lib/x86_64-linux-ghc-8.9.0.20190717/time-1.9.3/include -I/home/zubin/ghc/_build/stage1
/lib/x86_64-linux-ghc-8.9.0.20190717/bytestring-0.10.9.0/include -I/home/zubin/ghc/_build/stage1/lib/x86_64-linux-ghc-8.9.0.20190717
/base-4.13.0.0/include -I/home/zubin/ghc/_build/stage1/lib/x86_64-linux-ghc-8.9.0.20190717/integer-gmp-1.0.2.0/include -I/home/zubin
/ghc/_build/stage1/lib/x86_64-linux-ghc-8.9.0.20190717/rts-1.0/include -I_build/generated -optc-I_build/generated -optP-include -opt
P_build/stage1/ghc/build/ghc/autogen/cabal_macros.h -optP-DHAVE_INTERNAL_INTERPRETER -optP-DHAVE_EXTERNAL_INTERPRETER -optP-DHAVE_IN
TERPRETER -outputdir _build/stage1/ghc/build -no-auto-link-packages -no-hs-main -Wnoncanonical-monad-instances -optc-Werror=unused-b
ut-set-variable -optc-Wno-error=inline _build/stage1/ghc/build/c/hschooks.o _build/stage1/ghc/build/Main.o _build/stage1/ghc/build/G
HCi/Leak.o _build/stage1/ghc/build/GHCi/UI.o _build/stage1/ghc/build/GHCi/UI/Info.o _build/stage1/ghc/build/GHCi/UI/Monad.o _build/s
tage1/ghc/build/GHCi/UI/Tags.o _build/stage1/ghc/build/GHCi/Util.o -o _build/stage1/bin/ghc -O0 -H64m -Wall -Wnoncanonical-monad-ins
tances -Wnoncanonical-monoid-instances -fno-warn-name-shadowing -threaded -XHaskell2010 -XNoImplicitPrelude -ghcversion-file=/home/z
ubin/ghc/_build/generated/ghcversion.h -I_build/stage1/compiler/build -Wcpp-undef
Exit code: 1
Stderr:
ld.lld: error: undefined symbol: ghc_CoreMonad_zdfxMonadCoreM_closure
>>> referenced by Plugins.o:(.text+0x207C) in archive _build/stage1/lib/../lib/x86_64-linux-ghc-8.9.0.20190717/ghc-8.9.0.20190717/li
bHSghc-8.9.0.20190717.a
ld.lld: error: undefined symbol: ghc_CoreMonad_zdfxMonadCoreM_closure
>>> referenced by Plugins.o:(.text+0x20B4) in archive _build/stage1/lib/../lib/x86_64-linux-ghc-8.9.0.20190717/ghc-8.9.0.20190717/li
bHSghc-8.9.0.20190717.a
collect2: error: ld returned 1 exit status
`cc' failed in phase `Linker'. (Exit code: 1)
)
Building with the quick
flavour succeeds.
Steps to reproduce
$ rm -rf _build
$ ./boot && ./configure && ./hadrian/build.sh --flavour=quickest
Environment
- Boot GHC version used: 8.6.5
$ uname -a
Linux zubinpc 5.1.15-arch1-1-ARCH #1 SMP PREEMPT Tue Jun 25 04:49:39 UTC 2019 x86_64 GNU/Linux