From 8a22938e76396fcbe2fc174686322e6e2e874ad4 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Fri, 12 Aug 2016 01:29:26 +0000 Subject: [CMake] If the compiler supports _Atomic include atomic.c in builtins libraries This fixes a long-standing TODO by implementing a compiler check for supporting the _Atomic keyword. If the _Atomic keyword is supported by the compiler we should include it in the builtin library sources. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278454 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/builtin-config-ix.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cmake/builtin-config-ix.cmake') diff --git a/cmake/builtin-config-ix.cmake b/cmake/builtin-config-ix.cmake index 432b1fadb..83466d81b 100644 --- a/cmake/builtin-config-ix.cmake +++ b/cmake/builtin-config-ix.cmake @@ -1,4 +1,5 @@ include(BuiltinTests) +include(CheckCSourceCompiles) # Make all the tests only check the compiler set(TEST_COMPILE_ONLY On) @@ -14,6 +15,15 @@ builtin_check_c_compiler_flag(-mfloat-abi=soft COMPILER_RT_HAS_FLOAT_ABI_SO builtin_check_c_compiler_flag(-mfloat-abi=hard COMPILER_RT_HAS_FLOAT_ABI_HARD_FLAG) builtin_check_c_compiler_flag(-static COMPILER_RT_HAS_STATIC_FLAG) +builtin_check_c_compiler_source(COMPILER_RT_SUPPORTS_ATOMIC_KEYWORD +" +int foo(int x, int y) { + _Atomic int result = x * y; + return result; +} +") + + set(ARM64 aarch64) set(ARM32 arm armhf) set(X86 i386 i686) -- cgit v1.2.3