Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable building NativeAOT for Apple mobile platforms #81780

Merged
merged 16 commits into from
Feb 16, 2023
Merged
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -47,16 +47,21 @@
</PropertyGroup>

<PropertyGroup Label="SetOSTargetMinVersions">
<!-- Minimum Apple target OS versions, keep in sync with src/native/libs/build-native.sh -->
<!--
Minimum target OS versions, keep in sync with:
- eng/native/configurecompiler.cmake
- eng/native/build-commons.sh
- src/native/libs/build-native.sh
- src/installer/pkg/sfx/bundle/shared-framework-distribution-template-x64.xml
- src/installer/pkg/sfx/bundle/shared-framework-distribution-template-arm64.xml
-->
<AndroidApiLevelMin>21</AndroidApiLevelMin>
<iOSVersionMin>11.0</iOSVersionMin>
<tvOSVersionMin>11.0</tvOSVersionMin>
<watchOSVersionMin>2.0</watchOSVersionMin>
<watchOS64_32VersionMin>5.1</watchOS64_32VersionMin>
<macOSVersionMin>10.15</macOSVersionMin>
<macOSVersionMin Condition="('$(TargetOS)' == 'osx' or '$(TargetOS)' == 'maccatalyst') and '$(TargetArchitecture)' == 'arm64'">11.0</macOSVersionMin>

<!-- Minimum version of the Android API level we target, keep in sync with eng/native/build-commons.sh -->
<AndroidApiLevelMin>21</AndroidApiLevelMin>
</PropertyGroup>

<PropertyGroup>
8 changes: 5 additions & 3 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
@@ -45,7 +45,8 @@
</PropertyGroup>

<PropertyGroup>
<RuntimeFlavor Condition="'$(TargetsMobile)' == 'true'">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(TargetsMobile)' == 'true' and !$(_subset.Contains('+clr.nativeaotlibs+'))">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(TargetsMobile)' == 'true' and $(_subset.Contains('+clr.nativeaotlibs+'))">CoreCLR</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == '' and ($(_subset.Contains('+mono+')) or $(_subset.Contains('+mono.runtime+'))) and (!$(_subset.Contains('+clr+')) and !$(_subset.Contains('+clr.runtime+')))">Mono</RuntimeFlavor>
<RuntimeFlavor Condition="'$(RuntimeFlavor)' == ''">$(PrimaryRuntimeFlavor)</RuntimeFlavor>
</PropertyGroup>
@@ -71,7 +72,8 @@
<DefaultLibrariesSubsets Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or
'$(BuildTargetFramework)' == '' or
'$(BuildAllConfigurations)' == 'true'">libs.native+</DefaultLibrariesSubsets>
<DefaultLibrariesSubsets>$(DefaultLibrariesSubsets)libs.sfx+libs.oob+libs.pretest</DefaultLibrariesSubsets>
<DefaultLibrariesSubsets>$(DefaultLibrariesSubsets)libs.sfx+libs.oob+</DefaultLibrariesSubsets>
<DefaultLibrariesSubsets Condition="'$(TargetsMobile)' == 'true' and !$(_subset.Contains('+clr.nativeaotlibs+'))">$(DefaultLibrariesSubsets)+libs.pretest</DefaultLibrariesSubsets>

<DefaultToolsSubsets>tools.illink</DefaultToolsSubsets>

@@ -105,7 +107,7 @@

<PropertyGroup>
<!-- CLR NativeAot only builds in a subset of the matrix -->
<NativeAotSupported Condition="('$(TargetOS)' == 'windows' or '$(TargetOS)' == 'linux' or '$(TargetOS)' == 'osx' or '$(TargetOS)' == 'freebsd') and ('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64')">true</NativeAotSupported>
<NativeAotSupported Condition="('$(TargetOS)' == 'windows' or '$(TargetOS)' == 'linux' or '$(TargetOS)' == 'osx' or '$(TargetOS)' == 'maccatalyst' or '$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'ios' or '$(TargetOS)' == 'tvossimulator' or '$(TargetOS)' == 'tvos' or '$(TargetOS)' == 'freebsd') and ('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64')">true</NativeAotSupported>

