LLVM build fails with undefined symbol memcmp
Summary
Since commit 7fdcce6d building via the LLVM code generator results in:
Error when running Shake build system:
at action, called at src/Rules.hs:40:19 in main:Rules
at need, called at src/Rules.hs:62:5 in main:Rules
* Depends on: _build/stage1/lib/package.conf.d/ghci-9.1.0.20201013.conf
at apply1, called at src/Development/Shake/Internal/Rules/Oracle.hs:159:32 in shake-0.19.1-f81fccbd02f40c56646f2f87dedae8d9e8153bda2d7c73afd3608764a02fd99a:Development.Shake.Internal.Rules.Oracle
* Depends on: OracleQ (ContextDataKey (Context {stage = Stage1, package = Package {pkgType = Library, pkgName = "ghci", pkgPath = "libraries/ghci"}, way = v}))
at need, called at src/Hadrian/Oracles/Cabal/Rules.hs:54:9 in main:Hadrian.Oracles.Cabal.Rules
* Depends on: _build/stage1/libraries/ghci/setup-config
at need, called at src/Rules/Library.hs:157:18 in main:Rules.Library
* Depends on: _build/stage1/libraries/ghc-boot/build/libHSghc-boot-9.1.0.20201013.a
at need, called at src/Rules/Library.hs:152:5 in main:Rules.Library
* Depends on: _build/stage1/libraries/ghc-boot/build/GHC/Unit/Database.o
at &%>, called at src/Rules/Compile.hs:77:9 in main:Rules.Compile
* Depends on: _build/stage1/libraries/ghc-boot/build/GHC/Unit/Database.o _build/stage1/libraries/ghc-boot/build/GHC/Unit/Database.hi
at cmd', called at src/Builder.hs:293:23 in main:Builder
at cmd, called at src/Builder.hs:389:8 in main:Builder
* Raised the exception:
Development.Shake.cmd, system command failed
Command line: _build/stage0/bin/ghc -Wall -dynamic-too -hisuf hi -osuf o -hcsuf hc -static -hide-all-packages -no-user-package-db '-package-db _build/stage1/lib/package.conf.d' '-this-unit-id ghc-boot-9.1.0.20201013' '-package-id base-4.15.0.0' '-package-id binary-0.8.7.0' '-package-id bytestring-0.10.12.0' '-package-id containers-0.6.4.1' '-package-id deepseq-1.4.4.0' '-package-id directory-1.3.6.1' '-package-id filepath-1.4.2.1' '-package-id ghc-boot-th-9.1.0.20201013' -i -i/devel/ghc/ghc-master/_build/stage1/libraries/ghc-boot/build -i/devel/ghc/ghc-master/_build/stage1/libraries/ghc-boot/build/autogen -i/devel/ghc/ghc-master/libraries/ghc-boot -Iincludes -I_build/stage1/lib -I_build/stage1/libraries/ghc-boot/build -I/devel/ghc/ghc-master/_build/stage1/lib/x86_64-linux-ghc-9.1.0.20201013/unix-2.7.2.2/include -I/devel/ghc/ghc-master/_build/stage1/lib/x86_64-linux-ghc-9.1.0.20201013/time-1.9.3/include -I/devel/ghc/ghc-master/_build/stage1/lib/x86_64-linux-ghc-9.1.0.20201013/bytestring-0.10.12.0/include -I/devel/ghc/ghc-master/_build/stage1/lib/x86_64-linux-ghc-9.1.0.20201013/base-4.15.0.0/include -I/devel/ghc/ghc-master/_build/stage1/lib/x86_64-linux-ghc-9.1.0.20201013/ghc-bignum-1.0/include -I/devel/ghc/ghc-master/_build/stage1/lib/x86_64-linux-ghc-9.1.0.20201013/rts-1.0/include -I_build/stage1/lib -optc-I_build/stage1/lib -optP-include -optP_build/stage1/libraries/ghc-boot/build/autogen/cabal_macros.h -outputdir _build/stage1/libraries/ghc-boot/build -Wnoncanonical-monad-instances -optc-Wno-error=inline -optP-Wno-nonportable-include-path -c libraries/ghc-boot/GHC/Unit/Database.hs -o _build/stage1/libraries/ghc-boot/build/GHC/Unit/Database.o -O0 -H64m -XHaskell2010 -XNoImplicitPrelude -no-global-package-db -package-db=/devel/ghc/ghc-master/_build/stage1/lib/package.conf.d -ghcversion-file=/devel/ghc/ghc-master/_build/stage1/lib/ghcversion.h -O -Wno-deprecated-flags -fllvm
Exit code: 1
Stderr and Stdout:
/nix/store/khqyxflp8wbq038wdyv5sr8sjsfwlr72-llvm-9.0.1/bin/opt: /run/user/1000/ghc373616_0/ghc_3.ll:2130:41: error: use of undefined value '@memcmp$def'
%lne3X = bitcast i32 (i8*, i8*, i64)* @memcmp$def to i64 (i8*, i8*, i64)*
^
`opt' failed in phase `LLVM Optimiser'. (Exit code: 1)
Environment
- GHC version used: 7fdcce6d
Optional:
- Operating System: Fedora 32
- System Architecture: x86-64