[PATCH] D53968: [LLD]fix windows mingw build with 'LLVM_LINK_LLVM_DYLIB' the lld will hang when exiting

Peiyuan Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 1 16:41:24 PDT 2018


SquallATF added a comment.

This bug only in shared dll, static build does not trigger this bug  Here is a issue <https://github.com/civetweb/civetweb/issues/264> with another project here that is very similar to this one.
I create a small test code to reproduce the bug. I have tried use clang, MSVC and gcc,I post MSVC build command  here.
F7485180: cpptest.zip <https://reviews.llvm.org/F7485180>
bug build,  test program will hang when exiting.

  cl /EHsc /LD cppdll.cpp /Fecppdllcl.dll
  cl cppexe.cpp /Fecppexecl.exe /link cppdllcl.lib

static build does not have this bug

  cl /EHsc cppexe.cpp cppdll.cpp -DSTATIC /Fecppdllcls.exe

fix use `std::weak_ptr`, but  `std::weak_ptr` is not a real singleton.

  cl /EHsc /LD cppdll.cpp -DFIX /Fecppdllclfix.dll
  cl cppexe.cpp /Fecppexeclfix.exe -DFIX /link cppdllclfix.lib


Repository:
  rL LLVM

https://reviews.llvm.org/D53968





More information about the llvm-commits mailing list