<!-- If we're building clr.nativeaotlibs and not building the CLR runtime, compile libraries against NativeAOT CoreLib -->
<UseNativeAotCoreLib Condition="$(_subset.Contains('+clr.nativeaotlibs+')) and !$(_subset.Contains('+clr.native+')) and !$(_subset.Contains('+clr.runtime+'))">true</UseNativeAotCoreLib>
52 changes: 52 additions & 0 deletions eng/native/build-commons.sh
Original file line number Diff line number Diff line change
@@ -102,6 +102,58 @@ build_native()
echo "Error: Unknown Android architecture $hostArch."
exit 1
fi
elif [[ "$__TargetOS" == iossimulator ]]; then
cmakeArgs="-C $__RepoRootDir/eng/native/tryrun_ios_tvos.cmake $cmakeArgs"

# set default iOS simulator deployment target
# keep in sync with SetOSTargetMinVersions in the root Directory.Build.props
cmakeArgs="-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 $cmakeArgs"
if [[ "$__TargetArch" == x64 ]]; then
cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"x86_64\" $cmakeArgs"
elif [[ "$__TargetArch" == arm64 ]]; then
cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"arm64\" $cmakeArgs"
else
echo "Error: Unknown iOS Simulator architecture $__TargetArch."
exit 1
fi
elif [[ "$__TargetOS" == ios ]]; then
cmakeArgs="-C $__RepoRootDir/eng/native/tryrun_ios_tvos.cmake $cmakeArgs"

# set default iOS device deployment target
# keep in sync with SetOSTargetMinVersions in the root Directory.Build.props
cmakeArgs="-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 $cmakeArgs"
if [[ "$__TargetArch" == arm64 ]]; then
cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"arm64\" $cmakeArgs"
else
echo "Error: Unknown iOS architecture $__TargetArch."
exit 1
fi
elif [[ "$__TargetOS" == tvossimulator ]]; then
cmakeArgs="-C $__RepoRootDir/eng/native/tryrun_ios_tvos.cmake $cmakeArgs"

# set default tvOS simulator deployment target
# keep in sync with SetOSTargetMinVersions in the root Directory.Build.props
cmakeArgs="-DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvsimulator -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 $cmakeArgs"
if [[ "$__TargetArch" == x64 ]]; then
cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"x86_64\" $cmakeArgs"
elif [[ "$__TargetArch" == arm64 ]]; then
cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"arm64\" $cmakeArgs"
else
echo "Error: Unknown tvOS Simulator architecture $__TargetArch."
exit 1
fi
elif [[ "$__TargetOS" == tvos ]]; then
cmakeArgs="-C $__RepoRootDir/eng/native/tryrun_ios_tvos.cmake $cmakeArgs"

# set default tvOS device deployment target
# keep in sync with SetOSTargetMinVersions in the root Directory.Build.props
cmakeArgs="-DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 $cmakeArgs"
if [[ "$__TargetArch" == arm64 ]]; then
cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"arm64\" $cmakeArgs"
else
echo "Error: Unknown tvOS architecture $__TargetArch."
exit 1
fi
fi

