[compiler-rt] r248756 - [CMake] [Darwin] [builtins] Apply OS and OS-arch filters to cc_kext builtin libraries.

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 16:09:47 PDT 2015


Author: cbieneman
Date: Mon Sep 28 18:09:46 2015
New Revision: 248756

URL: http://llvm.org/viewvc/llvm-project?rev=248756&view=rev
Log:
[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.

Modified:
    compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake

Modified: compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake?rev=248756&r1=248755&r2=248756&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake Mon Sep 28 18:09:46 2015
@@ -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)




More information about the llvm-commits mailing list