[cfe-dev] Multiple-defined __destructor_1, __destructor_8 when building with recent clang-cl

Akira Hatanaka via cfe-dev cfe-dev at lists.llvm.org
Wed Apr 4 14:32:49 PDT 2018


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?

On Wed, Apr 4, 2018 at 12:16 PM, John McCall <rjmccall at apple.com> wrote:

> On Apr 4, 2018, at 3:07 PM, Reid Kleckner via cfe-dev <
> cfe-dev at lists.llvm.org> wrote:
>
> 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.
>
> John.
>
>
> On Wed, Apr 4, 2018 at 1:32 AM Stephan Bergmann via cfe-dev <
> cfe-dev at lists.llvm.org> wrote:
>
>> 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?
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180404/64bc9877/attachment.html>


More information about the cfe-dev mailing list