Hi,

On Thu, 27 Aug 2020, Michael Hartmann wrote:

I want to use LLVM (clang, clang++) as compiler on Windows in a MinGW environment together with sanitizers (ASAN and UB). I am using the MinGW distribution provided by winlibs.com which is based on MinGW-w64 7.0.0 - release 3 and comes with LLVM 10. Unfortunately, the runtime libraries necessary for ASAN are missing.

For this purpose, I'd recommend my llvm based mingw distribution from https://github.com/mstorsjo/llvm-mingw. (See "Releases" on the right hand side.)

However, I ran into the problem that sometimes (not reproducable) lld just hangs indefinitely. There have been issues with lld and winpthreads which caused deadlocks in the past.

Yes, there's been a few reports of this. I think some of the reported issues might be fixed in the very latest version of winpthreads in the git versions of mingw-w64 - I don't know for sure if all the fixes are in the mingw-w64 7.0.0 release as you're using or not.

My builds of lld are built on top of libc++ instead of libstdc++, and libc++ doesn't use winpthreads for its threading on windows, so this issue should not be present in lld in my distribution at all.

Or maybe someone knows how to get sanitizers working using GNU ld.

The sanitizers rely on a number of exotic linker features, including some added specifically to lld for supporting the sanitizer user case - and GNU ld doesn't support those features, unfortunately.

// Martin



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to