@@ -392,16 +392,17 @@ cmd.exe /C cd /d "$location" "&" "$vcvarsallbatPath" "$Arch" "&" "$cmakePath" "$
392392
393393function Start-BuildNativeUnixBinaries {
394394 param (
395- [switch ] $BuildLinuxArm
395+ [switch ] $BuildLinuxArm ,
396+ [switch ] $BuildLinuxArm64
396397 )
397398
398399 if (-not $Environment.IsLinux -and -not $Environment.IsMacOS ) {
399400 Write-Warning - Message " 'Start-BuildNativeUnixBinaries' is only supported on Linux/macOS platforms"
400401 return
401402 }
402403
403- if ($BuildLinuxArm -and -not $Environment.IsUbuntu ) {
404- throw " Cross compiling for linux-arm is only supported on Ubuntu environment"
404+ if (( $BuildLinuxArm -or $BuildLinuxArm64 ) -and -not $Environment.IsUbuntu ) {
405+ throw " Cross compiling for linux-arm/linux-arm64 are only supported on Ubuntu environment"
405406 }
406407
407408 # Verify we have all tools in place to do the build
@@ -414,6 +415,10 @@ function Start-BuildNativeUnixBinaries {
414415 foreach ($Dependency in ' arm-linux-gnueabihf-gcc' , ' arm-linux-gnueabihf-g++' ) {
415416 $precheck = $precheck -and (precheck $Dependency " Build dependency '$Dependency ' not found. Run 'Start-PSBootstrap'." )
416417 }
418+ } elseif ($BuildLinuxArm64 ) {
419+ foreach ($Dependency in ' aarch64-linux-gnu-gcc' , ' aarch64-linux-gnu-g++' ) {
420+ $precheck = $precheck -and (precheck $Dependency " Build dependency '$Dependency ' not found. Run 'Start-PSBootstrap'." )
421+ }
417422 }
418423
419424 # Abort if any precheck failed
@@ -440,6 +445,10 @@ function Start-BuildNativeUnixBinaries {
440445 Start-NativeExecution { cmake - DCMAKE_TOOLCHAIN_FILE= " ./arm.toolchain.cmake" . }
441446 Start-NativeExecution { make - j }
442447 }
448+ elseif ($BuildLinuxArm64 ) {
449+ Start-NativeExecution { cmake - DCMAKE_TOOLCHAIN_FILE= " ./arm64.toolchain.cmake" . }
450+ Start-NativeExecution { make - j }
451+ }
443452 else {
444453 Start-NativeExecution { cmake - DCMAKE_BUILD_TYPE= Debug . }
445454 Start-NativeExecution { make - j }
@@ -492,6 +501,10 @@ function Start-BuildPowerShellNativePackage
492501 [ValidateScript ({Test-Path $_ - PathType Leaf})]
493502 [string ] $LinuxARMZipPath ,
494503
504+ [Parameter (Mandatory = $true )]
505+ [ValidateScript ({Test-Path $_ - PathType Leaf})]
506+ [string ] $LinuxARM64ZipPath ,
507+
495508 [Parameter (Mandatory = $true )]
496509 [ValidateScript ({Test-Path $_ - PathType Leaf})]
497510 [string ] $LinuxAlpineZipPath ,
@@ -525,6 +538,7 @@ function Start-BuildPowerShellNativePackage
525538 $BinFolderARM64 = Join-Path $tempExtractionPath " ARM64"
526539 $BinFolderLinux = Join-Path $tempExtractionPath " Linux"
527540 $BinFolderLinuxARM = Join-Path $tempExtractionPath " LinuxARM"
541+ $BinFolderLinuxARM64 = Join-Path $tempExtractionPath " LinuxARM64"
528542 $BinFolderLinuxAlpine = Join-Path $tempExtractionPath " LinuxAlpine"
529543 $BinFolderMacOS = Join-Path $tempExtractionPath " MacOS"
530544 $BinFolderPSRP = Join-Path $tempExtractionPath " PSRP"
@@ -536,12 +550,13 @@ function Start-BuildPowerShellNativePackage
536550 Expand-Archive - Path $LinuxZipPath - DestinationPath $BinFolderLinux - Force
537551 Expand-Archive - Path $LinuxAlpineZipPath - DestinationPath $BinFolderLinuxAlpine - Force
538552 Expand-Archive - Path $LinuxARMZipPath - DestinationPath $BinFolderLinuxARM - Force
553+ Expand-Archive - Path $LinuxARM64ZipPath - DestinationPath $BinFolderLinuxARM64 - Force
539554 Expand-Archive - Path $macOSZipPath - DestinationPath $BinFolderMacOS - Force
540555 Expand-Archive - Path $psrpZipPath - DestinationPath $BinFolderPSRP - Force
541556
542557 PlaceWindowsNativeBinaries - PackageRoot $PackageRoot - BinFolderX64 $BinFolderX64 - BinFolderX86 $BinFolderX86 - BinFolderARM $BinFolderARM - BinFolderARM64 $BinFolderARM64
543558
544- PlaceUnixBinaries - PackageRoot $PackageRoot - BinFolderLinux $BinFolderLinux - BinFolderLinuxARM $BinFolderLinuxARM - BinFolderOSX $BinFolderMacOS - BinFolderPSRP $BinFolderPSRP - BinFolderLinuxAlpine $BinFolderLinuxAlpine
559+ PlaceUnixBinaries - PackageRoot $PackageRoot - BinFolderLinux $BinFolderLinux - BinFolderLinuxARM $BinFolderLinuxARM - BinFolderLinuxARM64 $BinFolderLinuxARM64 - BinFolderOSX $BinFolderMacOS - BinFolderPSRP $BinFolderPSRP - BinFolderLinuxAlpine $BinFolderLinuxAlpine
545560
546561 $Nuspec = @'
547562<?xml version="1.0" encoding="utf-8"?>
@@ -606,6 +621,10 @@ function PlaceUnixBinaries
606621 [ValidateScript ({Test-Path $_ - PathType Container})]
607622 $BinFolderLinuxARM ,
608623
624+ [Parameter (Mandatory = $true )]
625+ [ValidateScript ({Test-Path $_ - PathType Container})]
626+ $BinFolderLinuxARM64 ,
627+
609628 [Parameter (Mandatory = $true )]
610629 [ValidateScript ({Test-Path $_ - PathType Container})]
611630 $BinFolderLinuxAlpine ,
@@ -621,11 +640,13 @@ function PlaceUnixBinaries
621640
622641 $RuntimePathLinux = New-Item - ItemType Directory - Path (Join-Path $PackageRoot - ChildPath ' runtimes/linux-x64/native' ) - Force
623642 $RuntimePathLinuxARM = New-Item - ItemType Directory - Path (Join-Path $PackageRoot - ChildPath ' runtimes/linux-arm/native' ) - Force
643+ $RuntimePathLinuxARM64 = New-Item - ItemType Directory - Path (Join-Path $PackageRoot - ChildPath ' runtimes/linux-arm64/native' ) - Force
624644 $RuntimePathLinuxAlpine = New-Item - ItemType Directory - Path (Join-Path $PackageRoot - ChildPath ' runtimes/linux-musl-x64/native' ) - Force
625645 $RuntimePathOSX = New-Item - ItemType Directory - Path (Join-Path $PackageRoot - ChildPath ' runtimes/osx/native' ) - Force
626646
627647 Copy-Item " $BinFolderLinux \*" - Destination $RuntimePathLinux - Verbose
628648 Copy-Item " $BinFolderLinuxARM \*" - Destination $RuntimePathLinuxARM - Verbose
649+ Copy-Item " $BinFolderLinuxARM64 \*" - Destination $RuntimePathLinuxARM64 - Verbose
629650 Copy-Item " $BinFolderLinuxAlpine \*" - Destination $RuntimePathLinuxAlpine - Verbose
630651 Copy-Item " $BinFolderOSX \*" - Destination $RuntimePathOSX - Verbose
631652
@@ -738,6 +759,7 @@ function Start-PSBuild {
738759 " osx-x64" ,
739760 " linux-x64" ,
740761 " linux-arm" ,
762+ " linux-arm64" ,
741763 " win-arm" ,
742764 " win-arm64" )]
743765 [string ]$Runtime ,
@@ -752,8 +774,8 @@ function Start-PSBuild {
752774 [string ]$ReleaseTag
753775 )
754776
755- if ($Runtime -eq " linux-arm" -and -not $Environment.IsUbuntu ) {
756- throw " Cross compiling for linux-arm is only supported on Ubuntu environment"
777+ if (( $Runtime -eq " linux-arm" -or $Runtime -eq " linux-arm64 " ) -and -not $Environment.IsUbuntu ) {
778+ throw " Cross compiling for linux-arm/linux-arm64 are only supported on Ubuntu environment"
757779 }
758780
759781 if (" win-arm" , " win-arm64" -contains $Runtime -and -not $Environment.IsWindows ) {
@@ -1050,6 +1072,7 @@ function New-PSOptions {
10501072 " osx-x64" ,
10511073 " linux-x64" ,
10521074 " linux-arm" ,
1075+ " linux-arm64" ,
10531076 " win-arm" ,
10541077 " win-arm64" )]
10551078 [string ]$Runtime ,
@@ -1873,6 +1896,7 @@ function Start-PSBootstrap {
18731896 [switch ]$NoSudo ,
18741897 [switch ]$BuildWindowsNative ,
18751898 [switch ]$BuildLinuxArm ,
1899+ [switch ]$BuildLinuxArm64 ,
18761900 [switch ]$Force
18771901 )
18781902
@@ -1896,8 +1920,8 @@ function Start-PSBootstrap {
18961920 Pop-Location
18971921 }
18981922
1899- if ($BuildLinuxArm -and -not $Environment.IsUbuntu ) {
1900- Write-Error " Cross compiling for linux-arm is only supported on Ubuntu environment"
1923+ if (( $BuildLinuxArm -or $BuildLinuxArm64 ) -and -not $Environment.IsUbuntu ) {
1924+ Write-Error " Cross compiling for linux-arm/linux-arm64 are only supported on Ubuntu environment"
19011925 return
19021926 }
19031927
@@ -1909,6 +1933,8 @@ function Start-PSBootstrap {
19091933
19101934 if ($BuildLinuxArm ) {
19111935 $Deps += " gcc-arm-linux-gnueabihf" , " g++-arm-linux-gnueabihf"
1936+ } elseif ($BuildLinuxArm64 ) {
1937+ $Deps += " gcc-aarch64-linux-gnu" , " g++-aarch64-linux-gnu"
19121938 }
19131939
19141940 # .NET Core required runtime libraries
@@ -2483,6 +2509,7 @@ function Start-CrossGen {
24832509 " osx-x64" ,
24842510 " linux-x64" ,
24852511 " linux-arm" ,
2512+ " linux-arm64" ,
24862513 " win-arm" ,
24872514 " win-arm64" )]
24882515 [string ]
@@ -2545,6 +2572,8 @@ function Start-CrossGen {
25452572 }
25462573 } elseif ($Runtime -eq " linux-arm" ) {
25472574 throw " crossgen is not available for 'linux-arm'"
2575+ } elseif ($Runtime -eq " linux-arm64" ) {
2576+ throw " crossgen is not available for 'linux-arm64'"
25482577 } elseif ($Environment.IsLinux ) {
25492578 " linux-x64"
25502579 } elseif ($Environment.IsMacOS ) {
0 commit comments