From 5def2a8a44b8ee2fc38e5bfd82f6cc37546dbe88 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Mon, 28 Sep 2015 23:09:46 +0000 Subject: [PATCH] [CMake] [Darwin] [builtins] Apply OS and OS-arch filters to cc_kext builtin libraries. We don't want to filter out the builtins that are present in libSystem like we do for the normal builtins because kexts can't link libSystem, but we should filter out all the builtins that are generally not supported on the OS and architecture. llvm-svn: 248756 --- .../cmake/Modules/CompilerRTDarwinUtils.cmake | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake index b09f3678e86a..1e017b8b3816 100644 --- a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake +++ b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake @@ -272,11 +272,22 @@ macro(darwin_add_builtin_libraries) # Don't build cc_kext libraries for simulator platforms if(NOT ${os} MATCHES ".*sim$") foreach (arch ${DARWIN_BUILTIN_ARCHS}) + # By not specifying MIN_VERSION this only reads the OS and OS-arch lists. + # We don't want to filter out the builtins that are present in libSystem + # because kexts can't link libSystem. + darwin_find_excluded_builtins_list(${arch}_${os}_EXCLUDED_BUILTINS + OS ${os} + ARCH ${arch}) + + darwin_filter_builtin_sources(filtered_sources + EXCLUDE ${arch}_${os}_EXCLUDED_BUILTINS + ${${arch}_SOURCES}) + # In addition to the builtins cc_kext includes some profile sources darwin_add_builtin_library(clang_rt cc_kext OS ${os} ARCH ${arch} - SOURCES ${${arch}_SOURCES} ${PROFILE_SOURCES} + SOURCES ${filtered_sources} ${PROFILE_SOURCES} CFLAGS -arch ${arch} -mkernel DEFS KERNEL_USE PARENT_TARGET builtins)