Add support for building arm64ec binaries (#2146)

* Add support for building arm64ec binaries

Arm64ec is an emulation compatible arm64 calling convention. It allows x64 and arm64 code to mix in the same exectable. This is great for a program that uses plugins, as it can use exisiting x64 plugins but run most of its code as arm code.

Only supports schannel, as openssl would require changes to their assembly files, which they do not have any interest in doing.

* Formatting nit

* Use windows 2022
This commit is contained in:
Thad House 2021-11-16 09:25:06 -08:00 коммит произвёл GitHub
Родитель a1efa4adab
Коммит ba151c2149
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 22 добавлений и 2 удалений

Просмотреть файл

@ -195,6 +195,13 @@ stages:
arch: arm64
tls: schannel
extraBuildArgs: -EnableTelemetryAsserts
- template: ./templates/build-config-user.yml
parameters:
image: windows-2022
platform: windows
arch: arm64ec
tls: schannel
extraBuildArgs: -EnableTelemetryAsserts
- template: ./templates/build-config-user.yml
parameters:
image: windows-2019

Просмотреть файл

@ -104,7 +104,7 @@ param (
[string]$Config = "Debug",
[Parameter(Mandatory = $false)]
[ValidateSet("x86", "x64", "arm", "arm64")]
[ValidateSet("x86", "x64", "arm", "arm64", "arm64ec")]
[string]$Arch = "",
[Parameter(Mandatory = $false)]
@ -239,6 +239,15 @@ if ($Arch -ne "x64" -And ($Platform -eq "gamecore_console")) {
exit
}
if ($Arch -eq "arm64ec") {
if (!$IsWindows) {
Write-Error "Arm64EC is only supported on Windows"
}
if ($Tls -eq "openssl") {
Write-Error "Arm64EC does not support openssl"
}
}
if ($Platform -eq "ios" -and !$Static) {
$Static = $true
Write-Host "iOS can only be built as static"
@ -306,6 +315,7 @@ function CMake-Generate {
"x64" { $Arguments += "x64" }
"arm" { $Arguments += "arm" }
"arm64" { $Arguments += "arm64" }
"arm64ec" { $Arguments += "arm64ec" }
}
} else {
Write-Host "Non VS based generators must be run from a Visual Studio Developer Powershell Prompt matching the passed in architecture"

Просмотреть файл

@ -26,7 +26,7 @@ param (
[string]$Config = "Debug",
[Parameter(Mandatory = $false)]
[ValidateSet("x86", "x64", "arm", "arm64", "universal", "")]
[ValidateSet("x86", "x64", "arm", "arm64", "arm64ec", "universal", "")]
[string]$Arch = "",
[Parameter(Mandatory = $false)]

Просмотреть файл

@ -43,6 +43,9 @@ endif()
if(WIN32)
target_link_libraries(base_link INTERFACE ws2_32 schannel ntdll bcrypt ncrypt crypt32 iphlpapi advapi32)
if (_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "ARM64EC")
target_link_libraries(base_link INTERFACE softintrin)
endif()
endif()
add_library(warnings INTERFACE)