Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a977268
Build Mono with LLVM AOT on arm64 Linux.
imhameed Sep 2, 2020
abf4057
Use the libstdc++ C++11 ABI on Linux non-amd64
imhameed Sep 2, 2020
931bf3e
Pass archType to build-test.sh for LLVM AOT
imhameed Sep 4, 2020
4bb4daa
Debugging: Probe the file type of /__w/1/s/artifacts/tests/coreclr/Li…
imhameed Sep 29, 2020
9dfdf2b
Build a Linux + arm64 + glibc AOT cross compiler
imhameed Oct 14, 2020
01dadbd
Revert "Debugging: Probe the file type of /__w/1/s/artifacts/tests/co…
imhameed Oct 14, 2020
5b51070
Hack in support for only building an AOT cross-compiler without also …
imhameed Oct 15, 2020
75b9b1a
Use CMake
imhameed Oct 21, 2020
b065307
Add some AOT-specific LLVM knobs in mono.proj
imhameed Oct 21, 2020
d590bc5
More support for only building an AOT cross-compiler without an assoc…
imhameed Oct 21, 2020
c5f639c
Use LLVM for the host os/architecture when building an AOT cross comp…
imhameed Oct 21, 2020
ebb102d
Unconditionally enable LLVM AOT cross compilation for iOS, tvOS, and …
imhameed Oct 22, 2020
d83cf70
-
imhameed Oct 22, 2020
b3c8d13
-
imhameed Oct 22, 2020
c35ecc2
Unconditionally define MonoLLVMDir and MonoAOTLLVMDir
imhameed Oct 22, 2020
45896f1
Use an Ubuntu 16.04 cross compilation image with clang-tools-9 preins…
imhameed Oct 22, 2020
6de863a
Actually use clang-tools-9
imhameed Oct 22, 2020
ffbb0fe
Cross-compile test dlls for arm64
imhameed Oct 23, 2020
3c820a5
... cross compile for arm64, not amd64. Also, add tests that fail to …
imhameed Oct 23, 2020
a5975e6
Cleanup; address review feedback
imhameed Oct 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/workflow/building/coreclr/linux-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ This table of images might often become stale as we change our images as our req
| Alpine | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.9-WithNode-0fc54a3-20190918214015` | - | -clang9 |
| CentOS 7 (build for RHEL 7) | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-359e48e-20200313130914` | - | -clang9 |
| Ubuntu 16.04 | arm32 (armhf) | `mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-20200413125008-09ec757` | `/crossrootfs/arm` | -clang9 |
| Ubuntu 16.04 | arm64 (arm64v8) | `mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-20200413125008-cfdd435` | `/crossrootfs/arm64` | -clang9 |
| Ubuntu 16.04 | arm64 (arm64v8) | `mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-20201022204150-b2c2436` | `/crossrootfs/arm64` | -clang9 |
| Alpine | arm64 (arm64v8) | `mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-alpine-20200413125008-406629a` | `/crossrootfs/arm64` | -clang5.0 |

Environment
Expand Down
1 change: 1 addition & 0 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<DefaultCoreClrSubsets>clr.runtime+clr.jit+clr.alljits+linuxdac+clr.corelib+clr.nativecorelib+clr.tools+clr.packages</DefaultCoreClrSubsets>

<DefaultMonoSubsets Condition="'$(MonoEnableLLVM)' == 'true' and '$(MonoLLVMDir)' == ''">mono.llvm+</DefaultMonoSubsets>
<DefaultMonoSubsets Condition="'$(MonoAOTEnableLLVM)' == 'true' and '$(MonoAOTLLVMDir)' == ''">mono.llvm+</DefaultMonoSubsets>
<DefaultMonoSubsets Condition="'$(TargetOS)' == 'Browser'">$(DefaultMonoSubsets)mono.wasmruntime+</DefaultMonoSubsets>
<DefaultMonoSubsets>$(DefaultMonoSubsets)mono.runtime+mono.corelib+mono.packages</DefaultMonoSubsets>

Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/common/platform-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
targetRid: linux-arm64
platform: Linux_arm64
container:
image: ubuntu-16.04-cross-arm64-20200413125008-cfdd435
image: ubuntu-16.04-cross-arm64-20201022204150-b2c2436
registry: mcr
jobParameters:
runtimeFlavor: ${{ parameters.runtimeFlavor }}
Expand Down
25 changes: 22 additions & 3 deletions eng/pipelines/common/templates/runtimes/run-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ jobs:
artifactName: '$(coreClrProductArtifactName)'
displayName: 'CoreCLR product download for Mono'


