From 5015d0321c8faf00f0a051831fd31041e7515b29 Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Mon, 1 Feb 2021 10:50:51 -0500 Subject: [PATCH 01/28] Initial support for Mac Catalyst for mono subset (incl SPC) --- Directory.Build.props | 3 ++- eng/build.sh | 6 ++++-- eng/native/init-distro-rid.sh | 2 ++ .../System.Private.CoreLib.Shared.projitems | 2 +- src/mono/mono.proj | 19 +++++++++++++++++-- src/mono/mono/mini/aot-compiler.c | 2 +- src/mono/mono/mini/graph.c | 2 +- src/mono/mono/mini/helpers.c | 2 +- 8 files changed, 29 insertions(+), 9 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 1f3e8c1d192cf..a044cbc586996 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -176,6 +176,7 @@ true true true + true true true true @@ -183,7 +184,7 @@ true true true - true + true diff --git a/eng/build.sh b/eng/build.sh index 10553485e3a1b..93f62d7808704 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -28,7 +28,7 @@ usage() echo " --help (-h) Print help and exit." echo " --librariesConfiguration (-lc) Libraries build configuration: Debug or Release." echo " [Default: Debug]" - echo " --os Target operating system: windows, Linux, FreeBSD, OSX, tvOS, iOS, Android," + echo " --os Target operating system: windows, Linux, FreeBSD, OSX, Catalyst, tvOS, iOS, Android," echo " Browser, NetBSD, illumos or Solaris." echo " [Default: Your machine's OS.]" echo " --projects Project or solution file(s) to build." @@ -262,6 +262,8 @@ while [[ $# > 0 ]]; do os="FreeBSD" ;; osx) os="OSX" ;; + catalyst) + os="Catalyst" ;; tvos) os="tvOS" ;; ios) @@ -276,7 +278,7 @@ while [[ $# > 0 ]]; do os="Solaris" ;; *) echo "Unsupported target OS '$2'." - echo "The allowed values are windows, Linux, FreeBSD, OSX, tvOS, iOS, Android, Browser, illumos and Solaris." + echo "The allowed values are windows, Linux, FreeBSD, OSX, Catalyst, tvOS, iOS, Android, Browser, illumos and Solaris." exit 1 ;; esac diff --git a/eng/native/init-distro-rid.sh b/eng/native/init-distro-rid.sh index fea888fdf7810..c647d08de1cce 100644 --- a/eng/native/init-distro-rid.sh +++ b/eng/native/init-distro-rid.sh @@ -170,6 +170,8 @@ initDistroRidGlobal() distroRid="linux-$buildArch" elif [ "$targetOs" = "OSX" ]; then distroRid="osx-$buildArch" + elif [ "$targetOs" = "Catalyst" ]; then + distroRid="maccatalyst-$buildArch" elif [ "$targetOs" = "tvOS" ]; then distroRid="tvos-$buildArch" elif [ "$targetOs" = "iOS" ]; then diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems index fd5b33c24c7b1..af4f116ef9766 100644 --- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems +++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems @@ -10,7 +10,7 @@ enable - true + true true true $(MSBuildThisFileDirectory)ILLink\ diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 0c7077d0e59de..53370d37f16b0 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -19,6 +19,7 @@ .sh coreclr.dll libcoreclr.dylib + libcoreclr.dylib libcoreclr.so libmonosgen-2.0.dylib libmonosgen-2.0.so @@ -64,7 +65,7 @@ - + <_MonoCMakeArgs Include="-DENABLE_WERROR=1"/> @@ -201,6 +202,19 @@ <_MonoBuildEnv Condition="'$(Platform)' == 'arm64'" Include="arch -arch arm64" /> + + + <_MonoCMakeArgs Include="-DCMAKE_BUILD_TYPE=MAC_CATALYST" /> + <_MonoCFlags Include="-target x86_64-apple-ios13.2-macabi" /> + <_MonoCFlags Include="-DMAC_CATALYST" /> + <_MonoCFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" /> + <_MonoCXXFlags Include="-target x86_64-apple-ios13.2-macabi" /> + <_MonoCXXFlags Include="-DMAC_CATALYST" /> + <_MonoCXXFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" /> + <_MonoLDFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" /> + + <_MonoBuildEnv Condition="'$(Platform)' == 'arm64'" Include="arch -arch arm64" /> + <_MonoMinimal Condition="'$(Configuration)' == 'Release'">,assert_messages @@ -500,6 +514,7 @@ <_MonoRuntimeFilePath Condition="'$(TargetsWindows)' == 'true'">$(MonoObjDir)out\bin\monosgen-2.0.dll <_MonoRuntimeFilePath Condition="'$(TargetsOSX)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.dylib + <_MonoRuntimeFilePath Condition="'$(TargetsCatalyst)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.dylib <_MonoRuntimeFilePath Condition="'$(TargetsiOS)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.dylib <_MonoRuntimeFilePath Condition="'$(TargetstvOS)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.dylib <_MonoRuntimeFilePath Condition="'$(TargetsBrowser)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.a @@ -559,7 +574,7 @@ SkipUnchangedFiles="true" Condition="'$(MonoGenerateOffsetsOSGroups)' == '' and ('$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsAndroid)' == 'true' or '$(TargetsBrowser)' == 'true')"/> - + diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c index a87b4eda72dfb..099216944c7cd 100644 --- a/src/mono/mono/mini/aot-compiler.c +++ b/src/mono/mono/mini/aot-compiler.c @@ -10027,7 +10027,7 @@ execute_system (const char * command) g_free (wstr); g_free (quoted_command); -#elif defined (HAVE_SYSTEM) +#elif defined (HAVE_SYSTEM) && !defined(MAC_CATALYST) status = system (command); #else g_assert_not_reached (); diff --git a/src/mono/mono/mini/graph.c b/src/mono/mono/mini/graph.c index 39d7bdec76e74..1fd4973784f7e 100644 --- a/src/mono/mono/mini/graph.c +++ b/src/mono/mono/mini/graph.c @@ -223,7 +223,7 @@ mono_draw_graph (MonoCompile *cfg, MonoGraphOptions draw_options) fclose (fp); -#ifdef HAVE_SYSTEM +#if defined(HAVE_SYSTEM) && !defined(MAC_CATALYST) //com = g_strdup_printf ("dot %s -Tpng -o %s.png; eog %s.png", fn, fn, fn); com = g_strdup_printf ("dot %s -Tps -o %s.ps;gv %s.ps", fn, fn, fn); _i = system (com); diff --git a/src/mono/mono/mini/helpers.c b/src/mono/mono/mini/helpers.c index 0a7b0d9b43373..9963bfeef3352 100644 --- a/src/mono/mono/mini/helpers.c +++ b/src/mono/mono/mini/helpers.c @@ -252,7 +252,7 @@ mono_disassemble_code (MonoCompile *cfg, guint8 *code, int size, char *id) close (i); #endif -#ifdef HAVE_SYSTEM +#if defined(HAVE_SYSTEM) && !defined(MAC_CATALYST) char *cmd = g_strdup_printf (ARCH_PREFIX AS_CMD " %s -o %s", as_file, o_file); unused = system (cmd); g_free (cmd); From 8980f4115736dec70ce20d0401d6a41398e267cf Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Mon, 1 Feb 2021 17:05:27 -0500 Subject: [PATCH 02/28] Get host and libs.native building. Lingering type forward issue w/ libs --- eng/native/build-commons.sh | 6 +++- eng/native/configurecompiler.cmake | 29 ++++++++++++------- eng/native/configureplatform.cmake | 5 ++++ eng/native/configuretools.cmake | 2 +- eng/native/functions.cmake | 10 +++---- eng/targetframeworksuffix.props | 7 +++++ .../Assets/TestUtils/TestProjects.targets | 2 +- src/libraries/Native/Unix/CMakeLists.txt | 21 ++++++++++---- .../CMakeLists.txt | 4 +-- .../CMakeLists.txt | 2 +- .../Native/Unix/System.Native/CMakeLists.txt | 8 ++--- .../Unix/System.Native/extra_libs.cmake | 2 +- .../System.Net.Security.Native/CMakeLists.txt | 4 +-- .../CMakeLists.txt | 6 +++- .../entrypoints.c | 4 +-- .../pal_ecc.c | 2 +- .../pal_ecc.h | 2 +- .../pal_keychain.c | 2 +- .../pal_keychain.h | 2 +- .../pal_rsa.c | 2 +- .../pal_rsa.h | 2 +- .../pal_sec.c | 2 +- .../pal_sec.h | 2 +- .../pal_seckey.c | 4 +-- .../pal_seckey.h | 4 +-- .../pal_signverify.c | 2 +- .../pal_signverify.h | 2 +- .../pal_ssl.c | 4 +-- .../pal_trust.c | 2 +- .../pal_trust.h | 2 +- .../pal_x509.c | 4 +-- .../pal_x509.h | 2 +- .../CMakeLists.txt | 2 +- src/libraries/Native/Unix/configure.cmake | 10 ++++++- .../CMakeLists.txt | 2 +- .../System.Console/src/System.Console.csproj | 4 +-- .../src/System.Data.Odbc.csproj | 2 +- .../tests/System.Data.Odbc.Tests.csproj | 2 +- .../src/System.Diagnostics.Process.csproj | 2 +- .../src/System.IO.FileSystem.Watcher.csproj | 2 +- .../System.IO.FileSystem.Watcher.Tests.csproj | 2 +- .../src/System.Net.Http.csproj | 8 ++--- .../System.Net.Http.Unit.Tests.csproj | 6 ++-- .../src/System.Net.NetworkInformation.csproj | 4 +-- .../src/System.Net.Quic.csproj | 2 +- .../src/System.Net.Security.csproj | 6 ++-- .../System.Private.CoreLib.Shared.projitems | 3 +- ...em.Security.Cryptography.Algorithms.csproj | 4 +-- ...stem.Security.Cryptography.Encoding.csproj | 10 +++---- ...urity.Cryptography.X509Certificates.csproj | 6 ++-- ...Cryptography.X509Certificates.Tests.csproj | 4 +-- src/mono/mono.proj | 1 - .../System.Private.CoreLib.csproj | 2 +- 53 files changed, 141 insertions(+), 97 deletions(-) diff --git a/eng/native/build-commons.sh b/eng/native/build-commons.sh index 775e4a90ac2b7..8c5be3ac7ba32 100755 --- a/eng/native/build-commons.sh +++ b/eng/native/build-commons.sh @@ -78,7 +78,7 @@ build_native() # All set to commence the build echo "Commencing build of \"$message\" for $__TargetOS.$__BuildArch.$__BuildType in $intermediatesDir" - if [[ "$targetOS" == OSX ]]; then + if [[ "$targetOS" == OSX || "$targetOS" == Catalyst ]]; then if [[ "$platformArch" == x64 ]]; then cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"x86_64\" $cmakeArgs" elif [[ "$platformArch" == arm64 ]]; then @@ -89,6 +89,10 @@ build_native() fi fi + if [[ "$targetOS" == Catalyst ]]; then + cmakeArgs="-DCLR_CMAKE_TARGET_CATALYST=1 $cmakeArgs" + fi + if [[ "$__UseNinja" == 1 ]]; then generator="ninja" buildTool="$(command -v ninja || command -v ninja-build)" diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index 2d19d97486342..231f11e5c191b 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -386,19 +386,26 @@ if (CLR_CMAKE_HOST_UNIX) # Specify the minimum supported version of macOS if(CLR_CMAKE_HOST_OSX) - if(CLR_CMAKE_HOST_ARCH_ARM64) - # 'pthread_jit_write_protect_np' is only available on macOS 11.0 or newer - set(MACOS_VERSION_MIN_FLAGS -mmacosx-version-min=11.0) - add_compile_options(-arch arm64) - elseif(CLR_CMAKE_HOST_ARCH_AMD64) - set(MACOS_VERSION_MIN_FLAGS -mmacosx-version-min=10.13) - add_compile_options(-arch x86_64) + # Mac Catalyst needs a special CFLAG, exclusive with mmacosx-version-min + if(CLR_CMAKE_TARGET_CATALYST) + add_compile_options(-target x86_64-apple-ios13.2-macabi) + add_link_options(-target x86_64-apple-ios13.2-macabi) else() - clr_unknown_arch() - endif() - add_compile_options(${MACOS_VERSION_MIN_FLAGS}) - add_linker_flag(${MACOS_VERSION_MIN_FLAGS}) + if(CLR_CMAKE_HOST_ARCH_ARM64) + # 'pthread_jit_write_protect_np' is only available on macOS 11.0 or newer + set(MACOS_VERSION_MIN_FLAGS -mmacosx-version-min=11.0) + add_compile_options(-arch arm64) + elseif(CLR_CMAKE_HOST_ARCH_AMD64) + set(MACOS_VERSION_MIN_FLAGS -mmacosx-version-min=10.13) + add_compile_options(-arch x86_64) + else() + clr_unknown_arch() + endif() + add_compile_options(${MACOS_VERSION_MIN_FLAGS}) + add_linker_flag(${MACOS_VERSION_MIN_FLAGS}) + endif(CLR_CMAKE_TARGET_CATALYST) endif(CLR_CMAKE_HOST_OSX) + endif(CLR_CMAKE_HOST_UNIX) if(CLR_CMAKE_TARGET_UNIX) diff --git a/eng/native/configureplatform.cmake b/eng/native/configureplatform.cmake index f8b1a10c0e8ff..eeb92180ef2a5 100644 --- a/eng/native/configureplatform.cmake +++ b/eng/native/configureplatform.cmake @@ -305,6 +305,11 @@ if(CLR_CMAKE_TARGET_OS STREQUAL iOS) set(CLR_CMAKE_TARGET_IOS 1) endif(CLR_CMAKE_TARGET_OS STREQUAL iOS) +if(CLR_CMAKE_TARGET_OS STREQUAL Catalyst) + set(CLR_CMAKE_TARGET_UNIX 1) + set(CLR_CMAKE_TARGET_CATALYST 1) +endif(CLR_CMAKE_TARGET_OS STREQUAL Catalyst) + if(CLR_CMAKE_TARGET_OS STREQUAL tvOS) set(CLR_CMAKE_TARGET_UNIX 1) set(CLR_CMAKE_TARGET_TVOS 1) diff --git a/eng/native/configuretools.cmake b/eng/native/configuretools.cmake index 70cd43dd71247..30e5f802b118b 100644 --- a/eng/native/configuretools.cmake +++ b/eng/native/configuretools.cmake @@ -47,7 +47,7 @@ if(NOT WIN32 AND NOT CLR_CMAKE_TARGET_BROWSER) locate_toolchain_exec(link CMAKE_LINKER) endif() - if(NOT CLR_CMAKE_TARGET_OSX 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_OSX AND NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND (NOT CLR_CMAKE_TARGET_ANDROID OR CROSS_ROOTFS)) locate_toolchain_exec(objdump CMAKE_OBJDUMP) if(CLR_CMAKE_TARGET_ANDROID) diff --git a/eng/native/functions.cmake b/eng/native/functions.cmake index eec30971ecb5d..cbae9131dd128 100644 --- a/eng/native/functions.cmake +++ b/eng/native/functions.cmake @@ -211,7 +211,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_IOS OR CLR_CMAKE_TARGET_TVOS) + if(CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) set(SCRIPT_NAME generateexportedsymbols.sh) else() set(SCRIPT_NAME generateversionscript.sh) @@ -252,7 +252,7 @@ function(strip_symbols targetName outputFilename) if (CLR_CMAKE_HOST_UNIX) set(strip_source_file $) - if (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) + if (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) set(strip_destination_file ${strip_source_file}.dwarf) # Ensure that dsymutil and strip are present @@ -281,7 +281,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_IOS OR CLR_CMAKE_TARGET_TVOS) + else (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) set(strip_destination_file ${strip_source_file}.dbg) add_custom_command( @@ -293,7 +293,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_IOS OR CLR_CMAKE_TARGET_TVOS) + endif (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) set(${outputFilename} ${strip_destination_file} PARENT_SCOPE) else(CLR_CMAKE_HOST_UNIX) @@ -316,7 +316,7 @@ function(install_with_stripped_symbols targetName kind destination) install_symbols(${symbol_file} ${destination}) endif() - if ((CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) AND ("${kind}" STREQUAL "TARGETS")) + if ((CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) AND ("${kind}" STREQUAL "TARGETS")) # We want to avoid the kind=TARGET install behaviors which corrupt code signatures on osx-arm64 set(kind PROGRAMS) endif() diff --git a/eng/targetframeworksuffix.props b/eng/targetframeworksuffix.props index e4473df46fa74..a777231f93fb1 100644 --- a/eng/targetframeworksuffix.props +++ b/eng/targetframeworksuffix.props @@ -46,6 +46,13 @@ osx + + + true + true + maccatalyst + + true diff --git a/src/installer/tests/Assets/TestUtils/TestProjects.targets b/src/installer/tests/Assets/TestUtils/TestProjects.targets index 3ab4d72988c5a..b6f1b073a9688 100644 --- a/src/installer/tests/Assets/TestUtils/TestProjects.targets +++ b/src/installer/tests/Assets/TestUtils/TestProjects.targets @@ -17,7 +17,7 @@ LatestRuntimeFrameworkVersion="6.0.0-alpha.1.20602.4" RuntimeFrameworkName="Microsoft.NETCore.App" RuntimePackNamePatterns="Microsoft.NETCore.App.Runtime.**RID**" - RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;osx-arm64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;ios-arm64;ios-arm;ios-x64;ios-x86;tvos-arm64;tvos-x64;android-arm64;android-arm;android-x64;android-x86;browser-wasm" + RuntimePackRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;osx-arm64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;maccatalyst-x64;maccatalyst-arm64;ios-arm64;ios-arm;ios-x64;ios-x86;tvos-arm64;tvos-x64;android-arm64;android-arm;android-x64;android-x86;browser-wasm" TargetFramework="net6.0" TargetingPackName="Microsoft.NETCore.App.Ref" TargetingPackVersion="6.0.0-alpha.1.20602.4" /> diff --git a/src/libraries/Native/Unix/CMakeLists.txt b/src/libraries/Native/Unix/CMakeLists.txt index ebc9ff30e9ea8..086311e8474a7 100644 --- a/src/libraries/Native/Unix/CMakeLists.txt +++ b/src/libraries/Native/Unix/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.6.2) include(CheckCCompilerFlag) -if(CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) +if(CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) # CMake 3.14.5 contains bug fixes for iOS cmake_minimum_required(VERSION 3.14.5) endif() @@ -13,7 +13,7 @@ include(../../../../eng/native/configurepaths.cmake) include(${CLR_ENG_NATIVE_DIR}/configuretools.cmake) set(CMAKE_MACOSX_RPATH ON) -if(CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) +if(CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) set(CMAKE_INSTALL_NAME_DIR "@rpath") endif() @@ -76,6 +76,11 @@ if(CLR_CMAKE_TARGET_BROWSER) set(STATIC_LIB_DESTINATION .) endif() +if(CLR_CMAKE_TARGET_CATALYST) + add_compile_options(-target x86_64-apple-ios13.2-macabi) + add_link_options(-target x86_64-apple-ios13.2-macabi) +endif() + if (CLR_CMAKE_TARGET_ARCH_AMD64) add_definitions(-DTARGET_64BIT=1) add_definitions(-DTARGET_AMD64) @@ -168,7 +173,7 @@ else () endif () if(CLR_CMAKE_TARGET_BROWSER) -elseif (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) +elseif (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) add_definitions(-D__APPLE_USE_RFC_3542) # We cannot enable "stack-protector-strong" on OS X due to a bug in clang compiler (current version 7.0.2) @@ -188,7 +193,7 @@ endif () # ./build-native.sh cmakeargs -DCLR_ADDITIONAL_COMPILER_OPTIONS=<...> cmakeargs -DCLR_ADDITIONAL_LINKER_FLAGS=<...> # if(CLR_CMAKE_TARGET_UNIX) - if(NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS) + if(NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS) if(CLR_CMAKE_TARGET_OSX) add_definitions(-DTARGET_OSX) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-bind_at_load") @@ -216,7 +221,7 @@ include(configure.cmake) add_subdirectory(System.IO.Compression.Native) -if (NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) +if (NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) add_subdirectory(System.IO.Ports.Native) endif() @@ -228,6 +233,10 @@ add_subdirectory(System.Native) if(CLR_CMAKE_TARGET_BROWSER) # skip for now +elseif(CLR_CMAKE_TARGET_CATALYST) + add_subdirectory(System.Net.Security.Native) + # System.Security.Cryptography.Native is intentionally disabled on iOS + # it is only used for interacting with OpenSSL which isn't useful there elseif(CLR_CMAKE_TARGET_IOS) add_subdirectory(System.Net.Security.Native) # System.Security.Cryptography.Native is intentionally disabled on iOS @@ -248,7 +257,7 @@ else() add_subdirectory(System.Security.Cryptography.Native) endif() -if(CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) +if(CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) add_subdirectory(System.Security.Cryptography.Native.Apple) endif() diff --git a/src/libraries/Native/Unix/System.Globalization.Native/CMakeLists.txt b/src/libraries/Native/Unix/System.Globalization.Native/CMakeLists.txt index 080ac34fdf623..3e2bf4d1888f1 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/CMakeLists.txt +++ b/src/libraries/Native/Unix/System.Globalization.Native/CMakeLists.txt @@ -62,7 +62,7 @@ set(NATIVEGLOBALIZATION_SOURCES pal_icushim.c ) -if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) +if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) set(NATIVEGLOBALIZATION_SOURCES ${NATIVEGLOBALIZATION_SOURCES} entrypoints.c) endif() @@ -98,7 +98,7 @@ endif() install (TARGETS System.Globalization.Native-Static DESTINATION ${STATIC_LIB_DESTINATION}) -if(NOT CLR_CMAKE_TARGET_OSX AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) +if(NOT CLR_CMAKE_TARGET_OSX AND NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) if (GEN_SHARED_LIB) add_custom_command(TARGET System.Globalization.Native POST_BUILD COMMENT "Verifying System.Globalization.Native.so dependencies" diff --git a/src/libraries/Native/Unix/System.IO.Compression.Native/CMakeLists.txt b/src/libraries/Native/Unix/System.IO.Compression.Native/CMakeLists.txt index dbdefbc99955c..0ff90b495c6fc 100644 --- a/src/libraries/Native/Unix/System.IO.Compression.Native/CMakeLists.txt +++ b/src/libraries/Native/Unix/System.IO.Compression.Native/CMakeLists.txt @@ -68,7 +68,7 @@ if (GEN_SHARED_LIB) ${NATIVE_LIBS_EXTRA} ) - if (NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) + if (NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/System.IO.Compression.Native_unixexports.src) set(EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/System.IO.Compression.Native.exports) generate_exports_file(${DEF_SOURCES} ${EXPORTS_FILE}) diff --git a/src/libraries/Native/Unix/System.Native/CMakeLists.txt b/src/libraries/Native/Unix/System.Native/CMakeLists.txt index 641ac75735de9..ec11b8f2f3857 100644 --- a/src/libraries/Native/Unix/System.Native/CMakeLists.txt +++ b/src/libraries/Native/Unix/System.Native/CMakeLists.txt @@ -1,6 +1,6 @@ project(System.Native C) -if (NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS) +if (NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS) add_definitions(-DHAS_CONSOLE_SIGNALS) endif () @@ -29,7 +29,7 @@ set(NATIVE_SOURCES pal_sysctl.c ) -if (CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) +if (CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) set(NATIVE_SOURCES ${NATIVE_SOURCES} pal_log.m pal_searchpath.m) @@ -60,7 +60,7 @@ if (GEN_SHARED_LIB) ${NATIVE_LIBS_EXTRA} ) - if (NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) + if (NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) add_custom_command(TARGET System.Native POST_BUILD COMMENT "Verifying System.Native entry points against entrypoints.c " COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../verify-entrypoints.sh @@ -74,7 +74,7 @@ if (GEN_SHARED_LIB) install_with_stripped_symbols (System.Native PROGRAMS .) endif () -if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) +if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) set(NATIVE_SOURCES ${NATIVE_SOURCES} entrypoints.c) endif() diff --git a/src/libraries/Native/Unix/System.Native/extra_libs.cmake b/src/libraries/Native/Unix/System.Native/extra_libs.cmake index 7a04e35f46e30..6e489aea2aece 100644 --- a/src/libraries/Native/Unix/System.Native/extra_libs.cmake +++ b/src/libraries/Native/Unix/System.Native/extra_libs.cmake @@ -10,7 +10,7 @@ macro(append_extra_system_libs NativeLibsExtra) list(APPEND ${NativeLibsExtra} socket) endif () - if (CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) + if (CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) list(APPEND ${NativeLibsExtra} "-framework Foundation") endif () diff --git a/src/libraries/Native/Unix/System.Net.Security.Native/CMakeLists.txt b/src/libraries/Native/Unix/System.Net.Security.Native/CMakeLists.txt index cf1739205bfa9..0b6239fce30e2 100644 --- a/src/libraries/Native/Unix/System.Net.Security.Native/CMakeLists.txt +++ b/src/libraries/Native/Unix/System.Net.Security.Native/CMakeLists.txt @@ -19,7 +19,7 @@ if (GEN_SHARED_LIB) ) endif() -if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) +if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) set(NATIVEGSS_SOURCES ${NATIVEGSS_SOURCES} entrypoints.c) endif() @@ -35,7 +35,7 @@ if (GEN_SHARED_LIB) ${NATIVE_LIBS_EXTRA} ) - if (NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) + if (NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) add_custom_command(TARGET System.Net.Security.Native POST_BUILD COMMENT "Verifying System.Net.Security.Native entry points against entrypoints.c " COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../verify-entrypoints.sh diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/CMakeLists.txt b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/CMakeLists.txt index ae4d764cbbba9..bb31d55e18982 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/CMakeLists.txt +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/CMakeLists.txt @@ -23,6 +23,10 @@ set(NATIVECRYPTO_SOURCES pal_x509chain.c ) +if (CLR_CMAKE_TARGET_CATALYST) + add_definitions(-DTARGET_CATALYST) +endif() + if (CLR_CMAKE_TARGET_IOS) add_definitions(-DTARGET_IOS) endif() @@ -39,7 +43,7 @@ if (GEN_SHARED_LIB) ) endif() -if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) +if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) set(NATIVECRYPTO_SOURCES ${NATIVECRYPTO_SOURCES} entrypoints.c) endif() diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/entrypoints.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/entrypoints.c index 3736fee0c1865..b084c43972867 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/entrypoints.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/entrypoints.c @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) #include "../../AnyOS/entrypoints.h" @@ -112,4 +112,4 @@ EXTERN_C const void* CryptoAppleResolveDllImport(const char* name) return ResolveDllImport(s_cryptoAppleNative, lengthof(s_cryptoAppleNative), name); } -#endif // !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#endif // !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.c index 59b0491a6cd1f..630df6a90a7e5 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.c @@ -3,7 +3,7 @@ #include "pal_ecc.h" -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) int32_t AppleCryptoNative_EccGenerateKey( int32_t keySizeBits, SecKeychainRef tempKeychain, SecKeyRef* pPublicKey, SecKeyRef* pPrivateKey, int32_t* pOSStatus) { diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.h index a3ddd1c182c1e..63b7112581dcc 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.h @@ -8,7 +8,7 @@ #include -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) /* Generate an ECC keypair of the specified size. diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.c index 1443290f434a4..40dea0d6b11cb 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.c @@ -4,7 +4,7 @@ #include "pal_keychain.h" #include "pal_utilities.h" -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) int32_t AppleCryptoNative_SecKeychainItemCopyKeychain(SecKeychainItemRef item, SecKeychainRef* pKeychainOut) { if (pKeychainOut != NULL) diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.h index 3274f0c49c263..54f7266240adc 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.h @@ -8,7 +8,7 @@ #include -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) /* Get a CFRetain()ed SecKeychainRef value for the keychain to which the keychain item belongs. diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.c index c5253e48ae57c..1ea0a8f1f1ea1 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.c @@ -3,7 +3,7 @@ #include "pal_rsa.h" -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) static int32_t ExecuteCFDataTransform( SecTransformRef xform, uint8_t* pbData, int32_t cbData, CFDataRef* pDataOut, CFErrorRef* pErrorOut); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.h index ce9976095a1cb..301dd437e3017 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.h @@ -9,7 +9,7 @@ #include -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) /* Generate a new RSA keypair with the specified key size, in bits. diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.c index 0fcaa51f4b44b..34a8a776fd2c7 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.c @@ -3,7 +3,7 @@ #include "pal_sec.h" -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) CFStringRef AppleCryptoNative_SecCopyErrorMessageString(int32_t osStatus) { return SecCopyErrorMessageString(osStatus, NULL); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.h index 0b6b65778c51f..f7f42dc559aad 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.h @@ -8,7 +8,7 @@ #include -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) /* Get an error message for an OSStatus error from the security library. diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.c index f4bca5827286e..4eff6ea5ed658 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.c @@ -4,7 +4,7 @@ #include "pal_seckey.h" #include "pal_utilities.h" -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) int32_t AppleCryptoNative_SecKeyExport( SecKeyRef pKey, int32_t exportPrivate, CFStringRef cfExportPassphrase, CFDataRef* ppDataOut, int32_t* pOSStatus) { @@ -140,7 +140,7 @@ uint64_t AppleCryptoNative_SecKeyGetSimpleKeySizeInBytes(SecKeyRef publicKey) return SecKeyGetBlockSize(publicKey); } -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) OSStatus ExportImportKey(SecKeyRef* key, SecExternalItemType type) { SecExternalFormat dataFormat = kSecFormatOpenSSL; diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.h index fcffc3023d107..8970520ffdcbb 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.h @@ -16,7 +16,7 @@ static const int32_t kErrorSeeError = -2; static const int32_t kErrorUnknownAlgorithm = -3; static const int32_t kErrorUnknownState = -4; -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) /* Export a key object. @@ -60,7 +60,7 @@ For ECC the value should not be used. */ PALEXPORT uint64_t AppleCryptoNative_SecKeyGetSimpleKeySizeInBytes(SecKeyRef publicKey); -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) /* Export a key and re-import it to the NULL keychain. diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.c index 39550b5997816..793cc94b693a0 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.c @@ -3,7 +3,7 @@ #include "pal_signverify.h" -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) static int32_t ExecuteSignTransform(SecTransformRef signer, CFDataRef* pSignatureOut, CFErrorRef* pErrorOut); static int32_t ExecuteVerifyTransform(SecTransformRef verifier, CFErrorRef* pErrorOut); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.h index e87ac9701c528..0643ec3d83025 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.h @@ -9,7 +9,7 @@ #include -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) /* Generate a signature for algorithms which require only the data hash blob, like DSA and ECDSA. diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.c index ac0d06b172a48..9eb4ade7a397b 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.c @@ -588,7 +588,7 @@ int32_t AppleCryptoNative_SslSetEnabledCipherSuites(SSLContextRef sslContext, co // Max numCipherSuites is 2^16 (all possible cipher suites) assert(numCipherSuites < (1 << 16)); -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) if (sizeof(SSLCipherSuite) == sizeof(uint32_t)) { #pragma clang diagnostic push @@ -600,7 +600,7 @@ int32_t AppleCryptoNative_SslSetEnabledCipherSuites(SSLContextRef sslContext, co else #endif { - // iOS, tvOS, watchOS + // Catalyst, iOS, tvOS, watchOS SSLCipherSuite* cipherSuites16 = (SSLCipherSuite*)calloc((size_t)numCipherSuites, sizeof(SSLCipherSuite)); if (cipherSuites16 == NULL) diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.c index 99afb40735460..5adb203ad9f57 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.c @@ -4,7 +4,7 @@ #include "pal_trust.h" #include "pal_utilities.h" -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) static bool CheckTrustMatch(SecCertificateRef cert, SecTrustSettingsDomain domain, SecTrustSettingsResult result, diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.h index 4339570fcaf1e..2245897822174 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.h @@ -8,7 +8,7 @@ #include -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) /* Enumerate the certificates which are root trusted by the user. diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.c index 649b5ed2e566e..51458aca0c737 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.c @@ -107,7 +107,7 @@ PAL_X509ContentType AppleCryptoNative_X509GetContentType(uint8_t* pbData, int32_ return PAL_Certificate; } -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) SecExternalFormat dataFormat = kSecFormatPKCS7; SecExternalFormat actualFormat = dataFormat; SecExternalItemType itemType = kSecItemTypeAggregate; @@ -257,7 +257,7 @@ int32_t AppleCryptoNative_X509CopyPrivateKeyFromIdentity(SecIdentityRef identity return SecIdentityCopyPrivateKey(identity, pPrivateKeyOut); } -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) static int32_t ReadX509(uint8_t* pbData, int32_t cbData, PAL_X509ContentType contentType, diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.h index f9d2f4c322a44..4be8c63d88fb2 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.h @@ -73,7 +73,7 @@ pPrivateKeyOut: Receives a SecKeyRef for the private key associated with the ide */ PALEXPORT int32_t AppleCryptoNative_X509CopyPrivateKeyFromIdentity(SecIdentityRef identity, SecKeyRef* pPrivateKeyOut); -#if !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) /* Read cbData bytes of data from pbData and interpret it to a collection of certificates (or identities). diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/CMakeLists.txt b/src/libraries/Native/Unix/System.Security.Cryptography.Native/CMakeLists.txt index b9c01c3915949..4e185b22539e8 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/CMakeLists.txt +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/CMakeLists.txt @@ -97,7 +97,7 @@ if (GEN_SHARED_LIB) endif() endif() - if (NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) + if (NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) add_custom_command(TARGET System.Security.Cryptography.Native.OpenSsl POST_BUILD COMMENT "Verifying System.Security.Cryptography.Native.OpenSsl entry points against entrypoints.c " COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../verify-entrypoints.sh diff --git a/src/libraries/Native/Unix/configure.cmake b/src/libraries/Native/Unix/configure.cmake index 2d82decfde624..f22a127962747 100644 --- a/src/libraries/Native/Unix/configure.cmake +++ b/src/libraries/Native/Unix/configure.cmake @@ -25,6 +25,8 @@ elseif (CLR_CMAKE_TARGET_OSX) # Xcode's clang does not include /usr/local/include by default, but brew's does. # This ensures an even playing field. include_directories(SYSTEM /usr/local/include) +elseif (CLR_CMAKE_TARGET_CATALYST) + set(PAL_UNIX_NAME \"CATALYST\") elseif (CLR_CMAKE_TARGET_IOS) set(PAL_UNIX_NAME \"IOS\") elseif (CLR_CMAKE_TARGET_TVOS) @@ -503,6 +505,12 @@ if(CLR_CMAKE_TARGET_IOS) unset(HAVE_CLOCK_MONOTONIC) # only exists on iOS 10+ unset(HAVE_CLOCK_REALTIME) # only exists on iOS 10+ unset(HAVE_FORK) # exists but blocked by kernel +elseif(CLR_CMAKE_TARGET_CATALYST) + # Manually set results from check_c_source_runs() since it's not possible to actually run it during CMake configure checking + unset(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP) + unset(HAVE_CLOCK_MONOTONIC) # only exists on iOS 10+ + unset(HAVE_CLOCK_REALTIME) # only exists on iOS 10+ + unset(HAVE_FORK) # exists but blocked by kernel elseif(CLR_CMAKE_TARGET_TVOS) # Manually set results from check_c_source_runs() since it's not possible to actually run it during CMake configure checking unset(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP) @@ -782,7 +790,7 @@ check_symbol_exists( "unistd.h;grp.h" HAVE_GETGROUPLIST) -if(CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) +if(CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) set(HAVE_IOS_NET_ROUTE_H 1) set(CMAKE_EXTRA_INCLUDE_FILES sys/types.h "${CMAKE_CURRENT_SOURCE_DIR}/System.Native/ios/net/route.h") else() diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/CMakeLists.txt b/src/libraries/Native/Windows/System.IO.Compression.Native/CMakeLists.txt index f35ddcfce15ac..435462a90b3a4 100644 --- a/src/libraries/Native/Windows/System.IO.Compression.Native/CMakeLists.txt +++ b/src/libraries/Native/Windows/System.IO.Compression.Native/CMakeLists.txt @@ -89,7 +89,7 @@ if (GEN_SHARED_LIB) ) endif() -if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) +if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) set(NATIVECOMPRESSION_SOURCES ${NATIVECOMPRESSION_SOURCES} ../../AnyOS/System.IO.Compression.Native/entrypoints.c) endif() diff --git a/src/libraries/System.Console/src/System.Console.csproj b/src/libraries/System.Console/src/System.Console.csproj index b4b5eb0bcb247..a333bb7d6dc99 100644 --- a/src/libraries/System.Console/src/System.Console.csproj +++ b/src/libraries/System.Console/src/System.Console.csproj @@ -19,7 +19,7 @@ Link="Common\System\Text\ConsoleEncoding.cs" /> - + @@ -149,7 +149,7 @@ Link="Common\System\Text\ValueStringBuilder.cs" /> - + diff --git a/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj b/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj index 20d918a90a125..0bf609c1c2436 100644 --- a/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj +++ b/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj @@ -118,7 +118,7 @@ - + diff --git a/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj b/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj index d22d70ea780ba..71a8ff3109105 100644 --- a/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj +++ b/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj b/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj index 8896c6b0bfd16..527303bf4dac1 100644 --- a/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj +++ b/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj @@ -286,7 +286,7 @@ - + diff --git a/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj b/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj index 2687d60160295..92b98d951ca13 100644 --- a/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj +++ b/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj @@ -75,7 +75,7 @@ - + diff --git a/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj b/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj index 6198325a2dfb7..8a4575f7e451b 100644 --- a/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj +++ b/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj @@ -32,7 +32,7 @@ - + diff --git a/src/libraries/System.Net.Http/src/System.Net.Http.csproj b/src/libraries/System.Net.Http/src/System.Net.Http.csproj index 43afb449b58aa..04146ae94fd33 100644 --- a/src/libraries/System.Net.Http/src/System.Net.Http.csproj +++ b/src/libraries/System.Net.Http/src/System.Net.Http.csproj @@ -6,7 +6,7 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-Solaris enable - + $(DefineConstants);SYSNETHTTP_NO_OPENSSL @@ -329,11 +329,11 @@ - + - + - + - - @@ -257,7 +257,7 @@ - + diff --git a/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj b/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj index 0ad2ab63dc2e4..b28b15df3af50 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj +++ b/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj @@ -145,7 +145,7 @@ - + @@ -164,7 +164,7 @@ - + diff --git a/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj b/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj index 2b75f1c3eeecb..dd1d9a49220c9 100644 --- a/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj +++ b/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj @@ -38,7 +38,7 @@ - + diff --git a/src/libraries/System.Net.Security/src/System.Net.Security.csproj b/src/libraries/System.Net.Security/src/System.Net.Security.csproj index a1b7848cf7c00..91c1a8e26834f 100644 --- a/src/libraries/System.Net.Security/src/System.Net.Security.csproj +++ b/src/libraries/System.Net.Security/src/System.Net.Security.csproj @@ -9,7 +9,7 @@ SR.SystemNetSecurity_PlatformNotSupported - + $(DefineConstants);SYSNETSECURITY_NO_OPENSSL @@ -268,7 +268,7 @@ - + @@ -326,7 +326,7 @@ - + $(DefineConstants);TARGET_UNIX $(DefineConstants);TARGET_WINDOWS $(DefineConstants);TARGET_OSX + $(DefineConstants);TARGET_CATALYST $(DefineConstants);TARGET_IOS $(DefineConstants);TARGET_TVOS $(DefineConstants);TARGET_BROWSER @@ -1818,7 +1819,7 @@ - + diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj b/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj index 3ab0e6157eb7f..42333a9f2a655 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj @@ -423,7 +423,7 @@ - + - + SR.SystemSecurityCryptographyEncoding_PlatformNotSupported - - + + @@ -52,7 +52,7 @@ - + @@ -79,7 +79,7 @@ - + @@ -123,7 +123,7 @@ - + diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj b/src/libraries/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj index 5c7060a7b40d2..18b84e827d1a6 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj @@ -282,7 +282,7 @@ - + System\Security\Cryptography\X509Certificates\Asn1\DistributionPointAsn.xml @@ -391,7 +391,7 @@ - + - + diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/System.Security.Cryptography.X509Certificates.Tests.csproj b/src/libraries/System.Security.Cryptography.X509Certificates/tests/System.Security.Cryptography.X509Certificates.Tests.csproj index 1ffcaefd56a99..f9df1fe8351c2 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/System.Security.Cryptography.X509Certificates.Tests.csproj +++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/System.Security.Cryptography.X509Certificates.Tests.csproj @@ -67,7 +67,7 @@ - + @@ -89,7 +89,7 @@ Link="Common\System\IO\PersistedFiles.Names.Unix.cs" /> - + diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 53370d37f16b0..098a8e4fae116 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -204,7 +204,6 @@ - <_MonoCMakeArgs Include="-DCMAKE_BUILD_TYPE=MAC_CATALYST" /> <_MonoCFlags Include="-target x86_64-apple-ios13.2-macabi" /> <_MonoCFlags Include="-DMAC_CATALYST" /> <_MonoCFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" /> diff --git a/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj index 7261d8bb7c27b..4df6e7ccf32d0 100644 --- a/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -268,7 +268,7 @@ - + Common\Interop\OSX\Interop.SearchPath.cs From 840e234a07ed46066f9211d444cdf39ba2bbde8a Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Tue, 2 Feb 2021 09:59:34 -0500 Subject: [PATCH 03/28] Add support for ARM64 Mac Catalyst --- eng/native/configurecompiler.cmake | 11 +++++++++-- src/libraries/Native/Unix/CMakeLists.txt | 9 +++++++-- src/mono/mono.proj | 6 ++++-- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index 231f11e5c191b..73269ffa3363b 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -388,8 +388,15 @@ if (CLR_CMAKE_HOST_UNIX) if(CLR_CMAKE_HOST_OSX) # Mac Catalyst needs a special CFLAG, exclusive with mmacosx-version-min if(CLR_CMAKE_TARGET_CATALYST) - add_compile_options(-target x86_64-apple-ios13.2-macabi) - add_link_options(-target x86_64-apple-ios13.2-macabi) + if(CLR_CMAKE_HOST_ARCH_ARM64) + add_compile_options(-target arm64-apple-ios13.2-macabi) + add_link_options(-target arm64-apple-ios13.2-macabi) + elseif(CLR_CMAKE_HOST_ARCH_AMD64) + add_compile_options(-target x86_64-apple-ios13.2-macabi) + add_link_options(-target x86_64-apple-ios13.2-macabi) + else() + clr_unknown_arch() + endif() else() if(CLR_CMAKE_HOST_ARCH_ARM64) # 'pthread_jit_write_protect_np' is only available on macOS 11.0 or newer diff --git a/src/libraries/Native/Unix/CMakeLists.txt b/src/libraries/Native/Unix/CMakeLists.txt index 086311e8474a7..c7e387d47c5b3 100644 --- a/src/libraries/Native/Unix/CMakeLists.txt +++ b/src/libraries/Native/Unix/CMakeLists.txt @@ -77,8 +77,13 @@ if(CLR_CMAKE_TARGET_BROWSER) endif() if(CLR_CMAKE_TARGET_CATALYST) - add_compile_options(-target x86_64-apple-ios13.2-macabi) - add_link_options(-target x86_64-apple-ios13.2-macabi) + if (CLR_CMAKE_TARGET_ARCH_AMD64) + add_compile_options(-target x86_64-apple-ios13.2-macabi) + add_link_options(-target x86_64-apple-ios13.2-macabi) + elseif (CLR_CMAKE_TARGET_ARCH_ARM64) + add_compile_options(-target arm64-apple-ios13.2-macabi) + add_link_options(-target arm64-apple-ios13.2-macabi) + endif() endif() if (CLR_CMAKE_TARGET_ARCH_AMD64) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 098a8e4fae116..dbb97383c1475 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -204,10 +204,12 @@ - <_MonoCFlags Include="-target x86_64-apple-ios13.2-macabi" /> + <_MonoCFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios13.2-macabi" /> + <_MonoCFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios13.2-macabi" /> <_MonoCFlags Include="-DMAC_CATALYST" /> <_MonoCFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" /> - <_MonoCXXFlags Include="-target x86_64-apple-ios13.2-macabi" /> + <_MonoCXXFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios13.2-macabi" /> + <_MonoCXXFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios13.2-macabi" /> <_MonoCXXFlags Include="-DMAC_CATALYST" /> <_MonoCXXFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" /> <_MonoLDFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" /> From 901bac382778eb37bfe2b547f7a6c1770e492d5a Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Tue, 2 Feb 2021 10:42:51 -0500 Subject: [PATCH 04/28] Add platform checks. Ref https://github.com/dotnet/runtime/issues/47768 --- .../TestUtilities/System/PlatformDetection.cs | 5 +++-- .../src/System/IO/Path.Unix.cs | 2 +- .../src/System/OperatingSystem.cs | 16 ++++++++++++++++ .../Runtime/Loader/LibraryNameVariation.Unix.cs | 2 +- .../tests/System/OperatingSystemTests.cs | 9 +++++++++ .../System.Runtime/ref/System.Runtime.cs | 2 ++ 6 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index 53b02129328bf..b8d9fbd1ac989 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -28,6 +28,7 @@ public static partial class PlatformDetection public static bool IsNetBSD => RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD")); public static bool IsiOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS")); public static bool IstvOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("TVOS")); + public static bool IstvOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACCATALYST")); public static bool Isillumos => RuntimeInformation.IsOSPlatform(OSPlatform.Create("ILLUMOS")); public static bool IsSolaris => RuntimeInformation.IsOSPlatform(OSPlatform.Create("SOLARIS")); public static bool IsBrowser => RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER")); @@ -132,7 +133,7 @@ public static bool IsNonZeroLowerBoundArraySupported (IsOpenSslSupported && (OpenSslVersion.Major >= 1 && (OpenSslVersion.Minor >= 1 || OpenSslVersion.Build >= 2))); - public static bool SupportsClientAlpn => SupportsAlpn || IsOSX || IsiOS || IstvOS; + public static bool SupportsClientAlpn => SupportsAlpn || IsOSX || IsMacCatalyst || IsiOS || IstvOS; private static Lazy s_supportsTls10 = new Lazy(GetTls10Support); private static Lazy s_supportsTls11 = new Lazy(GetTls11Support); @@ -339,7 +340,7 @@ private static bool GetTls13Support() // The build number is approximation. return IsWindows10Version2004Build19573OrGreater; } - else if (IsOSX || IsiOS || IstvOS) + else if (IsOSX || IsMacCatalyst || IsiOS || IstvOS) { // [ActiveIssue("https://github.com/dotnet/runtime/issues/1979")] return false; diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/Path.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/IO/Path.Unix.cs index 9303667afa639..e9851ce2c3d72 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/Path.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/Path.Unix.cs @@ -134,7 +134,7 @@ internal static bool IsCaseSensitive { get { - #if TARGET_OSX || TARGET_IOS || TARGET_TVOS + #if TARGET_OSX || TARGET_CATALYST || TARGET_IOS || TARGET_TVOS return false; #else return true; diff --git a/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs b/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs index 6b3a5b5682f48..3ca03ce3955a8 100644 --- a/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs +++ b/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs @@ -203,6 +203,22 @@ public static bool IsMacOS() => public static bool IsMacOSVersionAtLeast(int major, int minor = 0, int build = 0) => IsMacOS() && IsOSVersionAtLeast(major, minor, build, 0); + /// + /// Indicates whether the current application is running on Mac Catalyst. + /// + public static bool IsMacCatalyst() => +#if TARGET_CATALYST + true; +#else + false; +#endif + + /// + /// Check for the tvOS version (returned by 'libobjc.get_operatingSystemVersion') with a >= version comparison. Used to guard APIs that were added in the given tvOS release. + /// + public static bool IsMacCatalystVersionAtLeast(int major, int minor = 0, int build = 0) + => IsMacCatalyst() && IsOSVersionAtLeast(major, minor, build, 0); + /// /// Indicates whether the current application is running on tvOS. /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/LibraryNameVariation.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/LibraryNameVariation.Unix.cs index ee4d9d95e1950..71c40ee856d9a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/LibraryNameVariation.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/LibraryNameVariation.Unix.cs @@ -9,7 +9,7 @@ namespace System.Runtime.Loader internal partial struct LibraryNameVariation { private const string LibraryNamePrefix = "lib"; -#if TARGET_OSX || TARGET_IOS || TARGET_TVOS +#if TARGET_OSX || TARGET_CATALYST || TARGET_IOS || TARGET_TVOS private const string LibraryNameSuffix = ".dylib"; #else private const string LibraryNameSuffix = ".so"; diff --git a/src/libraries/System.Runtime.Extensions/tests/System/OperatingSystemTests.cs b/src/libraries/System.Runtime.Extensions/tests/System/OperatingSystemTests.cs index c355baf8e2aea..a15a2fe0dbaeb 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/OperatingSystemTests.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/OperatingSystemTests.cs @@ -11,6 +11,7 @@ public static class OperatingSystemTests { "Android", "macOS", + "MacCatalyst", "iOS", "tvOS", "watchOS", @@ -122,6 +123,12 @@ public static void OSX_Is_Treated_as_macOS() AssertVersionChecks(true, (major, minor, build) => OperatingSystem.IsOSPlatformVersionAtLeast("osx", major, minor, build)); } + [Fact, PlatformSpecific(TestPlatforms.MacCatalyst)] + public static void TestIsOSPlatform_MacCatalyst() => TestIsOSPlatform("MacCatalyst", OperatingSystem.IsMacCatalyst); + + [Fact, PlatformSpecific(TestPlatforms.MacCatalyst)] + public static void TestIsOSVersionAtLeast_MacCatalyst() => TestIsOSVersionAtLeast("MacCatalyst"); + [Fact, PlatformSpecific(TestPlatforms.tvOS)] public static void TestIsOSPlatform_TvOS() => TestIsOSPlatform("tvOS", OperatingSystem.IsTvOS); @@ -155,6 +162,7 @@ private static void TestIsOSPlatform(string currentOSName, Func currentOSC OperatingSystem.IsAndroid(), OperatingSystem.IsIOS(), OperatingSystem.IsMacOS(), + OperatingSystem.IsMacCatalyst(), OperatingSystem.IsTvOS(), OperatingSystem.IsWatchOS(), OperatingSystem.IsWindows() @@ -177,6 +185,7 @@ private static void TestIsOSVersionAtLeast(string currentOSName) AssertVersionChecks(currentOSName.Equals("Android", StringComparison.OrdinalIgnoreCase), OperatingSystem.IsAndroidVersionAtLeast); AssertVersionChecks(currentOSName.Equals("iOS", StringComparison.OrdinalIgnoreCase), OperatingSystem.IsIOSVersionAtLeast); AssertVersionChecks(currentOSName.Equals("macOS", StringComparison.OrdinalIgnoreCase), OperatingSystem.IsMacOSVersionAtLeast); + AssertVersionChecks(currentOSName.Equals("MacCatalyst", StringComparison.OrdinalIgnoreCase), OperatingSystem.IsMacCatalystVersionAtLeast); AssertVersionChecks(currentOSName.Equals("tvOS", StringComparison.OrdinalIgnoreCase), OperatingSystem.IsTvOSVersionAtLeast); AssertVersionChecks(currentOSName.Equals("watchOS", StringComparison.OrdinalIgnoreCase), OperatingSystem.IsWatchOSVersionAtLeast); AssertVersionChecks(currentOSName.Equals("Windows", StringComparison.OrdinalIgnoreCase), OperatingSystem.IsWindowsVersionAtLeast); diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index 67894c177737d..8ed0532b93048 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -3099,6 +3099,8 @@ public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, S public static bool IsIOSVersionAtLeast(int major, int minor = 0, int build = 0) { throw null; } public static bool IsMacOS() { throw null; } public static bool IsMacOSVersionAtLeast(int major, int minor = 0, int build = 0) { throw null; } + public static bool IsMacCatalyst() { throw null; } + public static bool IsMacCatalystVersionAtLeast(int major, int minor = 0, int build = 0) { throw null; } public static bool IsTvOS() { throw null; } public static bool IsTvOSVersionAtLeast(int major, int minor = 0, int build = 0) { throw null; } public static bool IsWatchOS() { throw null; } From ce6ef33533e577f87e5b77e321e2953991ed6977 Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Tue, 2 Feb 2021 11:15:15 -0500 Subject: [PATCH 05/28] Add Mac Catalyst TFM consumption where we have iOS TFM consumption --- src/libraries/System.Console/src/System.Console.csproj | 2 +- src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj | 2 +- .../System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj | 2 +- .../src/System.Diagnostics.Process.csproj | 2 +- .../src/System.IO.FileSystem.Watcher.csproj | 2 +- .../tests/System.IO.FileSystem.Watcher.Tests.csproj | 2 +- .../System.IO.Ports/tests/System.IO.Ports.Tests.csproj | 4 ++-- src/libraries/System.Net.Http/src/System.Net.Http.csproj | 2 +- .../tests/UnitTests/System.Net.Http.Unit.Tests.csproj | 2 +- .../src/System.Net.NetworkInformation.csproj | 2 +- src/libraries/System.Net.Quic/src/System.Net.Quic.csproj | 2 +- .../System.Net.Security/src/System.Net.Security.csproj | 2 +- .../tests/FunctionalTests/System.Net.Security.Tests.csproj | 2 +- .../tests/UnitTests/System.Net.Security.Unit.Tests.csproj | 4 ++-- .../System.Runtime.Serialization.Formatters.Tests.csproj | 2 +- .../src/System.Security.Cryptography.Algorithms.csproj | 2 +- .../src/System.Security.Cryptography.Encoding.csproj | 2 +- .../src/System.Security.Cryptography.X509Certificates.csproj | 2 +- ...System.Security.Cryptography.X509Certificates.Tests.csproj | 2 +- 19 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/libraries/System.Console/src/System.Console.csproj b/src/libraries/System.Console/src/System.Console.csproj index a333bb7d6dc99..3018afa215540 100644 --- a/src/libraries/System.Console/src/System.Console.csproj +++ b/src/libraries/System.Console/src/System.Console.csproj @@ -1,7 +1,7 @@ true - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Android;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Browser + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Android;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Browser enable diff --git a/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj b/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj index 0bf609c1c2436..42276e3da7287 100644 --- a/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj +++ b/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj @@ -1,7 +1,7 @@ true - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-Solaris;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent);netcoreapp2.0-FreeBSD;netcoreapp2.0-Linux;netcoreapp2.0-OSX;netcoreapp2.0-windows;netstandard2.0;net461-windows + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-Solaris;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent);netcoreapp2.0-FreeBSD;netcoreapp2.0-Linux;netcoreapp2.0-OSX;netcoreapp2.0-windows;netstandard2.0;net461-windows true $(NoWarn);CA2249;CA1838 enable diff --git a/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj b/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj index 71a8ff3109105..50ab495360fe3 100644 --- a/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj +++ b/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj @@ -1,7 +1,7 @@ $(DefineConstants);TargetsWindows - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;net461-windows + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;net461-windows diff --git a/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj b/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj index 527303bf4dac1..ea8ef6a0adcab 100644 --- a/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj +++ b/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj @@ -2,7 +2,7 @@ $(DefineConstants);FEATURE_REGISTRY true - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent);$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent);$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS enable $(NoWarn);0649 diff --git a/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj b/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj index 92b98d951ca13..0da2ef9db1ba6 100644 --- a/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj +++ b/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj @@ -1,7 +1,7 @@ true - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent);$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-FreeBSD + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent);$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-FreeBSD enable diff --git a/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj b/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj index 8a4575f7e451b..4acd31257ddff 100644 --- a/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj +++ b/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj @@ -1,7 +1,7 @@ true - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-FreeBSD + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-FreeBSD diff --git a/src/libraries/System.IO.Ports/tests/System.IO.Ports.Tests.csproj b/src/libraries/System.IO.Ports/tests/System.IO.Ports.Tests.csproj index 4b498002d8020..49631432ba136 100644 --- a/src/libraries/System.IO.Ports/tests/System.IO.Ports.Tests.csproj +++ b/src/libraries/System.IO.Ports/tests/System.IO.Ports.Tests.csproj @@ -1,6 +1,6 @@ - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-FreeBSD;net461-windows + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-FreeBSD;net461-windows @@ -124,4 +124,4 @@ - \ No newline at end of file + diff --git a/src/libraries/System.Net.Http/src/System.Net.Http.csproj b/src/libraries/System.Net.Http/src/System.Net.Http.csproj index 04146ae94fd33..43907bf6149e1 100644 --- a/src/libraries/System.Net.Http/src/System.Net.Http.csproj +++ b/src/libraries/System.Net.Http/src/System.Net.Http.csproj @@ -3,7 +3,7 @@ win true $(DefineConstants);HTTP_DLL - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-Solaris + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-Solaris enable diff --git a/src/libraries/System.Net.Http/tests/UnitTests/System.Net.Http.Unit.Tests.csproj b/src/libraries/System.Net.Http/tests/UnitTests/System.Net.Http.Unit.Tests.csproj index dd86549c38ea9..c567d4e914f3b 100644 --- a/src/libraries/System.Net.Http/tests/UnitTests/System.Net.Http.Unit.Tests.csproj +++ b/src/libraries/System.Net.Http/tests/UnitTests/System.Net.Http.Unit.Tests.csproj @@ -3,7 +3,7 @@ ../../src/Resources/Strings.resx true true - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS annotations diff --git a/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj b/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj index b28b15df3af50..38fb63359f8ff 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj +++ b/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj @@ -1,7 +1,7 @@ true - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-Solaris;$(NetCoreAppCurrent) + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-Solaris;$(NetCoreAppCurrent) enable diff --git a/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj b/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj index dd1d9a49220c9..d4b603ae24923 100644 --- a/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj +++ b/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj @@ -1,7 +1,7 @@ true - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent) + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent) enable diff --git a/src/libraries/System.Net.Security/src/System.Net.Security.csproj b/src/libraries/System.Net.Security/src/System.Net.Security.csproj index 91c1a8e26834f..b564afbdc55bb 100644 --- a/src/libraries/System.Net.Security/src/System.Net.Security.csproj +++ b/src/libraries/System.Net.Security/src/System.Net.Security.csproj @@ -1,7 +1,7 @@ true - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent) + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent) $(DefineConstants);PRODUCT enable diff --git a/src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj b/src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj index f35aa1a509197..666a79a7f425d 100644 --- a/src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj +++ b/src/libraries/System.Net.Security/tests/FunctionalTests/System.Net.Security.Tests.csproj @@ -2,7 +2,7 @@ true true - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS annotations true diff --git a/src/libraries/System.Net.Security/tests/UnitTests/System.Net.Security.Unit.Tests.csproj b/src/libraries/System.Net.Security/tests/UnitTests/System.Net.Security.Unit.Tests.csproj index 9835fac615253..75573204e4892 100644 --- a/src/libraries/System.Net.Security/tests/UnitTests/System.Net.Security.Unit.Tests.csproj +++ b/src/libraries/System.Net.Security/tests/UnitTests/System.Net.Security.Unit.Tests.csproj @@ -10,7 +10,7 @@ 436 $(NoWarn);3021 - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS annotations true @@ -76,4 +76,4 @@ - \ No newline at end of file + diff --git a/src/libraries/System.Runtime.Serialization.Formatters/tests/System.Runtime.Serialization.Formatters.Tests.csproj b/src/libraries/System.Runtime.Serialization.Formatters/tests/System.Runtime.Serialization.Formatters.Tests.csproj index 9981362c913c5..4048599954111 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/tests/System.Runtime.Serialization.Formatters.Tests.csproj +++ b/src/libraries/System.Runtime.Serialization.Formatters/tests/System.Runtime.Serialization.Formatters.Tests.csproj @@ -2,7 +2,7 @@ true true - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-Solaris;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;net48 + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-Solaris;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;net48 diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj b/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj index 42333a9f2a655..dbd3f53646939 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj @@ -3,7 +3,7 @@ true $(DefineConstants);INTERNAL_ASYMMETRIC_IMPLEMENTATIONS $(NoWarn);CA5350;CA5351;CA5379;CA5384 - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Android;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Browser + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Android;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Browser enable diff --git a/src/libraries/System.Security.Cryptography.Encoding/src/System.Security.Cryptography.Encoding.csproj b/src/libraries/System.Security.Cryptography.Encoding/src/System.Security.Cryptography.Encoding.csproj index 4d8ca17255475..73b2c1e372d49 100644 --- a/src/libraries/System.Security.Cryptography.Encoding/src/System.Security.Cryptography.Encoding.csproj +++ b/src/libraries/System.Security.Cryptography.Encoding/src/System.Security.Cryptography.Encoding.csproj @@ -1,7 +1,7 @@ true - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent);$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent);$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS enable diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj b/src/libraries/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj index 18b84e827d1a6..06e5fbd1c18e7 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj @@ -2,7 +2,7 @@ true $(NoWarn);CA5384 - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent); + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent); enable diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/System.Security.Cryptography.X509Certificates.Tests.csproj b/src/libraries/System.Security.Cryptography.X509Certificates/tests/System.Security.Cryptography.X509Certificates.Tests.csproj index f9df1fe8351c2..da54c01fa51ec 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/System.Security.Cryptography.X509Certificates.Tests.csproj +++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/System.Security.Cryptography.X509Certificates.Tests.csproj @@ -4,7 +4,7 @@ $(DefineConstants);HAVE_THUMBPRINT_OVERLOADS $(DefineConstants);Unix true - $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS From b955a3a91bd904dcc8413dafbdc86cfcc6e4c26b Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Tue, 2 Feb 2021 12:55:23 -0500 Subject: [PATCH 06/28] Unify around maccatalyst name, fix up build a little --- Directory.Build.props | 10 ++++++---- eng/build.sh | 8 ++++---- eng/native/build-commons.sh | 4 ++-- eng/native/configureplatform.cmake | 4 ++-- eng/native/init-distro-rid.sh | 2 +- eng/targetframeworksuffix.props | 4 ++-- .../pal_ssl.c | 2 +- src/libraries/Native/Unix/configure.cmake | 2 +- src/libraries/OSGroups.json | 5 +++++ src/libraries/System.Console/src/System.Console.csproj | 4 ++-- .../System.Data.Odbc/src/System.Data.Odbc.csproj | 2 +- .../tests/System.Data.Odbc.Tests.csproj | 2 +- .../src/System.Diagnostics.Process.csproj | 2 +- .../src/System.IO.FileSystem.Watcher.csproj | 2 +- .../tests/System.IO.FileSystem.Watcher.Tests.csproj | 2 +- .../System.Net.Http/src/System.Net.Http.csproj | 8 ++++---- .../tests/UnitTests/System.Net.Http.Unit.Tests.csproj | 6 +++--- .../src/System.Net.NetworkInformation.csproj | 4 ++-- .../System.Net.Quic/src/System.Net.Quic.csproj | 2 +- .../System.Net.Security/src/System.Net.Security.csproj | 6 +++--- .../src/System.Private.CoreLib.Shared.projitems | 6 +++--- .../src/System.Security.Cryptography.Algorithms.csproj | 4 ++-- .../src/System.Security.Cryptography.Encoding.csproj | 10 +++++----- ...ystem.Security.Cryptography.X509Certificates.csproj | 6 +++--- ...Security.Cryptography.X509Certificates.Tests.csproj | 4 ++-- src/mono/mono.proj | 10 +++++----- .../System.Private.CoreLib.csproj | 2 +- 27 files changed, 65 insertions(+), 58 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index a044cbc586996..d9b09baaa2691 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -17,7 +17,7 @@ Solaris Linux windows - true + true @@ -117,6 +117,7 @@ <_portableOS Condition="'$(_runtimeOSFamily)' == 'illumos'">illumos <_portableOS Condition="'$(_runtimeOSFamily)' == 'Solaris'">solaris <_portableOS Condition="'$(_runtimeOS)' == 'Browser'">browser + <_portableOS Condition="'$(_runtimeOS)' == 'maccatalyst'">maccatalyst <_portableOS Condition="'$(_runtimeOS)' == 'ios'">ios <_portableOS Condition="'$(_runtimeOS)' == 'tvos'">tvos <_portableOS Condition="'$(_runtimeOS)' == 'android'">android @@ -145,7 +146,7 @@ <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android' and $([MSBuild]::IsOSPlatform('OSX'))">osx-x64 - <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'ios' or '$(_runtimeOS)' == 'tvos'">osx-x64 + <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'maccatalyst' or '$(_runtimeOS)' == 'ios' or '$(_runtimeOS)' == 'tvos'">osx-x64 $(_toolRuntimeRID) @@ -160,6 +161,7 @@ <_outputRID Condition="'$(TargetOS)' == 'NetBSD'">netbsd-$(TargetArchitecture) <_outputRID Condition="'$(TargetOS)' == 'illumos'">illumos-$(TargetArchitecture) <_outputRID Condition="'$(TargetOS)' == 'Solaris'">solaris-$(TargetArchitecture) + <_outputRID Condition="'$(TargetOS)' == 'MacCatalyst'">maccatalyst-$(TargetArchitecture) <_outputRID Condition="'$(TargetOS)' == 'iOS'">ios-$(TargetArchitecture) <_outputRID Condition="'$(TargetOS)' == 'tvOS'">tvos-$(TargetArchitecture) <_outputRID Condition="'$(TargetOS)' == 'Android'">android-$(TargetArchitecture) @@ -176,7 +178,7 @@ true true true - true + true true true true @@ -184,7 +186,7 @@ true true true - true + true diff --git a/eng/build.sh b/eng/build.sh index 93f62d7808704..4acb1e2c79289 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -28,7 +28,7 @@ usage() echo " --help (-h) Print help and exit." echo " --librariesConfiguration (-lc) Libraries build configuration: Debug or Release." echo " [Default: Debug]" - echo " --os Target operating system: windows, Linux, FreeBSD, OSX, Catalyst, tvOS, iOS, Android," + echo " --os Target operating system: windows, Linux, FreeBSD, OSX, MacCatalyst, tvOS, iOS, Android," echo " Browser, NetBSD, illumos or Solaris." echo " [Default: Your machine's OS.]" echo " --projects Project or solution file(s) to build." @@ -262,8 +262,8 @@ while [[ $# > 0 ]]; do os="FreeBSD" ;; osx) os="OSX" ;; - catalyst) - os="Catalyst" ;; + maccatalyst) + os="MacCatalyst" ;; tvos) os="tvOS" ;; ios) @@ -278,7 +278,7 @@ while [[ $# > 0 ]]; do os="Solaris" ;; *) echo "Unsupported target OS '$2'." - echo "The allowed values are windows, Linux, FreeBSD, OSX, Catalyst, tvOS, iOS, Android, Browser, illumos and Solaris." + echo "The allowed values are windows, Linux, FreeBSD, OSX, MacCatalyst, tvOS, iOS, Android, Browser, illumos and Solaris." exit 1 ;; esac diff --git a/eng/native/build-commons.sh b/eng/native/build-commons.sh index 8c5be3ac7ba32..1a0ee465ab945 100755 --- a/eng/native/build-commons.sh +++ b/eng/native/build-commons.sh @@ -78,7 +78,7 @@ build_native() # All set to commence the build echo "Commencing build of \"$message\" for $__TargetOS.$__BuildArch.$__BuildType in $intermediatesDir" - if [[ "$targetOS" == OSX || "$targetOS" == Catalyst ]]; then + if [[ "$targetOS" == OSX || "$targetOS" == MacCatalyst ]]; then if [[ "$platformArch" == x64 ]]; then cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"x86_64\" $cmakeArgs" elif [[ "$platformArch" == arm64 ]]; then @@ -89,7 +89,7 @@ build_native() fi fi - if [[ "$targetOS" == Catalyst ]]; then + if [[ "$targetOS" == MacCatalyst ]]; then cmakeArgs="-DCLR_CMAKE_TARGET_CATALYST=1 $cmakeArgs" fi diff --git a/eng/native/configureplatform.cmake b/eng/native/configureplatform.cmake index eeb92180ef2a5..23622cfb12fcb 100644 --- a/eng/native/configureplatform.cmake +++ b/eng/native/configureplatform.cmake @@ -305,10 +305,10 @@ if(CLR_CMAKE_TARGET_OS STREQUAL iOS) set(CLR_CMAKE_TARGET_IOS 1) endif(CLR_CMAKE_TARGET_OS STREQUAL iOS) -if(CLR_CMAKE_TARGET_OS STREQUAL Catalyst) +if(CLR_CMAKE_TARGET_OS STREQUAL MacCatalyst) set(CLR_CMAKE_TARGET_UNIX 1) set(CLR_CMAKE_TARGET_CATALYST 1) -endif(CLR_CMAKE_TARGET_OS STREQUAL Catalyst) +endif(CLR_CMAKE_TARGET_OS STREQUAL MacCatalyst) if(CLR_CMAKE_TARGET_OS STREQUAL tvOS) set(CLR_CMAKE_TARGET_UNIX 1) diff --git a/eng/native/init-distro-rid.sh b/eng/native/init-distro-rid.sh index c647d08de1cce..9c0092a22bce2 100644 --- a/eng/native/init-distro-rid.sh +++ b/eng/native/init-distro-rid.sh @@ -170,7 +170,7 @@ initDistroRidGlobal() distroRid="linux-$buildArch" elif [ "$targetOs" = "OSX" ]; then distroRid="osx-$buildArch" - elif [ "$targetOs" = "Catalyst" ]; then + elif [ "$targetOs" = "MacCatalyst" ]; then distroRid="maccatalyst-$buildArch" elif [ "$targetOs" = "tvOS" ]; then distroRid="tvos-$buildArch" diff --git a/eng/targetframeworksuffix.props b/eng/targetframeworksuffix.props index a777231f93fb1..8a55da6832975 100644 --- a/eng/targetframeworksuffix.props +++ b/eng/targetframeworksuffix.props @@ -46,10 +46,10 @@ osx - + true - true + true maccatalyst diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.c index 9eb4ade7a397b..7b03e1a96689a 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.c @@ -600,7 +600,7 @@ int32_t AppleCryptoNative_SslSetEnabledCipherSuites(SSLContextRef sslContext, co else #endif { - // Catalyst, iOS, tvOS, watchOS + // MacCatalyst, iOS, tvOS, watchOS SSLCipherSuite* cipherSuites16 = (SSLCipherSuite*)calloc((size_t)numCipherSuites, sizeof(SSLCipherSuite)); if (cipherSuites16 == NULL) diff --git a/src/libraries/Native/Unix/configure.cmake b/src/libraries/Native/Unix/configure.cmake index f22a127962747..0c1cd68fa5adf 100644 --- a/src/libraries/Native/Unix/configure.cmake +++ b/src/libraries/Native/Unix/configure.cmake @@ -26,7 +26,7 @@ elseif (CLR_CMAKE_TARGET_OSX) # This ensures an even playing field. include_directories(SYSTEM /usr/local/include) elseif (CLR_CMAKE_TARGET_CATALYST) - set(PAL_UNIX_NAME \"CATALYST\") + set(PAL_UNIX_NAME \"MACCATALYST\") elseif (CLR_CMAKE_TARGET_IOS) set(PAL_UNIX_NAME \"IOS\") elseif (CLR_CMAKE_TARGET_TVOS) diff --git a/src/libraries/OSGroups.json b/src/libraries/OSGroups.json index b0a421fa5c302..8bcd4aa7e9d32 100644 --- a/src/libraries/OSGroups.json +++ b/src/libraries/OSGroups.json @@ -14,6 +14,11 @@ "Unix" ] }, + "MacCatalyst": { + "#import": [ + "Unix" + ] + }, "iOS": { "#import": [ "Unix" diff --git a/src/libraries/System.Console/src/System.Console.csproj b/src/libraries/System.Console/src/System.Console.csproj index 3018afa215540..deb4c6b9347c0 100644 --- a/src/libraries/System.Console/src/System.Console.csproj +++ b/src/libraries/System.Console/src/System.Console.csproj @@ -19,7 +19,7 @@ Link="Common\System\Text\ConsoleEncoding.cs" /> - + @@ -149,7 +149,7 @@ Link="Common\System\Text\ValueStringBuilder.cs" /> - + diff --git a/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj b/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj index 42276e3da7287..af9acbe069dd9 100644 --- a/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj +++ b/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj @@ -118,7 +118,7 @@ - + diff --git a/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj b/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj index 50ab495360fe3..ec9f0153009c8 100644 --- a/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj +++ b/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj b/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj index ea8ef6a0adcab..2d0ea9a7ba3ee 100644 --- a/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj +++ b/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj @@ -286,7 +286,7 @@ - + diff --git a/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj b/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj index 0da2ef9db1ba6..e63db3b70aea3 100644 --- a/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj +++ b/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj @@ -75,7 +75,7 @@ - + diff --git a/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj b/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj index 4acd31257ddff..8541c8a86adc8 100644 --- a/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj +++ b/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj @@ -32,7 +32,7 @@ - + diff --git a/src/libraries/System.Net.Http/src/System.Net.Http.csproj b/src/libraries/System.Net.Http/src/System.Net.Http.csproj index 43907bf6149e1..607cbc4212309 100644 --- a/src/libraries/System.Net.Http/src/System.Net.Http.csproj +++ b/src/libraries/System.Net.Http/src/System.Net.Http.csproj @@ -6,7 +6,7 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-Solaris enable - + $(DefineConstants);SYSNETHTTP_NO_OPENSSL @@ -329,11 +329,11 @@ - + - + - + - - @@ -257,7 +257,7 @@ - + diff --git a/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj b/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj index 38fb63359f8ff..58f1bce82a811 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj +++ b/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj @@ -145,7 +145,7 @@ - + @@ -164,7 +164,7 @@ - + diff --git a/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj b/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj index d4b603ae24923..33e3f55daf276 100644 --- a/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj +++ b/src/libraries/System.Net.Quic/src/System.Net.Quic.csproj @@ -38,7 +38,7 @@ - + diff --git a/src/libraries/System.Net.Security/src/System.Net.Security.csproj b/src/libraries/System.Net.Security/src/System.Net.Security.csproj index b564afbdc55bb..d161c0d6b5340 100644 --- a/src/libraries/System.Net.Security/src/System.Net.Security.csproj +++ b/src/libraries/System.Net.Security/src/System.Net.Security.csproj @@ -9,7 +9,7 @@ SR.SystemNetSecurity_PlatformNotSupported - + $(DefineConstants);SYSNETSECURITY_NO_OPENSSL @@ -268,7 +268,7 @@ - + @@ -326,7 +326,7 @@ - + enable - true + true true true $(MSBuildThisFileDirectory)ILLink\ @@ -24,7 +24,7 @@ $(DefineConstants);TARGET_UNIX $(DefineConstants);TARGET_WINDOWS $(DefineConstants);TARGET_OSX - $(DefineConstants);TARGET_CATALYST + $(DefineConstants);TARGET_CATALYST $(DefineConstants);TARGET_IOS $(DefineConstants);TARGET_TVOS $(DefineConstants);TARGET_BROWSER @@ -1819,7 +1819,7 @@ - + diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj b/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj index dbd3f53646939..4bc44931c4420 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System.Security.Cryptography.Algorithms.csproj @@ -423,7 +423,7 @@ - + - + SR.SystemSecurityCryptographyEncoding_PlatformNotSupported - - + + @@ -52,7 +52,7 @@ - + @@ -79,7 +79,7 @@ - + @@ -123,7 +123,7 @@ - + diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj b/src/libraries/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj index 06e5fbd1c18e7..ee276515f6d9a 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj +++ b/src/libraries/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj @@ -282,7 +282,7 @@ - + System\Security\Cryptography\X509Certificates\Asn1\DistributionPointAsn.xml @@ -391,7 +391,7 @@ - + - + diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/System.Security.Cryptography.X509Certificates.Tests.csproj b/src/libraries/System.Security.Cryptography.X509Certificates/tests/System.Security.Cryptography.X509Certificates.Tests.csproj index da54c01fa51ec..23670a966e3c9 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/System.Security.Cryptography.X509Certificates.Tests.csproj +++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/System.Security.Cryptography.X509Certificates.Tests.csproj @@ -67,7 +67,7 @@ - + @@ -89,7 +89,7 @@ Link="Common\System\IO\PersistedFiles.Names.Unix.cs" /> - + diff --git a/src/mono/mono.proj b/src/mono/mono.proj index dbb97383c1475..7ffd75e0bd8a9 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -19,7 +19,7 @@ .sh coreclr.dll libcoreclr.dylib - libcoreclr.dylib + libcoreclr.dylib libcoreclr.so libmonosgen-2.0.dylib libmonosgen-2.0.so @@ -65,7 +65,7 @@ - + <_MonoCMakeArgs Include="-DENABLE_WERROR=1"/> @@ -203,7 +203,7 @@ <_MonoBuildEnv Condition="'$(Platform)' == 'arm64'" Include="arch -arch arm64" /> - + <_MonoCFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios13.2-macabi" /> <_MonoCFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios13.2-macabi" /> <_MonoCFlags Include="-DMAC_CATALYST" /> @@ -515,7 +515,7 @@ <_MonoRuntimeFilePath Condition="'$(TargetsWindows)' == 'true'">$(MonoObjDir)out\bin\monosgen-2.0.dll <_MonoRuntimeFilePath Condition="'$(TargetsOSX)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.dylib - <_MonoRuntimeFilePath Condition="'$(TargetsCatalyst)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.dylib + <_MonoRuntimeFilePath Condition="'$(TargetsMacCatalyst)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.dylib <_MonoRuntimeFilePath Condition="'$(TargetsiOS)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.dylib <_MonoRuntimeFilePath Condition="'$(TargetstvOS)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.dylib <_MonoRuntimeFilePath Condition="'$(TargetsBrowser)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.a @@ -575,7 +575,7 @@ SkipUnchangedFiles="true" Condition="'$(MonoGenerateOffsetsOSGroups)' == '' and ('$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsAndroid)' == 'true' or '$(TargetsBrowser)' == 'true')"/> - + diff --git a/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj index 4df6e7ccf32d0..f4101d0d59919 100644 --- a/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/mono/netcore/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -268,7 +268,7 @@ - + Common\Interop\OSX\Interop.SearchPath.cs From ab7d99f3636e4341084799f927f34548ac4fea8b Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Wed, 3 Feb 2021 16:58:22 -0500 Subject: [PATCH 07/28] Partially bring up app builder. THIS IS INCOMPLETE, THERE ARE MISSING SYMBOLS LINKING THE RUNTIME --- eng/testing/tests.mobile.targets | 12 ++- eng/testing/tests.targets | 2 +- .../TestUtilities/System/PlatformDetection.cs | 2 +- src/libraries/pretest.proj | 2 +- src/libraries/tests.proj | 2 +- src/mono/mono.proj | 2 +- src/tasks/AppleAppBuilder/TargetOS.cs | 1 + .../Templates/CMakeLists.txt.template | 1 + src/tasks/AppleAppBuilder/Xcode.cs | 84 ++++++++++++++----- src/tasks/tasks.proj | 2 +- 10 files changed, 78 insertions(+), 32 deletions(-) diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 31e2a3afa2ed5..bb144a9373d11 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -77,7 +77,7 @@ - - + + - + + + - @@ -217,7 +221,7 @@ AfterTargets="ComputeResolvedFilesToPublishList"> <_runnerFilesToPublish Include="$(AndroidTestRunnerDir)*" Condition="'$(TargetOS)' == 'Android'" /> - <_runnerFilesToPublish Include="$(AppleTestRunnerDir)*" Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS'" /> + <_runnerFilesToPublish Include="$(AppleTestRunnerDir)*" Condition="'$(TargetOS)' == 'MacCatalyst' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS'" /> <_runnerFilesToPublish Include="$(WasmTestRunnerDir)*" Condition="'$(TargetOS)' == 'Browser'" /> diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets index ceb58345ed982..d5ab901145464 100644 --- a/eng/testing/tests.targets +++ b/eng/testing/tests.targets @@ -2,7 +2,7 @@ RunnerTemplate.cmd RunnerTemplate.sh - AppleRunnerTemplate.sh + AppleRunnerTemplate.sh AndroidRunnerTemplate.sh WasmRunnerTemplate.sh diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index b8d9fbd1ac989..dfd4ba7b81762 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -28,7 +28,7 @@ public static partial class PlatformDetection public static bool IsNetBSD => RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD")); public static bool IsiOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS")); public static bool IstvOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("TVOS")); - public static bool IstvOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACCATALYST")); + public static bool IsMacCatalyst => RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACCATALYST")); public static bool Isillumos => RuntimeInformation.IsOSPlatform(OSPlatform.Create("ILLUMOS")); public static bool IsSolaris => RuntimeInformation.IsOSPlatform(OSPlatform.Create("SOLARIS")); public static bool IsBrowser => RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER")); diff --git a/src/libraries/pretest.proj b/src/libraries/pretest.proj index 13d0423bb026f..11cf05cf89ed0 100644 --- a/src/libraries/pretest.proj +++ b/src/libraries/pretest.proj @@ -19,7 +19,7 @@ - + diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 2e8ee568b98b2..751ea06ae7263 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -257,7 +257,7 @@ - + Condition="'$(MonoGenerateOffsetsOSGroups)' == '' and ('$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsAndroid)' == 'true' or '$(TargetsBrowser)' == 'true')"/> diff --git a/src/tasks/AppleAppBuilder/TargetOS.cs b/src/tasks/AppleAppBuilder/TargetOS.cs index c3e55db30d114..3fb54c975c88c 100644 --- a/src/tasks/AppleAppBuilder/TargetOS.cs +++ b/src/tasks/AppleAppBuilder/TargetOS.cs @@ -5,4 +5,5 @@ internal class TargetNames { public const string iOS = "iOS"; public const string tvOS = "tvOS"; + public const string MacCatalyst = "MacCatalyst"; } diff --git a/src/tasks/AppleAppBuilder/Templates/CMakeLists.txt.template b/src/tasks/AppleAppBuilder/Templates/CMakeLists.txt.template index 6b76683dfc718..4b3d40bda6a8a 100644 --- a/src/tasks/AppleAppBuilder/Templates/CMakeLists.txt.template +++ b/src/tasks/AppleAppBuilder/Templates/CMakeLists.txt.template @@ -27,6 +27,7 @@ set_target_properties(%ProjectName% PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist XCODE_ATTRIBUTE_ENABLE_BITCODE "NO" XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING "NO" + XCODE_ATTRIBUTE_SUPPORTS_MACCATALYST "YES" RESOURCE "${APP_RESOURCES}" ) diff --git a/src/tasks/AppleAppBuilder/Xcode.cs b/src/tasks/AppleAppBuilder/Xcode.cs index 2d7d5a2ed59f8..56999e29a7f85 100644 --- a/src/tasks/AppleAppBuilder/Xcode.cs +++ b/src/tasks/AppleAppBuilder/Xcode.cs @@ -15,9 +15,18 @@ internal class Xcode public Xcode(string target) { Target = target; - SysRoot = (Target == TargetNames.iOS) ? - Utils.RunProcess("xcrun", "--sdk iphoneos --show-sdk-path") : - Utils.RunProcess("xcrun", "--sdk appletvos --show-sdk-path"); + switch (Target) + { + case TargetNames.iOS: + SysRoot = Utils.RunProcess("xcrun", "--sdk iphoneos --show-sdk-path"); + break; + case TargetNames.tvOS: + SysRoot = Utils.RunProcess("xcrun", "--sdk appletvos --show-sdk-path"); + break; + default: + SysRoot = Utils.RunProcess("xcrun", "--sdk macosx --show-sdk-path"); + break; + } } public string GenerateXCode( @@ -95,7 +104,7 @@ public string GenerateXCode( } string frameworks = ""; - if (Target == TargetNames.iOS) + if ((Target == TargetNames.iOS) || (Target == TargetNames.MacCatalyst)) { frameworks = "\"-framework GSS\""; } @@ -122,13 +131,15 @@ public string GenerateXCode( File.WriteAllText(Path.Combine(binDir, "Info.plist"), plist); File.WriteAllText(Path.Combine(binDir, "CMakeLists.txt"), cmakeLists); + var targetName = (Target == TargetNames.MacCatalyst) ? "Darwin" : Target.ToString(); + var deployTarget = (Target == TargetNames.MacCatalyst) ? "" : " -DCMAKE_OSX_DEPLOYMENT_TARGET=10.1"; var cmakeArgs = new StringBuilder(); cmakeArgs .Append("-S.") .Append(" -B").Append(projectName) .Append(" -GXcode") - .Append(" -DCMAKE_SYSTEM_NAME=" + Target.ToString()) - .Append(" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.1"); + .Append(" -DCMAKE_SYSTEM_NAME=" + targetName) + .Append(deployTarget); File.WriteAllText(Path.Combine(binDir, "runtime.h"), Utils.GetEmbeddedResource("runtime.h")); @@ -162,29 +173,58 @@ public string BuildAppBundle( var args = new StringBuilder(); args.Append("ONLY_ACTIVE_ARCH=YES"); - if (architecture == "arm64") + if (devTeamProvisioning == "-") { - sdk = (Target == TargetNames.iOS) ? "iphoneos" : "appletvos"; - args.Append(" -arch arm64") - .Append(" -sdk " + sdk); + args.Append(" CODE_SIGN_IDENTITY=\"\"") + .Append(" CODE_SIGNING_REQUIRED=NO") + .Append(" CODE_SIGNING_ALLOWED=NO"); + } + else + { + args.Append(" -allowProvisioningUpdates") + .Append(" DEVELOPMENT_TEAM=").Append(devTeamProvisioning); + } - if (devTeamProvisioning == "-") - { - args.Append(" CODE_SIGN_IDENTITY=\"\"") - .Append(" CODE_SIGNING_REQUIRED=NO") - .Append(" CODE_SIGNING_ALLOWED=NO"); - } - else + + if (architecture == "arm64") + { + switch (Target) { - args.Append(" -allowProvisioningUpdates") - .Append(" DEVELOPMENT_TEAM=").Append(devTeamProvisioning); + case TargetNames.iOS: + args.Append(" -arch arm64") + .Append(" -sdk iphoneos"); + break; + case TargetNames.tvOS: + args.Append(" -arch arm64") + .Append(" -sdk appletvos"); + break; + default: + args.Append(" -scheme \"" + Path.GetFileNameWithoutExtension(xcodePrjPath) + "\"") + .Append(" -destination \"platform=macOS,arch=arm64,variant=Mac Catalyst\"") + .Append(" -UseModernBuildSystem=YES") + .Append(" IPHONEOS_DEPLOYMENT_TARGET=13.2"); + break; } } else { - sdk = (Target == TargetNames.iOS) ? "iphonesimulator" : "appletvsimulator"; - args.Append(" -arch x86_64") - .Append(" -sdk " + sdk); + switch (Target) + { + case TargetNames.iOS: + args.Append(" -arch x86_64") + .Append(" -sdk iphonesimulator"); + break; + case TargetNames.tvOS: + args.Append(" -arch x86_64") + .Append(" -sdk appletvsimulator"); + break; + default: + args.Append(" -scheme \"" + Path.GetFileNameWithoutExtension(xcodePrjPath) + "\"") + .Append(" -destination \"platform=macOS,arch=x86_64,variant=Mac Catalyst\"") + .Append(" -UseModernBuildSystem=YES") + .Append(" IPHONEOS_DEPLOYMENT_TARGET=13.2"); + break; + } } string config = optimized ? "Release" : "Debug"; diff --git a/src/tasks/tasks.proj b/src/tasks/tasks.proj index ac868c66d419c..ef88be0fe724a 100644 --- a/src/tasks/tasks.proj +++ b/src/tasks/tasks.proj @@ -4,7 +4,7 @@ + Condition="'$(TargetOS)' != 'MacCatalyst' and '$(TargetOS)' != 'iOS' and '$(TargetOS)' != 'tvOS'" /> Date: Wed, 3 Feb 2021 18:01:20 -0500 Subject: [PATCH 08/28] Finish brining up app builder. Next, test runner.y --- src/mono/mono.proj | 4 ++-- src/tasks/AppleAppBuilder/Templates/runtime.m | 4 ++-- src/tasks/AppleAppBuilder/Xcode.cs | 14 ++++++++++---- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 7b89bea23b021..66d419e841a8d 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -25,7 +25,7 @@ libmonosgen-2.0.so libmonosgen-2.0.a $(CoreClrFileName) - libmonosgen-2.0.a + libmonosgen-2.0.a $(Configuration) $(Configuration) $([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'tests', 'coreclr', '$(TargetOS).$(Platform).$(CoreClrTestConfig)', 'Tests', 'Core_Root')) @@ -520,7 +520,7 @@ <_MonoRuntimeFilePath Condition="'$(TargetstvOS)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.dylib <_MonoRuntimeFilePath Condition="'$(TargetsBrowser)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.a <_MonoRuntimeFilePath Condition="'$(_MonoRuntimeFilePath)' == ''">$(MonoObjDir)out\lib\libmonosgen-2.0.so - <_MonoRuntimeStaticFilePath Condition="'$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsAndroid)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.a + <_MonoRuntimeStaticFilePath Condition="'$(TargetsMacCatalyst)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsAndroid)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.a <_MonoIncludeInterpStaticFiles Condition="'$(TargetsBrowser)' == 'true'">true diff --git a/src/tasks/AppleAppBuilder/Templates/runtime.m b/src/tasks/AppleAppBuilder/Templates/runtime.m index a7e6e9869b9f0..f7697becea3d5 100644 --- a/src/tasks/AppleAppBuilder/Templates/runtime.m +++ b/src/tasks/AppleAppBuilder/Templates/runtime.m @@ -196,7 +196,7 @@ //%DllMap% } -#if FORCE_INTERPRETER || FORCE_AOT || !TARGET_OS_SIMULATOR +#if FORCE_INTERPRETER || FORCE_AOT void mono_jit_set_aot_mode (MonoAotMode mode); void register_aot_modules (void); #endif @@ -231,7 +231,7 @@ #if FORCE_INTERPRETER os_log_info (OS_LOG_DEFAULT, "INTERP Enabled"); mono_jit_set_aot_mode (MONO_AOT_MODE_INTERP_ONLY); -#elif !TARGET_OS_SIMULATOR || FORCE_AOT +#elif FORCE_AOT register_dllmap (); // register modules register_aot_modules (); diff --git a/src/tasks/AppleAppBuilder/Xcode.cs b/src/tasks/AppleAppBuilder/Xcode.cs index 56999e29a7f85..2477c746dda21 100644 --- a/src/tasks/AppleAppBuilder/Xcode.cs +++ b/src/tasks/AppleAppBuilder/Xcode.cs @@ -191,14 +191,17 @@ public string BuildAppBundle( switch (Target) { case TargetNames.iOS: + sdk = "iphoneos"; args.Append(" -arch arm64") - .Append(" -sdk iphoneos"); + .Append(" -sdk " + sdk); break; case TargetNames.tvOS: + sdk = "appletvos"; args.Append(" -arch arm64") - .Append(" -sdk appletvos"); + .Append(" -sdk " + sdk); break; default: + sdk = "maccatalyst"; args.Append(" -scheme \"" + Path.GetFileNameWithoutExtension(xcodePrjPath) + "\"") .Append(" -destination \"platform=macOS,arch=arm64,variant=Mac Catalyst\"") .Append(" -UseModernBuildSystem=YES") @@ -211,14 +214,17 @@ public string BuildAppBundle( switch (Target) { case TargetNames.iOS: + sdk = "iphonesimulator"; args.Append(" -arch x86_64") - .Append(" -sdk iphonesimulator"); + .Append(" -sdk " + sdk); break; case TargetNames.tvOS: + sdk = "appletvsimulator"; args.Append(" -arch x86_64") - .Append(" -sdk appletvsimulator"); + .Append(" -sdk " + sdk); break; default: + sdk = "maccatalyst"; args.Append(" -scheme \"" + Path.GetFileNameWithoutExtension(xcodePrjPath) + "\"") .Append(" -destination \"platform=macOS,arch=x86_64,variant=Mac Catalyst\"") .Append(" -UseModernBuildSystem=YES") From 49ab49a2821b8454d665674de75194838aeddec5 Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Wed, 3 Feb 2021 18:14:37 -0500 Subject: [PATCH 09/28] Fix test runner. Now only xharness itself is bad --- eng/testing/AppleRunnerTemplate.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eng/testing/AppleRunnerTemplate.sh b/eng/testing/AppleRunnerTemplate.sh index 663eee16589e3..dda892576df53 100644 --- a/eng/testing/AppleRunnerTemplate.sh +++ b/eng/testing/AppleRunnerTemplate.sh @@ -16,6 +16,8 @@ if [ -n "$5" ]; then EXPECTED_EXIT_CODE="--expected-exit-code $5" fi +if [[ "$TARGET_OS" == "MacCatalyst" ]]; then TARGET=maccatalyst; fi + if [[ "$TARGET_OS" == "iOS" && "$TARGET_ARCH" == "x86" ]]; then TARGET=ios-simulator-32; fi if [[ "$TARGET_OS" == "iOS" && "$TARGET_ARCH" == "x64" ]]; then TARGET=ios-simulator-64; fi if [[ "$TARGET_OS" == "iOS" && "$TARGET_ARCH" == "arm" ]]; then TARGET=ios-device; fi @@ -29,6 +31,7 @@ if [[ "$TARGET" == "ios-simulator-"* ]]; then SCHEME_SDK=Release-iphonesimulator if [[ "$TARGET" == "tvos-simulator" ]]; then SCHEME_SDK=Release-appletvsimulator; fi if [[ "$TARGET" == "ios-device" ]]; then SCHEME_SDK=Release-iphoneos; fi if [[ "$TARGET" == "tvos-device" ]]; then SCHEME_SDK=Release-appletvos; fi +if [[ "$TARGET" == "maccatalyst" ]]; then SCHEME_SDK=Release-maccatalyst; fi cd $EXECUTION_DIR From cbec4f24428caa39b27509f23d48ebdd02ba8d92 Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Wed, 3 Feb 2021 18:15:00 -0500 Subject: [PATCH 10/28] re-enable all tests --- src/libraries/tests.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 751ea06ae7263..5d9a3e0124181 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -257,7 +257,7 @@ - Date: Wed, 3 Feb 2021 18:21:55 -0500 Subject: [PATCH 11/28] Bad change, revert --- src/libraries/tests.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 5d9a3e0124181..2e8ee568b98b2 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -257,7 +257,7 @@ - Date: Wed, 3 Feb 2021 20:12:59 -0500 Subject: [PATCH 12/28] copy-paste error --- .../System.Private.CoreLib/src/System/OperatingSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs b/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs index 3ca03ce3955a8..64f7f5562a4ca 100644 --- a/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs +++ b/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs @@ -214,7 +214,7 @@ public static bool IsMacCatalyst() => #endif /// - /// Check for the tvOS version (returned by 'libobjc.get_operatingSystemVersion') with a >= version comparison. Used to guard APIs that were added in the given tvOS release. + /// Check for the Mac Catalyst version (returned by 'libobjc.get_operatingSystemVersion') with a >= version comparison. Used to guard APIs that were added in the given tvOS release. /// public static bool IsMacCatalystVersionAtLeast(int major, int minor = 0, int build = 0) => IsMacCatalyst() && IsOSVersionAtLeast(major, minor, build, 0); From 0f701853eba957f94b759f055feb1136aa9b0be2 Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Thu, 4 Feb 2021 09:35:28 -0500 Subject: [PATCH 13/28] Unify around "MacCatalyst", get rid of all uses of "Catalyst" --- eng/native/build-commons.sh | 2 +- eng/native/configurecompiler.cmake | 4 ++-- eng/native/configureplatform.cmake | 2 +- eng/native/configuretools.cmake | 2 +- eng/native/functions.cmake | 10 +++++----- src/libraries/Native/Unix/CMakeLists.txt | 16 ++++++++-------- .../System.Globalization.Native/CMakeLists.txt | 4 ++-- .../System.IO.Compression.Native/CMakeLists.txt | 2 +- .../Native/Unix/System.Native/CMakeLists.txt | 8 ++++---- .../Native/Unix/System.Native/extra_libs.cmake | 2 +- .../System.Net.Security.Native/CMakeLists.txt | 4 ++-- .../CMakeLists.txt | 6 +++--- .../entrypoints.c | 4 ++-- .../pal_ecc.c | 2 +- .../pal_ecc.h | 2 +- .../pal_keychain.c | 2 +- .../pal_keychain.h | 2 +- .../pal_rsa.c | 2 +- .../pal_rsa.h | 2 +- .../pal_sec.c | 2 +- .../pal_sec.h | 2 +- .../pal_seckey.c | 4 ++-- .../pal_seckey.h | 4 ++-- .../pal_signverify.c | 2 +- .../pal_signverify.h | 2 +- .../pal_ssl.c | 2 +- .../pal_trust.c | 2 +- .../pal_trust.h | 2 +- .../pal_x509.c | 4 ++-- .../pal_x509.h | 2 +- .../CMakeLists.txt | 2 +- src/libraries/Native/Unix/configure.cmake | 6 +++--- .../System.IO.Compression.Native/CMakeLists.txt | 2 +- .../src/System/IO/Path.Unix.cs | 2 +- .../src/System/OperatingSystem.cs | 2 +- .../Runtime/Loader/LibraryNameVariation.Unix.cs | 2 +- .../tests/System/OperatingSystemTests.cs | 4 +++- 37 files changed, 64 insertions(+), 62 deletions(-) diff --git a/eng/native/build-commons.sh b/eng/native/build-commons.sh index 1a0ee465ab945..2c2da6bfb2d65 100755 --- a/eng/native/build-commons.sh +++ b/eng/native/build-commons.sh @@ -90,7 +90,7 @@ build_native() fi if [[ "$targetOS" == MacCatalyst ]]; then - cmakeArgs="-DCLR_CMAKE_TARGET_CATALYST=1 $cmakeArgs" + cmakeArgs="-DCLR_CMAKE_TARGET_MACCATALYST=1 $cmakeArgs" fi if [[ "$__UseNinja" == 1 ]]; then diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index 73269ffa3363b..f00ce406da3d3 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -387,7 +387,7 @@ if (CLR_CMAKE_HOST_UNIX) # Specify the minimum supported version of macOS if(CLR_CMAKE_HOST_OSX) # Mac Catalyst needs a special CFLAG, exclusive with mmacosx-version-min - if(CLR_CMAKE_TARGET_CATALYST) + if(CLR_CMAKE_TARGET_MACCATALYST) if(CLR_CMAKE_HOST_ARCH_ARM64) add_compile_options(-target arm64-apple-ios13.2-macabi) add_link_options(-target arm64-apple-ios13.2-macabi) @@ -410,7 +410,7 @@ if (CLR_CMAKE_HOST_UNIX) endif() add_compile_options(${MACOS_VERSION_MIN_FLAGS}) add_linker_flag(${MACOS_VERSION_MIN_FLAGS}) - endif(CLR_CMAKE_TARGET_CATALYST) + endif(CLR_CMAKE_TARGET_MACCATALYST) endif(CLR_CMAKE_HOST_OSX) endif(CLR_CMAKE_HOST_UNIX) diff --git a/eng/native/configureplatform.cmake b/eng/native/configureplatform.cmake index 23622cfb12fcb..9e7e7743c0f9e 100644 --- a/eng/native/configureplatform.cmake +++ b/eng/native/configureplatform.cmake @@ -307,7 +307,7 @@ endif(CLR_CMAKE_TARGET_OS STREQUAL iOS) if(CLR_CMAKE_TARGET_OS STREQUAL MacCatalyst) set(CLR_CMAKE_TARGET_UNIX 1) - set(CLR_CMAKE_TARGET_CATALYST 1) + set(CLR_CMAKE_TARGET_MACCATALYST 1) endif(CLR_CMAKE_TARGET_OS STREQUAL MacCatalyst) if(CLR_CMAKE_TARGET_OS STREQUAL tvOS) diff --git a/eng/native/configuretools.cmake b/eng/native/configuretools.cmake index 30e5f802b118b..501aec5f6c6a9 100644 --- a/eng/native/configuretools.cmake +++ b/eng/native/configuretools.cmake @@ -47,7 +47,7 @@ if(NOT WIN32 AND NOT CLR_CMAKE_TARGET_BROWSER) locate_toolchain_exec(link CMAKE_LINKER) endif() - if(NOT CLR_CMAKE_TARGET_OSX AND NOT CLR_CMAKE_TARGET_CATALYST 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_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)) locate_toolchain_exec(objdump CMAKE_OBJDUMP) if(CLR_CMAKE_TARGET_ANDROID) diff --git a/eng/native/functions.cmake b/eng/native/functions.cmake index cbae9131dd128..9c2cc0c7dee2b 100644 --- a/eng/native/functions.cmake +++ b/eng/native/functions.cmake @@ -211,7 +211,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_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) + if(CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) set(SCRIPT_NAME generateexportedsymbols.sh) else() set(SCRIPT_NAME generateversionscript.sh) @@ -252,7 +252,7 @@ function(strip_symbols targetName outputFilename) if (CLR_CMAKE_HOST_UNIX) set(strip_source_file $) - if (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) + if (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) set(strip_destination_file ${strip_source_file}.dwarf) # Ensure that dsymutil and strip are present @@ -281,7 +281,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_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) + else (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) set(strip_destination_file ${strip_source_file}.dbg) add_custom_command( @@ -293,7 +293,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_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) + endif (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) set(${outputFilename} ${strip_destination_file} PARENT_SCOPE) else(CLR_CMAKE_HOST_UNIX) @@ -316,7 +316,7 @@ function(install_with_stripped_symbols targetName kind destination) install_symbols(${symbol_file} ${destination}) endif() - if ((CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) AND ("${kind}" STREQUAL "TARGETS")) + if ((CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) AND ("${kind}" STREQUAL "TARGETS")) # We want to avoid the kind=TARGET install behaviors which corrupt code signatures on osx-arm64 set(kind PROGRAMS) endif() diff --git a/src/libraries/Native/Unix/CMakeLists.txt b/src/libraries/Native/Unix/CMakeLists.txt index c7e387d47c5b3..2841a8f2440ea 100644 --- a/src/libraries/Native/Unix/CMakeLists.txt +++ b/src/libraries/Native/Unix/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.6.2) include(CheckCCompilerFlag) -if(CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) +if(CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) # CMake 3.14.5 contains bug fixes for iOS cmake_minimum_required(VERSION 3.14.5) endif() @@ -13,7 +13,7 @@ include(../../../../eng/native/configurepaths.cmake) include(${CLR_ENG_NATIVE_DIR}/configuretools.cmake) set(CMAKE_MACOSX_RPATH ON) -if(CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) +if(CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) set(CMAKE_INSTALL_NAME_DIR "@rpath") endif() @@ -76,7 +76,7 @@ if(CLR_CMAKE_TARGET_BROWSER) set(STATIC_LIB_DESTINATION .) endif() -if(CLR_CMAKE_TARGET_CATALYST) +if(CLR_CMAKE_TARGET_MACCATALYST) if (CLR_CMAKE_TARGET_ARCH_AMD64) add_compile_options(-target x86_64-apple-ios13.2-macabi) add_link_options(-target x86_64-apple-ios13.2-macabi) @@ -178,7 +178,7 @@ else () endif () if(CLR_CMAKE_TARGET_BROWSER) -elseif (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) +elseif (CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) add_definitions(-D__APPLE_USE_RFC_3542) # We cannot enable "stack-protector-strong" on OS X due to a bug in clang compiler (current version 7.0.2) @@ -198,7 +198,7 @@ endif () # ./build-native.sh cmakeargs -DCLR_ADDITIONAL_COMPILER_OPTIONS=<...> cmakeargs -DCLR_ADDITIONAL_LINKER_FLAGS=<...> # if(CLR_CMAKE_TARGET_UNIX) - if(NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS) + if(NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS) if(CLR_CMAKE_TARGET_OSX) add_definitions(-DTARGET_OSX) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-bind_at_load") @@ -226,7 +226,7 @@ include(configure.cmake) add_subdirectory(System.IO.Compression.Native) -if (NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) +if (NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) add_subdirectory(System.IO.Ports.Native) endif() @@ -238,7 +238,7 @@ add_subdirectory(System.Native) if(CLR_CMAKE_TARGET_BROWSER) # skip for now -elseif(CLR_CMAKE_TARGET_CATALYST) +elseif(CLR_CMAKE_TARGET_MACCATALYST) add_subdirectory(System.Net.Security.Native) # System.Security.Cryptography.Native is intentionally disabled on iOS # it is only used for interacting with OpenSSL which isn't useful there @@ -262,7 +262,7 @@ else() add_subdirectory(System.Security.Cryptography.Native) endif() -if(CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) +if(CLR_CMAKE_TARGET_OSX OR CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) add_subdirectory(System.Security.Cryptography.Native.Apple) endif() diff --git a/src/libraries/Native/Unix/System.Globalization.Native/CMakeLists.txt b/src/libraries/Native/Unix/System.Globalization.Native/CMakeLists.txt index 3e2bf4d1888f1..b3dc00c107cd1 100644 --- a/src/libraries/Native/Unix/System.Globalization.Native/CMakeLists.txt +++ b/src/libraries/Native/Unix/System.Globalization.Native/CMakeLists.txt @@ -62,7 +62,7 @@ set(NATIVEGLOBALIZATION_SOURCES pal_icushim.c ) -if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) +if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) set(NATIVEGLOBALIZATION_SOURCES ${NATIVEGLOBALIZATION_SOURCES} entrypoints.c) endif() @@ -98,7 +98,7 @@ endif() install (TARGETS System.Globalization.Native-Static DESTINATION ${STATIC_LIB_DESTINATION}) -if(NOT CLR_CMAKE_TARGET_OSX AND NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) +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) if (GEN_SHARED_LIB) add_custom_command(TARGET System.Globalization.Native POST_BUILD COMMENT "Verifying System.Globalization.Native.so dependencies" diff --git a/src/libraries/Native/Unix/System.IO.Compression.Native/CMakeLists.txt b/src/libraries/Native/Unix/System.IO.Compression.Native/CMakeLists.txt index 0ff90b495c6fc..e45d404b89519 100644 --- a/src/libraries/Native/Unix/System.IO.Compression.Native/CMakeLists.txt +++ b/src/libraries/Native/Unix/System.IO.Compression.Native/CMakeLists.txt @@ -68,7 +68,7 @@ if (GEN_SHARED_LIB) ${NATIVE_LIBS_EXTRA} ) - if (NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) + if (NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) set(DEF_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/System.IO.Compression.Native_unixexports.src) set(EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/System.IO.Compression.Native.exports) generate_exports_file(${DEF_SOURCES} ${EXPORTS_FILE}) diff --git a/src/libraries/Native/Unix/System.Native/CMakeLists.txt b/src/libraries/Native/Unix/System.Native/CMakeLists.txt index ec11b8f2f3857..48df59ab175ba 100644 --- a/src/libraries/Native/Unix/System.Native/CMakeLists.txt +++ b/src/libraries/Native/Unix/System.Native/CMakeLists.txt @@ -1,6 +1,6 @@ project(System.Native C) -if (NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS) +if (NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS) add_definitions(-DHAS_CONSOLE_SIGNALS) endif () @@ -29,7 +29,7 @@ set(NATIVE_SOURCES pal_sysctl.c ) -if (CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) +if (CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) set(NATIVE_SOURCES ${NATIVE_SOURCES} pal_log.m pal_searchpath.m) @@ -60,7 +60,7 @@ if (GEN_SHARED_LIB) ${NATIVE_LIBS_EXTRA} ) - if (NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) + if (NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) add_custom_command(TARGET System.Native POST_BUILD COMMENT "Verifying System.Native entry points against entrypoints.c " COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../verify-entrypoints.sh @@ -74,7 +74,7 @@ if (GEN_SHARED_LIB) install_with_stripped_symbols (System.Native PROGRAMS .) endif () -if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) +if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) set(NATIVE_SOURCES ${NATIVE_SOURCES} entrypoints.c) endif() diff --git a/src/libraries/Native/Unix/System.Native/extra_libs.cmake b/src/libraries/Native/Unix/System.Native/extra_libs.cmake index 6e489aea2aece..a8cc4a3bea612 100644 --- a/src/libraries/Native/Unix/System.Native/extra_libs.cmake +++ b/src/libraries/Native/Unix/System.Native/extra_libs.cmake @@ -10,7 +10,7 @@ macro(append_extra_system_libs NativeLibsExtra) list(APPEND ${NativeLibsExtra} socket) endif () - if (CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) + if (CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) list(APPEND ${NativeLibsExtra} "-framework Foundation") endif () diff --git a/src/libraries/Native/Unix/System.Net.Security.Native/CMakeLists.txt b/src/libraries/Native/Unix/System.Net.Security.Native/CMakeLists.txt index 0b6239fce30e2..3c03fa1696793 100644 --- a/src/libraries/Native/Unix/System.Net.Security.Native/CMakeLists.txt +++ b/src/libraries/Native/Unix/System.Net.Security.Native/CMakeLists.txt @@ -19,7 +19,7 @@ if (GEN_SHARED_LIB) ) endif() -if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) +if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) set(NATIVEGSS_SOURCES ${NATIVEGSS_SOURCES} entrypoints.c) endif() @@ -35,7 +35,7 @@ if (GEN_SHARED_LIB) ${NATIVE_LIBS_EXTRA} ) - if (NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) + if (NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) add_custom_command(TARGET System.Net.Security.Native POST_BUILD COMMENT "Verifying System.Net.Security.Native entry points against entrypoints.c " COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../verify-entrypoints.sh diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/CMakeLists.txt b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/CMakeLists.txt index bb31d55e18982..e1e4c47a6d861 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/CMakeLists.txt +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/CMakeLists.txt @@ -23,8 +23,8 @@ set(NATIVECRYPTO_SOURCES pal_x509chain.c ) -if (CLR_CMAKE_TARGET_CATALYST) - add_definitions(-DTARGET_CATALYST) +if (CLR_CMAKE_TARGET_MACCATALYST) + add_definitions(-DTARGET_MACCATALYST) endif() if (CLR_CMAKE_TARGET_IOS) @@ -43,7 +43,7 @@ if (GEN_SHARED_LIB) ) endif() -if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) +if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) set(NATIVECRYPTO_SOURCES ${NATIVECRYPTO_SOURCES} entrypoints.c) endif() diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/entrypoints.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/entrypoints.c index b084c43972867..3c00bb540e2ce 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/entrypoints.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/entrypoints.c @@ -1,7 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) #include "../../AnyOS/entrypoints.h" @@ -112,4 +112,4 @@ EXTERN_C const void* CryptoAppleResolveDllImport(const char* name) return ResolveDllImport(s_cryptoAppleNative, lengthof(s_cryptoAppleNative), name); } -#endif // !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#endif // !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.c index 630df6a90a7e5..d0189f5e78760 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.c @@ -3,7 +3,7 @@ #include "pal_ecc.h" -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) int32_t AppleCryptoNative_EccGenerateKey( int32_t keySizeBits, SecKeychainRef tempKeychain, SecKeyRef* pPublicKey, SecKeyRef* pPrivateKey, int32_t* pOSStatus) { diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.h index 63b7112581dcc..0e044376d17dd 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ecc.h @@ -8,7 +8,7 @@ #include -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) /* Generate an ECC keypair of the specified size. diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.c index 40dea0d6b11cb..866cedf2a012b 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.c @@ -4,7 +4,7 @@ #include "pal_keychain.h" #include "pal_utilities.h" -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) int32_t AppleCryptoNative_SecKeychainItemCopyKeychain(SecKeychainItemRef item, SecKeychainRef* pKeychainOut) { if (pKeychainOut != NULL) diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.h index 54f7266240adc..59cfaad1e91f5 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_keychain.h @@ -8,7 +8,7 @@ #include -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) /* Get a CFRetain()ed SecKeychainRef value for the keychain to which the keychain item belongs. diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.c index 1ea0a8f1f1ea1..a4240bf5bf935 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.c @@ -3,7 +3,7 @@ #include "pal_rsa.h" -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) static int32_t ExecuteCFDataTransform( SecTransformRef xform, uint8_t* pbData, int32_t cbData, CFDataRef* pDataOut, CFErrorRef* pErrorOut); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.h index 301dd437e3017..fb44bf21733c0 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_rsa.h @@ -9,7 +9,7 @@ #include -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) /* Generate a new RSA keypair with the specified key size, in bits. diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.c index 34a8a776fd2c7..a9dc6888f272c 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.c @@ -3,7 +3,7 @@ #include "pal_sec.h" -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) CFStringRef AppleCryptoNative_SecCopyErrorMessageString(int32_t osStatus) { return SecCopyErrorMessageString(osStatus, NULL); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.h index f7f42dc559aad..25eee34933536 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_sec.h @@ -8,7 +8,7 @@ #include -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) /* Get an error message for an OSStatus error from the security library. diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.c index 4eff6ea5ed658..99c4a1c4820ad 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.c @@ -4,7 +4,7 @@ #include "pal_seckey.h" #include "pal_utilities.h" -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) int32_t AppleCryptoNative_SecKeyExport( SecKeyRef pKey, int32_t exportPrivate, CFStringRef cfExportPassphrase, CFDataRef* ppDataOut, int32_t* pOSStatus) { @@ -140,7 +140,7 @@ uint64_t AppleCryptoNative_SecKeyGetSimpleKeySizeInBytes(SecKeyRef publicKey) return SecKeyGetBlockSize(publicKey); } -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) OSStatus ExportImportKey(SecKeyRef* key, SecExternalItemType type) { SecExternalFormat dataFormat = kSecFormatOpenSSL; diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.h index 8970520ffdcbb..37fcb4f5cd226 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_seckey.h @@ -16,7 +16,7 @@ static const int32_t kErrorSeeError = -2; static const int32_t kErrorUnknownAlgorithm = -3; static const int32_t kErrorUnknownState = -4; -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) /* Export a key object. @@ -60,7 +60,7 @@ For ECC the value should not be used. */ PALEXPORT uint64_t AppleCryptoNative_SecKeyGetSimpleKeySizeInBytes(SecKeyRef publicKey); -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) /* Export a key and re-import it to the NULL keychain. diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.c index 793cc94b693a0..f429771ad9676 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.c @@ -3,7 +3,7 @@ #include "pal_signverify.h" -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) static int32_t ExecuteSignTransform(SecTransformRef signer, CFDataRef* pSignatureOut, CFErrorRef* pErrorOut); static int32_t ExecuteVerifyTransform(SecTransformRef verifier, CFErrorRef* pErrorOut); diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.h index 0643ec3d83025..03186109108de 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_signverify.h @@ -9,7 +9,7 @@ #include -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) /* Generate a signature for algorithms which require only the data hash blob, like DSA and ECDSA. diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.c index 7b03e1a96689a..190c1dc1c9976 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_ssl.c @@ -588,7 +588,7 @@ int32_t AppleCryptoNative_SslSetEnabledCipherSuites(SSLContextRef sslContext, co // Max numCipherSuites is 2^16 (all possible cipher suites) assert(numCipherSuites < (1 << 16)); -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) if (sizeof(SSLCipherSuite) == sizeof(uint32_t)) { #pragma clang diagnostic push diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.c index 5adb203ad9f57..83eefc916c598 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.c @@ -4,7 +4,7 @@ #include "pal_trust.h" #include "pal_utilities.h" -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) static bool CheckTrustMatch(SecCertificateRef cert, SecTrustSettingsDomain domain, SecTrustSettingsResult result, diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.h index 2245897822174..5087db65b8c72 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_trust.h @@ -8,7 +8,7 @@ #include -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) /* Enumerate the certificates which are root trusted by the user. diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.c index 51458aca0c737..ec91e362f501b 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.c @@ -107,7 +107,7 @@ PAL_X509ContentType AppleCryptoNative_X509GetContentType(uint8_t* pbData, int32_ return PAL_Certificate; } -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) SecExternalFormat dataFormat = kSecFormatPKCS7; SecExternalFormat actualFormat = dataFormat; SecExternalItemType itemType = kSecItemTypeAggregate; @@ -257,7 +257,7 @@ int32_t AppleCryptoNative_X509CopyPrivateKeyFromIdentity(SecIdentityRef identity return SecIdentityCopyPrivateKey(identity, pPrivateKeyOut); } -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) static int32_t ReadX509(uint8_t* pbData, int32_t cbData, PAL_X509ContentType contentType, diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.h b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.h index 4be8c63d88fb2..fbe79a9e6af24 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.h +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/pal_x509.h @@ -73,7 +73,7 @@ pPrivateKeyOut: Receives a SecKeyRef for the private key associated with the ide */ PALEXPORT int32_t AppleCryptoNative_X509CopyPrivateKeyFromIdentity(SecIdentityRef identity, SecKeyRef* pPrivateKeyOut); -#if !defined(TARGET_CATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) +#if !defined(TARGET_MACCATALYST) && !defined(TARGET_IOS) && !defined(TARGET_TVOS) /* Read cbData bytes of data from pbData and interpret it to a collection of certificates (or identities). diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/CMakeLists.txt b/src/libraries/Native/Unix/System.Security.Cryptography.Native/CMakeLists.txt index 4e185b22539e8..83b9ae5999816 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/CMakeLists.txt +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/CMakeLists.txt @@ -97,7 +97,7 @@ if (GEN_SHARED_LIB) endif() endif() - if (NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) + if (NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) add_custom_command(TARGET System.Security.Cryptography.Native.OpenSsl POST_BUILD COMMENT "Verifying System.Security.Cryptography.Native.OpenSsl entry points against entrypoints.c " COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../verify-entrypoints.sh diff --git a/src/libraries/Native/Unix/configure.cmake b/src/libraries/Native/Unix/configure.cmake index 0c1cd68fa5adf..b9d51e46c9026 100644 --- a/src/libraries/Native/Unix/configure.cmake +++ b/src/libraries/Native/Unix/configure.cmake @@ -25,7 +25,7 @@ elseif (CLR_CMAKE_TARGET_OSX) # Xcode's clang does not include /usr/local/include by default, but brew's does. # This ensures an even playing field. include_directories(SYSTEM /usr/local/include) -elseif (CLR_CMAKE_TARGET_CATALYST) +elseif (CLR_CMAKE_TARGET_MACCATALYST) set(PAL_UNIX_NAME \"MACCATALYST\") elseif (CLR_CMAKE_TARGET_IOS) set(PAL_UNIX_NAME \"IOS\") @@ -505,7 +505,7 @@ if(CLR_CMAKE_TARGET_IOS) unset(HAVE_CLOCK_MONOTONIC) # only exists on iOS 10+ unset(HAVE_CLOCK_REALTIME) # only exists on iOS 10+ unset(HAVE_FORK) # exists but blocked by kernel -elseif(CLR_CMAKE_TARGET_CATALYST) +elseif(CLR_CMAKE_TARGET_MACCATALYST) # Manually set results from check_c_source_runs() since it's not possible to actually run it during CMake configure checking unset(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP) unset(HAVE_CLOCK_MONOTONIC) # only exists on iOS 10+ @@ -790,7 +790,7 @@ check_symbol_exists( "unistd.h;grp.h" HAVE_GETGROUPLIST) -if(CLR_CMAKE_TARGET_CATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) +if(CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS) set(HAVE_IOS_NET_ROUTE_H 1) set(CMAKE_EXTRA_INCLUDE_FILES sys/types.h "${CMAKE_CURRENT_SOURCE_DIR}/System.Native/ios/net/route.h") else() diff --git a/src/libraries/Native/Windows/System.IO.Compression.Native/CMakeLists.txt b/src/libraries/Native/Windows/System.IO.Compression.Native/CMakeLists.txt index 435462a90b3a4..e161657b3960d 100644 --- a/src/libraries/Native/Windows/System.IO.Compression.Native/CMakeLists.txt +++ b/src/libraries/Native/Windows/System.IO.Compression.Native/CMakeLists.txt @@ -89,7 +89,7 @@ if (GEN_SHARED_LIB) ) endif() -if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_CATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) +if (NOT GEN_SHARED_LIB AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_BROWSER) set(NATIVECOMPRESSION_SOURCES ${NATIVECOMPRESSION_SOURCES} ../../AnyOS/System.IO.Compression.Native/entrypoints.c) endif() diff --git a/src/libraries/System.Private.CoreLib/src/System/IO/Path.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/IO/Path.Unix.cs index e9851ce2c3d72..ecc990b07c6e1 100644 --- a/src/libraries/System.Private.CoreLib/src/System/IO/Path.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/IO/Path.Unix.cs @@ -134,7 +134,7 @@ internal static bool IsCaseSensitive { get { - #if TARGET_OSX || TARGET_CATALYST || TARGET_IOS || TARGET_TVOS + #if TARGET_OSX || TARGET_MACCATALYST || TARGET_IOS || TARGET_TVOS return false; #else return true; diff --git a/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs b/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs index 64f7f5562a4ca..93f8af328807f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs +++ b/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs @@ -207,7 +207,7 @@ public static bool IsMacOSVersionAtLeast(int major, int minor = 0, int build = 0 /// Indicates whether the current application is running on Mac Catalyst. /// public static bool IsMacCatalyst() => -#if TARGET_CATALYST +#if TARGET_MACCATALYST true; #else false; diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/LibraryNameVariation.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/LibraryNameVariation.Unix.cs index 71c40ee856d9a..cf1efef3fab2e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/LibraryNameVariation.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/LibraryNameVariation.Unix.cs @@ -9,7 +9,7 @@ namespace System.Runtime.Loader internal partial struct LibraryNameVariation { private const string LibraryNamePrefix = "lib"; -#if TARGET_OSX || TARGET_CATALYST || TARGET_IOS || TARGET_TVOS +#if TARGET_OSX || TARGET_MACCATALYST || TARGET_IOS || TARGET_TVOS private const string LibraryNameSuffix = ".dylib"; #else private const string LibraryNameSuffix = ".so"; diff --git a/src/libraries/System.Runtime.Extensions/tests/System/OperatingSystemTests.cs b/src/libraries/System.Runtime.Extensions/tests/System/OperatingSystemTests.cs index a15a2fe0dbaeb..d99a21d274780 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/OperatingSystemTests.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/OperatingSystemTests.cs @@ -11,7 +11,7 @@ public static class OperatingSystemTests { "Android", "macOS", - "MacCatalyst", + //"MacCatalyst", "iOS", "tvOS", "watchOS", @@ -123,11 +123,13 @@ public static void OSX_Is_Treated_as_macOS() AssertVersionChecks(true, (major, minor, build) => OperatingSystem.IsOSPlatformVersionAtLeast("osx", major, minor, build)); } + /* Disable Mac Catalyst tests until Arcade and xharness are ready [Fact, PlatformSpecific(TestPlatforms.MacCatalyst)] public static void TestIsOSPlatform_MacCatalyst() => TestIsOSPlatform("MacCatalyst", OperatingSystem.IsMacCatalyst); [Fact, PlatformSpecific(TestPlatforms.MacCatalyst)] public static void TestIsOSVersionAtLeast_MacCatalyst() => TestIsOSVersionAtLeast("MacCatalyst"); + */ [Fact, PlatformSpecific(TestPlatforms.tvOS)] public static void TestIsOSPlatform_TvOS() => TestIsOSPlatform("tvOS", OperatingSystem.IsTvOS); From 5a3ab815d63172eb701b67da2438b4235adb16dc Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Thu, 4 Feb 2021 09:47:27 -0500 Subject: [PATCH 14/28] Add some yaml for Mac Catalyst --- eng/pipelines/common/platform-matrix.yml | 42 ++++++++++++++++++++++++ eng/pipelines/common/xplat-setup.yml | 4 +-- eng/pipelines/runtime-official.yml | 1 + eng/pipelines/runtime.yml | 3 +- 4 files changed, 47 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index 97268ab6107dd..3486e0d08c075 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -323,6 +323,48 @@ jobs: helixQueueGroup: ${{ parameters.helixQueueGroup }} ${{ insert }}: ${{ parameters.jobParameters }} +# Mac Catalyst x64 + +- ${{ if containsValue(parameters.platforms, 'MacCatalyst_x64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: MacCatalyst + archType: x64 + targetRid: maccatalyst-x64 + platform: MacCatalyst_x64 + jobParameters: + runtimeFlavor: mono + stagedBuild: ${{ parameters.stagedBuild }} + buildConfig: ${{ parameters.buildConfig }} + ${{ if eq(parameters.passPlatforms, true) }}: + platforms: ${{ parameters.platforms }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + +# Mac Catalyst arm64 + +- ${{ if containsValue(parameters.platforms, 'MacCatalyst_arm64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: MacCatalyst + archType: arm64 + targetRid: maccatalyst-arm64 + platform: MacCatalyst_arm64 + jobParameters: + runtimeFlavor: mono + stagedBuild: ${{ parameters.stagedBuild }} + buildConfig: ${{ parameters.buildConfig }} + ${{ if eq(parameters.passPlatforms, true) }}: + platforms: ${{ parameters.platforms }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + ${{ insert }}: ${{ parameters.jobParameters }} + # tvOS x64 - ${{ if containsValue(parameters.platforms, 'tvOS_x64') }}: diff --git a/eng/pipelines/common/xplat-setup.yml b/eng/pipelines/common/xplat-setup.yml index c9929621eb17b..a9ed9dbf41715 100644 --- a/eng/pipelines/common/xplat-setup.yml +++ b/eng/pipelines/common/xplat-setup.yml @@ -119,7 +119,7 @@ jobs: queue: BuildPool.Ubuntu.1604.Amd64 # OSX Build Pool (we don't have on-prem OSX BuildPool - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}: + ${{ if in(parameters.osGroup, 'OSX', 'MacCatalyst', 'iOS', 'tvOS') }}: vmImage: 'macOS-10.15' # Official Build Windows Pool @@ -135,7 +135,7 @@ jobs: ${{ if eq(parameters.helixQueuesTemplate, '') }}: # macOS hosted pool machines are slower so we need to give a greater timeout than the 60 mins default. - ${{ if and(eq(parameters.jobParameters.timeoutInMinutes, ''), in(parameters.osGroup, 'OSX', 'iOS', 'tvOS')) }}: + ${{ if and(eq(parameters.jobParameters.timeoutInMinutes, ''), in(parameters.osGroup, 'OSX', 'MacCatalyst', 'iOS', 'tvOS')) }}: timeoutInMinutes: 120 ${{ insert }}: ${{ parameters.jobParameters }} ${{ if ne(parameters.helixQueuesTemplate, '') }}: diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml index 6a3dfd842094f..7e240dbee3294 100644 --- a/eng/pipelines/runtime-official.yml +++ b/eng/pipelines/runtime-official.yml @@ -98,6 +98,7 @@ stages: - Android_x86 - Android_arm - Android_arm64 + - MacCatalyst_x64 - tvOS_x64 - tvOS_arm64 - iOS_x64 diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 23ff8d993fe99..84557058220e7 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -212,6 +212,7 @@ jobs: runtimeFlavor: mono platforms: - Android_x86 + - MacCatalyst_x64 - tvOS_x64 - iOS_arm64 - iOS_x86 @@ -1050,4 +1051,4 @@ jobs: or( eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true), eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), - eq(variables['isFullMatrix'], true)) \ No newline at end of file + eq(variables['isFullMatrix'], true)) From 2d5d1fb637bb637df1b1a230e578cad965fdb8a6 Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Thu, 4 Feb 2021 09:50:38 -0500 Subject: [PATCH 15/28] Use "correct" Catalyst OS version targets - 11.0 ARM64 & 10.15.5 x64 --- eng/native/configurecompiler.cmake | 8 ++++---- src/libraries/Native/Unix/CMakeLists.txt | 8 ++++---- src/mono/mono.proj | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index f00ce406da3d3..6f4a4ed0432f0 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -389,11 +389,11 @@ if (CLR_CMAKE_HOST_UNIX) # Mac Catalyst needs a special CFLAG, exclusive with mmacosx-version-min if(CLR_CMAKE_TARGET_MACCATALYST) if(CLR_CMAKE_HOST_ARCH_ARM64) - add_compile_options(-target arm64-apple-ios13.2-macabi) - add_link_options(-target arm64-apple-ios13.2-macabi) + add_compile_options(-target arm64-apple-ios14.2-macabi) + add_link_options(-target arm64-apple-ios14.2-macabi) elseif(CLR_CMAKE_HOST_ARCH_AMD64) - add_compile_options(-target x86_64-apple-ios13.2-macabi) - add_link_options(-target x86_64-apple-ios13.2-macabi) + add_compile_options(-target x86_64-apple-ios13.5-macabi) + add_link_options(-target x86_64-apple-ios13.5-macabi) else() clr_unknown_arch() endif() diff --git a/src/libraries/Native/Unix/CMakeLists.txt b/src/libraries/Native/Unix/CMakeLists.txt index 2841a8f2440ea..15062c1fc81f6 100644 --- a/src/libraries/Native/Unix/CMakeLists.txt +++ b/src/libraries/Native/Unix/CMakeLists.txt @@ -78,11 +78,11 @@ endif() if(CLR_CMAKE_TARGET_MACCATALYST) if (CLR_CMAKE_TARGET_ARCH_AMD64) - add_compile_options(-target x86_64-apple-ios13.2-macabi) - add_link_options(-target x86_64-apple-ios13.2-macabi) + add_compile_options(-target x86_64-apple-ios13.5-macabi) + add_link_options(-target x86_64-apple-ios13.5-macabi) elseif (CLR_CMAKE_TARGET_ARCH_ARM64) - add_compile_options(-target arm64-apple-ios13.2-macabi) - add_link_options(-target arm64-apple-ios13.2-macabi) + add_compile_options(-target arm64-apple-ios14.2-macabi) + add_link_options(-target arm64-apple-ios14.2-macabi) endif() endif() diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 66d419e841a8d..61e33d8f9b1b7 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -204,12 +204,12 @@ - <_MonoCFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios13.2-macabi" /> - <_MonoCFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios13.2-macabi" /> + <_MonoCFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios14.2-macabi" /> + <_MonoCFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios13.5-macabi" /> <_MonoCFlags Include="-DMAC_CATALYST" /> <_MonoCFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" /> - <_MonoCXXFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios13.2-macabi" /> - <_MonoCXXFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios13.2-macabi" /> + <_MonoCXXFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios14.2-macabi" /> + <_MonoCXXFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios13.5-macabi" /> <_MonoCXXFlags Include="-DMAC_CATALYST" /> <_MonoCXXFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" /> <_MonoLDFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" /> From 8daf812cf51d74b1b1c0a8ec44f5c782728b98c3 Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Thu, 4 Feb 2021 13:01:26 -0500 Subject: [PATCH 16/28] Disable -Woverriding-t-option on Mac Catalyst builds Somewhere between CMake 3.17 and 3.19.4, a decision was made to force setting of -mmacosx-version-min when building with an OSX SDK. Leave The relevant cmake deployment variable blank, and it just picks its own default. You can't bypass it, as far as I can tell. Mac Catalyst requires a -target flag, which is incompatible with a -mmacosx-version-min flag. Sadly, our best option is to suppress the warning/error, as the bug is in CMake not with us. --- eng/native/configurecompiler.cmake | 6 ++++++ src/libraries/Native/Unix/CMakeLists.txt | 3 +++ src/mono/mono.proj | 1 + 3 files changed, 10 insertions(+) diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index 6f4a4ed0432f0..f6863959ad1d8 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -388,6 +388,12 @@ if (CLR_CMAKE_HOST_UNIX) if(CLR_CMAKE_HOST_OSX) # Mac Catalyst needs a special CFLAG, exclusive with mmacosx-version-min if(CLR_CMAKE_TARGET_MACCATALYST) + # Somewhere between CMake 3.17 and 3.19.4, it became impossible to not pass + # a value for mmacosx-version-min (blank CMAKE_OSX_DEPLOYMENT_TARGET gets + # replaced with a default value, and always gets expanded to an OS version. + # We need to disable the warning that -tagret replaces -mmacosx-version-min + add_compile_options(-Wno-overriding-t-option) + add_link_options(-Wno-overriding-t-option) if(CLR_CMAKE_HOST_ARCH_ARM64) add_compile_options(-target arm64-apple-ios14.2-macabi) add_link_options(-target arm64-apple-ios14.2-macabi) diff --git a/src/libraries/Native/Unix/CMakeLists.txt b/src/libraries/Native/Unix/CMakeLists.txt index 15062c1fc81f6..881731c69e8b6 100644 --- a/src/libraries/Native/Unix/CMakeLists.txt +++ b/src/libraries/Native/Unix/CMakeLists.txt @@ -77,6 +77,9 @@ if(CLR_CMAKE_TARGET_BROWSER) endif() if(CLR_CMAKE_TARGET_MACCATALYST) + # -target overrides -mmacosx-version-min so suppress warning about that + add_compile_options(-Wno-overriding-t-option) + add_link_options(-Wno-overriding-t-option) if (CLR_CMAKE_TARGET_ARCH_AMD64) add_compile_options(-target x86_64-apple-ios13.5-macabi) add_link_options(-target x86_64-apple-ios13.5-macabi) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 61e33d8f9b1b7..8958e11761504 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -204,6 +204,7 @@ + <_MonoCPPFLAGS Include="-Wno-overriding-t-option" /> <_MonoCFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios14.2-macabi" /> <_MonoCFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios13.5-macabi" /> <_MonoCFlags Include="-DMAC_CATALYST" /> From 519b266f67a43713e775e5a1a92e9ed5a8739d09 Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Thu, 4 Feb 2021 13:35:42 -0500 Subject: [PATCH 17/28] Fix build failure --- src/mono/mono/mini/graph.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mono/mono/mini/graph.c b/src/mono/mono/mini/graph.c index 1fd4973784f7e..960a7e957527e 100644 --- a/src/mono/mono/mini/graph.c +++ b/src/mono/mono/mini/graph.c @@ -198,7 +198,9 @@ mono_draw_code_cfg (MonoCompile *cfg, FILE *fp) void mono_draw_graph (MonoCompile *cfg, MonoGraphOptions draw_options) { +#if defined(HAVE_SYSTEM) && !defined(MAC_CATALYST) char *com; +#endif const char *fn; FILE *fp; int _i G_GNUC_UNUSED; From a88df9fa62616b303cbdfdb411b7d43dc0a4c214 Mon Sep 17 00:00:00 2001 From: Jo Shields Date: Thu, 4 Feb 2021 15:34:49 -0500 Subject: [PATCH 18/28] Update src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs Co-authored-by: Rolf Bjarne Kvinge --- .../System.Private.CoreLib/src/System/OperatingSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs b/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs index 93f8af328807f..e8bf015e52c07 100644 --- a/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs +++ b/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs @@ -214,7 +214,7 @@ public static bool IsMacCatalyst() => #endif /// - /// Check for the Mac Catalyst version (returned by 'libobjc.get_operatingSystemVersion') with a >= version comparison. Used to guard APIs that were added in the given tvOS release. + /// Check for the Mac Catalyst version (returned by 'libobjc.get_operatingSystemVersion') with a >= version comparison. Used to guard APIs that were added in the given Mac Catalyst release. /// public static bool IsMacCatalystVersionAtLeast(int major, int minor = 0, int build = 0) => IsMacCatalyst() && IsOSVersionAtLeast(major, minor, build, 0); From ebdb15e171afbec0b9f7cd814c9c5746baa5e1bd Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Fri, 5 Feb 2021 08:20:31 -0500 Subject: [PATCH 19/28] Fix folder detection for Catalyst test apps --- src/tasks/AppleAppBuilder/Templates/runtime.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tasks/AppleAppBuilder/Templates/runtime.m b/src/tasks/AppleAppBuilder/Templates/runtime.m index f7697becea3d5..37e5744e5c71a 100644 --- a/src/tasks/AppleAppBuilder/Templates/runtime.m +++ b/src/tasks/AppleAppBuilder/Templates/runtime.m @@ -29,6 +29,11 @@ return bundle_path; NSBundle* main_bundle = [NSBundle mainBundle]; NSString* path = [main_bundle bundlePath]; + +#if TARGET_OS_MACCATALYST + path = [path stringByAppendingString:@"/Contents/Resources"]; +#endif + bundle_path = strdup ([path UTF8String]); return bundle_path; From 59ce23058a8ea6cd6a781fcfde2149ac08b667e6 Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Fri, 5 Feb 2021 09:03:22 -0500 Subject: [PATCH 20/28] Address changes suggested by Alex --- Directory.Build.props | 4 ++-- eng/native/configurecompiler.cmake | 1 + src/libraries/Native/Unix/CMakeLists.txt | 1 + src/libraries/Native/Unix/configure.cmake | 1 + .../src/System.Private.CoreLib.Shared.projitems | 2 +- .../System.Private.CoreLib/src/System/OperatingSystem.cs | 2 ++ src/libraries/System.Runtime/ref/System.Runtime.cs | 2 -- src/mono/cmake/configure.cmake | 6 +++++- src/mono/mono.proj | 2 ++ src/mono/mono/mini/aot-compiler.c | 2 +- src/mono/mono/mini/graph.c | 4 +--- src/mono/mono/mini/helpers.c | 2 +- src/tasks/AppleAppBuilder/Xcode.cs | 4 ++-- 13 files changed, 20 insertions(+), 13 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 00e866b3f4c1c..bda23977ca1de 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -17,7 +17,7 @@ Solaris Linux windows - true + true @@ -145,7 +145,7 @@ <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android' and $([MSBuild]::IsOSPlatform('WINDOWS'))">win-x64 <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'android' and $([MSBuild]::IsOSPlatform('OSX'))">osx-x64 - + <_toolRuntimeRID Condition="'$(_runtimeOS)' == 'maccatalyst' or '$(_runtimeOS)' == 'ios' or '$(_runtimeOS)' == 'tvos'">osx-x64 $(_toolRuntimeRID) diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index 5c55ad38a7a88..a5dac887902eb 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -395,6 +395,7 @@ if (CLR_CMAKE_HOST_UNIX) # Somewhere between CMake 3.17 and 3.19.4, it became impossible to not pass # a value for mmacosx-version-min (blank CMAKE_OSX_DEPLOYMENT_TARGET gets # replaced with a default value, and always gets expanded to an OS version. + # https://gitlab.kitware.com/cmake/cmake/-/issues/20132 # We need to disable the warning that -tagret replaces -mmacosx-version-min add_compile_options(-Wno-overriding-t-option) add_link_options(-Wno-overriding-t-option) diff --git a/src/libraries/Native/Unix/CMakeLists.txt b/src/libraries/Native/Unix/CMakeLists.txt index 881731c69e8b6..999a3062fbe5a 100644 --- a/src/libraries/Native/Unix/CMakeLists.txt +++ b/src/libraries/Native/Unix/CMakeLists.txt @@ -78,6 +78,7 @@ endif() if(CLR_CMAKE_TARGET_MACCATALYST) # -target overrides -mmacosx-version-min so suppress warning about that + # https://gitlab.kitware.com/cmake/cmake/-/issues/20132 add_compile_options(-Wno-overriding-t-option) add_link_options(-Wno-overriding-t-option) if (CLR_CMAKE_TARGET_ARCH_AMD64) diff --git a/src/libraries/Native/Unix/configure.cmake b/src/libraries/Native/Unix/configure.cmake index b9d51e46c9026..a3f541d332042 100644 --- a/src/libraries/Native/Unix/configure.cmake +++ b/src/libraries/Native/Unix/configure.cmake @@ -507,6 +507,7 @@ if(CLR_CMAKE_TARGET_IOS) unset(HAVE_FORK) # exists but blocked by kernel elseif(CLR_CMAKE_TARGET_MACCATALYST) # Manually set results from check_c_source_runs() since it's not possible to actually run it during CMake configure checking + # TODO: test to see if these all actually hold true on Mac Catalyst unset(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP) unset(HAVE_CLOCK_MONOTONIC) # only exists on iOS 10+ unset(HAVE_CLOCK_REALTIME) # only exists on iOS 10+ diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems index 296cdb222dce8..5441132f3ae34 100644 --- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems +++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems @@ -24,7 +24,7 @@ $(DefineConstants);TARGET_UNIX $(DefineConstants);TARGET_WINDOWS $(DefineConstants);TARGET_OSX - $(DefineConstants);TARGET_CATALYST + $(DefineConstants);TARGET_MACCATALYST $(DefineConstants);TARGET_IOS $(DefineConstants);TARGET_TVOS $(DefineConstants);TARGET_BROWSER diff --git a/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs b/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs index e8bf015e52c07..02995ff47b74a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs +++ b/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs @@ -203,6 +203,7 @@ public static bool IsMacOS() => public static bool IsMacOSVersionAtLeast(int major, int minor = 0, int build = 0) => IsMacOS() && IsOSVersionAtLeast(major, minor, build, 0); +/* Commented out for now, until we're ready to make changes to the public API /// /// Indicates whether the current application is running on Mac Catalyst. /// @@ -218,6 +219,7 @@ public static bool IsMacCatalyst() => /// public static bool IsMacCatalystVersionAtLeast(int major, int minor = 0, int build = 0) => IsMacCatalyst() && IsOSVersionAtLeast(major, minor, build, 0); +*/ /// /// Indicates whether the current application is running on tvOS. diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index 26942dcab3c52..f791e7c53eb66 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -3099,8 +3099,6 @@ public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, S public static bool IsIOSVersionAtLeast(int major, int minor = 0, int build = 0) { throw null; } public static bool IsMacOS() { throw null; } public static bool IsMacOSVersionAtLeast(int major, int minor = 0, int build = 0) { throw null; } - public static bool IsMacCatalyst() { throw null; } - public static bool IsMacCatalystVersionAtLeast(int major, int minor = 0, int build = 0) { throw null; } public static bool IsTvOS() { throw null; } public static bool IsTvOSVersionAtLeast(int major, int minor = 0, int build = 0) { throw null; } public static bool IsWatchOS() { throw null; } diff --git a/src/mono/cmake/configure.cmake b/src/mono/cmake/configure.cmake index f7e6e78c27c01..0d99d503bf5ad 100644 --- a/src/mono/cmake/configure.cmake +++ b/src/mono/cmake/configure.cmake @@ -163,4 +163,8 @@ if(HOST_IOS) set(HAVE_EXECVP 0) set(HAVE_SIGNAL 0) endif() -endif() \ No newline at end of file +endif() + +if(MAC_CATALYST) + set(HAVE_SYSTEM 0) +endif() diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 1ea8a56fc2fc1..44c13dfd46209 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -204,6 +204,8 @@ + <_MonoCMakeArgs Include="-DMAC_CATALYST=1" /> + <_MonoCPPFLAGS Include="-Wno-overriding-t-option" /> <_MonoCFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios14.2-macabi" /> <_MonoCFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios13.5-macabi" /> diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c index c9db16122e587..e384ef6c099b7 100644 --- a/src/mono/mono/mini/aot-compiler.c +++ b/src/mono/mono/mini/aot-compiler.c @@ -10046,7 +10046,7 @@ execute_system (const char * command) g_free (wstr); g_free (quoted_command); -#elif defined (HAVE_SYSTEM) && !defined(MAC_CATALYST) +#elif defined (HAVE_SYSTEM) status = system (command); #else g_assert_not_reached (); diff --git a/src/mono/mono/mini/graph.c b/src/mono/mono/mini/graph.c index 960a7e957527e..39d7bdec76e74 100644 --- a/src/mono/mono/mini/graph.c +++ b/src/mono/mono/mini/graph.c @@ -198,9 +198,7 @@ mono_draw_code_cfg (MonoCompile *cfg, FILE *fp) void mono_draw_graph (MonoCompile *cfg, MonoGraphOptions draw_options) { -#if defined(HAVE_SYSTEM) && !defined(MAC_CATALYST) char *com; -#endif const char *fn; FILE *fp; int _i G_GNUC_UNUSED; @@ -225,7 +223,7 @@ mono_draw_graph (MonoCompile *cfg, MonoGraphOptions draw_options) fclose (fp); -#if defined(HAVE_SYSTEM) && !defined(MAC_CATALYST) +#ifdef HAVE_SYSTEM //com = g_strdup_printf ("dot %s -Tpng -o %s.png; eog %s.png", fn, fn, fn); com = g_strdup_printf ("dot %s -Tps -o %s.ps;gv %s.ps", fn, fn, fn); _i = system (com); diff --git a/src/mono/mono/mini/helpers.c b/src/mono/mono/mini/helpers.c index 9963bfeef3352..0a7b0d9b43373 100644 --- a/src/mono/mono/mini/helpers.c +++ b/src/mono/mono/mini/helpers.c @@ -252,7 +252,7 @@ mono_disassemble_code (MonoCompile *cfg, guint8 *code, int size, char *id) close (i); #endif -#if defined(HAVE_SYSTEM) && !defined(MAC_CATALYST) +#ifdef HAVE_SYSTEM char *cmd = g_strdup_printf (ARCH_PREFIX AS_CMD " %s -o %s", as_file, o_file); unused = system (cmd); g_free (cmd); diff --git a/src/tasks/AppleAppBuilder/Xcode.cs b/src/tasks/AppleAppBuilder/Xcode.cs index 2477c746dda21..3f29fcf3a911a 100644 --- a/src/tasks/AppleAppBuilder/Xcode.cs +++ b/src/tasks/AppleAppBuilder/Xcode.cs @@ -205,7 +205,7 @@ public string BuildAppBundle( args.Append(" -scheme \"" + Path.GetFileNameWithoutExtension(xcodePrjPath) + "\"") .Append(" -destination \"platform=macOS,arch=arm64,variant=Mac Catalyst\"") .Append(" -UseModernBuildSystem=YES") - .Append(" IPHONEOS_DEPLOYMENT_TARGET=13.2"); + .Append(" IPHONEOS_DEPLOYMENT_TARGET=14.2"); break; } } @@ -228,7 +228,7 @@ public string BuildAppBundle( args.Append(" -scheme \"" + Path.GetFileNameWithoutExtension(xcodePrjPath) + "\"") .Append(" -destination \"platform=macOS,arch=x86_64,variant=Mac Catalyst\"") .Append(" -UseModernBuildSystem=YES") - .Append(" IPHONEOS_DEPLOYMENT_TARGET=13.2"); + .Append(" IPHONEOS_DEPLOYMENT_TARGET=13.5"); break; } } From d75869a5073be7fe6c5b524aec7842846903be78 Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Fri, 5 Feb 2021 09:43:45 -0500 Subject: [PATCH 21/28] Fix unused variable when HAVE_SYSTEM is false --- src/mono/mono/mini/graph.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mono/mono/mini/graph.c b/src/mono/mono/mini/graph.c index 39d7bdec76e74..4d6902d34a83a 100644 --- a/src/mono/mono/mini/graph.c +++ b/src/mono/mono/mini/graph.c @@ -198,7 +198,9 @@ mono_draw_code_cfg (MonoCompile *cfg, FILE *fp) void mono_draw_graph (MonoCompile *cfg, MonoGraphOptions draw_options) { +#ifdef HAVE_SYSTEM char *com; +#endif const char *fn; FILE *fp; int _i G_GNUC_UNUSED; From e7cd8cc3c759e466cfb3c8977f880c109fd9d82b Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Fri, 5 Feb 2021 09:44:38 -0500 Subject: [PATCH 22/28] Fix arm64 build starting. Remaining void->int error to fix due to Werror --- src/mono/mono.proj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 44c13dfd46209..aa9c3cc38d7a7 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -217,7 +217,7 @@ <_MonoCXXFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" /> <_MonoLDFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" /> - <_MonoBuildEnv Condition="'$(Platform)' == 'arm64'" Include="arch -arch arm64" /> + <_MonoBuildEnv Condition="'$(BuildArchitecture)' == 'arm64'" Include="arch -arch arm64" /> @@ -249,6 +249,9 @@ <_MonoCMakeVersionMin Condition="'$(TargetsiOS)' == 'true'">$(iOSVersionMin) <_MonoCMakeVersionMin Condition="'$(TargetstvOS)' == 'true'">$(tvOSVersionMin) + + <_MonoCMakeArgs Include="-DCMAKE_OSX_ARCHITECTURES=arm64"/> + <_MonoCMakeArgs Include="-DCMAKE_SYSTEM_NAME=$(_MonoCMakeSystemName)"/> <_MonoCMakeArgs Include="-DCMAKE_OSX_DEPLOYMENT_TARGET=$(_MonoCMakeVersionMin)" /> From 1192773df6a912466615c9bc0fe2ec1cc5b5f625 Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Fri, 5 Feb 2021 10:58:48 -0500 Subject: [PATCH 23/28] More fixes from Alex --- src/tasks/AppleAppBuilder/Templates/runtime.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tasks/AppleAppBuilder/Templates/runtime.m b/src/tasks/AppleAppBuilder/Templates/runtime.m index 37e5744e5c71a..1a27d785f3b13 100644 --- a/src/tasks/AppleAppBuilder/Templates/runtime.m +++ b/src/tasks/AppleAppBuilder/Templates/runtime.m @@ -201,7 +201,7 @@ //%DllMap% } -#if FORCE_INTERPRETER || FORCE_AOT +#if FORCE_INTERPRETER || FORCE_AOT || (!TARGET_OS_SIMULATOR && !TARGET_OS_MACCATALYST) void mono_jit_set_aot_mode (MonoAotMode mode); void register_aot_modules (void); #endif @@ -236,7 +236,7 @@ #if FORCE_INTERPRETER os_log_info (OS_LOG_DEFAULT, "INTERP Enabled"); mono_jit_set_aot_mode (MONO_AOT_MODE_INTERP_ONLY); -#elif FORCE_AOT +#elif (!TARGET_OS_SIMULATOR && !TARGET_OS_MACCATALYST) || FORCE_AOT register_dllmap (); // register modules register_aot_modules (); From 1dc4019be7285eed5e51b726fe87a1a673e6b66d Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Fri, 5 Feb 2021 14:29:42 -0500 Subject: [PATCH 24/28] Disable more tests, pending API changes --- .../tests/System/OperatingSystemTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Runtime.Extensions/tests/System/OperatingSystemTests.cs b/src/libraries/System.Runtime.Extensions/tests/System/OperatingSystemTests.cs index d99a21d274780..c0e05a97e37d0 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/OperatingSystemTests.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/OperatingSystemTests.cs @@ -164,7 +164,7 @@ private static void TestIsOSPlatform(string currentOSName, Func currentOSC OperatingSystem.IsAndroid(), OperatingSystem.IsIOS(), OperatingSystem.IsMacOS(), - OperatingSystem.IsMacCatalyst(), + //OperatingSystem.IsMacCatalyst(), OperatingSystem.IsTvOS(), OperatingSystem.IsWatchOS(), OperatingSystem.IsWindows() @@ -187,7 +187,7 @@ private static void TestIsOSVersionAtLeast(string currentOSName) AssertVersionChecks(currentOSName.Equals("Android", StringComparison.OrdinalIgnoreCase), OperatingSystem.IsAndroidVersionAtLeast); AssertVersionChecks(currentOSName.Equals("iOS", StringComparison.OrdinalIgnoreCase), OperatingSystem.IsIOSVersionAtLeast); AssertVersionChecks(currentOSName.Equals("macOS", StringComparison.OrdinalIgnoreCase), OperatingSystem.IsMacOSVersionAtLeast); - AssertVersionChecks(currentOSName.Equals("MacCatalyst", StringComparison.OrdinalIgnoreCase), OperatingSystem.IsMacCatalystVersionAtLeast); + //AssertVersionChecks(currentOSName.Equals("MacCatalyst", StringComparison.OrdinalIgnoreCase), OperatingSystem.IsMacCatalystVersionAtLeast); AssertVersionChecks(currentOSName.Equals("tvOS", StringComparison.OrdinalIgnoreCase), OperatingSystem.IsTvOSVersionAtLeast); AssertVersionChecks(currentOSName.Equals("watchOS", StringComparison.OrdinalIgnoreCase), OperatingSystem.IsWatchOSVersionAtLeast); AssertVersionChecks(currentOSName.Equals("Windows", StringComparison.OrdinalIgnoreCase), OperatingSystem.IsWindowsVersionAtLeast); From 740dddbfab9b27b9c5d5dfada2845b97609ac7bb Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Fri, 5 Feb 2021 14:32:06 -0500 Subject: [PATCH 25/28] Remove retired C define --- src/mono/mono.proj | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index aa9c3cc38d7a7..7daa08c2b7557 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -209,11 +209,9 @@ <_MonoCPPFLAGS Include="-Wno-overriding-t-option" /> <_MonoCFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios14.2-macabi" /> <_MonoCFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios13.5-macabi" /> - <_MonoCFlags Include="-DMAC_CATALYST" /> <_MonoCFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" /> <_MonoCXXFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios14.2-macabi" /> <_MonoCXXFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios13.5-macabi" /> - <_MonoCXXFlags Include="-DMAC_CATALYST" /> <_MonoCXXFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" /> <_MonoLDFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" /> From 619e4d51db86828fd203619ce135c8de0e2786cc Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Fri, 5 Feb 2021 15:40:05 -0500 Subject: [PATCH 26/28] More changes from Alex --- src/mono/CMakeLists.txt | 3 +++ src/mono/cmake/configure.cmake | 4 +--- src/mono/mono.proj | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index 2f27bcdb3a0b8..6ca1e18686fa0 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -186,6 +186,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") set(HOST_OSX 1) set(PTHREAD_POINTER_ID 1) set(USE_MACH_SEMA 1) + if(CMAKE_SYSTEM_VARIANT STREQUAL "MacCatalyst") + set(HOST_MACCATALYST 1) + endif() elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "tvOS") # See man cmake-toolchains(7) on which variables # control cross-compiling to ios diff --git a/src/mono/cmake/configure.cmake b/src/mono/cmake/configure.cmake index 0d99d503bf5ad..bbdfe7be4a7de 100644 --- a/src/mono/cmake/configure.cmake +++ b/src/mono/cmake/configure.cmake @@ -163,8 +163,6 @@ if(HOST_IOS) set(HAVE_EXECVP 0) set(HAVE_SIGNAL 0) endif() -endif() - -if(MAC_CATALYST) +elseif(HOST_MACCATALYST) set(HAVE_SYSTEM 0) endif() diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 7daa08c2b7557..6ef917b034b18 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -204,7 +204,7 @@ - <_MonoCMakeArgs Include="-DMAC_CATALYST=1" /> + <_MonoCMakeArgs Include="-DCMAKE_SYSTEM_VARIANT=MacCatalyst" /> <_MonoCPPFLAGS Include="-Wno-overriding-t-option" /> <_MonoCFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios14.2-macabi" /> From 6ac6335e1b264cfaa1c4e54d70cbde148969fe32 Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Mon, 8 Feb 2021 09:30:23 -0500 Subject: [PATCH 27/28] Fixes from Zoltan and Steve for arm64 --- src/mono/mono.proj | 4 ++-- src/mono/mono/utils/mono-sigcontext.h | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 33a602156918c..40537a2f5d539 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -200,7 +200,7 @@ <_MonoCXXFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" /> <_MonoLDFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" /> - <_MonoBuildEnv Condition="'$(Platform)' == 'arm64'" Include="arch -arch arm64" /> + <_MonoBuildEnv Condition="'$(BuildArchitecture)' == 'arm64'" Include="arch -arch arm64" /> @@ -247,7 +247,7 @@ <_MonoCMakeVersionMin Condition="'$(TargetsiOS)' == 'true'">$(iOSVersionMin) <_MonoCMakeVersionMin Condition="'$(TargetstvOS)' == 'true'">$(tvOSVersionMin) - + <_MonoCMakeArgs Include="-DCMAKE_OSX_ARCHITECTURES=arm64"/> diff --git a/src/mono/mono/utils/mono-sigcontext.h b/src/mono/mono/utils/mono-sigcontext.h index 699af6e37d1fb..e8e2161733ee4 100644 --- a/src/mono/mono/utils/mono-sigcontext.h +++ b/src/mono/mono/utils/mono-sigcontext.h @@ -474,6 +474,9 @@ typedef struct ucontext { #else #define UCONTEXT_REG_PC(ctx) (((ucontext64_t*)(ctx))->uc_mcontext64->__ss.__pc) #define UCONTEXT_REG_SP(ctx) (((ucontext64_t*)(ctx))->uc_mcontext64->__ss.__sp) + #define UCONTEXT_REG_SET_PC(ctx,val) do { \ + UCONTEXT_REG_PC (ctx) = (__uint64_t)(val); \ + } while (0) #endif #define UCONTEXT_REG_R0(ctx) (((ucontext64_t*)(ctx))->uc_mcontext64->__ss.__x [ARMREG_R0]) @@ -497,6 +500,8 @@ typedef struct ucontext { #define UCONTEXT_REG_SET_PC(ctx, val) do { \ UCONTEXT_REG_PC (ctx) = (val); \ } while (0) +#endif +#ifndef UCONTEXT_REG_SET_SP #define UCONTEXT_REG_SET_SP(ctx, val) do { \ UCONTEXT_REG_SP (ctx) = (val); \ } while (0) From 1ee37bca3ea35a75c253e13cb068c3a62804a066 Mon Sep 17 00:00:00 2001 From: Joseph Shields Date: Mon, 8 Feb 2021 09:33:15 -0500 Subject: [PATCH 28/28] Build Catalyst for arm64 too --- eng/pipelines/runtime-official.yml | 1 + eng/pipelines/runtime.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml index 7e240dbee3294..258218bf331ec 100644 --- a/eng/pipelines/runtime-official.yml +++ b/eng/pipelines/runtime-official.yml @@ -99,6 +99,7 @@ stages: - Android_arm - Android_arm64 - MacCatalyst_x64 + - MacCatalyst_arm64 - tvOS_x64 - tvOS_arm64 - iOS_x64 diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 84557058220e7..a4f3dcd0d286e 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -213,6 +213,7 @@ jobs: platforms: - Android_x86 - MacCatalyst_x64 + - MacCatalyst_arm64 - tvOS_x64 - iOS_arm64 - iOS_x86