summaryrefslogtreecommitdiff
path: root/cmake/Modules
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-11-10 00:41:18 +0000
committerChris Bieneman <beanz@apple.com>2015-11-10 00:41:18 +0000
commit4ae803e99647e837c5da1b2c992895c51f2118e5 (patch)
tree0ba6993270be90a66192be49728645ffdc8fc2a9 /cmake/Modules
parent6fd90709733df85f5cac054b70f37185e04cda9d (diff)
[CMake] Temporary workaround to support building builtins on darwin with a toolchain that may not support all x86 and arm architectures.
This is at least a little better than my first attempt. We still really need a way to do compile checks without linking. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252572 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/Modules')
-rw-r--r--cmake/Modules/CompilerRTDarwinUtils.cmake21
1 files changed, 18 insertions, 3 deletions
diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake
index c4e2e011c..7b61dc0ea 100644
--- a/cmake/Modules/CompilerRTDarwinUtils.cmake
+++ b/cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -344,6 +344,24 @@ macro(darwin_add_builtin_libraries)
endmacro()
function(darwin_add_embedded_builtin_libraries)
+ # this is a hacky opt-out. If you can't target both intel and arm
+ # architectures we bail here.
+ set(DARWIN_SOFT_FLOAT_ARCHS armv6m armv7m armv7em armv7)
+ set(DARWIN_HARD_FLOAT_ARCHS armv7em armv7)
+ if(NOT COMPILER_RT_SUPPORTED_ARCH MATCHES ".*armv.*")
+ return()
+ endif()
+
+ list(FIND COMPILER_RT_SUPPORTED_ARCH i386 i386_idx)
+ if(i386_idx GREATER -1)
+ list(APPEND DARWIN_HARD_FLOAT_ARCHS i386)
+ endif()
+
+ list(FIND COMPILER_RT_SUPPORTED_ARCH x86_64 x86_64_idx)
+ if(x86_64_idx GREATER -1)
+ list(APPEND DARWIN_HARD_FLOAT_ARCHS x86_64)
+ endif()
+
set(MACHO_SYM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/macho_embedded)
if(CMAKE_CONFIGURATION_TYPES)
foreach(type ${CMAKE_CONFIGURATION_TYPES})
@@ -376,9 +394,6 @@ function(darwin_add_embedded_builtin_libraries)
set(CFLAGS_armv7m "-target thumbv7-apple-darwin-eabi")
set(CFLAGS_i386 "-march=pentium")
- set(DARWIN_SOFT_FLOAT_ARCHS armv6m armv7m armv7em armv7)
- set(DARWIN_HARD_FLOAT_ARCHS armv7em armv7 i386 x86_64)
-
darwin_read_list_from_file(common_FUNCTIONS ${MACHO_SYM_DIR}/common.txt)
darwin_read_list_from_file(thumb2_FUNCTIONS ${MACHO_SYM_DIR}/thumb2.txt)
darwin_read_list_from_file(thumb2_64_FUNCTIONS ${MACHO_SYM_DIR}/thumb2-64.txt)