# Download and unzip the Microsoft.NET.Sdk.IL package needed for traversing
# ilproj test projects during copynativeonly.
- template: /eng/pipelines/common/download-artifact-step.yml
Expand Down Expand Up @@ -263,6 +262,20 @@ jobs:
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) generatelayoutonly $(runtimeFlavorArgs) $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg)
displayName: Generate CORE_ROOT

# Build a Mono LLVM AOT cross-compiler for non-amd64 targets (in this case, just arm64)
- ${{ if and(eq(parameters.runtimeFlavor, 'mono'), eq(parameters.runtimeVariant, 'llvmaot')) }}:
- ${{ if eq(parameters.archType, 'arm64') }}:
- script: ./build.sh
-subset mono
-c $(buildConfigUpper)
-arch $(archType)
/p:BuildMonoAotCrossCompiler=true
/p:BuildMonoAotCrossCompilerOnly=true
/p:MonoLibClang="/usr/lib/llvm-9/lib/libclang-9.so.1"
/p:MonoAOTEnableLLVM=true
/p:MonoAOTLLVMUseCxx11Abi=true
displayName: "Build Mono LLVM AOT cross compiler"


# Overwrite coreclr runtime binaries with mono ones
- ${{ if eq(parameters.runtimeFlavor, 'mono') }}:
Expand All @@ -274,8 +287,14 @@ jobs:
displayName: "Patch dotnet with mono"

- ${{ if and(eq(parameters.runtimeFlavor, 'mono'), eq(parameters.runtimeVariant, 'llvmaot')) }}:
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) mono_aot $(buildConfig)
displayName: "LLVM AOT compile CoreCLR tests"
- ${{ if eq(parameters.archType, 'x64') }}:
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) mono_aot $(buildConfig) $(archType)
displayName: "LLVM AOT compile CoreCLR tests"
- ${{ if eq(parameters.archType, 'arm64') }}:
- script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) mono_aot $(buildConfig) $(archType) cross
displayName: "LLVM AOT cross-compile CoreCLR tests"
env:
__MonoToolPrefix: aarch64-linux-gnu-

# Send tests to Helix
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-step.yml
Expand Down
11 changes: 7 additions & 4 deletions eng/pipelines/mono/templates/build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,15 @@ jobs:
value: wasm
- name: osOverride
value: '-os Browser'
- ${{ if and(eq(parameters.osGroup, 'Linux'), not(eq(parameters.archType, 'x64'))) }}:
name: llvmCxxAbi
value: /p:MonoLLVMUseCxx11Abi=true
- ${{ if eq(parameters.runtimeVariant, 'llvmjit') }}:
- name: llvmParameter
value: /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=false
value: /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=false $(llvmCxxAbi)
- ${{ if eq(parameters.runtimeVariant, 'llvmaot') }}:
- name: llvmParameter
value: /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=true
value: /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=true $(llvmCxxAbi)
- ${{ parameters.variables }}

steps:
Expand All @@ -96,7 +99,7 @@ jobs:
- script: $(Build.SourcesDirectory)\eng\common\init-tools-native.cmd -InstallDirectory $(Build.SourcesDirectory)\native-tools -Force
displayName: Install native dependencies

