| 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
<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>
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 }}
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
- 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') }}:
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
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:
- 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
- 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
buildConfig: release
platforms:
- Linux_x64
+ - Linux_arm64
jobParameters:
runtimeVariant: llvmaot
condition: >-
runtimeFlavor: mono
platforms:
- Linux_x64
+ - Linux_arm64
helixQueueGroup: pr
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
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()
<SkipImportArcadeSdkFromRoot>true</SkipImportArcadeSdkFromRoot>
</PropertyGroup>
<Import Project="..\..\Directory.Build.props" />
-
+
<!-- Set default Platform -->
<PropertyGroup>
<HostArch>$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant)</HostArch>
<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 -->
<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">
<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>
Build properties:
- MonoEnableInterpreter - enable the interpreter
- MonoEnableLLVM - enable LLVM
+ - MonoLLVMDir - [optional] the directory where LLVM is located
+ - MonoAOTEnableLLVM - enable LLVM for an AOT-only Mono
+ - MonoAOTLLVMDir - [optional] the directory where LLVM is located, for an AOT-only Mono
- MonoVerboseBuild - enable verbose build
-->
<BuildMonoAOTCrossCompiler Condition="'$(TargetsiOS)' == 'true'">true</BuildMonoAOTCrossCompiler>
<BuildMonoAOTCrossCompiler Condition="'$(TargetstvOS)' == 'true'">true</BuildMonoAOTCrossCompiler>
<BuildMonoAOTCrossCompiler Condition="'$(TargetsBrowser)' == 'true'">true</BuildMonoAOTCrossCompiler>
+ <MonoAOTEnableLLVM Condition="'$(TargetsiOS)' == 'true'">true</MonoAOTEnableLLVM>
+ <MonoAOTEnableLLVM Condition="'$(TargetstvOS)' == 'true'">true</MonoAOTEnableLLVM>
+ <MonoAOTEnableLLVM Condition="'$(TargetsBrowser)' == 'true'">true</MonoAOTEnableLLVM>
<CrossConfigH Condition="'$(BuildMonoAOTCrossCompiler)' == 'true'">$(MonoObjDir)cross\config.h</CrossConfigH>
<MonoBundleLLVMOptimizer Condition="'$(MonoEnableLLVM)' == 'true'">true</MonoBundleLLVMOptimizer>
+ <MonoAOTBundleLLVMOptimizer Condition="'$(MonoAOTEnableLLVM)' == 'true'">true</MonoAOTBundleLLVMOptimizer>
<MonoCCompiler>$(Compiler)</MonoCCompiler>
<MonoCCompiler Condition="'$(MonoCCompiler)' == ''">clang</MonoCCompiler>
<!-- when we use runtime/build.sh -gcc, it is passed to eng/build.sh which sets the raw value to $(Compiler); strip the leading hyphens. -->
<Error Condition="'$(Destination)' == ''" Text="Destination should not be empty" />
<Error Condition="@(_MonoRuntimeArtifacts->Count()) < 2" Text="Mono artifacts were not found at $(RuntimeBinDir)" />
<Message Text="Copying Mono Runtime artifacts from '$(RuntimeBinDir)' to '$(Destination)'.'" Importance="High" />
- <Copy SourceFiles="@(_MonoRuntimeArtifacts)"
+ <Copy SourceFiles="@(_MonoRuntimeArtifacts)"
DestinationFolder="$(Destination)"
OverwriteReadOnlyFiles="true"
SkipUnchangedFiles="true" />
<ItemGroup Condition="'$(TargetOS)' == 'Linux' and '$(MonoEnableLLVM)' == 'true' and '$(MonoLLVMUseCxx11Abi)' != 'true'">
<_MonoCXXFLAGS Include="-D_GLIBCXX_USE_CXX11_ABI=0" />
</ItemGroup>
+ <ItemGroup Condition="'$(TargetOS)' == 'Linux' and '$(MonoAOTEnableLLVM)' == 'true' and '$(MonoAOTLLVMUseCxx11Abi)' != 'true'">
+ <_MonoAOTCXXFLAGS Include="-D_GLIBCXX_USE_CXX11_ABI=0" />
+ </ItemGroup>
<!-- We build LLVM bits for ARM64 Linux with C++11 ABI (Ubuntu 16.04 has libstdc++ > 5.1)-->
<ItemGroup Condition="'$(TargetOS)' == 'Linux' and '$(MonoEnableLLVM)' == 'true' and '$(MonoLLVMUseCxx11Abi)' == 'true'">
<_MonoCXXFLAGS Include="-D_GLIBCXX_USE_CXX11_ABI=1" />
</ItemGroup>
+ <ItemGroup Condition="'$(TargetOS)' == 'Linux' and '$(MonoAOTEnableLLVM)' == 'true' and '$(MonoAOTLLVMUseCxx11Abi)' == 'true'">
+ <_MonoAOTCXXFLAGS Include="-D_GLIBCXX_USE_CXX11_ABI=1" />
+ </ItemGroup>
<!-- ARM Linux cross build options on CI -->
<ItemGroup Condition="'$(TargetsAndroid)' != 'true' and '$(MonoCrossDir)' != '' and ('$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'arm64')">
<Exec Condition="'$(TargetsBrowser)' != 'true' and '$(_MonoRunInitCompiler)' == 'false'" Command="$(_MonoCCOption) $(_MonoCXXOption) @(_MonoBuildEnv, ' ') cmake @(_MonoCMakeArgs, ' ') $(MonoProjectRoot)" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(MonoObjDir)"/>
<Exec Condition="'$(TargetsBrowser)' == 'true'" Command="bash -c 'source $(EMSDK_PATH)/emsdk_env.sh && emcmake cmake @(_MonoCMakeArgs, ' ') $(MonoProjectRoot)'" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(MonoObjDir)" />
<!-- ninja/make -->
- <Exec Condition="'$(TargetsBrowser)' != 'true'" Command="@(_MonoBuildEnv, ' ') $(MonoBuildTool) $(_MonoVerboseArg) all install" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(MonoObjDir)"/>
- <Exec Condition="'$(TargetsBrowser)' == 'true'" Command="bash -c 'source $(EMSDK_PATH)/emsdk_env.sh && $(MonoBuildTool) $(_MonoVerboseArg) all install'" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(MonoObjDir)" />
+ <Exec Condition="'$(TargetsBrowser)' != 'true' and '$(BuildMonoAOTCrossCompilerOnly)' != 'true'" Command="@(_MonoBuildEnv, ' ') $(MonoBuildTool) $(_MonoVerboseArg) all install" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(MonoObjDir)"/>
+ <Exec Condition="'$(TargetsBrowser)' == 'true' and '$(BuildMonoAOTCrossCompilerOnly)' != 'true'" Command="bash -c 'source $(EMSDK_PATH)/emsdk_env.sh && $(MonoBuildTool) $(_MonoVerboseArg) all install'" IgnoreStandardErrorWarningFormat="true" WorkingDirectory="$(MonoObjDir)" />
</Target>
<!-- Build AOT cross compiler (if available) -->
<MonoAotAbi Condition="'$(Platform)' == 'x64'">x86_64-apple-darwin10</MonoAotAbi>
</PropertyGroup>
+ <PropertyGroup Condition="'$(TargetOS)' == 'Linux' and '$(Platform)' == 'arm64'">
+ <MonoUseCrossTool>true</MonoUseCrossTool>
+ <MonoAotAbi>aarch64-linux-gnu</MonoAotAbi>
+ <MonoAotOffsetsFile>$(MonoObjDir)cross/offsets-aarch-linux-gnu.h</MonoAotOffsetsFile>
+ <MonoAotOffsetsPrefix>$(MonoCrossDir)/usr/lib/gcc/aarch64-linux-gnu/5</MonoAotOffsetsPrefix>
+ </PropertyGroup>
+
<!-- WASM specific options -->
<PropertyGroup Condition="'$(TargetsBrowser)' == 'true'">
<MonoUseCrossTool>true</MonoUseCrossTool>
<PropertyGroup>
<MonoLibClang Condition="'$(MonoLibClang)' == ''">$(XcodeDir)/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib</MonoLibClang>
+ <MonoCMakeSysroot Condition="'$(MonoCMakeSysroot)' == ''">$(MonoCrossDir)</MonoCMakeSysroot>
</PropertyGroup>
<ItemGroup Condition="'$(MonoUseCrossTool)' == 'true'">
<MonoAotCrossOffsetsToolParams Include="--abi=$(MonoAotAbi)" />
<MonoAotCrossOffsetsToolParams Include="--monodir="$(MonoProjectRoot)"" />
<MonoAotCrossOffsetsToolParams Include="--outfile="$(MonoAotOffsetsFile)"" />
<MonoAotCrossOffsetsToolParams Include="--libclang="$(MonoLibClang)"" />
+ <MonoAotCrossOffsetsToolParams Condition="'$(MonoAotOffsetsPrefix)' != ''" Include="--prefix="$(MonoAotOffsetsPrefix)"" />
<MonoAotCrossOffsetsToolParams Condition="'$(MonoCMakeSysroot)' != ''" Include="--sysroot="$(MonoCMakeSysroot)"" />
<MonoAotCrossOffsetsToolParams Condition="'$(TargetsBrowser)' == 'true'" Include="--emscripten-sdk="$(EMSDK_PATH)/upstream/emscripten"" />
</ItemGroup>
<MonoAotCrossOffsetsCommand>python3 $(MonoProjectRoot)mono/tools/offsets-tool/offsets-tool.py @(MonoAotCrossOffsetsToolParams, ' ')</MonoAotCrossOffsetsCommand>
</PropertyGroup>
+ <PropertyGroup>
+ <_MonoAOTCXXFLAGSOption>-DCMAKE_CXX_FLAGS="@(_MonoAOTCXXFLAGS, ' ')"</_MonoAOTCXXFLAGSOption>
+ </PropertyGroup>
+
<ItemGroup>
<MonoAOTCMakeArgs Include="-DAOT_TARGET_TRIPLE=$(MonoAotAbi)"/>
<MonoAOTCMakeArgs Condition="'$(MonoBuildTool)' == 'ninja'" Include="-G Ninja"/>
<MonoAOTCMakeArgs Include="-DDISABLE_SHARED_LIBS=1" />
<MonoAOTCMakeArgs Include="-DDISABLE_LIBS=1" />
<MonoAOTCMakeArgs Condition="'$(MonoAotOffsetsFile)' != ''" Include="-DAOT_OFFSETS_FILE="$(MonoAotOffsetsFile)"" />
- <MonoAOTCMakeArgs Include="-DLLVM_PREFIX=$(MonoLLVMDir)" />
+ <MonoAOTCMakeArgs Condition="'$(MonoAOTEnableLLVM)' == 'true'" Include="-DLLVM_PREFIX=$(MonoAOTLLVMDir)" />
+ <MonoAOTCMakeArgs Include="$(_MonoAOTCXXFLAGSOption)" />
</ItemGroup>
<MakeDir Directories="$(MonoObjDir)/cross" />
<!-- General targets -->
<Target Name="BuildMono" AfterTargets="Build" DependsOnTargets="CheckEnv;BuildMonoRuntimeUnix;BuildMonoCrossUnix;BuildMonoRuntimeWindows">
- <PropertyGroup>
+ <PropertyGroup Condition="'$(BuildMonoAOTCrossCompilerOnly)' != 'true'">
<_MonoRuntimeFilePath Condition="'$(TargetsWindows)' == 'true' and '$(Platform)' == 'x64'">$(MonoObjDir)x64\Bin\$(Configuration)\mono-2.0-sgen.dll</_MonoRuntimeFilePath>
<_MonoRuntimeFilePath Condition="'$(TargetsWindows)' == 'true' and '$(Platform)' == 'x86'">$(MonoObjDir)Win32\Bin\$(Configuration)\mono-2.0-sgen.dll</_MonoRuntimeFilePath>
<_MonoRuntimeFilePath Condition="'$(TargetsOSX)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.dylib</_MonoRuntimeFilePath>
<_MonoRuntimeFilePath Condition="'$(TargetsBrowser)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.a</_MonoRuntimeFilePath>
<_MonoRuntimeFilePath Condition="'$(_MonoRuntimeFilePath)' == ''">$(MonoObjDir)mono\mini\.libs\libmonosgen-2.0.so</_MonoRuntimeFilePath>
<_MonoRuntimeStaticFilePath Condition="'$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsAndroid)' == 'true'">$(MonoObjDir)out\lib\libmonosgen-2.0.a</_MonoRuntimeStaticFilePath>
- <_MonoAotCrossFilePath Condition="'$(BuildMonoAOTCrossCompiler)' == 'true'">$(MonoObjDir)cross\out\bin\mono-sgen</_MonoAotCrossFilePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(BuildMonoAOTCrossCompiler)' == 'true'">
+ <_MonoAotCrossFilePath >$(MonoObjDir)cross\out\bin\mono-sgen</_MonoAotCrossFilePath>
</PropertyGroup>
<!-- Copy Mono runtime files to artifacts directory -->
<_MonoRuntimeArtifacts Condition="'$(MonoBundleLLVMOptimizer)' == 'true'" Include="$(MonoLLVMDir)\bin\opt">
<Destination>$(RuntimeBinDir)\opt</Destination>
</_MonoRuntimeArtifacts>
- <_MonoRuntimeArtifacts Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS'" Include="$(MonoLLVMDir)\bin\llc">
+ <_MonoRuntimeArtifacts Condition="'$(MonoAOTBundleLLVMOptimizer)' == 'true'" Include="$(MonoAOTLLVMDir)\bin\llc">
<Destination>$(RuntimeBinDir)cross\llc</Destination>
</_MonoRuntimeArtifacts>
- <_MonoRuntimeArtifacts Condition="'$(TargetOS)' == 'iOS' or '$(TargetOS)' == 'tvOS'" Include="$(MonoLLVMDir)\bin\opt">
+ <_MonoRuntimeArtifacts Condition="'$(MonoAOTBundleLLVMOptimizer)' == 'true'" Include="$(MonoAOTLLVMDir)\bin\opt">
<Destination>$(RuntimeBinDir)cross\opt</Destination>
</_MonoRuntimeArtifacts>
<_MonoIncludeArtifacts Include="$(MonoObjDir)out\include\**" />
sys.exit (1)
parser = argparse.ArgumentParser ()
- parser.add_argument ('--libclang', dest='libclang', help='path to shared library of libclang.{so,dylib}')
+ parser.add_argument ('--libclang', dest='libclang', help='path to shared library of libclang.{so,dylib}', required=True)
parser.add_argument ('--emscripten-sdk', dest='emscripten_path', help='path to emscripten sdk')
parser.add_argument ('--outfile', dest='outfile', help='path to output file', required=True)
parser.add_argument ('--monodir', dest='mono_path', help='path to mono source tree', required=True)
parser.add_argument ('--targetdir', dest='target_path', help='path to mono tree configured for target', required=True)
parser.add_argument ('--abi=', dest='abi', help='ABI triple to generate', required=True)
parser.add_argument ('--sysroot=', dest='sysroot', help='path to sysroot headers of target')
- parser.add_argument ('--include-prefix=', dest='include_prefix', help='prefix path to include directory of target')
+ parser.add_argument ('--prefix=', dest='prefixes', action='append', help='prefix path to include directory of target')
parser.add_argument ('--netcore', dest='netcore', help='target runs with netcore', action='store_true')
args = parser.parse_args ()
# Linux
elif "arm-linux-gnueabihf" == args.abi:
+ require_sysroot (args)
self.target = Target ("TARGET_ARM", None, ["ARM_FPU_VFP", "HAVE_ARMV5", "HAVE_ARMV6", "HAVE_ARMV7"] + LINUX_DEFINES)
self.target_args += ["--target=arm---gnueabihf"]
self.target_args += ["-I", args.sysroot + "/include"]
- if args.include_prefix:
- if not os.path.isdir (args.include_prefix):
- print ("provided path via --include-prefix (\"" + args.include_prefix + "\") doesn't exist.", file=sys.stderr)
- sys.exit (1)
- self.target_args += ["-I", args.include_prefix + "/include"]
- self.target_args += ["-I", args.include_prefix + "/include-fixed"]
+ if args.prefixes:
+ for prefix in args.prefixes:
+ if not os.path.isdir (prefix):
+ print ("provided path via --prefix (\"" + prefix + "\") doesn't exist.", file=sys.stderr)
+ sys.exit (1)
+ self.target_args += ["-I", prefix + "/include"]
+ self.target_args += ["-I", prefix + "/include-fixed"]
else:
found = False
for i in range (11, 5, -1):
break
if not found:
- print ("could not find a valid include path for target, provide one via --include-prefix=<path>.", file=sys.stderr)
+ print ("could not find a valid include path for target, provide one via --prefix=<path>.", file=sys.stderr)
sys.exit (1)
+ elif "aarch64-linux-gnu" == args.abi:
+ require_sysroot (args)
+ self.target = Target ("TARGET_ARM64", None, LINUX_DEFINES)
+ self.target_args += ["--target=aarch64-linux-gnu"]
+ self.target_args += ["--sysroot", args.sysroot]
+ self.target_args += ["-I", args.sysroot + "/include"]
+ if args.prefixes:
+ for prefix in args.prefixes:
+ if not os.path.isdir (prefix):
+ print ("provided path via --prefix (\"" + prefix + "\") doesn't exist.", file=sys.stderr)
+ sys.exit (1)
+ self.target_args += ["-I", prefix + "/include"]
+ self.target_args += ["-I", prefix + "/include-fixed"]
+
# iOS
elif "arm-apple-darwin10" == args.abi:
require_sysroot (args)
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="AotCompile">
- <Exec Command="$(_CorerunExecutable) $(_TestDll)" EnvironmentVariables="$(AotEnvVars)" />
+ <ItemGroup>
+ <MonoEnvVar Condition="'$(_MonoPath)' != ''" Include="MONO_PATH=$(_MonoPath)" />
+ <MonoEnvVar Include="MONO_ENV_OPTIONS=--aot=$(_MonoAotOptions)" />
+ </ItemGroup>
+ <Exec Command="$(_AotCompiler) $(_TestDll)" EnvironmentVariables="@(MonoEnvVar)" />
</Target>
</Project>
build_mono_aot()
{
__RuntimeFlavor="mono"
- __MonoBinDir="$__RootBinDir/bin/mono/$__TargetOS.$__BuildArch.$__BuildType"
__Exclude="$__RepoRootDir/src/tests/issues.targets"
__TestBinDir="$__TestWorkingDir"
CORE_ROOT="$__TestBinDir"/Tests/Core_Root
export __Exclude
export CORE_ROOT
- build_MSBuild_projects "Tests_MonoAot" "$__RepoRootDir/src/tests/run.proj" "Mono AOT compile tests" "/t:MonoAotCompileTests" "/p:RuntimeFlavor=$__RuntimeFlavor" "/p:MonoLlvmPath=$__MonoBinDir"
+ build_MSBuild_projects "Tests_MonoAot" "$__RepoRootDir/src/tests/run.proj" "Mono AOT compile tests" "/t:MonoAotCompileTests" "/p:RuntimeFlavor=$__RuntimeFlavor" "/p:MonoBinDir=$__MonoBinDir"
}
generate_layout()
__TestIntermediatesDir="$__RootBinDir/tests/coreclr/obj/$__OSPlatformConfig"
__CrossComponentBinDir="$__BinDir"
__CrossCompIntermediatesDir="$__IntermediatesDir/crossgen"
+__MonoBinDir="$__RootBinDir/bin/mono/$__OSPlatformConfig"
__CrossArch="$__HostArch"
if [[ "$__CrossBuild" == 1 ]]; then
</ItemGroup>
<ItemGroup Condition=" '$(RuntimeFlavor)' == 'mono' and ('$(TargetArchitecture)' == 'arm64' or '$(AltJitArch)' == 'arm64') and '$(TargetsWindows)' != 'true' " >
+ <ExcludeList Include="$(XunitTestBinBase)/baseservices/typeequivalence/simple/Simple/**">
+ <Issue>Doesn't compile with LLVM AOT.</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Loader/classloader/generics/Variance/IL/Unbox002/**">
+ <Issue>Doesn't compile with LLVM AOT.</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Loader/classloader/generics/Variance/IL/Unbox003/**">
+ <Issue>Doesn't compile with LLVM AOT.</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Loader/classloader/generics/Variance/IL/vsw543506/**">
+ <Issue>Doesn't compile with LLVM AOT.</Issue>
+ </ExcludeList>
+
<ExcludeList Include = "$(XunitTestBinBase)/GC/Features/Finalizer/finalizeother/finalizearray/**">
<Issue>needs triage</Issue>
</ExcludeList>
<TestDllPaths Include="$([System.IO.Path]::ChangeExtension('%(TestScripts.Identity)', 'dll'))" />
<TestDlls Include="%(TestDllPaths.Identity)" Condition="Exists(%(TestDllPaths.Identity))" />
</ItemGroup>
- <PropertyGroup>
- <CorerunExecutable Condition="'$(RunningOnUnix)' == 'true'">$(CORE_ROOT)\corerun</CorerunExecutable>
- <CorerunExecutable Condition="'$(RunningOnUnix)' != 'true'">$(CORE_ROOT)\corerun.exe</CorerunExecutable>
+
+ <PropertyGroup Condition="'$(CROSSCOMPILE)' == ''">
+ <AotCompiler Condition="'$(RunningOnUnix)' == 'true'">$(CORE_ROOT)/corerun</AotCompiler>
+ <AotCompiler Condition="'$(RunningOnUnix)' != 'true'">$(CORE_ROOT)\corerun.exe</AotCompiler>
+ <MonoLlvmPath>$(MonoBinDir)</MonoLlvmPath>
</PropertyGroup>
+ <PropertyGroup Condition="'$(CROSSCOMPILE)' != ''">
+ <AotCompiler>$(MonoBinDir)/cross/mono-aot-cross</AotCompiler>
+ <MonoLlvmPath>$(MonoBinDir)/cross</MonoLlvmPath>
+ </PropertyGroup>
+
<ItemGroup>
- <AotEnvVar Include="MONO_ENV_OPTIONS=--aot=llvm,llvm-path='$(MonoLlvmPath)'" />
+ <MonoAotOption Include="llvm" />
+ <MonoAotOption Include="llvm-path=$(MonoLlvmPath)" />
+ <MonoAotOption Condition="'$(__MonoToolPrefix)' != ''" Include="tool-prefix=$(__MonoToolPrefix)" />
</ItemGroup>
<PropertyGroup>
- <AotEnvVars>@(AotEnvVar)</AotEnvVars>
+ <MonoAotOptions>@(MonoAotOption->'%(Identity)', ',')</MonoAotOptions>
+ <MonoPath Condition="'$(CROSSCOMPILE)' != ''">$(CORE_ROOT)</MonoPath>
</PropertyGroup>
+
<ItemGroup>
<AotProject Include="../mono/msbuild/aot-compile.proj">
- <Properties>_CorerunExecutable=$(CorerunExecutable);_TestDll=%(TestDlls.Identity);AotEnvVars=@(AotEnvVar)</Properties>
+ <Properties>_AotCompiler=$(AotCompiler);_TestDll=%(TestDlls.Identity);_MonoPath=$(MonoPath);_MonoAotOptions=$(MonoAotOptions)</Properties>
</AotProject>
</ItemGroup>
<MSBuild
<ItemGroup>
<AllRunnableTestPaths Include="$(XunitTestBinBase)\**\*.cmd" Condition="'$(TargetOS)' == 'Windows_NT'" />
<AllRunnableTestPaths Include="$(XunitTestBinBase)\**\*.sh" Condition="'$(TargetOS)' != 'Windows_NT'" />
- <AllRunnableTestPaths Remove="$(XunitTestBinBase)\**\run-v8.sh" Condition="'$(TargetArchitecture)' == 'wasm'" />
+ <AllRunnableTestPaths Remove="$(XunitTestBinBase)\**\run-v8.sh" Condition="'$(TargetArchitecture)' == 'wasm'" />
</ItemGroup>
</Target>
<MSBuild Projects="$(RepoRoot)/src/tests/Common/test_dependencies/test_dependencies.csproj"
Condition=" '$(BuildWrappers)'=='true' " />
- <MSBuild Projects="$(MSBuildProjectFile)"
- Targets="MonoAotCompileTests"
- Properties=""
- Condition=" '$(MonoAotCompile)'=='true' " />
-
<!-- Default for building -->
<MSBuild Projects="$(MSBuildProjectFile)"
Targets="CreateAllWrappers"