Skip to content

Commit 82b3c6a

Browse files
akoeplingermatouskozak
authored andcommitted
Bump minimum Apple OS versions (dotnet#101342)
As defined in the ".NET 9 - Supported OS versions" document: https://github.com/dotnet/core/blob/main/release-notes/9.0/supported-os.md - macOS 12.0 - iOS/iOSSimulator 12.2 - tvOS/tvOSSimulator 12.2 - MacCatalyst 15.0 (== macOS 12.0) Fixes dotnet#91736
1 parent b115264 commit 82b3c6a

File tree

22 files changed

+87
-66
lines changed

22 files changed

+87
-66
lines changed

Directory.Build.props

+9-5
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,22 @@
5656
- eng/native/configurecompiler.cmake
5757
- eng/native/build-commons.sh
5858
- src/native/libs/build-native.sh
59-
- src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ObjectWriter.cs
59+
- src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/MachObjectWriter.cs
6060
- src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
61+
- src/mono/mono/tools/offsets-tool/offsets-tool.py
62+
- src/mono/msbuild/apple/build/AppleBuild.targets
6163
- src/installer/pkg/sfx/bundle/shared-framework-distribution-template-x64.xml
6264
- src/installer/pkg/sfx/bundle/shared-framework-distribution-template-arm64.xml
65+
- src/tasks/AotCompilerTask/MonoAOTCompiler.props
66+
- src/tasks/AppleAppBuilder/Xcode.cs
6367
- src/tasks/MobileBuildTasks/Apple/AppleProject.cs
6468
- dotnet/installer repo > src/redist/targets/GeneratePKG.targets
6569
-->
6670
<AndroidApiLevelMin>21</AndroidApiLevelMin>
67-
<iOSVersionMin>11.0</iOSVersionMin>
68-
<tvOSVersionMin>11.0</tvOSVersionMin>
69-
<macOSVersionMin>10.15</macOSVersionMin>
70-
<macOSVersionMin Condition="('$(TargetOS)' == 'osx' or '$(TargetOS)' == 'maccatalyst') and '$(TargetArchitecture)' == 'arm64'">11.0</macOSVersionMin>
71+
<iOSVersionMin>12.2</iOSVersionMin>
72+
<tvOSVersionMin>12.2</tvOSVersionMin>
73+
<macOSVersionMin>12.0</macOSVersionMin>
74+
<MacCatalystVersionMin>15.0</MacCatalystVersionMin>
7175
</PropertyGroup>
7276

7377
<PropertyGroup>

eng/native/build-commons.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ build_native()
109109

110110
# set default iOS simulator deployment target
111111
# keep in sync with SetOSTargetMinVersions in the root Directory.Build.props
112-
cmakeArgs="-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 $cmakeArgs"
112+
cmakeArgs="-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_DEPLOYMENT_TARGET=12.2 $cmakeArgs"
113113
if [[ "$__TargetArch" == x64 ]]; then
114114
cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"x86_64\" $cmakeArgs"
115115
elif [[ "$__TargetArch" == arm64 ]]; then
@@ -123,7 +123,7 @@ build_native()
123123

124124
# set default iOS device deployment target
125125
# keep in sync with SetOSTargetMinVersions in the root Directory.Build.props
126-
cmakeArgs="-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 $cmakeArgs"
126+
cmakeArgs="-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_DEPLOYMENT_TARGET=12.2 $cmakeArgs"
127127
if [[ "$__TargetArch" == arm64 ]]; then
128128
cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"arm64\" $cmakeArgs"
129129
else
@@ -135,7 +135,7 @@ build_native()
135135

136136
# set default tvOS simulator deployment target
137137
# keep in sync with SetOSTargetMinVersions in the root Directory.Build.props
138-
cmakeArgs="-DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvsimulator -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 $cmakeArgs"
138+
cmakeArgs="-DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvsimulator -DCMAKE_OSX_DEPLOYMENT_TARGET=12.2 $cmakeArgs"
139139
if [[ "$__TargetArch" == x64 ]]; then
140140
cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"x86_64\" $cmakeArgs"
141141
elif [[ "$__TargetArch" == arm64 ]]; then
@@ -149,7 +149,7 @@ build_native()
149149

150150
# set default tvOS device deployment target
151151
# keep in sync with SetOSTargetMinVersions in the root Directory.Build.props
152-
cmakeArgs="-DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 $cmakeArgs"
152+
cmakeArgs="-DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_DEPLOYMENT_TARGET=12.2 $cmakeArgs"
153153
if [[ "$__TargetArch" == arm64 ]]; then
154154
cmakeArgs="-DCMAKE_OSX_ARCHITECTURES=\"arm64\" $cmakeArgs"
155155
else

eng/native/configurecompiler.cmake

+13-7
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
1414

1515
include(CheckCCompilerFlag)
1616
include(CheckCXXCompilerFlag)
17+
include(CheckLinkerFlag)
1718

1819
# "configureoptimization.cmake" must be included after CLR_CMAKE_HOST_UNIX has been set.
1920
include(${CMAKE_CURRENT_LIST_DIR}/configureoptimization.cmake)
@@ -300,7 +301,13 @@ elseif(CLR_CMAKE_HOST_SUNOS)
300301
add_definitions(-D__EXTENSIONS__ -D_XPG4_2 -D_POSIX_PTHREAD_SEMANTICS)
301302
elseif(CLR_CMAKE_HOST_OSX AND NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS)
302303
add_definitions(-D_XOPEN_SOURCE)
303-
add_linker_flag("-Wl,-bind_at_load")
304+
305+
# the new linker in Xcode 15 (ld_new/ld_prime) deprecated the -bind_at_load flag for macOS which causes a warning
306+
# that fails the build since we build with -Werror. Only pass the flag if we need it, i.e. older linkers.
307+
check_linker_flag(C "-Wl,-bind_at_load,-fatal_warnings" LINKER_SUPPORTS_BIND_AT_LOAD_FLAG)
308+
if(LINKER_SUPPORTS_BIND_AT_LOAD_FLAG)
309+
add_linker_flag("-Wl,-bind_at_load")
310+
endif()
304311
elseif(CLR_CMAKE_HOST_HAIKU)
305312
add_compile_options($<$<COMPILE_LANGUAGE:ASM>:-Wa,--noexecstack>)
306313
add_linker_flag("-Wl,--no-undefined")
@@ -662,11 +669,11 @@ if (CLR_CMAKE_HOST_UNIX)
662669
set(DISABLE_OVERRIDING_MIN_VERSION_ERROR -Wno-overriding-t-option)
663670
add_link_options(-Wno-overriding-t-option)
664671
if(CLR_CMAKE_HOST_ARCH_ARM64)
665-
set(MACOS_VERSION_MIN_FLAGS "-target arm64-apple-ios14.2-macabi")
666-
add_link_options(-target arm64-apple-ios14.2-macabi)
672+
set(MACOS_VERSION_MIN_FLAGS "-target arm64-apple-ios15.0-macabi")
673+
add_link_options(-target arm64-apple-ios15.0-macabi)
667674
elseif(CLR_CMAKE_HOST_ARCH_AMD64)
668-
set(MACOS_VERSION_MIN_FLAGS "-target x86_64-apple-ios13.5-macabi")
669-
add_link_options(-target x86_64-apple-ios13.5-macabi)
675+
set(MACOS_VERSION_MIN_FLAGS "-target x86_64-apple-ios15.0-macabi")
676+
add_link_options(-target x86_64-apple-ios15.0-macabi)
670677
else()
671678
clr_unknown_arch()
672679
endif()
@@ -679,11 +686,10 @@ if (CLR_CMAKE_HOST_UNIX)
679686
set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS} ${MACOS_VERSION_MIN_FLAGS} ${DISABLE_OVERRIDING_MIN_VERSION_ERROR}")
680687
set(CMAKE_OBJCXX_FLAGS "${CMAKE_OBJCXX_FLAGS} ${MACOS_VERSION_MIN_FLAGS} ${DISABLE_OVERRIDING_MIN_VERSION_ERROR}")
681688
elseif(CLR_CMAKE_HOST_OSX)
689+
set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0")
682690
if(CLR_CMAKE_HOST_ARCH_ARM64)
683-
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0")
684691
add_compile_options(-arch arm64)
685692
elseif(CLR_CMAKE_HOST_ARCH_AMD64)
686-
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15")
687693
add_compile_options(-arch x86_64)
688694
else()
689695
clr_unknown_arch()