- ${{ if in(parameters.osGroup, 'OSX', 'iOS','tvOS') }}:
- ${{ if in(parameters.osGroup, 'OSX', 'iOS','tvOS') }}:
- script: |
du -sh $(Build.SourcesDirectory)/*
df -h
Expand All @@ -110,7 +113,7 @@ jobs:
- script: build$(scriptExt) -subset mono -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(llvmParameter)
displayName: Build product

- ${{ if in(parameters.osGroup, 'OSX', 'iOS','tvOS') }}:
- ${{ if in(parameters.osGroup, 'OSX', 'iOS','tvOS') }}:
- script: |
du -sh $(Build.SourcesDirectory)/*
df -h
Expand Down
2 changes: 2 additions & 0 deletions eng/pipelines/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ jobs:
buildConfig: release
platforms:
- Linux_x64
- Linux_arm64
jobParameters:
runtimeVariant: llvmaot
condition: >-
Expand Down Expand Up @@ -853,6 +854,7 @@ jobs:
runtimeFlavor: mono
platforms:
- Linux_x64
- Linux_arm64
helixQueueGroup: pr
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
Expand Down
3 changes: 3 additions & 0 deletions src/mono/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ if(NOT AOT_TARGET_TRIPLE STREQUAL "")
elseif(AOT_TARGET_TRIPLE STREQUAL "wasm32-unknown-none")
set(TARGET_SYSTEM_NAME "Emscripten")
set(TARGET_ARCH "wasm")
elseif(AOT_TARGET_TRIPLE STREQUAL "aarch64-linux-gnu")
set(TARGET_SYSTEM_NAME "Linux")
set(TARGET_ARCH "arm64")
else()
message(FATAL_ERROR "AOT target '${AOT_TARGET_TRIPLE}' not supported.")
endif()
Expand Down
5 changes: 3 additions & 2 deletions src/mono/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<SkipImportArcadeSdkFromRoot>true</SkipImportArcadeSdkFromRoot>
</PropertyGroup>
<Import Project="..\..\Directory.Build.props" />

<!-- Set default Platform -->
<PropertyGroup>
<HostArch>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant)</HostArch>
Expand Down Expand Up @@ -101,7 +101,8 @@

<PropertyGroup>
<MonoObjDir>$(ArtifactsObjDir)mono/$(PlatformConfigPathPart)/</MonoObjDir>
<MonoLLVMDir Condition="('$(MonoEnableLLVM)' == 'true' or '$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS' or '$(TargetOS)' == 'Browser') and '$(MonoLLVMDir)' == ''">$(MonoObjDir)llvm</MonoLLVMDir>
<MonoLLVMDir Condition="'$(MonoLLVMDir)' == ''">$(MonoObjDir)llvm</MonoLLVMDir>
<MonoAOTLLVMDir Condition="'$(MonoAOTLLVMDir)' == ''">$(MonoObjDir)cross/llvm</MonoAOTLLVMDir>
</PropertyGroup>

<!-- Paths for Mobile App Projects -->
Expand Down
11 changes: 11 additions & 0 deletions src/mono/llvm/llvm-init.proj
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,28 @@
<ItemGroup>
<PackageReference Include="runtime.$(MonoLLVMHostOS)-$(MonoLLVMTargetArchitecture).Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="$(MonoLLVMSDKVersion)"/>
<PackageReference Include="runtime.$(MonoLLVMHostOS)-$(MonoLLVMTargetArchitecture).Microsoft.NETCore.Runtime.Mono.LLVM.Tools" Version="$(MonoLLVMToolsVersion)"/>

<PackageReference Include="runtime.$(MonoLLVMHostOS)-$(HostArch).Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="$(MonoLLVMSDKVersion)"/>
<PackageReference Include="runtime.$(MonoLLVMHostOS)-$(HostArch).Microsoft.NETCore.Runtime.Mono.LLVM.Tools" Version="$(MonoLLVMToolsVersion)"/>
</ItemGroup>

<Target Name="CopyLLVMToTree" AfterTargets="Build">
<ItemGroup>
<LLVMFiles Include="$(NuGetPackageRoot)\runtime.$(MonoLLVMHostOS)-$(MonoLLVMTargetArchitecture).microsoft.netcore.runtime.mono.llvm.sdk\$(MonoLLVMSDKVersion)\tools\$(MonoLLVMHostOS)-$(MonoLLVMTargetArchitecture)\**" />
<LLVMFiles Include="$(NuGetPackageRoot)\runtime.$(MonoLLVMHostOS)-$(MonoLLVMTargetArchitecture).microsoft.netcore.runtime.mono.llvm.tools\$(MonoLLVMSDKVersion)\tools\$(MonoLLVMHostOS)-$(MonoLLVMTargetArchitecture)\**" />
</ItemGroup>
<ItemGroup>
<AOTLLVMFiles Include="$(NuGetPackageRoot)\runtime.$(MonoLLVMHostOS)-$(HostArch).microsoft.netcore.runtime.mono.llvm.sdk\$(MonoLLVMSDKVersion)\tools\$(MonoLLVMHostOS)-$(HostArch)\**" />
<AOTLLVMFiles Include="$(NuGetPackageRoot)\runtime.$(MonoLLVMHostOS)-$(HostArch).microsoft.netcore.runtime.mono.llvm.tools\$(MonoLLVMSDKVersion)\tools\$(MonoLLVMHostOS)-$(HostArch)\**" />
</ItemGroup>

<Copy SourceFiles="@(LLVMFiles)" DestinationFolder="$(MonoLLVMDir)\%(RecursiveDir)">
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
</Copy>

<Copy SourceFiles="@(AOTLLVMFiles)" DestinationFolder="$(MonoAOTLLVMDir)\%(RecursiveDir)">
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
</Copy>
</Target>

</Project>
Loading