Open maveric2 opened 1 year ago
I'm dealing with this problem for years, the fix was planned for 12.4 but is still unfixed, could somebody ping that issue at GCC bugzilla. I can't as registrations are closed and I don't have an account there.
Is weird that there is one definition that prevents strict -static
linking and is unfixed still. 🙃
There is already discussion going on here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110572 see: "N.B. this can be reproduced without clang, just by using -std=c++20 -static-libstdc++"
Thx for the link, I currently fixed it by defining the __GXX_TYPEINFO_EQUALITY_INLINE macro manually and it works.
This is fixed on libstdc++ trunk and clang trunk.
Already fixed, will be released in Clang 19.
Description / Steps to reproduce the issue
comp_unit.h
There may be a better vehicle to reproduce, but we reduced a real world example to this minimum.
comp_unit.cpp
main.cpp
Now compile and link
Expected behavior
compile and link successfully ;-)
Actual behavior
Issue Clang doesn't define the macro __GXX_TYPEINFO_EQUALITY_INLINE which is evaluated within typeinfo AND set it if not set before to __GXX_TYPEINFO_EQUALITY_INLINE=1:
GCC defines the macro (built-in) __GXX_TYPEINFO_EQUALITY_INLINE=0 (for mingw only - see gcc/config/i386/cygming.h). Thus the tinfo.o already contains the operator. Now compiling and link the user code the same operator in invoked again, since the __GXX_TYPEINFO_EQUALITY_INLINE switch picks it again from the typeinfo header.
hackaround
possible solution
Verification
Windows Version
MINGW64_NT-10.0-19042
MINGW environments affected
Are you willing to submit a PR?
No response