This is an archive of the discontinued LLVM Phabricator instance.

[ASan tests] Use clang-cl to build tests on Windows
ClosedPublic

Authored by timurrrr on May 8 2014, 8:25 AM.

Details

Reviewers
samsonov
Summary

Please note that COMPILER_RT_CAN_EXECUTE_TESTS is still OFF, so this only affects stuff when everything is ready to flip the switch.

Diff Detail

Event Timeline

timurrrr updated this revision to Diff 9226.May 8 2014, 8:25 AM
timurrrr retitled this revision from to [ASan tests] Use clang-cl to build tests on Windows.
timurrrr updated this object.
timurrrr edited the test plan for this revision. (Show Details)
timurrrr added a reviewer: samsonov.
timurrrr added a subscriber: Unknown Object (MLST).
samsonov accepted this revision.May 8 2014, 1:22 PM
samsonov edited edge metadata.

LGTM modulo nits.

CMakeLists.txt
65

_OUT makes no sense to me. You can probably use EXE/OBJ instead.

cmake/Modules/AddCompilerRT.cmake
140

Sanity check: is it ok to not have a space between ${COMPILER_RT_TEST_COMPILER_EXE} and "${output_bin}" ?

This revision is now accepted and ready to land.May 8 2014, 1:22 PM
rnk added a subscriber: rnk.May 8 2014, 4:39 PM

Two things:

  1. Should we add -o to clang-cl? MSVC ignores it silently, and CMake

always uses it when it does its initial test compile.

  1. Should we even use clang-cl when building compiler-rt? Do we have lots

of CFLAGS in compiler-rt? We will either have to expose them as core
clang-cl options, or switch to the regular clang driver. Do you need this
to handle /MT or /MD?

cmake/Modules/AddCompilerRT.cmake
140

There cannot be a space between -Fo and its argument. =/

  1. Should we add -o to clang-cl?

MSVC ignores it silently, and CMake always uses it when it does its initial test compile.

I don't see any reasons not to do that.

  1. Should we even use clang-cl when building compiler-rt? Do we have lots of CFLAGS in compiler-rt?

We will either have to expose them as core clang-cl options, or switch to the regular clang driver.
Do you need this to handle /MT or /MD?

I think we can start using clang-cl as a secondary compiler building c-rt so we have extra test coverage, but stick with CL as a primary compiler until we declare clang-cl production-quality.

CMakeLists.txt
65

Ah, good idea -- I forgot about the "OBJ" possibility :)

cmake/Modules/AddCompilerRT.cmake
140

What Reid says.

timurrrr closed this revision.May 12 2014, 2:03 AM

r208526