Skip to content

LInking on Windows fails with GHC 9.4.1 (undefined symbol)

I was trying to move hackage-security to 9.4.1 and met a bunch of undefined symbols. Here's an example (the first error and the trailer)

[9 of 9] Linking D:\\a\\hackage-security\\hackage-security\\dist-newstyle\\build\\x86_64-windows\\ghc-9.4.1\\hackage-security-0.6.2.2\\t\\TestSuite\\build\\TestSuite\\TestSuite.exe
ld.lld: error: undefined symbol: hackagezmsecurityzm0zi6zi2zi2zminplace_HackageziSecurityziClient_zdfShowDirectoryEntry_closure
>>> referenced by D:\\a\\hackage-security\\hackage-security\\dist-newstyle\\build\\x86_64-windows\\ghc-9.4.1\\hackage-security-0.6.2.2\\t\\TestSuite\\build\\TestSuite\\TestSuite-tmp\Main.o:(.text)
>>> referenced by D:\\a\\hackage-security\\hackage-security\\dist-newstyle\\build\\x86_64-windows\\ghc-9.4.1\\hackage-security-0.6.2.2\\t\\TestSuite\\build\\TestSuite\\TestSuite-tmp\Main.o:(.text)
>>> referenced by D:\\a\\hackage-security\\hackage-security\\dist-newstyle\\build\\x86_64-windows\\ghc-9.4.1\\hackage-security-0.6.2.2\\t\\TestSuite\\build\\TestSuite\\TestSuite-tmp\Main.o:(.text)
>>> referenced 2 more times

...

ld.lld: error: too many errors emitted, stopping now (use /errorlimit:0 to see all errors)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ghc-9.4.1.exe: `clang.exe' failed in phase `Linker'. (Exit code: 1)
cabal.exe: Failed to build test:TestSuite from hackage-security-0.6.2.2.

Linux and MacOS are fine.

Edited by Artem Pelenitsyn
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information