if [[ "$__UseNinja" == 1 ]]; then
40 changes: 37 additions & 3 deletions eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
@@ -200,7 +200,7 @@ elseif(CLR_CMAKE_HOST_SUNOS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector")
add_definitions(-D__EXTENSIONS__ -D_XPG4_2 -D_POSIX_PTHREAD_SEMANTICS)
elseif(CLR_CMAKE_HOST_OSX AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS)
elseif(CLR_CMAKE_HOST_OSX AND NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS)
add_definitions(-D_XOPEN_SOURCE)
add_linker_flag("-Wl,-bind_at_load")
endif()
@@ -276,14 +276,39 @@ if (CLR_CMAKE_HOST_UNIX)
add_definitions(-DHOST_UNIX)

if(CLR_CMAKE_HOST_OSX OR CLR_CMAKE_HOST_MACCATALYST)
add_definitions(-DHOST_OSX)
add_definitions(-DHOST_APPLE)
if(CLR_CMAKE_HOST_MACCATALYST)
add_definitions(-DHOST_MACCATALYST)
else()
add_definitions(-DHOST_OSX)
endif()
if(CLR_CMAKE_HOST_UNIX_AMD64)
message("Detected OSX x86_64")
elseif(CLR_CMAKE_HOST_UNIX_ARM64)
message("Detected OSX ARM64")
else()
clr_unknown_arch()
endif()
elseif (CLR_CMAKE_HOST_IOS)
add_definitions(-DHOST_APPLE)
add_definitions(-DHOST_IOS)
if(CLR_CMAKE_HOST_UNIX_AMD64)
message("Detected iOS x86_64")
elseif(CLR_CMAKE_HOST_UNIX_ARM64)
message("Detected iOS ARM64")
else()
clr_unknown_arch()
endif()
elseif (CLR_CMAKE_HOST_TVOS)
add_definitions(-DHOST_APPLE)
add_definitions(-DHOST_TVOS)
if(CLR_CMAKE_HOST_UNIX_AMD64)
message("Detected tvOS x86_64")
elseif(CLR_CMAKE_HOST_UNIX_ARM64)
message("Detected tvOS ARM64")
else()
clr_unknown_arch()
endif()
elseif(CLR_CMAKE_HOST_FREEBSD)
if(CLR_CMAKE_HOST_UNIX_ARM64)
message("Detected FreeBSD aarch64")
@@ -542,8 +567,17 @@ if(CLR_CMAKE_TARGET_UNIX)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_OS>>>:TARGET_UNIX>)
# Contracts are disabled on UNIX.
add_definitions(-DDISABLE_CONTRACTS)
if(CLR_CMAKE_TARGET_OSX AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS)
if(CLR_CMAKE_TARGET_APPLE)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_OS>>>:TARGET_APPLE>)
endif()
if(CLR_CMAKE_TARGET_OSX)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_OS>>>:TARGET_OSX>)
elseif(CLR_CMAKE_TARGET_MACCATALYST)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_OS>>>:TARGET_MACCATALYST>)
elseif(CLR_CMAKE_TARGET_IOS)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_OS>>>:TARGET_IOS>)
elseif(CLR_CMAKE_TARGET_TVOS)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_OS>>>:TARGET_TVOS>)
akoeplinger marked this conversation as resolved.
Show resolved Hide resolved
elseif(CLR_CMAKE_TARGET_FREEBSD)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_OS>>>:TARGET_FREEBSD>)
elseif(CLR_CMAKE_TARGET_ANDROID)
8 changes: 7 additions & 1 deletion eng/native/configureplatform.cmake
Original file line number Diff line number Diff line change
@@ -99,6 +99,7 @@ endif(CLR_CMAKE_HOST_OS STREQUAL linux)

if(CLR_CMAKE_HOST_OS STREQUAL darwin)
set(CLR_CMAKE_HOST_UNIX 1)
set(CLR_CMAKE_HOST_APPLE 1)

if(CMAKE_SYSTEM_VARIANT STREQUAL maccatalyst)
set(CLR_CMAKE_HOST_MACCATALYST 1)
@@ -118,6 +119,7 @@ endif(CLR_CMAKE_HOST_OS STREQUAL darwin)

if(CLR_CMAKE_HOST_OS STREQUAL ios OR CLR_CMAKE_HOST_OS STREQUAL iossimulator)
set(CLR_CMAKE_HOST_UNIX 1)
set(CLR_CMAKE_HOST_APPLE 1)
set(CLR_CMAKE_HOST_IOS 1)
if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
set(CLR_CMAKE_HOST_UNIX_AMD64 1)
@@ -134,6 +136,7 @@ endif(CLR_CMAKE_HOST_OS STREQUAL ios OR CLR_CMAKE_HOST_OS STREQUAL iossimulator)

if(CLR_CMAKE_HOST_OS STREQUAL tvos OR CLR_CMAKE_HOST_OS STREQUAL tvossimulator)
set(CLR_CMAKE_HOST_UNIX 1)
set(CLR_CMAKE_HOST_APPLE 1)
set(CLR_CMAKE_HOST_TVOS 1)
if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
set(CLR_CMAKE_HOST_UNIX_AMD64 1)
@@ -374,6 +377,7 @@ endif(CLR_CMAKE_TARGET_OS STREQUAL android)