src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets

+3-4
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,8 @@ The .NET Foundation licenses this file to you under the MIT license.
7474
</PropertyGroup>
7575

7676
<PropertyGroup Condition="'$(_IsiOSLikePlatform)' == 'true'">
77-
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and '$(_targetOS)' == 'maccatalyst' and '$(_targetArchitecture)' == 'x64'">13.5</AppleMinOSVersion>
78-
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and '$(_targetOS)' == 'maccatalyst'">14.2</AppleMinOSVersion>
79-
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and ($(_targetOS.StartsWith('ios')) or $(_targetOS.StartsWith('tvos')))">11.0</AppleMinOSVersion>
77+
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and '$(_targetOS)' == 'maccatalyst'">15.0</AppleMinOSVersion>
78+
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and ($(_targetOS.StartsWith('ios')) or $(_targetOS.StartsWith('tvos')))">12.2</AppleMinOSVersion>
8079

8180
<_AppleSdkName Condition="'$(_targetOS)' == 'ios'">iphoneos</_AppleSdkName>
8281
<_AppleSdkName Condition="'$(_targetOS)' == 'iossimulator'">iphonesimulator</_AppleSdkName>
@@ -96,7 +95,7 @@ The .NET Foundation licenses this file to you under the MIT license.
9695
</PropertyGroup>
9796

