[PATCH] D84908: [darwin][compiler-rt] build libclang_rt.<os>sim.a Apple Silicon slice, if SDK supports it
Alex Lorenz via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 29 20:12:22 PDT 2020
arphaman created this revision.
arphaman added a reviewer: steven_wu.
Herald added subscribers: ributzka, dexonsmith, jkorous, kristof.beyls, mgorny, dberris.
arphaman requested review of this revision.
This change lets compiler-rt build the libclang_rt.<os>sim.a library with the arm64
Apple Silicon simulator slice by default, iff the relevant simulator SDK advertises
support for the arm64 arch in the SDKSettings.plist file.
https://reviews.llvm.org/D84908
Files:
compiler-rt/cmake/builtin-config-ix.cmake
Index: compiler-rt/cmake/builtin-config-ix.cmake
===================================================================
--- compiler-rt/cmake/builtin-config-ix.cmake
+++ compiler-rt/cmake/builtin-config-ix.cmake
@@ -93,6 +93,19 @@
endif()
endforeach(arch)
+ function(set_simulator_arches all_possible_archs os sdkname)
+ set(simulator_arches ${X86} ${X86_64})
+ # Add additional slices for Apple Silicon simulator targets, if they're
+ # supported by the SDK.
+ foreach(arch ${ARM64})
+ sdk_has_arch_support(${DARWIN_${os}sim_SYSROOT} ${sdkname} ${arch} SIM_ARM_SUPPORT)
+ if (SIM_ARM_SUPPORT)
+ list(APPEND simulator_arches ${arch})
+ endif()
+ endforeach()
+ set("${all_possible_archs}" ${simulator_arches} PARENT_SCOPE)
+ endfunction()
+
if(COMPILER_RT_ENABLE_IOS)
list(APPEND DARWIN_EMBEDDED_PLATFORMS ios)
set(DARWIN_ios_MIN_VER_FLAG -miphoneos-version-min)
@@ -100,7 +113,7 @@
set(DARWIN_ios_BUILTIN_MIN_VER_FLAG
${DARWIN_ios_MIN_VER_FLAG}=${DARWIN_ios_BUILTIN_MIN_VER})
set(DARWIN_ios_BUILTIN_ALL_POSSIBLE_ARCHS ${ARM64} ${ARM32})
- set(DARWIN_iossim_BUILTIN_ALL_POSSIBLE_ARCHS ${X86} ${X86_64})
+ set_simulator_arches(DARWIN_iossim_BUILTIN_ALL_POSSIBLE_ARCHS ios iphonesimulator)
endif()
if(COMPILER_RT_ENABLE_WATCHOS)
list(APPEND DARWIN_EMBEDDED_PLATFORMS watchos)
@@ -109,7 +122,7 @@
set(DARWIN_watchos_BUILTIN_MIN_VER_FLAG
${DARWIN_watchos_MIN_VER_FLAG}=${DARWIN_watchos_BUILTIN_MIN_VER})
set(DARWIN_watchos_BUILTIN_ALL_POSSIBLE_ARCHS armv7 armv7k)
- set(DARWIN_watchossim_BUILTIN_ALL_POSSIBLE_ARCHS ${X86})
+ set_simulator_arches(DARWIN_watchossim_BUILTIN_ALL_POSSIBLE_ARCHS watchos watchsimulator)
endif()
if(COMPILER_RT_ENABLE_TVOS)
list(APPEND DARWIN_EMBEDDED_PLATFORMS tvos)
@@ -118,7 +131,7 @@
set(DARWIN_tvos_BUILTIN_MIN_VER_FLAG
${DARWIN_tvos_MIN_VER_FLAG}=${DARWIN_tvos_BUILTIN_MIN_VER})
set(DARWIN_tvos_BUILTIN_ALL_POSSIBLE_ARCHS armv7 arm64)
- set(DARWIN_tvossim_BUILTIN_ALL_POSSIBLE_ARCHS ${X86} ${X86_64})
+ set_simulator_arches(DARWIN_tvossim_BUILTIN_ALL_POSSIBLE_ARCHS tvos appletvsimulator)
endif()
set(BUILTIN_SUPPORTED_OS osx)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84908.281788.patch
Type: text/x-patch
Size: 2217 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200730/84ab093e/attachment-0001.bin>
More information about the cfe-commits
mailing list