if(CLR_CMAKE_TARGET_OS STREQUAL darwin)
set(CLR_CMAKE_TARGET_UNIX 1)
set(CLR_CMAKE_TARGET_APPLE 1)

if(CMAKE_SYSTEM_VARIANT STREQUAL maccatalyst)
set(CLR_CMAKE_TARGET_MACCATALYST 1)
@@ -384,11 +388,13 @@ endif(CLR_CMAKE_TARGET_OS STREQUAL darwin)

if(CLR_CMAKE_TARGET_OS STREQUAL ios OR CLR_CMAKE_TARGET_OS STREQUAL iossimulator)
set(CLR_CMAKE_TARGET_UNIX 1)
set(CLR_CMAKE_TARGET_APPLE 1)
set(CLR_CMAKE_TARGET_IOS 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL ios OR CLR_CMAKE_TARGET_OS STREQUAL iossimulator)

if(CLR_CMAKE_TARGET_OS STREQUAL tvos OR CLR_CMAKE_TARGET_OS STREQUAL tvossimulator)
set(CLR_CMAKE_TARGET_UNIX 1)
set(CLR_CMAKE_TARGET_APPLE 1)
set(CLR_CMAKE_TARGET_TVOS 1)
endif(CLR_CMAKE_TARGET_OS STREQUAL tvos OR CLR_CMAKE_TARGET_OS STREQUAL tvossimulator)

@@ -474,7 +480,7 @@ endif()

if(NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_WASI)
# The default linker on Solaris also does not support PIE.
if(NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_SUNOS AND NOT CLR_CMAKE_TARGET_OSX AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_HOST_TVOS AND NOT CLR_CMAKE_HOST_IOS AND NOT MSVC)
if(NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_SUNOS AND NOT CLR_CMAKE_TARGET_APPLE AND NOT MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
add_compile_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:-fPIE>)
add_compile_options($<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:-fPIC>)
2 changes: 1 addition & 1 deletion eng/native/configuretools.cmake
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ if(NOT WIN32 AND NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_WASI)
locate_toolchain_exec(link CMAKE_LINKER YES)
endif()

if(NOT CLR_CMAKE_TARGET_OSX AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND (NOT CLR_CMAKE_TARGET_ANDROID OR CROSS_ROOTFS))
if(NOT CLR_CMAKE_TARGET_APPLE AND (NOT CLR_CMAKE_TARGET_ANDROID OR CROSS_ROOTFS))
locate_toolchain_exec(objdump CMAKE_OBJDUMP YES)

unset(CMAKE_OBJCOPY CACHE)
12 changes: 6 additions & 6 deletions eng/native/functions.cmake
Original file line number Diff line number Diff line change
@@ -327,7 +327,7 @@ function(generate_exports_file)
list(GET INPUT_LIST -1 outputFilename)
list(REMOVE_AT INPUT_LIST -1)

if(CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS)
if(CLR_CMAKE_TARGET_APPLE)
set(SCRIPT_NAME generateexportedsymbols.sh)
else()
set(SCRIPT_NAME generateversionscript.sh)
@@ -366,7 +366,7 @@ endfunction()

function (get_symbol_file_name targetName outputSymbolFilename)
if (CLR_CMAKE_HOST_UNIX)
if (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS)
if (CLR_CMAKE_TARGET_APPLE)
set(strip_destination_file $<TARGET_FILE:${targetName}>.dwarf)
else ()
set(strip_destination_file $<TARGET_FILE:${targetName}>.dbg)
@@ -386,7 +386,7 @@ function(strip_symbols targetName outputFilename)
if (CLR_CMAKE_HOST_UNIX)
set(strip_source_file $<TARGET_FILE:${targetName}>)

if (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS)
if (CLR_CMAKE_TARGET_APPLE)

