Repository navigation
Closed
Description
I recently had a build fail for a confusing reason: https://github.com/tfausak/monadoc/runs/7532083433?check_suite_focus=true#step:15:277
Linking D:\\a\\monadoc\\monadoc\\dist-newstyle\\build\\x86_64-windows\\ghc-9.2.3\\monadoc-0.2022.7.27\\x\\monadoc\\opt\\build\\monadoc\\monadoc.exe ...
C://tools//ghc-9.2.3//mingw//bin/ld.exe: d000000.o:(.idata$2+0x0): multiple definition of `_head_libstdc___6_dll'; C://tools//ghc-9.2.3//mingw//bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/libstdc++.dll.a(d000000.o):(.idata$2+0x0): first defined here
C://tools//ghc-9.2.3//mingw//bin/ld.exe: d000001.o:(.idata$5+0x0): multiple definition of `__imp__ZTVN10__cxxabiv117__class_type_infoE'; C://tools//ghc-9.2.3//mingw//bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/libstdc++.dll.a(d006226.o):(.idata$5+0x0): first defined here
C://tools//ghc-9.2.3//mingw//bin/ld.exe: d000001.o:(.idata$6+0x0): multiple definition of `__nm__ZTVN10__cxxabiv117__class_type_infoE'; C://tools//ghc-9.2.3//mingw//bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/libstdc++.dll.a(d006226.o):(.idata$6+0x0): first defined here
C://tools//ghc-9.2.3//mingw//bin/ld.exe: d000002.o:(.idata$5+0x0): multiple definition of `__imp__ZTVN10__cxxabiv120__si_class_type_infoE'; C://tools//ghc-9.2.3//mingw//bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/libstdc++.dll.a(d006231.o):(.idata$5+0x0): first defined here
C://tools//ghc-9.2.3//mingw//bin/ld.exe: d000002.o:(.idata$6+0x0): multiple definition of `__nm__ZTVN10__cxxabiv120__si_class_type_infoE'; C://tools//ghc-9.2.3//mingw//bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/libstdc++.dll.a(d006231.o):(.idata$6+0x0): first defined here
C://tools//ghc-9.2.3//mingw//bin/ld.exe: d000003.o:(.idata$7+0x0): multiple definition of `libstdc___6_dll_iname'; C://tools//ghc-9.2.3//mingw//bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/libstdc++.dll.a(d006587.o):(.idata$7+0x0): first defined here
C://tools//ghc-9.2.3//mingw//bin/ld.exe: d000000.o:(.idata$2+0x0): multiple definition of `_head_libstdc___6_dll'; C://tools//ghc-9.2.3//mingw//bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/libstdc++.dll.a(d000000.o):(.idata$2+0x0): first defined here
C://tools//ghc-9.2.3//mingw//bin/ld.exe: d000001.o:(.idata$5+0x0): multiple definition of `__imp__ZTVN10__cxxabiv117__class_type_infoE'; C://tools//ghc-9.2.3//mingw//bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/libstdc++.dll.a(d006226.o):(.idata$5+0x0): first defined here
C://tools//ghc-9.2.3//mingw//bin/ld.exe: d000001.o:(.idata$6+0x0): multiple definition of `__nm__ZTVN10__cxxabiv117__class_type_infoE'; C://tools//ghc-9.2.3//mingw//bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/libstdc++.dll.a(d006226.o):(.idata$6+0x0): first defined here
C://tools//ghc-9.2.3//mingw//bin/ld.exe: d000002.o:(.idata$5+0x0): multiple definition of `__imp__ZTVN10__cxxabiv120__si_class_type_infoE'; C://tools//ghc-9.2.3//mingw//bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/libstdc++.dll.a(d006231.o):(.idata$5+0x0): first defined here
C://tools//ghc-9.2.3//mingw//bin/ld.exe: d000002.o:(.idata$6+0x0): multiple definition of `__nm__ZTVN10__cxxabiv120__si_class_type_infoE'; C://tools//ghc-9.2.3//mingw//bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/libstdc++.dll.a(d006231.o):(.idata$6+0x0): first defined here
C://tools//ghc-9.2.3//mingw//bin/ld.exe: d000003.o:(.idata$7+0x0): multiple definition of `libstdc___6_dll_iname'; C://tools//ghc-9.2.3//mingw//bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/libstdc++.dll.a(d006587.o):(.idata$7+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
`gcc.exe' failed in phase `Linker'. (Exit code: 1)
collect2.exe: error: ld returned 1 exit status
`gcc.exe' failed in phase `Linker'. (Exit code: 1)
cabal.exe: Failed to build exe:monadoc from monadoc-0.2022.7.27.
Failed to build test:monadoc-test-suite from monadoc-0.2022.7.27.
I'm not certain that this was caused by text-2.0.1. Compared to the last successful build, that's one of the few things that changed. Here's a diff of the freeze file from the last successful build with that failing build:
102c102
< any.http-client ==0.7.11,
---
> any.http-client ==0.7.12,
176c176
< any.text ==2.0,
---
> any.text ==2.0.1,
228c228
< index-state: hackage.haskell.org 2022-07-26T09:56:38Z
---
> index-state: hackage.haskell.org 2022-07-27T01:07:47ZThe changes in http-client-0.7.12 don't seem like they could cause this. However I'd be happy to be proven wrong and pointed elsewhere!
If this is indeed caused by upgrading from text-2.0 to text-2.0.1, then I think it's related to #453.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Bodigrim commentedon Jul 27, 2022
This is likely because of
text, but I cannot reproduce neither locally nor on CI.As a short term solution you can disable
-simdutfflag.Is the solution reproducible with GHC 9.4-rc1? If it does, please forward this issue to GHC developers.
tfausak commentedon Jul 29, 2022
Unfortunately I don't have a Windows machine to test with. But I can confirm that setting
--flags=-simdutffor thetextpackage fixed my problem: https://github.com/tfausak/monadoc/runs/7577924604?check_suite_focus=true#step:10:183Bodigrim commentedon Jul 29, 2022
OK, I managed to reproduce with GHC 9.2.4. The problem is that
monadocdepends both ontextanddouble-conversion. The latter requiresif os(windows) if arch(x86_64) extra-libraries: stdc++-6 gcc_s_seh-1text-2.0requiresstdc++-6as well:text/text.cabal
Lines 93 to 95 in 9075b05
However,
text-2.0.1is more relaxed and does not ask for specific version ofstdc++:text/text.cabal
Lines 93 to 104 in fdb06ff
But under the hood
stdc++andstdc++-6are the same library, so GHC linker gets confused. This technically qualifies as a GHC bug, but a low-priority one, because GHC 9.4 comes with a virtual packagesystem-cxx-std-libto provide a portable solution for packages depending on C++ runtime.double-conversionwould have to adopt tosystem-cxx-std-libanyway, so it can switch fromstdc++-6tostdc++for older GHCs at the same time. CC @Haskell-mouse. In the meantime-simdutfwill do.Bodigrim commentedon Aug 2, 2022
Closing as there is nothing we can fix on
textside, but feel free to forward this bug to GHC devs.tfausak commentedon Aug 3, 2022
Thanks for investigating! I think this issue is already solved by https://gitlab.haskell.org/ghc/ghc/-/merge_requests/8086, so I won't open another issue against GHC.
Fix linking `with` text on windows
Fix linking with `text-2.0.1` on windows