9897
<PropertyGroup Condition="'$(_targetOS)' == 'osx'">
99-
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == ''">11.0</AppleMinOSVersion>
98+
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == ''">12.0</AppleMinOSVersion>
10099
<TargetTriple Condition="'$(_targetArchitecture)' == 'x64'">x86_64-apple-macos$(AppleMinOSVersion)</TargetTriple>
101100
<TargetTriple Condition="'$(_targetArchitecture)' == 'arm64'">arm64-apple-macos$(AppleMinOSVersion)</TargetTriple>
102101
</PropertyGroup>

src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/MachObjectWriter.cs

+3-7
Original file line numberDiff line numberDiff line change
@@ -244,16 +244,12 @@ private protected override void EmitObjectFile(string objectFilePath)
244244
{
245245
case TargetOS.OSX:
246246
buildVersion.Platform = PLATFORM_MACOS;
247-
buildVersion.MinimumPlatformVersion = 0x0A_0C_00; // 10.12.0
247+
buildVersion.MinimumPlatformVersion = 0x0C_00_00; // 12.0.0
248248
break;
249249

250250
case TargetOS.MacCatalyst:
251251
buildVersion.Platform = PLATFORM_MACCATALYST;
252-
buildVersion.MinimumPlatformVersion = _cpuType switch
253-
{
254-
CPU_TYPE_X86_64 => 0x0D_05_00u, // 13.5.0
255-
_ => 0x0E_02_00u, // 14.2.0
256-
};
252+
buildVersion.MinimumPlatformVersion = 0x0F_02_00; // 15.0.0
257253
break;
258254

259255
case TargetOS.iOS:
@@ -268,7 +264,7 @@ private protected override void EmitObjectFile(string objectFilePath)
268264
TargetOS.tvOSSimulator => PLATFORM_TVOSSIMULATOR,
269265
_ => 0,
270266
};
271-
buildVersion.MinimumPlatformVersion = 0x0B_00_00; // 11.0.0
267+
buildVersion.MinimumPlatformVersion = 0x0C_02_00; // 12.2.0
272268
break;
273269
}
274270
buildVersion.Write(outputFileStream);