# Ensure that dsymutil and strip are present
find_program(DSYMUTIL dsymutil)
@@ -425,7 +425,7 @@ function(strip_symbols targetName outputFilename)
COMMAND ${strip_command}
COMMENT "Stripping symbols from ${strip_source_file} into file ${strip_destination_file}"
)
else (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS)
else (CLR_CMAKE_TARGET_APPLE)

add_custom_command(
TARGET ${targetName}
@@ -436,7 +436,7 @@ function(strip_symbols targetName outputFilename)
COMMAND ${CMAKE_OBJCOPY} --add-gnu-debuglink=${strip_destination_file} ${strip_source_file}
COMMENT "Stripping symbols from ${strip_source_file} into file ${strip_destination_file}"
)
endif (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS)
endif (CLR_CMAKE_TARGET_APPLE)
endif(CLR_CMAKE_HOST_UNIX)
endfunction()

@@ -446,7 +446,7 @@ function(install_with_stripped_symbols targetName kind destination)
install_symbol_file(${symbol_file} ${destination} ${ARGN})
endif()

if ((CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) AND ("${kind}" STREQUAL "TARGETS"))
if (CLR_CMAKE_TARGET_APPLE AND ("${kind}" STREQUAL "TARGETS"))
# We want to avoid the kind=TARGET install behaviors which corrupt code signatures on osx-arm64
set(kind PROGRAMS)
endif()
50 changes: 50 additions & 0 deletions eng/native/tryrun_ios_tvos.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
macro(set_cache_value)
set(${ARGV0} ${ARGV1} CACHE STRING "Result from TRY_RUN" FORCE)
set(${ARGV0}__TRYRUN_OUTPUT "dummy output" CACHE STRING "Output from TRY_RUN" FORCE)
endmacro()

set_cache_value(HAVE_SCHED_GETCPU_EXITCODE 1)
set_cache_value(HAVE_CLOCK_MONOTONIC_COARSE_EXITCODE 1)
set_cache_value(HAVE_CLOCK_MONOTONIC_EXITCODE 0)


# TODO: these are taken from macOS, check these whether they're correct for iOS
# some of them are probably not used by what we use from NativeAOT so could be reduced
set_cache_value(FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL_EXITCODE 1)
set_cache_value(GETPWUID_R_SETS_ERRNO_EXITCODE 1)
set_cache_value(HAS_POSIX_SEMAPHORES_EXITCODE 1)
set_cache_value(HAVE_BROKEN_FIFO_KEVENT_EXITCODE 1)
set_cache_value(HAVE_BROKEN_FIFO_SELECT_EXITCODE 1)
set_cache_value(HAVE_CLOCK_REALTIME_EXITCODE 0)
set_cache_value(HAVE_CLOCK_THREAD_CPUTIME_EXITCODE 0)
set_cache_value(HAVE_CLOCK_GETTIME_NSEC_NP_EXITCODE 0)
set_cache_value(HAVE_COMPATIBLE_ACOS_EXITCODE 0)
set_cache_value(HAVE_COMPATIBLE_ASIN_EXITCODE 0)
set_cache_value(HAVE_COMPATIBLE_ATAN2_EXITCODE 0)
set_cache_value(HAVE_COMPATIBLE_EXP_EXITCODE 1)
set_cache_value(HAVE_COMPATIBLE_ILOGB0_EXITCODE 0)
set_cache_value(HAVE_COMPATIBLE_ILOGBNAN_EXITCODE 1)
set_cache_value(HAVE_COMPATIBLE_LOG10_EXITCODE 0)
set_cache_value(HAVE_COMPATIBLE_LOG_EXITCODE 0)
set_cache_value(HAVE_COMPATIBLE_POW_EXITCODE 0)
set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 1)
set_cache_value(HAVE_LARGE_SNPRINTF_SUPPORT_EXITCODE 0)
set_cache_value(HAVE_MMAP_DEV_ZERO_EXITCODE 1)
set_cache_value(HAVE_PROCFS_CTL_EXITCODE 1)
set_cache_value(HAVE_PROCFS_MAPS_EXITCODE 1)
set_cache_value(HAVE_PROCFS_STATUS_EXITCODE 1)
set_cache_value(HAVE_PROCFS_STAT_EXITCODE 1)
set_cache_value(HAVE_SCHED_GET_PRIORITY_EXITCODE 0)
set_cache_value(HAVE_VALID_NEGATIVE_INF_POW_EXITCODE 0)
set_cache_value(HAVE_VALID_POSITIVE_INF_POW_EXITCODE 0)
set_cache_value(HAVE_WORKING_CLOCK_GETTIME_EXITCODE 0)
set_cache_value(HAVE_WORKING_GETTIMEOFDAY_EXITCODE 0)
set_cache_value(MMAP_ANON_IGNORES_PROTECTION_EXITCODE 1)
set_cache_value(ONE_SHARED_MAPPING_PER_FILEREGION_PER_PROCESS_EXITCODE 1)
set_cache_value(PTHREAD_CREATE_MODIFIES_ERRNO_EXITCODE 1)
set_cache_value(REALPATH_SUPPORTS_NONEXISTENT_FILES_EXITCODE 1)
set_cache_value(SEM_INIT_MODIFIES_ERRNO_EXITCODE 1)
set_cache_value(SSCANF_CANNOT_HANDLE_MISSING_EXPONENT_EXITCODE 1)
set_cache_value(SSCANF_SUPPORT_ll_EXITCODE 0)
set_cache_value(UNGETC_NOT_RETURN_EOF_EXITCODE 1)
set_cache_value(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP_EXITCODE 1)
6 changes: 4 additions & 2 deletions src/coreclr/clrdefinitions.cmake
Original file line number Diff line number Diff line change
@@ -29,9 +29,9 @@ if (CLR_CMAKE_TARGET_UNIX)

