After a recent pull of LLVM/Clang trunk, my clang-cl build of LibreOffice on Windows started to fail to link some DLL because of __destructor_1 and __destructor_8 symbols defined in multiple objects.
I haven't been able yet to strip that down, and looking at the objects' assembler output it isn't clear to me what those symbols are emitted for.
Do those symbols maybe ring a bell for anybody? Is that some recent addition?
Looks like Akira added a bunch of stuff for this in r326307. It is supposed to relate to ARC and __strong, __weak, etc. It’s pretty complex.
That code does not appear to work for non-MachO. It creates LLVM IR functions directly without going through the usual CGM codepaths, so it doesn’t add a comdat.
Looks like Akira added a bunch of stuff for this in r326307. It is supposed to relate to ARC and __strong, __weak, etc. It’s pretty complex.
That code does not appear to work for non-MachO. It creates LLVM IR functions directly without going through the usual CGM codepaths, so it doesn’t add a comdat.
I would not have expected this patch to affect the compilation of ordinary C++ code.
r326307 and r327870 made changes that allow declaring ObjC __strong and __weak fields in C structs, so they shouldn’t have any effect if you are compiling your code in C++ mode. Is it possible to come up with a small C++ test case that causes clang to emit the destructor functions you are seeing?
Filed <https://bugs.llvm.org/show_bug.cgi?id=37146> "clang-cl emits special functions for non-trivial C-structs ('__destructor_8') introduced for Objective-C" now, with reproducer.