[CMake] Check -ffreestanding as C not C++ flag
authorPetr Hosek <phosek@chromium.org>
Tue, 30 Oct 2018 19:19:47 +0000 (19:19 +0000)
committerPetr Hosek <phosek@chromium.org>
Tue, 30 Oct 2018 19:19:47 +0000 (19:19 +0000)
commit0bd1a0fac1d1fb4a28c7882a1aa5f7ff2dfdcfbb
tree36729bd3b80c432b239a3711a167af3a984ed519
parent3e89fa8e088d31ea247c111b66755b2eaea443c0
[CMake] Check -ffreestanding as C not C++ flag

When -ffreestanding is used, main() isn't considered special and
when compiled as C++ code it'll get mangled which makes the
compilation fail since main() will be undefined so this check will
never succeed.

Differential Revision: https://reviews.llvm.org/D49332

llvm-svn: 345632
compiler-rt/cmake/config-ix.cmake