endif(CLR_CMAKE_TARGET_UNIX)

if (CLR_CMAKE_TARGET_OSX AND CLR_CMAKE_TARGET_ARCH_ARM64)
if (CLR_CMAKE_TARGET_APPLE AND CLR_CMAKE_TARGET_ARCH_ARM64)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_ARCH>>>:OSX_ARM64_ABI>)
endif(CLR_CMAKE_TARGET_OSX AND CLR_CMAKE_TARGET_ARCH_ARM64)
endif(CLR_CMAKE_TARGET_APPLE AND CLR_CMAKE_TARGET_ARCH_ARM64)

if(CLR_CMAKE_TARGET_ALPINE_LINUX)
# Alpine Linux doesn't have fixed stack limit, this define disables some stack pointer
@@ -249,9 +249,11 @@ function(set_target_definitions_to_custom_os_and_arch)
elseif (TARGETDETAILS_ARCH STREQUAL "loongarch64")
endif()
if ((TARGETDETAILS_ARCH STREQUAL "arm64") AND (TARGETDETAILS_OS STREQUAL "unix_osx"))
target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_APPLE)
target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE OSX_ARM64_ABI)
endif()
if (TARGETDETAILS_OS STREQUAL "unix_osx")
target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_APPLE)
target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE TARGET_OSX)
endif()
elseif (TARGETDETAILS_OS STREQUAL "win")
2 changes: 1 addition & 1 deletion src/coreclr/clrfeatures.cmake
Original file line number Diff line number Diff line change
@@ -36,6 +36,6 @@ if (CLR_CMAKE_TARGET_WIN32 OR CLR_CMAKE_TARGET_UNIX)
set(FEATURE_COMWRAPPERS 1)
endif()

if (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS)
if (CLR_CMAKE_TARGET_APPLE)
set(FEATURE_OBJCMARSHAL 1)
endif()
2 changes: 1 addition & 1 deletion src/coreclr/crosscomponents.cmake
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ if (CLR_CMAKE_HOST_OS STREQUAL CLR_CMAKE_TARGET_OS)
endif()
endif()

if(NOT CLR_CMAKE_HOST_LINUX AND NOT CLR_CMAKE_HOST_OSX AND NOT FEATURE_CROSSBITNESS)
if(NOT CLR_CMAKE_HOST_LINUX AND NOT CLR_CMAKE_HOST_APPLE AND NOT FEATURE_CROSSBITNESS)
install_clr (TARGETS
mscordaccore
mscordbi
Loading