[PATCH] D151152: [compiler-rt] Avoid memintrinsic calls inserted by the compiler

Marco Elver via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 7 04:47:19 PDT 2023


melver added a comment.

In D151152#4402854 <https://reviews.llvm.org/D151152#4402854>, @mstorsjo wrote:

> This broke linking the sanitizers for mingw targets. Building now fails with errors like these:
>
>   [330/350] Linking CXX shared library lib/windows/libclang_rt.asan_dynamic-x86_64.dll
>   FAILED: lib/windows/libclang_rt.asan_dynamic-x86_64.dll lib/windows/libclang_rt.asan_dynamic-x86_64.dll.a
>   [...]
>   ld.lld: error: lib/interception/CMakeFiles/RTInterception.x86_64.dir/interception_linux.cpp.obj: memcpy should not refer to special section 0
>   clang: error: linker command failed with exit code 1 (use -v to see invocation)
>
> I see that this also was happening with clang-cl configurations, which was then fixed in caa2c1bacbd76c017ebbb4fd13861f0f66770299 <https://reviews.llvm.org/rGcaa2c1bacbd76c017ebbb4fd13861f0f66770299>. I'll go ahead and push a change that changes `_MSC_VER` into `_WIN32` there, to keep the same behaviour in mingw configs as in clang-cl configs.

That sounds reasonable, thanks.

Getting it to work on Windows (when built with Clang) would be nice, because ftrivial-auto-var-init is also available on Windows (AFAIK). But I've deferred for now, because it seems rather tricky (likely needs some changes to the inline asm?).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151152/new/

https://reviews.llvm.org/D151152



More information about the llvm-commits mailing list