[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
This commit is contained in:
Chris Bieneman 2015-09-28 23:09:46 +00:00
parent c8badb717b
commit 5def2a8a44
1 changed files with 12 additions and 1 deletions

View File

@ -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)