[cfe-dev] clang-cl question

Nico Weber via cfe-dev cfe-dev at lists.llvm.org
Wed Nov 11 09:02:35 PST 2015


Hi Stephan,

#pragma intrinsic isn't implemented yet, this is http://llvm.org/PR19898 .
As a workaround, you can pass /FIIntrin.h in your compiler flags, then
things should work.

Slides 83-88 of this deck give some advice such as this for using clang-cl
in practice:
https://docs.google.com/presentation/d/1oxNHaVjA9Gn_rTzX6HIpJHP7nXRua_0URXxxJ3oYRq0/edit#slide=id.p

Nico

On Wed, Nov 11, 2015 at 8:46 AM, Stephan Bergmann via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> I'm experimenting with building LibreOffice on Windows with the clang-cl
> wrapper (and that looks really promising nowadays; it looked much worse
> when I naively tried last time).  I'm using a recent Clang trunk build.
>
> After some trial and error, I get along quite well for a while with passing
>
> C:/clang/build/Debug/bin/clang-cl.exe -fmsc-version=1700
>> -Qunused-arguments --target=x86_64-windows-mscv
>>
>
> as CC and CXX into LibreOffice's build system (which heavily expects the
> compiler to be MSVC on Windows, of course).
>
> However, one place that is causing trouble is code calling
> RtlSecureZeroMemory, which leads to referencing an unresolved external
> symbol __stosb during linking.  The definition of RtlSecureZeroMemory in
> winnt.h is using
>
> #if defined(_M_AMD64)
>> __stosb(...)
>>
>
> where __stosb is apparently an MSVC intrinsic, and I see an inline
> definition of it in the Clang installation's
> lib/clang/3.8.0/include/Intrin.h, but that include file is apparently not
> used when compiling the above code.
>
> When I manually #include <Intrin.h> into the LibreOffice source file that
> calls RtlSecureZeroMemory, compiling and linking succeeds, but I'm not sure
> that's the intended setup.  Am I missing something how to set up things so
> that Clang's Intrin.h gets picked up automatically (or is this the wrong
> approach to fix things anyway)?
> _______________________________________________
> 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/20151111/cb320228/attachment.html>


More information about the cfe-dev mailing list