@@ -392,16 +392,17 @@ cmd.exe /C cd /d "$location" "&" "$vcvarsallbatPath" "$Arch" "&" "$cmakePath" "$
392
392
393
393
function Start-BuildNativeUnixBinaries {
394
394
param (
395
- [switch ] $BuildLinuxArm
395
+ [switch ] $BuildLinuxArm ,
396
+ [switch ] $BuildLinuxArm64
396
397
)
397
398
398
399
if (-not $Environment.IsLinux -and -not $Environment.IsMacOS ) {
399
400
Write-Warning - Message " 'Start-BuildNativeUnixBinaries' is only supported on Linux/macOS platforms"
400
401
return
401
402
}
402
403
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"
405
406
}
406
407
407
408
# Verify we have all tools in place to do the build
@@ -414,6 +415,10 @@ function Start-BuildNativeUnixBinaries {
414
415
foreach ($Dependency in ' arm-linux-gnueabihf-gcc' , ' arm-linux-gnueabihf-g++' ) {
415
416
$precheck = $precheck -and (precheck $Dependency " Build dependency '$Dependency ' not found. Run 'Start-PSBootstrap'." )
416
417
}
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
+ }
417
422
}
418
423
419
424
# Abort if any precheck failed
@@ -440,6 +445,10 @@ function Start-BuildNativeUnixBinaries {
440
445
Start-NativeExecution { cmake - DCMAKE_TOOLCHAIN_FILE= " ./arm.toolchain.cmake" . }
441
446
Start-NativeExecution { make - j }
442
447
}
448
+ elseif ($BuildLinuxArm64 ) {
449
+ Start-NativeExecution { cmake - DCMAKE_TOOLCHAIN_FILE= " ./arm64.toolchain.cmake" . }
450
+ Start-NativeExecution { make - j }
451
+ }
443
452
else {
444
453
Start-NativeExecution { cmake - DCMAKE_BUILD_TYPE= Debug . }
445
454
Start-NativeExecution { make - j }
@@ -492,6 +501,10 @@ function Start-BuildPowerShellNativePackage
492
501
[ValidateScript ({Test-Path $_ - PathType Leaf})]
493
502
[string ] $LinuxARMZipPath ,
494
503
504
+ [Parameter (Mandatory = $true )]
505
+ [ValidateScript ({Test-Path $_ - PathType Leaf})]
506
+ [string ] $LinuxARM64ZipPath ,
507
+
495
508
[Parameter (Mandatory = $true )]
496
509
[ValidateScript ({Test-Path $_ - PathType Leaf})]
497
510
[string ] $LinuxAlpineZipPath ,
@@ -525,6 +538,7 @@ function Start-BuildPowerShellNativePackage
525
538
$BinFolderARM64 = Join-Path $tempExtractionPath " ARM64"
526
539
$BinFolderLinux = Join-Path $tempExtractionPath " Linux"
527
540
$BinFolderLinuxARM = Join-Path $tempExtractionPath " LinuxARM"
541
+ $BinFolderLinuxARM64 = Join-Path $tempExtractionPath " LinuxARM64"
528
542
$BinFolderLinuxAlpine = Join-Path $tempExtractionPath " LinuxAlpine"
529
543
$BinFolderMacOS = Join-Path $tempExtractionPath " MacOS"
530
544
$BinFolderPSRP = Join-Path $tempExtractionPath " PSRP"
@@ -536,12 +550,13 @@ function Start-BuildPowerShellNativePackage
536
550
Expand-Archive - Path $LinuxZipPath - DestinationPath $BinFolderLinux - Force
537
551
Expand-Archive - Path $LinuxAlpineZipPath - DestinationPath $BinFolderLinuxAlpine - Force
538
552
Expand-Archive - Path $LinuxARMZipPath - DestinationPath $BinFolderLinuxARM - Force
553
+ Expand-Archive - Path $LinuxARM64ZipPath - DestinationPath $BinFolderLinuxARM64 - Force
539
554
Expand-Archive - Path $macOSZipPath - DestinationPath $BinFolderMacOS - Force
540
555
Expand-Archive - Path $psrpZipPath - DestinationPath $BinFolderPSRP - Force
541
556
542
557
PlaceWindowsNativeBinaries - PackageRoot $PackageRoot - BinFolderX64 $BinFolderX64 - BinFolderX86 $BinFolderX86 - BinFolderARM $BinFolderARM - BinFolderARM64 $BinFolderARM64
543
558
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
545
560
546
561
$Nuspec = @'
547
562
<?xml version="1.0" encoding="utf-8"?>
@@ -606,6 +621,10 @@ function PlaceUnixBinaries
606
621
[ValidateScript ({Test-Path $_ - PathType Container})]
607
622
$BinFolderLinuxARM ,
608
623
624
+ [Parameter (Mandatory = $true )]
625
+ [ValidateScript ({Test-Path $_ - PathType Container})]
626
+ $BinFolderLinuxARM64 ,
627
+
609
628
[Parameter (Mandatory = $true )]
610
629
[ValidateScript ({Test-Path $_ - PathType Container})]
611
630
$BinFolderLinuxAlpine ,
@@ -621,11 +640,13 @@ function PlaceUnixBinaries
621
640
622
641
$RuntimePathLinux = New-Item - ItemType Directory - Path (Join-Path $PackageRoot - ChildPath ' runtimes/linux-x64/native' ) - Force
623
642
$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
624
644
$RuntimePathLinuxAlpine = New-Item - ItemType Directory - Path (Join-Path $PackageRoot - ChildPath ' runtimes/linux-musl-x64/native' ) - Force
625
645
$RuntimePathOSX = New-Item - ItemType Directory - Path (Join-Path $PackageRoot - ChildPath ' runtimes/osx/native' ) - Force
626
646
627
647
Copy-Item " $BinFolderLinux \*" - Destination $RuntimePathLinux - Verbose
628
648
Copy-Item " $BinFolderLinuxARM \*" - Destination $RuntimePathLinuxARM - Verbose
649
+ Copy-Item " $BinFolderLinuxARM64 \*" - Destination $RuntimePathLinuxARM64 - Verbose
629
650
Copy-Item " $BinFolderLinuxAlpine \*" - Destination $RuntimePathLinuxAlpine - Verbose
630
651
Copy-Item " $BinFolderOSX \*" - Destination $RuntimePathOSX - Verbose
631
652
@@ -738,6 +759,7 @@ function Start-PSBuild {
738
759
" osx-x64" ,
739
760
" linux-x64" ,
740
761
" linux-arm" ,
762
+ " linux-arm64" ,
741
763
" win-arm" ,
742
764
" win-arm64" )]
743
765
[string ]$Runtime ,
@@ -752,8 +774,8 @@ function Start-PSBuild {
752
774
[string ]$ReleaseTag
753
775
)
754
776
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"
757
779
}
758
780
759
781
if (" win-arm" , " win-arm64" -contains $Runtime -and -not $Environment.IsWindows ) {
@@ -1050,6 +1072,7 @@ function New-PSOptions {
1050
1072
" osx-x64" ,
1051
1073
" linux-x64" ,
1052
1074
" linux-arm" ,
1075
+ " linux-arm64" ,
1053
1076
" win-arm" ,
1054
1077
" win-arm64" )]
1055
1078
[string ]$Runtime ,
@@ -1873,6 +1896,7 @@ function Start-PSBootstrap {
1873
1896
[switch ]$NoSudo ,
1874
1897
[switch ]$BuildWindowsNative ,
1875
1898
[switch ]$BuildLinuxArm ,
1899
+ [switch ]$BuildLinuxArm64 ,
1876
1900
[switch ]$Force
1877
1901
)
1878
1902
@@ -1896,8 +1920,8 @@ function Start-PSBootstrap {
1896
1920
Pop-Location
1897
1921
}
1898
1922
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"
1901
1925
return
1902
1926
}
1903
1927
@@ -1909,6 +1933,8 @@ function Start-PSBootstrap {
1909
1933
1910
1934
if ($BuildLinuxArm ) {
1911
1935
$Deps += " gcc-arm-linux-gnueabihf" , " g++-arm-linux-gnueabihf"
1936
+ } elseif ($BuildLinuxArm64 ) {
1937
+ $Deps += " gcc-aarch64-linux-gnu" , " g++-aarch64-linux-gnu"
1912
1938
}
1913
1939
1914
1940
# .NET Core required runtime libraries
@@ -2483,6 +2509,7 @@ function Start-CrossGen {
2483
2509
" osx-x64" ,
2484
2510
" linux-x64" ,
2485
2511
" linux-arm" ,
2512
+ " linux-arm64" ,
2486
2513
" win-arm" ,
2487
2514
" win-arm64" )]
2488
2515
[string ]
@@ -2545,6 +2572,8 @@ function Start-CrossGen {
2545
2572
}
2546
2573
} elseif ($Runtime -eq " linux-arm" ) {
2547
2574
throw " crossgen is not available for 'linux-arm'"
2575
+ } elseif ($Runtime -eq " linux-arm64" ) {
2576
+ throw " crossgen is not available for 'linux-arm64'"
2548
2577
} elseif ($Environment.IsLinux ) {
2549
2578
" linux-x64"
2550
2579
} elseif ($Environment.IsMacOS ) {
0 commit comments