src/installer/pkg/sfx/bundle/shared-framework-distribution-template-arm64.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<volume-check>
88
<allowed-os-versions>
99
<!-- keep in sync with SetOSTargetMinVersions in the root Directory.Build.props -->
10-
<os-version min="11.0" />
10+
<os-version min="12.0" />
1111
</allowed-os-versions>
1212
</volume-check>
1313
</installer-gui-script>

src/installer/pkg/sfx/bundle/shared-framework-distribution-template-x64.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<volume-check>
88
<allowed-os-versions>
99
<!-- keep in sync with SetOSTargetMinVersions in the root Directory.Build.props -->
10-
<os-version min="10.15" />
10+
<os-version min="12.0" />
1111
</allowed-os-versions>
1212
</volume-check>
1313
</installer-gui-script>

src/libraries/System.Runtime.InteropServices/tests/TestAssets/NativeExports/NativeExports.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@
9191

9292
<Target Name="GetAppleBuildArgumentsForDNNE" Condition="'$(_TargetsAppleOS)' == 'true'">
9393
<PropertyGroup Condition=" '$(TargetOS)' == 'maccatalyst'">
94-
<TargetTriple Condition="'$(TargetArchitecture)' == 'arm64'">arm64-apple-ios14.2-macabi</TargetTriple>
95-
<TargetTriple Condition="'$(TargetArchitecture)' == 'x64'">x86_64-apple-ios13.5-macabi</TargetTriple>
94+
<TargetTriple Condition="'$(TargetArchitecture)' == 'arm64'">arm64-apple-ios$(MacCatalystVersionMin)-macabi</TargetTriple>
95+
<TargetTriple Condition="'$(TargetArchitecture)' == 'x64'">x86_64-apple-ios$(MacCatalystVersionMin)-macabi</TargetTriple>
9696
</PropertyGroup>
9797
<PropertyGroup Condition="'$(TargetOS)' == 'osx'">
98-
<TargetTriple Condition="'$(TargetArchitecture)' == 'arm64'">arm64-apple-macos11</TargetTriple>
99-
<TargetTriple Condition="'$(TargetArchitecture)' == 'x64'">x86_64-apple-macos10.15</TargetTriple>
98+
<TargetTriple Condition="'$(TargetArchitecture)' == 'arm64'">arm64-apple-macos$(macOSVersionMin)</TargetTriple>
99+
<TargetTriple Condition="'$(TargetArchitecture)' == 'x64'">x86_64-apple-macos$(macOSVersionMin)</TargetTriple>
100100
<XCodeSdkName>macosx</XCodeSdkName>
101101
</PropertyGroup>
102102

