aboutsummaryrefslogtreecommitdiff
path: root/cmake/config-ix.cmake
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2018-10-30 19:19:47 +0000
committerPetr Hosek <phosek@chromium.org>2018-10-30 19:19:47 +0000
commit98b45bc391b72b4372fffe1c15b66802cac71ebd (patch)
tree1a14b90d00e8df334971957ba531aa7136d0b290 /cmake/config-ix.cmake
parent376be794541b152ff494c39dca5be96c63bc7629 (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@345632 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/config-ix.cmake')
-rw-r--r--cmake/config-ix.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 27097b7e9..8ab9f1f29 100644
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -53,6 +53,7 @@ if (COMPILER_RT_HAS_NODEFAULTLIBS_FLAG)
endif ()
# CodeGen options.
+check_c_compiler_flag(-ffreestanding COMPILER_RT_HAS_FFREESTANDING_FLAG)
check_cxx_compiler_flag(-fPIC COMPILER_RT_HAS_FPIC_FLAG)
check_cxx_compiler_flag(-fPIE COMPILER_RT_HAS_FPIE_FLAG)
check_cxx_compiler_flag(-fno-builtin COMPILER_RT_HAS_FNO_BUILTIN_FLAG)
@@ -64,7 +65,6 @@ check_cxx_compiler_flag(-fno-sanitize=safe-stack COMPILER_RT_HAS_FNO_SANITIZE_SA
check_cxx_compiler_flag(-fvisibility=hidden COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG)
check_cxx_compiler_flag(-frtti COMPILER_RT_HAS_FRTTI_FLAG)
check_cxx_compiler_flag(-fno-rtti COMPILER_RT_HAS_FNO_RTTI_FLAG)
-check_cxx_compiler_flag(-ffreestanding COMPILER_RT_HAS_FFREESTANDING_FLAG)
check_cxx_compiler_flag("-Werror -fno-function-sections" COMPILER_RT_HAS_FNO_FUNCTION_SECTIONS_FLAG)
check_cxx_compiler_flag(-std=c++11 COMPILER_RT_HAS_STD_CXX11_FLAG)
check_cxx_compiler_flag(-ftls-model=initial-exec COMPILER_RT_HAS_FTLS_MODEL_INITIAL_EXEC)