diff --git a/eng/Subsets.props b/eng/Subsets.props
index b584263848a9ef3aaa9944ab64c2668539285828..bacc9b4edfd5668341f97a5686e04a0abf07ef91 100644
--- a/eng/Subsets.props
+++ b/eng/Subsets.props
@@ -59,7 +59,7 @@
clr.alljits+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime
mono.llvm+
- mono.llvm+
+ mono.llvm+
$(DefaultMonoSubsets)mono.wasmruntime+
$(DefaultMonoSubsets)mono.wasiruntime+
$(DefaultMonoSubsets)mono.aotcross+
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 3e9ce3e57f4eabac256a24238592448622694d2e..37b67845cb50103b1c24ad444dcf86992d0e1084 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -234,6 +234,14 @@
https://github.com/dotnet/llvm-project
ec1fd7b45b2751ce9abf204b03871f471b903609
+
+ https://github.com/dotnet/llvm-project
+ ec1fd7b45b2751ce9abf204b03871f471b903609
+
+
+ https://github.com/dotnet/llvm-project
+ ec1fd7b45b2751ce9abf204b03871f471b903609
+
https://github.com/dotnet/llvm-project
ec1fd7b45b2751ce9abf204b03871f471b903609
diff --git a/eng/Versions.props b/eng/Versions.props
index aa2152390d097e0c3734f080b87edb14c9315248..f00231fa675e0b7f02b35a000bbd3b0520a55932 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -228,6 +228,8 @@
14.0.0-alpha.1.22626.2
14.0.0-alpha.1.22626.2
14.0.0-alpha.1.22626.2
+ 14.0.0-alpha.1.22626.2
+ 14.0.0-alpha.1.22626.2
14.0.0-alpha.1.22626.2
14.0.0-alpha.1.22626.2
diff --git a/eng/pipelines/common/evaluate-default-paths.yml b/eng/pipelines/common/evaluate-default-paths.yml
index 84af019a0b17f24f0ab371ffadd75196e05a33c5..ad95f388107ee6413d4e31eb6d59d4ec314c7eb8 100644
--- a/eng/pipelines/common/evaluate-default-paths.yml
+++ b/eng/pipelines/common/evaluate-default-paths.yml
@@ -170,11 +170,13 @@ jobs:
- eng/Versions.props
- eng/testing/scenarios/BuildWasmAppsJobsList.txt
- eng/testing/workloads-testing.targets
+ - src/installer/pkg/sfx/Microsoft.NETCore.App/*
- src/libraries/sendtohelix*
- src/libraries/System.Net.WebSockets.Client/*
- src/libraries/System.Runtime.InteropServices/*
- src/libraries/System.Runtime.InteropServices.JavaScript/*
- src/mono/mono/*
+ - src/mono/monoaotcross.proj
- src/mono/nuget/Microsoft.NET.Runtime.MonoAOTCompiler.Task/*
- src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/*
- src/mono/nuget/Microsoft.NET.Runtime.WebAssembly.Sdk/*
diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml
index ad8d96e6305d015d6d92d2668544a99cd95a81bf..862e7708abf8cb0e2ef74726e7a825c27e117106 100644
--- a/eng/pipelines/runtime-official.yml
+++ b/eng/pipelines/runtime-official.yml
@@ -217,6 +217,27 @@ extends:
extraStepsParameters:
name: MonoRuntimePacks
+ - template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/global-build-job.yml
+ runtimeFlavor: mono
+ buildConfig: release
+ platforms:
+ - Linux_arm64
+ jobParameters:
+ buildArgs: -s mono+packs -c $(_BuildConfig)
+ /p:MonoCrossAOTTargetOS=Browser /p:SkipMonoCrossJitConfigure=true /p:BuildMonoAOTCrossCompilerOnly=true
+ nameSuffix: CrossAOT_Mono
+ runtimeVariant: crossaot
+ dependsOn:
+ - mono_browser_offsets
+ monoCrossAOTTargetOS:
+ - Browser
+ isOfficialBuild: ${{ variables.isOfficialBuild }}
+ extraStepsTemplate: /eng/pipelines/common/upload-intermediate-artifacts-step.yml
+ extraStepsParameters:
+ name: MonoRuntimePacks
+
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
@@ -269,6 +290,27 @@ extends:
extraStepsParameters:
name: MonoRuntimePacks
+ - template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/global-build-job.yml
+ runtimeFlavor: mono
+ buildConfig: release
+ platforms:
+ - OSX_arm64
+ jobParameters:
+ buildArgs: -s mono+packs -c $(_BuildConfig)
+ /p:MonoCrossAOTTargetOS=Browser /p:SkipMonoCrossJitConfigure=true /p:BuildMonoAOTCrossCompilerOnly=true
+ nameSuffix: CrossAOT_Mono
+ runtimeVariant: crossaot
+ dependsOn:
+ - mono_browser_offsets
+ monoCrossAOTTargetOS:
+ - Browser
+ isOfficialBuild: ${{ variables.isOfficialBuild }}
+ extraStepsTemplate: /eng/pipelines/common/upload-intermediate-artifacts-step.yml
+ extraStepsParameters:
+ name: MonoRuntimePacks
+
#
# Build Mono LLVM runtime packs
#
diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml
index fd086de0016eb5312b8805db72462232ce610235..cf5e09293ea31fc291c47e635ba3cf11385c9d45 100644
--- a/eng/pipelines/runtime.yml
+++ b/eng/pipelines/runtime.yml
@@ -311,7 +311,7 @@ extends:
buildConfig: release
platforms:
- Android_x64
- #- Browser_wasm - unused
+ - Browser_wasm
- tvOS_arm64
- iOS_arm64
- MacCatalyst_x64
@@ -670,10 +670,10 @@ extends:
runtimeVariant: crossaot
dependsOn:
- mono_android_offsets
- #- mono_browser_offsets - unused
+ - mono_browser_offsets
monoCrossAOTTargetOS:
- Android
- #- Browser - unused
+ - Browser
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'], true),
@@ -691,19 +691,39 @@ extends:
runtimeVariant: crossaot
dependsOn:
- mono_android_offsets
- #- mono_browser_offsets - unused
+ - mono_browser_offsets
- mono_tvos_offsets
- mono_ios_offsets
- mono_maccatalyst_offsets
monoCrossAOTTargetOS:
- Android
- #- Browser - unused
+ - Browser
- tvOS
- iOS
- MacCatalyst
condition: >-
or(
- eq(dependencies.evaluate_paths.outputs['SetPathVars_mono_excluding_wasm.containsChange'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true),
+ eq(variables['isRollingBuild'], true))
+
+ - template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/mono/templates/build-job.yml
+ runtimeFlavor: mono
+ buildConfig: release
+ platforms:
+ - Linux_arm64
+ - OSX_arm64
+ jobParameters:
+ runtimeVariant: crossaot
+ dependsOn:
+ - mono_browser_offsets
+ monoCrossAOTTargetOS:
+ - Browser
+ condition: >-
+ or(
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true),
eq(variables['isRollingBuild'], true))
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.MonoCrossAOT.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.MonoCrossAOT.sfxproj
index c0141fb950f497212fd0b43cf482d801d68bde0a..7f8b869b20e551037ff00ee31a9cd9cffccf5d6e 100644
--- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.MonoCrossAOT.sfxproj
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.MonoCrossAOT.sfxproj
@@ -8,7 +8,7 @@
Microsoft.NETCore.App.Runtime.AOT.$(RuntimeIdentifier).Cross.$(TargetCrossRid)
dotnet-monocrossaot
monocrossaot
- linux-x64;osx-x64;win-x64
+ linux-x64;linux-arm64;osx-x64;osx-arm64;win-x64
false
false
tools/
diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt
index 37a64158d4b9f81e00a1fce6135cec0d3c88cce2..f7bd010d5d9c180af9cab3335f85284a04a659b1 100644
--- a/src/mono/CMakeLists.txt
+++ b/src/mono/CMakeLists.txt
@@ -564,71 +564,55 @@ if(LLVM_PREFIX)
message(FATAL_ERROR "FIXME: ${TARGET_ARCH}")
endif()
- if(CMAKE_CROSSCOMPILING)
- # Can't run llvm-config, hardcode results
- set(llvm_config_path "${LLVM_PREFIX}/include/llvm/Config/llvm-config.h")
-
- # llvm-config --mono-api-version
- file(STRINGS ${llvm_config_path} llvm_api_version_line REGEX "MONO_API_VERSION ")
- string(REGEX REPLACE ".*MONO_API_VERSION ([0-9]+)" "\\1" llvm_api_version ${llvm_api_version_line})
-
- # llvm-config --libs analysis core bitwriter mcjit orcjit
- set(MONO_llvm_core_libs "LLVMOrcJIT" "LLVMPasses" "LLVMCoroutines" "LLVMipo" "LLVMInstrumentation" "LLVMVectorize" "LLVMScalarOpts" "LLVMLinker" "LLVMIRReader" "LLVMAsmParser" "LLVMInstCombine" "LLVMFrontendOpenMP" "LLVMAggressiveInstCombine" "LLVMTransformUtils" "LLVMJITLink" "LLVMMCJIT" "LLVMExecutionEngine" "LLVMTarget" "LLVMRuntimeDyld" "LLVMBitWriter" "LLVMAnalysis" "LLVMProfileData" "LLVMObject" "LLVMTextAPI" "LLVMMCParser" "LLVMMC" "LLVMDebugInfoCodeView" "LLVMBitReader" "LLVMCore" "LLVMRemarks" "LLVMBitstreamReader" "LLVMBinaryFormat" "LLVMSupport" "LLVMDemangle")
- if(${llvm_api_version} LESS 1200)
- set(MONO_llvm_core_libs ${MONO_llvm_core_libs} "LLVMOrcError" "LLVMDebugInfoMSF")
- else()
- set(MONO_llvm_core_libs ${MONO_llvm_core_libs} "LLVMObjCARCOpts" "LLVMMCDisassembler" "LLVMOrcTargetProcess" "LLVMOrcShared" "LLVMDebugInfoDWARF")
- endif()
-
- # llvm-config --libs x86codegen
- set(MONO_llvm_extra_libs_x86codegen "LLVMX86CodeGen" "LLVMCFGuard" "LLVMGlobalISel" "LLVMX86Desc" "LLVMX86Info" "LLVMMCDisassembler" "LLVMSelectionDAG" "LLVMAsmPrinter" "LLVMDebugInfoDWARF" "LLVMCodeGen" "LLVMTarget" "LLVMScalarOpts" "LLVMInstCombine" "LLVMAggressiveInstCombine" "LLVMTransformUtils" "LLVMBitWriter" "LLVMAnalysis" "LLVMProfileData" "LLVMObject" "LLVMTextAPI" "LLVMMCParser" "LLVMMC" "LLVMDebugInfoCodeView" "LLVMDebugInfoMSF" "LLVMBitReader" "LLVMCore" "LLVMRemarks" "LLVMBitstreamReader" "LLVMBinaryFormat" "LLVMSupport" "LLVMDemangle")
+ set(llvm_config_path "${LLVM_PREFIX}/include/llvm/Config/llvm-config.h")
- # llvm-config --libs armcodegen
- set(MONO_llvm_extra_libs_armcodegen "LLVMARMCodeGen" "LLVMCFGuard" "LLVMGlobalISel" "LLVMSelectionDAG" "LLVMAsmPrinter" "LLVMDebugInfoDWARF" "LLVMCodeGen" "LLVMTarget" "LLVMScalarOpts" "LLVMInstCombine" "LLVMAggressiveInstCombine" "LLVMTransformUtils" "LLVMBitWriter" "LLVMAnalysis" "LLVMProfileData" "LLVMObject" "LLVMTextAPI" "LLVMMCParser" "LLVMBitReader" "LLVMCore" "LLVMRemarks" "LLVMBitstreamReader" "LLVMARMDesc" "LLVMMCDisassembler" "LLVMMC" "LLVMDebugInfoCodeView" "LLVMDebugInfoMSF" "LLVMBinaryFormat" "LLVMARMUtils" "LLVMARMInfo" "LLVMSupport" "LLVMDemangle")
+ # llvm-config --mono-api-version
+ file(STRINGS ${llvm_config_path} llvm_api_version_line REGEX "MONO_API_VERSION ")
+ string(REGEX REPLACE ".*MONO_API_VERSION ([0-9]+)" "\\1" llvm_api_version ${llvm_api_version_line})
- # llvm-config --libs aarch64codegen
- set(MONO_llvm_extra_libs_aarch64codegen "LLVMAArch64CodeGen" "LLVMCFGuard" "LLVMGlobalISel" "LLVMSelectionDAG" "LLVMAsmPrinter" "LLVMDebugInfoDWARF" "LLVMCodeGen" "LLVMTarget" "LLVMScalarOpts" "LLVMInstCombine" "LLVMAggressiveInstCombine" "LLVMTransformUtils" "LLVMBitWriter" "LLVMAnalysis" "LLVMProfileData" "LLVMObject" "LLVMTextAPI" "LLVMMCParser" "LLVMBitReader" "LLVMCore" "LLVMRemarks" "LLVMBitstreamReader" "LLVMAArch64Desc" "LLVMMC" "LLVMDebugInfoCodeView" "LLVMDebugInfoMSF" "LLVMBinaryFormat" "LLVMAArch64Utils" "LLVMAArch64Info" "LLVMSupport" "LLVMDemangle")
+ # llvm-config --libs analysis core bitwriter mcjit orcjit
+ set(MONO_llvm_core_libs "LLVMOrcJIT" "LLVMPasses" "LLVMCoroutines" "LLVMipo" "LLVMInstrumentation" "LLVMVectorize" "LLVMScalarOpts" "LLVMLinker" "LLVMIRReader" "LLVMAsmParser" "LLVMInstCombine" "LLVMFrontendOpenMP" "LLVMAggressiveInstCombine" "LLVMTransformUtils" "LLVMJITLink" "LLVMMCJIT" "LLVMExecutionEngine" "LLVMTarget" "LLVMRuntimeDyld" "LLVMBitWriter" "LLVMAnalysis" "LLVMProfileData" "LLVMObject" "LLVMTextAPI" "LLVMMCParser" "LLVMMC" "LLVMDebugInfoCodeView" "LLVMBitReader" "LLVMCore" "LLVMRemarks" "LLVMBitstreamReader" "LLVMBinaryFormat" "LLVMSupport" "LLVMDemangle")
+ if(${llvm_api_version} LESS 1200)
+ set(MONO_llvm_core_libs ${MONO_llvm_core_libs} "LLVMOrcError" "LLVMDebugInfoMSF")
+ else()
+ set(MONO_llvm_core_libs ${MONO_llvm_core_libs} "LLVMObjCARCOpts" "LLVMMCDisassembler" "LLVMOrcTargetProcess" "LLVMOrcShared" "LLVMDebugInfoDWARF")
+ endif()
+ # llvm-config --libs x86codegen
+ set(MONO_llvm_extra_libs_x86codegen "LLVMX86CodeGen" "LLVMCFGuard" "LLVMGlobalISel" "LLVMX86Desc" "LLVMX86Info" "LLVMMCDisassembler" "LLVMSelectionDAG" "LLVMAsmPrinter" "LLVMDebugInfoDWARF" "LLVMCodeGen" "LLVMTarget" "LLVMScalarOpts" "LLVMInstCombine" "LLVMAggressiveInstCombine" "LLVMTransformUtils" "LLVMBitWriter" "LLVMAnalysis" "LLVMProfileData" "LLVMObject" "LLVMTextAPI" "LLVMMCParser" "LLVMMC" "LLVMDebugInfoCodeView" "LLVMDebugInfoMSF" "LLVMBitReader" "LLVMCore" "LLVMRemarks" "LLVMBitstreamReader" "LLVMBinaryFormat" "LLVMSupport" "LLVMDemangle")
- # llvm-config --cflags
- set(llvm_cflags "")
- set(llvm_cxxflags "")
- set(llvm_includedir "${LLVM_PREFIX}/include")
+ # llvm-config --libs armcodegen
+ set(MONO_llvm_extra_libs_armcodegen "LLVMARMCodeGen" "LLVMCFGuard" "LLVMGlobalISel" "LLVMSelectionDAG" "LLVMAsmPrinter" "LLVMDebugInfoDWARF" "LLVMCodeGen" "LLVMTarget" "LLVMScalarOpts" "LLVMInstCombine" "LLVMAggressiveInstCombine" "LLVMTransformUtils" "LLVMBitWriter" "LLVMAnalysis" "LLVMProfileData" "LLVMObject" "LLVMTextAPI" "LLVMMCParser" "LLVMBitReader" "LLVMCore" "LLVMRemarks" "LLVMBitstreamReader" "LLVMARMDesc" "LLVMMCDisassembler" "LLVMMC" "LLVMDebugInfoCodeView" "LLVMDebugInfoMSF" "LLVMBinaryFormat" "LLVMARMUtils" "LLVMARMInfo" "LLVMSupport" "LLVMDemangle")
- # llvm-config --system-libs
- set(llvm_system_libs "-lz" "-lrt" "-ldl" "-lpthread" "-lm")
+ # llvm-config --libs aarch64codegen
+ set(MONO_llvm_extra_libs_aarch64codegen "LLVMAArch64CodeGen" "LLVMCFGuard" "LLVMGlobalISel" "LLVMSelectionDAG" "LLVMAsmPrinter" "LLVMDebugInfoDWARF" "LLVMCodeGen" "LLVMTarget" "LLVMScalarOpts" "LLVMInstCombine" "LLVMAggressiveInstCombine" "LLVMTransformUtils" "LLVMBitWriter" "LLVMAnalysis" "LLVMProfileData" "LLVMObject" "LLVMTextAPI" "LLVMMCParser" "LLVMBitReader" "LLVMCore" "LLVMRemarks" "LLVMBitstreamReader" "LLVMAArch64Desc" "LLVMMC" "LLVMDebugInfoCodeView" "LLVMDebugInfoMSF" "LLVMBinaryFormat" "LLVMAArch64Utils" "LLVMAArch64Info" "LLVMSupport" "LLVMDemangle")
- # llvm-config --libs analysis core bitwriter mcjit orcjit
- set(llvm_core_libs ${MONO_llvm_core_libs})
+ # llvm-config --cflags
+ set(llvm_cflags "-I${LLVM_PREFIX}/include -D__STDC_CONSTANT_MACROS -D__STD_FORMAT_MACROS -D__STDC_LIMIT_MACROS")
+ set(llvm_cxxflags "-I${LLVM_PREFIX}/include -std=c++14 -fno-exceptions -fno-rtti -D__STDC_CONSTANT_MACROS -D__STD_FORMAT_MACROS -D__STDC_LIMIT_MACROS")
+ set(llvm_includedir "${LLVM_PREFIX}/include")
- # Check codegen libs and add needed libraries.
- set(llvm_extra ${MONO_llvm_extra_libs_${llvm_codegen_libs}})
- if("${llvm_extra}" STREQUAL "")
- message(FATAL_ERROR "FIXME: ${TARGET_ARCH}")
- endif()
+ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ # llvm-config --system-libs
+ set(llvm_system_libs "-lz" "-lrt" "-ldl" "-lpthread" "-lm")
+ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ # llvm-config --system-libs
+ set(llvm_system_libs "-lz" "-lm")
+ endif()
- set(llvm_libs ${llvm_core_libs} ${llvm_extra})
- list(TRANSFORM llvm_libs PREPEND "${LLVM_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}")
- list(TRANSFORM llvm_libs APPEND "${CMAKE_STATIC_LIBRARY_SUFFIX}")
- else()
- set(LLVM_CONFIG ${LLVM_PREFIX}/bin/llvm-config${EXE_SUFFIX})
- if (NOT EXISTS ${LLVM_CONFIG})
- message(FATAL_ERROR "LLVM executable '${LLVM_CONFIG}' not found.")
- endif()
+ # llvm-config --libs analysis core bitwriter mcjit orcjit
+ set(llvm_core_libs ${MONO_llvm_core_libs})
- execute_process(COMMAND ${LLVM_CONFIG} --mono-api-version RESULT_VARIABLE llvm_config_res OUTPUT_VARIABLE llvm_api_version OUTPUT_STRIP_TRAILING_WHITESPACE)
- if (NOT ${llvm_config_res} EQUAL 0)
- message(FATAL_ERROR "'${LLVM_CONFIG} --mono-api-version' failed. Use the llvm fork at https://github.com/dotnet/llvm-project.")
- endif()
- execute_process(COMMAND ${LLVM_CONFIG} --cflags OUTPUT_VARIABLE llvm_cflags OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND ${LLVM_CONFIG} --cxxflags OUTPUT_VARIABLE llvm_cxxflags OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND ${LLVM_CONFIG} --includedir OUTPUT_VARIABLE llvm_includedir OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND ${LLVM_CONFIG} --system-libs OUTPUT_VARIABLE llvm_system_libs_space_separated OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND ${LLVM_CONFIG} --libfiles analysis core bitwriter mcjit orcjit ${llvm_codegen_libs} OUTPUT_VARIABLE llvm_libs_space_separated OUTPUT_STRIP_TRAILING_WHITESPACE)
- separate_arguments(llvm_system_libs NATIVE_COMMAND ${llvm_system_libs_space_separated})
- separate_arguments(llvm_libs NATIVE_COMMAND ${llvm_libs_space_separated})
+ # Check codegen libs and add needed libraries.
+ set(llvm_extra ${MONO_llvm_extra_libs_${llvm_codegen_libs}})
+ if("${llvm_extra}" STREQUAL "" AND NOT "${TARGET_ARCH}" STREQUAL "wasm")
+ message(FATAL_ERROR "FIXME: ${TARGET_ARCH}")
endif()
+ set(llvm_libs ${llvm_core_libs} ${llvm_extra})
+ list(TRANSFORM llvm_libs PREPEND "${LLVM_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}")
+ list(TRANSFORM llvm_libs APPEND "${CMAKE_STATIC_LIBRARY_SUFFIX}")
+
if (${llvm_api_version} LESS 1100)
message(FATAL_ERROR "LLVM version too old.")
endif()
diff --git a/src/mono/Directory.Build.props b/src/mono/Directory.Build.props
index b64f87e11d95c0520aea8a075de2c63d447d1b5c..6bc85c60667b94be7cb630fbb492d97de35c5e56 100644
--- a/src/mono/Directory.Build.props
+++ b/src/mono/Directory.Build.props
@@ -53,10 +53,8 @@
true
true
true
- <_MonoUseLLVMPackage Condition="'$(MonoLLVMDir)' == '' and '$(MonoEnableLLVM)' == 'true'">true
- <_MonoUseAOTLLVMPackage Condition="'$(MonoAOTLLVMDir)' == '' and '$(MonoAOTEnableLLVM)' == 'true'">true
- $([MSBuild]::NormalizeDirectory('$(MonoObjDir)', 'llvm'))
- $([MSBuild]::NormalizeDirectory('$(MonoObjDir)', 'cross', 'llvm'))
+ <_MonoUseLLVMPackage Condition="'$(MonoLLVMDir)' == '' and ('$(MonoEnableLLVM)' == 'true' or $(MonoAOTEnableLLVM) == 'true')">true
+ $([MSBuild]::NormalizeDirectory('$(MonoObjDir)', 'llvm'))
diff --git a/src/mono/llvm/llvm-init.proj b/src/mono/llvm/llvm-init.proj
index eab193a1266f1fca337ebbbd89ab6479083a1cf2..c7351f4f8d0552089b1d3f6f16397be722f05d7b 100644
--- a/src/mono/llvm/llvm-init.proj
+++ b/src/mono/llvm/llvm-init.proj
@@ -12,39 +12,81 @@
$(runtimeosxx64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion)
-
-
- $(TargetArchitecture)
- $(BuildArchitecture)
-
-
-
-
-
-
-
+ PackageArch="$(TargetArchitecture)"
+ Condition="'$(TargetArchitecture)' != ''" />
+
+
+
+
+
+ <_PackageReferenceDeduplicated Include="@(PackageReference->Distinct())" />
+
+
+
+ <_PackageReferenceDeduplicated Remove="runtime.$(MonoLLVMHostOS)-arm.Microsoft.NETCore.Runtime.Mono.LLVM.Tools" />
+ <_PackageReferenceDeduplicated Include="runtime.$(MonoLLVMHostOS)-$(BuildArchitecture).Microsoft.NETCore.Runtime.Mono.LLVM.Tools"
+ Version="$(MonoLLVMToolsVersion)"
+ PackageArch="$(BuildArchitecture)"/>
+
+
+ <_PackageReferenceDeduplicated Remove="runtime.$(MonoLLVMHostOS)-arm.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" />
+ <_PackageReferenceDeduplicated Include="runtime.$(MonoLLVMHostOS)-$(BuildArchitecture).Microsoft.NETCore.Runtime.Mono.LLVM.Sdk"
+ Version="$(MonoLLVMSDKVersion)"
+ PackageArch="$(BuildArchitecture)"/>
+
+
+ <_PackageReferenceDeduplicated Remove="runtime.$(MonoLLVMHostOS)-x86.Microsoft.NETCore.Runtime.Mono.LLVM.Tools" />
+ <_PackageReferenceDeduplicated Include="runtime.$(MonoLLVMHostOS)-$(BuildArchitecture).Microsoft.NETCore.Runtime.Mono.LLVM.Tools"
+ Version="$(MonoLLVMToolsVersion)"
+ PackageArch="$(BuildArchitecture)"/>
+
+
+ <_PackageReferenceDeduplicated Remove="runtime.$(MonoLLVMHostOS)-x86.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" />
+ <_PackageReferenceDeduplicated Include="runtime.$(MonoLLVMHostOS)-$(BuildArchitecture).Microsoft.NETCore.Runtime.Mono.LLVM.Sdk"
+ Version="$(MonoLLVMSDKVersion)"
+ PackageArch="$(BuildArchitecture)"/>
+
+
+ <_PackageReferenceDeduplicated Remove="runtime.$(MonoLLVMHostOS)-wasm.Microsoft.NETCore.Runtime.Mono.LLVM.Tools" />
+ <_PackageReferenceDeduplicated Include="runtime.$(MonoLLVMHostOS)-$(BuildArchitecture).Microsoft.NETCore.Runtime.Mono.LLVM.Tools"
+ Version="$(MonoLLVMToolsVersion)"
+ PackageArch="$(BuildArchitecture)"/>
+
+
+ <_PackageReferenceDeduplicated Remove="runtime.$(MonoLLVMHostOS)-wasm.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" />
+ <_PackageReferenceDeduplicated Include="runtime.$(MonoLLVMHostOS)-$(BuildArchitecture).Microsoft.NETCore.Runtime.Mono.LLVM.Sdk"
+ Version="$(MonoLLVMSDKVersion)"
+ PackageArch="$(BuildArchitecture)"/>
+
+
+
+
-
-
-
-
-
-
+
-
-
-
-
-
-
+
diff --git a/src/mono/mono.proj b/src/mono/mono.proj
index 37d96487b496173ded6e04cd01dd97dbf210b715..94ffc014244470007a260554b1d96d0fb386e2ef 100644
--- a/src/mono/mono.proj
+++ b/src/mono/mono.proj
@@ -6,7 +6,6 @@
- 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
- MonoThreadSuspend - coop,hybrid,preemptive - default thread suspend mode
- MonoWasmThreads - build runtime with threading support for wasm
@@ -204,13 +203,17 @@
+
+ <_MonoLLVMTargetArchitecture Condition="'$(TargetArchitecture)' == 'wasm'">$(BuildArchitecture)
+ <_MonoLLVMTargetArchitecture Condition="'$(TargetArchitecture)' != 'wasm'">$(TargetArchitecture)
+
<_MonoCMakeArgs Condition="'$(_MonoUseNinja)' == 'true'" Include="-G Ninja"/>
<_MonoCMakeArgs Include="-DCMAKE_INSTALL_PREFIX="$(MonoObjDir)out""/>
<_MonoCMakeArgs Include="-DCMAKE_INSTALL_LIBDIR=lib"/>
<_MonoCMakeArgs Include="-DCMAKE_BUILD_TYPE=$(Configuration)"/>
<_MonoCMakeArgs Condition="'$(CMakeArgs)' != ''" Include="$(CMakeArgs)"/>
- <_MonoCMakeArgs Condition="'$(MonoEnableLLVM)' == 'true'" Include="-DLLVM_PREFIX=$(MonoLLVMDir.TrimEnd('\/'))" />
+ <_MonoCMakeArgs Condition="'$(MonoEnableLLVM)' == 'true'" Include="-DLLVM_PREFIX=$(MonoLLVMDir)\$(_MonoLLVMTargetArchitecture)" />
<_MonoCMakeArgs Condition="'$(BuildDarwinFrameworks)' == 'true'" Include="-DBUILD_DARWIN_FRAMEWORKS=1" />
<_MonoCMakeArgs Include="-DGC_SUSPEND=$(MonoThreadSuspend)" />
<_MonoCMakeArgs Include="-DMONO_LIB_NAME=$(MonoLibName)" />
@@ -366,7 +369,7 @@
<_MonoCCOption>CC="$(XcodeDir)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
<_MonoCXXOption>CXX="$(XcodeDir)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
- <_MonoRunInitCompiler>false
+ <_MonoSkipInitCompiler>true
<_MonoCMakeSysroot Condition="'$(TargetsiOS)' == 'true' and '$(TargetsiOSSimulator)' != 'true'">$(XcodeDir)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$(iOSVersion).sdk
<_MonoCMakeSysroot Condition="'$(TargetsiOS)' == 'true' and '$(TargetsiOSSimulator)' == 'true'">$(XcodeDir)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$(iOSVersion).sdk
<_MonoCMakeSysroot Condition="'$(TargetstvOS)' == 'true' and '$(TargetstvOSSimulator)' != 'true'">$(XcodeDir)/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS$(tvOSVersion).sdk
@@ -418,7 +421,7 @@
- <_MonoRunInitCompiler>false
+ <_MonoSkipInitCompiler>true
<_MonoCPPFLAGS Include="-DANDROID_FORCE_ICU_DATA_DIR" />
@@ -513,9 +516,9 @@
$([MSBuild]::EnsureTrailingSlash('$(EMSDK_PATH)'))
<_MonoCMakeConfigureCommand>cmake @(_MonoCMakeArgs, ' ') $(MonoCMakeExtraArgs) "$(MonoProjectRoot.TrimEnd('\/'))"
- <_MonoCMakeConfigureCommand Condition="'$(TargetsBrowser)' != 'true' and '$(_MonoRunInitCompiler)' != 'false' and '$(HostOS)' != 'windows'">sh -c 'build_arch="$(_CompilerTargetArch)" compiler="$(MonoCCompiler)" . "$(RepositoryEngineeringCommonDir)native/init-compiler.sh" && @(_MonoBuildEnv, ' ') $(_MonoCMakeConfigureCommand)'
- <_MonoCMakeConfigureCommand Condition="'$(TargetsBrowser)' != 'true' and '$(_MonoRunInitCompiler)' != 'false' and '$(HostOS)' == 'windows'">call "$(RepositoryEngineeringDir)native\init-vs-env.cmd" $(_CompilerTargetArch) && cd /D "$(MonoObjDir)" && @(_MonoBuildEnv, ' ') $(_MonoCMakeConfigureCommand)
- <_MonoCMakeConfigureCommand Condition="'$(TargetsBrowser)' != 'true' and '$(_MonoRunInitCompiler)' == 'false'">$(_MonoCCOption) $(_MonoCXXOption) @(_MonoBuildEnv, ' ') $(_MonoCMakeConfigureCommand)
+ <_MonoCMakeConfigureCommand Condition="'$(TargetsBrowser)' != 'true' and '$(_MonoSkipInitCompiler)' != 'true' and '$(HostOS)' != 'windows'">sh -c 'build_arch="$(_CompilerTargetArch)" compiler="$(MonoCCompiler)" . "$(RepositoryEngineeringCommonDir)native/init-compiler.sh" && @(_MonoBuildEnv, ' ') $(_MonoCMakeConfigureCommand)'
+ <_MonoCMakeConfigureCommand Condition="'$(TargetsBrowser)' != 'true' and '$(_MonoSkipInitCompiler)' == 'true' and '$(HostOS)' != 'windows'">$(_MonoCCOption) $(_MonoCXXOption) @(_MonoBuildEnv, ' ') $(_MonoCMakeConfigureCommand)
+ <_MonoCMakeConfigureCommand Condition="'$(TargetsBrowser)' != 'true' and '$(HostOS)' == 'windows'">call "$(RepositoryEngineeringDir)native\init-vs-env.cmd" $(_CompilerTargetArch) && cd /D "$(MonoObjDir)" && @(_MonoBuildEnv, ' ') $(_MonoCMakeConfigureCommand)
<_MonoCMakeConfigureCommand Condition="'$(TargetsBrowser)' == 'true' and '$(HostOS)' != 'windows'">bash -c 'source $(EMSDK_PATH)/emsdk_env.sh 2>&1 && emcmake $(_MonoCMakeConfigureCommand)'
<_MonoCMakeConfigureCommand Condition="'$(TargetsBrowser)' == 'true' and '$(HostOS)' == 'windows'">call "$(RepositoryEngineeringDir)native\init-vs-env.cmd" && call "$([MSBuild]::NormalizePath('$(EMSDK_PATH)', 'emsdk_env.bat'))" && emcmake $(_MonoCMakeConfigureCommand)
@@ -602,6 +605,7 @@
+ <_MonoSkipInitCompiler>true
true
$(XcodeDir)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$(iOSVersion).sdk
$(XcodeDir)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$(iOSVersion).sdk
@@ -636,17 +640,24 @@
+
+
+ <_MonoAOTCFLAGS Condition="'$(RealTargetArchitecture)' == 'arm64'" Include="-arch arm64" />
+ <_MonoAOTCXXFLAGS Condition="'$(RealTargetArchitecture)' == 'arm64'" Include="-arch arm64" />
+
+ <_MonoAotBuildEnv Condition="'$(BuildArchitecture)' == 'arm64'" Include="arch -arch arm64" />
true
+ <_MonoSkipInitCompiler>true
wasm32-unknown-none
$(MonoObjCrossDir)offsets-wasm32-unknown-none.h
- $(MonoAOTLLVMDir)/lib/libclang.dylib
- $(MonoAOTLLVMDir)/lib/libclang.so
- $([MSBuild]::NormalizePath('$(MonoAOTLLVMDir)', 'bin', 'libclang.dll'))
+ $(MonoLLVMDir)/$(BuildArchitecture)/lib/libclang.dylib
+ $(MonoLLVMDir)/$(BuildArchitecture)/lib/libclang.so
+ $([MSBuild]::NormalizePath('$(MonoLLVMDir)', '$(BuildArchitecture)', 'bin', 'libclang.dll'))
setlocal EnableDelayedExpansion && call "$([MSBuild]::NormalizePath('$(EMSDK_PATH)', 'emsdk_env.bat'))" && !EMSDK_PYTHON!
<_ForceRelease Condition="$([MSBuild]::IsOSPlatform('Windows')) and '$(TargetArchitecture)' == 'wasm' and '$(Configuration)' == 'Debug'">true
@@ -685,6 +696,7 @@
+ <_MonoSkipInitCompiler>true
linux-x86_64
darwin-x86_64
windows-x86_64
@@ -718,9 +730,18 @@
+
+
+
+ <_MonoAotBuildEnv Include="TARGET_BUILD_ARCH=arm64" />
+ <_MonoAotBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/aarch64-linux-gnu/pkgconfig" />
+
+
<_MonoAOTCFLAGSOption>-DCMAKE_C_FLAGS="@(_MonoAOTCPPFLAGS, ' ') @(_MonoAOTCFLAGS, ' ')"
<_MonoAOTCXXFLAGSOption>-DCMAKE_CXX_FLAGS="@(_MonoAOTCPPFLAGS, ' ') @(_MonoAOTCXXFLAGS, ' ')"
+ <_MonoLLVMTargetArchitecture>$(BuildArchitecture)
+ <_MonoLLVMTargetArchitecture Condition="'$(RealTargetArchitecture)' != ''">$(RealTargetArchitecture)
@@ -736,7 +757,7 @@
-
+
@@ -746,13 +767,17 @@
+ <_MonoSkipInitCompiler Condition="'$(RealTargetArchitecture)' != '' and '$(RealTargetArchitecture)' != '$(BuildArchitecture)'">false
<_MonoAotCrossOffsetsCommand Condition="'$(MonoUseCrossTool)' == 'true'">$(PythonCmd) $(MonoProjectRoot)mono/tools/offsets-tool/offsets-tool.py @(MonoAotCrossOffsetsToolParams, ' ')
- <_MonoAotCMakeConfigureCommand>cmake @(MonoAOTCMakeArgs, ' ') $(MonoProjectRoot)
- <_MonoAotCMakeConfigureCommand Condition="'$(HostOS)' == 'windows'">call "$(RepositoryEngineeringDir)native\init-vs-env.cmd" $(_CompilerTargetArch) && cd /D "$(MonoObjCrossDir)" && @(_MonoBuildEnv, ' ') $(_MonoAotCMakeConfigureCommand)
+ <_MonoAotCMakeConfigureCommand>cmake @(MonoAOTCMakeArgs, ' ') $(MonoCMakeExtraArgs) "$(MonoProjectRoot.TrimEnd('\/'))"
+ <_MonoAotCMakeConfigureCommand Condition="'$(_MonoSkipInitCompiler)' != 'true' and '$(HostOS)' != 'windows'">sh -c 'build_arch="$(_CompilerTargetArch)" compiler="$(MonoCCompiler)" . "$(RepositoryEngineeringCommonDir)native/init-compiler.sh" && @(_MonoAotBuildEnv, ' ') $(_MonoAotCMakeConfigureCommand)'
+ <_MonoAotCMakeConfigureCommand Condition="'$(_MonoSkipInitCompiler)' == 'true' and '$(HostOS)' != 'windows'">$(_MonoAOTCCOption) $(_MonoAOTCXXOption) @(_MonoAotBuildEnv, ' ') $(_MonoAotCMakeConfigureCommand)
+ <_MonoAotCMakeConfigureCommand Condition="'$(HostOS)' == 'windows'">call "$(RepositoryEngineeringDir)native\init-vs-env.cmd" $(_CompilerTargetArch) && cd /D "$(MonoObjCrossDir)" && @(_MonoAotBuildEnv, ' ') $(_MonoAotCMakeConfigureCommand)
<_MonoAotCMakeBuildCommand>cmake --build . --target install --config $(Configuration)
<_MonoAotCMakeBuildCommand Condition="'$(MonoVerboseBuild)' == 'true'">$(_MonoAotCMakeBuildCommand) --verbose
<_MonoAotCMakeBuildCommand Condition="'$(_MonoUseNinja)' != 'true'">$(_MonoAotCMakeBuildCommand) --parallel $([System.Environment]::ProcessorCount)
- <_MonoAotCMakeBuildCommand Condition="'$(HostOS)' == 'windows'">call "$(RepositoryEngineeringDir)native\init-vs-env.cmd" $(_CompilerTargetArch) && cd /D "$(MonoObjCrossDir)" && @(_MonoBuildEnv, ' ') $(_MonoAotCMakeBuildCommand)
+ <_MonoAotCMakeBuildCommand Condition="'$(HostOS)' != 'windows'">@(_MonoAotBuildEnv, ' ') $(_MonoAotCMakeBuildCommand)
+ <_MonoAotCMakeBuildCommand Condition="'$(HostOS)' == 'windows'">call "$(RepositoryEngineeringDir)native\init-vs-env.cmd" $(_CompilerTargetArch) && cd /D "$(MonoObjCrossDir)" && @(_MonoAotBuildEnv, ' ') $(_MonoAotCMakeBuildCommand)
<_MonoAotPrebuiltOffsetsFile>$(ArtifactsObjDir)\mono\offsetfiles\$(PlatformConfigPathPart)\cross\$([System.IO.Path]::GetFileName('$(MonoAotOffsetsFile)'))
@@ -812,6 +837,10 @@
<_MonoAotCrossFilePath>$(MonoObjCrossDir)out\bin\$(MonoAotCrossFileName)
<_MonoAotCrossPdbFilePath>$(MonoObjCrossDir)out\bin\$(MonoAotCrossPdbFileName)
+
+ <_MonoLLVMTargetArchitecture>$(BuildArchitecture)
+ <_MonoLLVMTargetArchitecture Condition="'$(TargetArchitecture)' != 'wasm' and '$(RealTargetArchitecture)' != ''">$(RealTargetArchitecture)
+
@@ -844,16 +873,16 @@
<_MonoRuntimeArtifacts Include="$(_MonoAotCrossPdbFilePath)" Condition="Exists('$(_MonoAotCrossPdbFilePath)')">
$(RuntimeBinDir)cross\$(PackageRID)\$(MonoAotCrossPdbFileName)
- <_MonoRuntimeArtifacts Condition="'$(MonoBundleLLVMOptimizer)' == 'true'" Include="$(MonoLLVMDir)\bin\llc$(ExeSuffix)">
+ <_MonoRuntimeArtifacts Condition="'$(MonoBundleLLVMOptimizer)' == 'true'" Include="$(MonoLLVMDir)\$(_MonoLLVMTargetArchitecture)\bin\llc$(ExeSuffix)">
$(RuntimeBinDir)\llc$(ExeSuffix)
- <_MonoRuntimeArtifacts Condition="'$(MonoBundleLLVMOptimizer)' == 'true'" Include="$(MonoLLVMDir)\bin\opt$(ExeSuffix)">
+ <_MonoRuntimeArtifacts Condition="'$(MonoBundleLLVMOptimizer)' == 'true'" Include="$(MonoLLVMDir)\$(_MonoLLVMTargetArchitecture)\bin\opt$(ExeSuffix)">
$(RuntimeBinDir)\opt$(ExeSuffix)
- <_MonoRuntimeArtifacts Condition="'$(MonoAOTBundleLLVMOptimizer)' == 'true'" Include="$(MonoAOTLLVMDir)\bin\llc$(ExeSuffix)">
+ <_MonoRuntimeArtifacts Condition="'$(MonoAOTBundleLLVMOptimizer)' == 'true'" Include="$(MonoLLVMDir)\$(_MonoLLVMTargetArchitecture)\bin\llc$(ExeSuffix)">
$(RuntimeBinDir)cross\$(PackageRID)\llc$(ExeSuffix)
- <_MonoRuntimeArtifacts Condition="'$(MonoAOTBundleLLVMOptimizer)' == 'true'" Include="$(MonoAOTLLVMDir)\bin\opt$(ExeSuffix)">
+ <_MonoRuntimeArtifacts Condition="'$(MonoAOTBundleLLVMOptimizer)' == 'true'" Include="$(MonoLLVMDir)\$(_MonoLLVMTargetArchitecture)\bin\opt$(ExeSuffix)">
$(RuntimeBinDir)cross\$(PackageRID)\opt$(ExeSuffix)
<_MonoIncludeArtifacts Include="$(MonoObjDir)out\include\**" />
diff --git a/src/mono/monoaotcross.proj b/src/mono/monoaotcross.proj
index 37b5a6a2d609305a0be32dce0a93ba8495e85f25..7d8b2a10a31c0d3599ac361dfde91ca4b8e53005 100644
--- a/src/mono/monoaotcross.proj
+++ b/src/mono/monoaotcross.proj
@@ -38,7 +38,7 @@
+ Properties="TargetArchitecture=$(MonoAotTargetArchitecture);TargetOS=$(MonoAotTargetOS);RealTargetArchitecture=$(TargetArchitecture)" />