src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/AesGcm.macOS.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public sealed partial class AesGcm
1111
{
1212
private FixedMemoryKeyBox _keyBox;
1313

14-
// CryptoKit added AES.GCM in macOS 10.15, which is our minimum target for macOS.
14+
// CryptoKit added AES.GCM in macOS 10.15, which is lower than our minimum target for macOS.
1515
public static bool IsSupported => true;
1616

1717
// CryptoKit only supports 16 byte tags.

src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ChaCha20Poly1305.macOS.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace System.Security.Cryptography
88
{
99
public sealed partial class ChaCha20Poly1305
1010
{
11-
// CryptoKit added ChaCha20Poly1305 in macOS 10.15, which is our minimum target for macOS.
11+
// CryptoKit added ChaCha20Poly1305 in macOS 10.15, which is lower than our minimum target for macOS.
1212
public static bool IsSupported => true;
1313
private FixedMemoryKeyBox _keyBox;
1414

src/libraries/System.Security.Cryptography/tests/ChaCha20Poly1305Tests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ public static void CheckIsSupported()
475475
}
476476
else if (PlatformDetection.IsOSX)
477477
{
478-
// CryptoKit is supported on macOS 10.15+, which is our minimum target.
478+
// CryptoKit is supported on macOS 10.15+, which is lower than our minimum target.
479479
expectedIsSupported = true;
480480
}
481481
else if (PlatformDetection.OpenSslPresentOnSystem && PlatformDetection.IsOpenSslSupported)

src/mono/mono.proj

+4-4
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,11 @@
401401
<_MonoCMakeArgs Include="-DCMAKE_SYSTEM_VARIANT=maccatalyst" />
402402
<!-- https://gitlab.kitware.com/cmake/cmake/-/issues/20132 -->
403403
<_MonoCPPFLAGS Include="-Wno-overriding-t-option" />
404-
<_MonoCFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios14.2-macabi" />
405-
<_MonoCFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios13.5-macabi" />
404+
<_MonoCFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios$(MacCatalystVersionMin)-macabi" />
405+
<_MonoCFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios$(MacCatalystVersionMin)-macabi" />
406406
<_MonoCFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" />
407-
<_MonoCXXFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios14.2-macabi" />
408-
<_MonoCXXFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios13.5-macabi" />
407+
<_MonoCXXFlags Condition="'$(TargetArchitecture)' == 'arm64'" Include="-target arm64-apple-ios$(MacCatalystVersionMin)-macabi" />
408+
<_MonoCXXFlags Condition="'$(TargetArchitecture)' == 'x64'" Include="-target x86_64-apple-ios$(MacCatalystVersionMin)-macabi" />
409409
<_MonoCXXFLAGS Condition="'$(TargetArchitecture)' == 'arm64'" Include="-arch arm64" />
410410
<!-- Force running as arm64 even when invoked from an x64 msbuild process -->
411411
<_MonoBuildEnv Condition="'$(BuildArchitecture)' == 'arm64'" Include="arch -arch arm64" />

src/mono/mono/tools/offsets-tool/offsets-tool.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,13 @@ def require_emscipten_path (args):
159159
elif "x86_64-apple-maccatalyst" == args.abi:
160160
require_sysroot (args)
161161
self.target = Target ("TARGET_AMD64", "TARGET_MACCAT", IOS_DEFINES)
162-
self.target_args += ["-target", "x86_64-apple-ios13.5-macabi"]
162+
self.target_args += ["-target", "x86_64-apple-ios15.0-macabi"]
163163
self.target_args += ["-isysroot", args.sysroot]
164164

165165
elif "aarch64-apple-maccatalyst" == args.abi:
166166
require_sysroot (args)
167167
self.target = Target ("TARGET_ARM64", "TARGET_MACCAT", IOS_DEFINES)
168-
self.target_args += ["-target", "arm64-apple-ios14.2-macabi"]
168+
self.target_args += ["-target", "arm64-apple-ios15.0-macabi"]
169169
self.target_args += ["-isysroot", args.sysroot]
170170

171171
# watchOS

src/mono/msbuild/apple/build/AppleBuild.targets

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@
159159

160160
<ItemGroup>
161161
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'arm64' and '$(TargetOS)' != 'maccatalyst'" Include="mtriple=arm64-ios" />
162-
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'arm64' and '$(TargetOS)' == 'maccatalyst'" Include="mtriple=arm64-apple-ios14.2-macabi" />
162+
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'arm64' and '$(TargetOS)' == 'maccatalyst'" Include="mtriple=arm64-apple-ios15.0-macabi" />
163163
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'x64' and '$(TargetOS)' != 'maccatalyst'" Include="mtriple=x86_64-ios" />
164-
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'x64' and '$(TargetOS)' == 'maccatalyst'" Include="mtriple=x86_64-apple-ios13.5-macabi" />
164+
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'x64' and '$(TargetOS)' == 'maccatalyst'" Include="mtriple=x86_64-apple-ios15.0-macabi" />
165165
<MonoAOTCompilerDefaultAotArguments Include="static" />
166166
<MonoAOTCompilerDefaultAotArguments Include="dwarfdebug" />
167167
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'arm64'" Include="mattr=+crc" /> <!-- enable System.Runtime.Intrinsics.Arm (Crc32 and ArmBase for now) -->

src/native/libs/System.Security.Cryptography.Native.Apple/pal_signverify.c

+9
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ static int32_t ExecuteSignTransform(SecTransformRef signer, CFDataRef* pSignatur
1616
assert(pErrorOut != NULL);
1717

1818
int32_t ret = INT_MIN;
19+
#pragma clang diagnostic push
20+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
1921
CFTypeRef signerResponse = SecTransformExecute(signer, pErrorOut);
22+
#pragma clang diagnostic pop
2023
CFDataRef signature = NULL;
2124

2225
if (signerResponse == NULL || *pErrorOut != NULL)
@@ -62,7 +65,10 @@ static int32_t ExecuteVerifyTransform(SecTransformRef verifier, CFErrorRef* pErr
6265
assert(pErrorOut != NULL);
6366

6467
int32_t ret = kErrorSeeError;
68+
#pragma clang diagnostic push
69+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
6570
CFTypeRef verifierResponse = SecTransformExecute(verifier, pErrorOut);
71+
#pragma clang diagnostic pop
6672

6773
if (verifierResponse != NULL)
6874
{
@@ -79,6 +85,8 @@ static int32_t ExecuteVerifyTransform(SecTransformRef verifier, CFErrorRef* pErr
7985

8086
static int32_t ConfigureSignVerifyTransform(SecTransformRef xform, CFDataRef cfDataHash, CFErrorRef* pErrorOut)
8187
{
88+
#pragma clang diagnostic push
89+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
8290
if (!SecTransformSetAttribute(xform, kSecInputIsAttributeName, kSecInputIsDigest, pErrorOut))
8391
{
8492
return 0;
@@ -88,6 +96,7 @@ static int32_t ConfigureSignVerifyTransform(SecTransformRef xform, CFDataRef cfD
8896
{
8997
return 0;
9098
}
99+
#pragma clang diagnostic pop
91100

92101
return 1;
93102
}

src/native/libs/System.Security.Cryptography.Native.Apple/pal_ssl.c

+4
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,11 @@ int32_t AppleCryptoNative_SslIsHostnameMatch(SSLContextRef sslContext, CFStringR
463463

464464
for (CFIndex i = 0; i < certificateCount; i++)
465465
{
466+
#pragma clang diagnostic push
467+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
466468
SecCertificateRef item = SecTrustGetCertificateAtIndex(existingTrust, i);
469+
#pragma clang diagnostic pop
470+
467471
CFArrayAppendValue(certs, item);
468472

469473
// Copy the EE cert into the anchors set, this will make the chain part

src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509.c

+1-10
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,7 @@ AppleCryptoNative_X509GetPublicKey(SecCertificateRef cert, SecKeyRef* pPublicKey
4343
if (cert == NULL || pPublicKeyOut == NULL)
4444
return kErrorUnknownState;
4545

46-
if (__builtin_available(macOS 10.14, iOS 12, tvOS 12, *))
47-
{
48-
*pPublicKeyOut = SecCertificateCopyKey(cert);
49-
}
50-
#if defined(TARGET_IOS) || defined(TARGET_TVOS)
51-
else
52-
{
53-
*pPublicKeyOut = SecCertificateCopyPublicKey(cert);
54-
}
55-
#endif
46+
*pPublicKeyOut = SecCertificateCopyKey(cert);
5647

5748
return 1;
5849
}

src/native/libs/System.Security.Cryptography.Native.Apple/pal_x509chain.c

+3
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ SecCertificateRef AppleCryptoNative_X509ChainGetCertificateAtIndex(SecTrustRef c
9292
if (chain == NULL || index < 0)
9393
return NULL;
9494

95+
#pragma clang diagnostic push
96+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
9597
return SecTrustGetCertificateAtIndex(chain, index);
98+
#pragma clang diagnostic pop
9699
}
97100

98101
CFArrayRef AppleCryptoNative_X509ChainGetTrustResults(SecTrustRef chain)

0 commit comments

Comments
 (0)