winlibs_mingw icon indicating copy to clipboard operation
winlibs_mingw copied to clipboard

<typeinfo> has an issue with clang when -static-libstdc++

Open denchat opened this issue 3 years ago • 2 comments

issue: operator== symbol get duplicated on linking phase when compile with -static-libstdc++ on clang target x86_64-w64-windows-gnu

workaround: by conditioning __clang__ with always inline attribute as seen in

Issues when building with clang (duplicate libstdc++.a symbols) https://github.com/msys2/MINGW-packages/issues/1677#issuecomment-242980310

denchat avatar Oct 14 '20 18:10 denchat

Do you mean errors like this: C:\mingw64\lib\libstdc++.a(bad_alloc.o): duplicate section `.rdata$_ZTSSt9exception[_ZTSSt9exception]' has different size
I get this when trying to build third-party software. Anything I can do?

Keithcat1 avatar Jul 12 '21 18:07 Keithcat1

I have the same problem. Hundreds of "sections of different size" and occasionally multiple definitions of operator == for type_info.

ld: C:/msys64/mingw64/lib\libstdc++.a(tinfo.o):(.text$_ZNKSt9type_infoeqERKS_+0x0): multiple definition of `std::type_info::operator==(std::type_info const&) const'; CMakeFiles/dm2.dir/src/script/script_f_map.cpp.obj:C://msys64/mingw64/include/c++/12.2.0/typeinfo:194: first defined here

fwsGonzo avatar Aug 24 '22 13:08 fwsGonzo