[LLVMbugs] [Bug 23698] New: [win] compiler_rt doesn't link when building with clang-cl.exe

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 29 09:53:30 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23698

            Bug ID: 23698
           Summary: [win] compiler_rt doesn't link when building with
                    clang-cl.exe
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Headers
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

1. Run cmake with CMAKE_C_COMPILER and CMAKE_CXX_COMPILER set to clang-cl.exe
2. Build target 'compiler-rt'

Expected: Works
Actual:

asan_thread.cc.obj : error LNK2001: unresolved external symbol
__ReadWriteBarrier
sanitizer_coverage_libcdep.cc.obj : error LNK2001: unresolved external symbol
__mm_pause
lib\clang\3.7.0\lib\windows\clang_rt.asan_dynamic-i386.dll : fatal error
LNK1120: 2 unresolved externals
LINK failed. with 1120

This is because sanitizer_atomic_msvc declares _mm_pause itself instead of
including Intrin.h (it can't include Intrin.h else it would get a declaration
of free() without dllexport, and then its own declaration of free with
dllexport would be an error, at least in clang-cl). Hence, the definition of
_mm_pause in clang/lib/Headers/emmintrin.h isn't seen.

(And the #pragma intrinsic stuff doesn't work in clang-cl yet, see bug 19898)

Since we control both the clang-cl code and the asan header code, maybe we can
figure something out before bug 19898 is fixed? Or we could just wait for that.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150529/6e9ac4f0/attachment.html>


More information about the llvm-bugs mailing list