rui314 / mold

Mold: A Modern Linker 🦠
MIT License
14.44k stars 473 forks source link

VTT and discarded COMDAT error #1311

Open diehard2 opened 4 months ago

diehard2 commented 4 months ago

Hi, I'm getting an error for

[build] mold: error: /mydirectory/libflat_combine.a(flat_combine.cpp.o):(.debug_loc): VTT for mynamespace::concurrent::FlatCombineFinishedException refers to a discarded COMDAT section probably due to an ODR violation

I'm not seeing this if I link with ld, gold, or lld. I can't seem to figure out how to make a small reproducer. There is nothing unusual about the code that I can see and VTT isn't finding any hits in this repository.

I don't know if it would make the difference, but the library is compiled with gcc and the executable is compiled with clang. If both are compiled with gcc it works as expected. I'm seeing this with both the latest mold and version 2.4. Any help is appreciated.

rui314 commented 4 months ago

Can you share your /mydirectory/libflat_combine.a with me?

diehard2 commented 4 months ago

thanks for the response @rui314. Do you have somewhere I can send it?

rui314 commented 4 months ago

You can zip that file and upload to this github issue as an attachment.