[PATCH] clang-cl: Add support for -o
Timur Iskhodzhanov
timurrrr at google.com
Mon May 19 05:10:30 PDT 2014
2014-05-15 11:00 GMT+04:00 Reid Kleckner <rnk at google.com>:
> Maybe we should just run these tests with the gcc driver frontend.
So the problem with that is a combination of the following factors:
a) The ASan lit tests use RUN lines like "%clangxx_asan %s -o %t"
[e.g. see test/asan/TestCases/stack-buffer-overflow.cc]
b) The clang-cl driver doesn't support "-o"
c) By default, %clangxx_asan is COMPILER_RT_TEST_COMPILER
d) We have to use clang-cl to build ASan gtest-based tests as gtest
itself uses exceptions.
Currently clang doesn't support exception, thus clang-cl falls back.
e) COMPILER_RT_TEST_COMPILER is apparently used to build gtest-based tests
[see cmake/Modules/CompilerRTCompile.cmake]
Looks like making any of (a-c,e) false fixes the problems.
Possible solutions are (at least):
A) Use a %exe_out macro in asan lit tests.
This implies a big (yet trivial) diff and a small-but-annoying
maintenance burden for new tests.
B) Add "-o" support to clang-cl, this is being discussed here.
C) We can un-override %clangxx_asan to be clang rather than clang-cl on Windows
Or we could use a wrapper for clang-cl which replaces "-o" with
"-Fo" when lit tests are run...
(there's a "android_commands/android_compile.py" wrapper around anyways)
E) We could set COMPILER_RT_TEST_COMPILER to clang (rather than
clang-cl) and override it for gtest-based tests.
Opinions?
More information about the cfe-commits
mailing list