[PATCH] Enable asan tests on Windows

Aaron Ballman aaron at aaronballman.com
Mon Oct 27 10:58:34 PDT 2014


On Mon, Oct 27, 2014 at 1:31 PM, Timur Iskhodzhanov <timurrrr at google.com> wrote:
> 2014-10-27 10:20 GMT-07:00 Aaron Ballman <aaron at aaronballman.com>:
>> On Mon, Oct 27, 2014 at 12:55 PM, Timur Iskhodzhanov
>> <timurrrr at google.com> wrote:
>>> 2014-10-27 8:57 GMT-07:00 Aaron Ballman <aaron at aaronballman.com>:
>>>> While trying to fix up cmake issues to get ubsan somewhat stumbling
>>>> around on Windows, I noticed the reason why all of the asan tests are
>>>> passing on that platform -- they weren't being run.
>>>
>>> That's not true, ASan/Win does have it own tests that are being run.
>>> [see below though]
>>>
>>>> I've attached the logs from my local testing on x86, and it's not
>>>> pretty. I'm not certain whether we *want* to enable tests on Windows
>>>> at this point, but if we do, the attached patch ensures the tests run.
>>>
>>> Some ASan tests are run and (tests for ''all platforms") are
>>> intentionally not enabled yet because, well, some of them don't work.
>>> I had a local patch for a few months that fixes most of them, but
>>> didn't have cycles to finish it.
>>>
>>> I agree this is probably not the easiest thing to figure out on one's
>>> own – sorry you've spent time on it... Please suggest how to document
>>> it to avoid doing duplicate work next time?
>>
>> At this point, the documentation should probably state that
>> compiler-rt is only usable with an MSVC toolchain by using ninja to
>> compile an x86, Release configuration.
>
> Which documentation?

Probably the "Get it and get involved!" documentation on compiler-rt's
main page. Probably also a mention in clang's "getting started" page
since compiler-rt won't build in MSVC out of the box (under the Using
Visual Studio section).

Unless you have other suggestions?

>
>> It's unfortunate that compiler-rt doesn't match the llvm and clang workflows with MSVC.
>
> I believe this is not compiler-rt-specific – IMO, any Clang/LLVM MSVC
> workflow is different from other platforms due to the way CMake and
> MSVC interplay.

You can fetch clang or llvm and follow the Getting Started guide to
get it set up and building with Visual Studio on Windows. You cannot
do that with compiler-rt, and it's not because of lacking
documentation. The CMake configuration simply does not work for Visual
Studio currently.

>  The issue is that the CMake peculiarities are not
> fully worked around for compiler-rt, which wasn't a priority [not many
> people compile/develop it, easy to work around with ninja].

While functional, that's an unsatisfying work around. I was hoping to
spend time contributing to compiler-rt, but it's difficult to justify
given how much time I've already spent just trying to hack around the
build system. Everything seems to be tantalizingly close to functional
on Windows when following the usual workflow I've had with
contributing to clang and llvm, but just nonfunctional enough to be
unusable. I sympathize with why the project is setup to use Ninja only
on Windows, but it is still a hurdle that prevents adoption, which is
unfortunate. Hopefully it's a hurdle we can overcome!

~Aaron




More information about the llvm-commits mailing list