public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/110572] New: ld.lld: error: duplicate symbol: std::type_info::operator==(std::type_info const&) const
@ 2023-07-06 11:07 arndtthomas at gmx dot de
  2023-07-06 11:34 ` [Bug libstdc++/110572] " redi at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: arndtthomas at gmx dot de @ 2023-07-06 11:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110572

            Bug ID: 110572
           Summary: ld.lld: error: duplicate symbol:
                    std::type_info::operator==(std::type_info const&)
                    const
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: arndtthomas at gmx dot de
  Target Milestone: ---

Created attachment 55489
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55489&action=edit
example to reproduce the error

I've filed the issue since it's a problem with libstdc++/tinfo.o.
It seems there is a missing inline if macro __GXX_TYPEINFO_EQUALITY_INLINE is
unset or set to 1.

It happens if clang is used under mingw-w64 in combination with the libstdc++
(msys2 default).
Since gcc defines the macro explicitly (built-in) to
_GXX_TYPEINFO_EQUALITY_INLINE=0 (see gcc/config/i386/cygming.h).
Clang doesn't define this macro at all, so it gets defined within typeinfo
while compiling user code. Thus there are one operator== defined within tinfo.o
and another within the user archive.

During linking the following error pops up:

ld.lld: error: duplicate symbol: std::type_info::operator==(std::type_info
const&) const
>>> defined at ../../../../libstdc++-v3/libsupc++/tinfo.cc:38
>>>            libstdc++.a(tinfo.o)
>>> defined at libclang_lld_error.a(comp_unit.o)
clang++: error: linker command failed with exit code 1 (use -v to see
invocation)

Here is the full example to reproduce:
https://github.com/msys2/MINGW-packages/issues/17730

I fully agree, it's a issue which is more related to mingw-w64 and clang but
the root cause is unfortunately the libstdc++.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-06-20  9:13 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-06 11:07 [Bug libstdc++/110572] New: ld.lld: error: duplicate symbol: std::type_info::operator==(std::type_info const&) const arndtthomas at gmx dot de
2023-07-06 11:34 ` [Bug libstdc++/110572] " redi at gcc dot gnu.org
2023-07-06 13:11 ` redi at gcc dot gnu.org
2023-07-06 13:14 ` redi at gcc dot gnu.org
2023-07-10  8:14 ` arndtthomas at gmx dot de
2023-09-01 21:30 ` peter0x44 at disroot dot org
2024-05-31 13:23 ` redi at gcc dot gnu.org
2024-05-31 13:44 ` redi at gcc dot gnu.org
2024-05-31 14:14 ` peter0x44 at disroot dot org
2024-05-31 14:17 ` redi at gcc dot gnu.org
2024-05-31 14:18 ` redi at gcc dot gnu.org
2024-05-31 14:29 ` redi at gcc dot gnu.org
2024-06-03 11:49 ` martin at martin dot st
2024-06-14 14:54 ` cvs-commit at gcc dot gnu.org
2024-06-14 16:10 ` martin at martin dot st
2024-06-14 16:33 ` redi at gcc dot gnu.org
2024-06-20  9:13 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).