diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e0d0e309c8071..3ca5d77b2961e 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -12,69 +12,69 @@ https://github.com/dotnet/wcf 7f504aabb1988e9a093c1e74d8040bd52feb2f01 - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - 76f334f354eb653a7b409a5319b591ea09df5a43 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - 76f334f354eb653a7b409a5319b591ea09df5a43 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - 76f334f354eb653a7b409a5319b591ea09df5a43 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - 76f334f354eb653a7b409a5319b591ea09df5a43 + bd3acea90cae502d9a62164b863708d57d7993bc https://github.com/dotnet/command-line-api @@ -238,45 +238,45 @@ https://github.com/dotnet/runtime-assets f8fb817328383c60534d11d57fd884d3b527d6c2 - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc - + https://github.com/dotnet/llvm-project - ac5ae64268db036eb394ed3f4d3f41775e251c58 + bd3acea90cae502d9a62164b863708d57d7993bc https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 5f81f25b9c5a8..95ca08ca62d1c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -105,14 +105,14 @@ 6.0.0 8.0.0-preview.7.23325.2 - 14.0.0-alpha.1.23326.1 - 14.0.0-alpha.1.23326.1 - 14.0.0-alpha.1.23326.1 - 14.0.0-alpha.1.23326.1 - 14.0.0-alpha.1.23326.1 - 14.0.0-alpha.1.23326.1 - 1.0.0-alpha.1.23106.1 - 1.0.0-alpha.1.23106.1 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 6.0.0 1.1.1 @@ -217,16 +217,16 @@ 2.1.7 8.0.0-alpha.1.23180.2 - 14.0.0-alpha.1.23326.1 - 14.0.0-alpha.1.23326.1 - 14.0.0-alpha.1.23326.1 - 14.0.0-alpha.1.23326.1 - 14.0.0-alpha.1.23326.1 - 14.0.0-alpha.1.23326.1 - 14.0.0-alpha.1.23326.1 - 14.0.0-alpha.1.23326.1 - 14.0.0-alpha.1.23326.1 - 14.0.0-alpha.1.23326.1 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 - 14.0.0-alpha.1.23326.1 - 14.0.0-alpha.1.23326.1 - 14.0.0-alpha.1.23326.1 - 14.0.0-alpha.1.23326.1 - 14.0.0-alpha.1.23326.1 - 14.0.0-alpha.1.23326.1 - 1.0.0-alpha.1.23106.1 - 1.0.0-alpha.1.23106.1 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 + 16.0.5-alpha.1.23330.2 3.1.7 1.0.406601 diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml index cf93d34062b7d..ccf969e5b5764 100644 --- a/eng/pipelines/common/global-build-job.yml +++ b/eng/pipelines/common/global-build-job.yml @@ -86,12 +86,6 @@ jobs: - name: ROOTFS_DIR value: ${{ parameters.jobParameters.crossrootfsDir }} - - name: _cxx11Parameter - ${{ if and(eq(parameters.osGroup, 'linux'), eq(parameters.archType, 'arm64')) }}: - value: /p:MonoLLVMUseCxx11Abi=true - ${{ if and(eq(parameters.osGroup, 'linux'), not(eq(parameters.archType, 'arm64'))) }}: - value: /p:MonoLLVMUseCxx11Abi=false - - name: _officialBuildParameter ${{ if eq(parameters.isOfficialBuild, true) }}: value: /p:OfficialBuildId=$(Build.BuildNumber) @@ -190,7 +184,7 @@ jobs: - task: CodeQL3000Init@0 displayName: Initialize CodeQL (manually-injected) - - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) $(crossArg) ${{ parameters.buildArgs }} $(_officialBuildParameter) $(_cxx11Parameter) $(_buildDarwinFrameworksParameter) $(_overrideTestScriptWindowsCmdParameter) + - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) $(crossArg) ${{ parameters.buildArgs }} $(_officialBuildParameter) $(_buildDarwinFrameworksParameter) $(_overrideTestScriptWindowsCmdParameter) displayName: Build product ${{ if eq(parameters.useContinueOnErrorDuringBuild, true) }}: continueOnError: ${{ parameters.shouldContinueOnError }} diff --git a/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml b/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml index e531acb638415..3da6cc22300cd 100644 --- a/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml +++ b/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml @@ -50,7 +50,6 @@ steps: /p:BuildMonoAotCrossCompilerOnly=true /p:MonoLibClang="/usr/local/lib/libclang.so.16" /p:MonoAOTEnableLLVM=true - /p:MonoAOTLLVMUseCxx11Abi=true /p:CrossBuild=true displayName: "Build Mono LLVM AOT cross compiler" diff --git a/eng/pipelines/common/templates/runtimes/run-test-job.yml b/eng/pipelines/common/templates/runtimes/run-test-job.yml index 296ac081a0440..766783e00c793 100644 --- a/eng/pipelines/common/templates/runtimes/run-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/run-test-job.yml @@ -293,7 +293,6 @@ jobs: /p:BuildMonoAotCrossCompilerOnly=true /p:MonoLibClang="/usr/local/lib/libclang.so.16" /p:MonoAOTEnableLLVM=true - /p:MonoAOTLLVMUseCxx11Abi=true displayName: "Build Mono LLVM AOT cross compiler" - ${{ if and(eq(parameters.runtimeFlavor, 'mono'), or(eq(parameters.runtimeVariant, 'llvmaot'), eq(parameters.runtimeVariant, 'llvmfullaot'))) }}: diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-other.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-other.yml index ca2aed4c166c0..40f75bfbd7c9a 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-other.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-other.yml @@ -334,7 +334,7 @@ jobs: testGroup: innerloop nameSuffix: AllSubsets_Mono_LLVMFullAot_RuntimeTests runtimeVariant: llvmfullaot - buildArgs: -s mono+libs+clr.hosts+clr.iltools -c Release /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=true /p:MonoLLVMUseCxx11Abi=true + buildArgs: -s mono+libs+clr.hosts+clr.iltools -c Release /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=true timeoutInMinutes: 300 condition: >- diff --git a/eng/pipelines/mono/templates/build-job.yml b/eng/pipelines/mono/templates/build-job.yml index 2c3fc2c45cf1c..b1ac9c1cc6554 100644 --- a/eng/pipelines/mono/templates/build-job.yml +++ b/eng/pipelines/mono/templates/build-job.yml @@ -104,15 +104,12 @@ jobs: value: wasm - name: osOverride value: '-os wasi' - - ${{ 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 $(llvmCxxAbi) + value: /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=false - ${{ if eq(parameters.runtimeVariant, 'llvmaot') }}: - name: llvmParameter - value: /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=true $(llvmCxxAbi) + value: /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=true - ${{ if gt(length(parameters.monoCrossAOTTargetOS),0) }}: - name: aotCrossParameter value: /p:MonoCrossAOTTargetOS=${{join('+',parameters.monoCrossAOTTargetOS)}} /p:SkipMonoCrossJitConfigure=true /p:BuildMonoAOTCrossCompilerOnly=true diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml index 9aa97b9034a3c..3e3d3431a35a0 100644 --- a/eng/pipelines/runtime-official.yml +++ b/eng/pipelines/runtime-official.yml @@ -157,7 +157,7 @@ extends: - windows_x86 # - windows_arm64 jobParameters: - buildArgs: -s mono+libs+host+packs -c $(_BuildConfig) + buildArgs: -s mono+libs+host+packs -c $(_BuildConfig) /p:BuildMonoAOTCrossCompiler=false nameSuffix: AllSubsets_Mono isOfficialBuild: ${{ variables.isOfficialBuild }} extraStepsTemplate: /eng/pipelines/common/upload-intermediate-artifacts-step.yml diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 4731612916c65..b97d380610af0 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -1225,7 +1225,7 @@ extends: testGroup: innerloop nameSuffix: AllSubsets_Mono_LLVMAot_RuntimeTests runtimeVariant: llvmaot - buildArgs: -s mono+libs+clr.hosts+clr.iltools -c Release /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=true /p:MonoLLVMUseCxx11Abi=true + buildArgs: -s mono+libs+clr.hosts+clr.iltools -c Release /p:MonoEnableLLVM=true /p:MonoBundleLLVMOptimizer=true timeoutInMinutes: 180 condition: >- diff --git a/src/coreclr/tools/SuperFileCheck/SuperFileCheck.csproj b/src/coreclr/tools/SuperFileCheck/SuperFileCheck.csproj index 7c76b9fa817b4..b954034a29b22 100644 --- a/src/coreclr/tools/SuperFileCheck/SuperFileCheck.csproj +++ b/src/coreclr/tools/SuperFileCheck/SuperFileCheck.csproj @@ -23,10 +23,6 @@ linux - - osx.10.12 - osx.11.0 - x64 arm64 @@ -38,8 +34,8 @@ $(runtimelinuxmuslx64MicrosoftNETCoreRuntimeJITToolsVersion) $(runtimewinarm64MicrosoftNETCoreRuntimeJITToolsVersion) $(runtimewinx64MicrosoftNETCoreRuntimeJITToolsVersion) - $(runtimeosx110arm64MicrosoftNETCoreRuntimeJITToolsVersion) - $(runtimeosx1012x64MicrosoftNETCoreRuntimeJITToolsVersion) + $(runtimeosxarm64MicrosoftNETCoreRuntimeJITToolsVersion) + $(runtimeosxx64MicrosoftNETCoreRuntimeJITToolsVersion) diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler.props b/src/coreclr/tools/aot/ILCompiler/ILCompiler.props index 247c50653e20b..17c95600f15e7 100644 --- a/src/coreclr/tools/aot/ILCompiler/ILCompiler.props +++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler.props @@ -33,10 +33,6 @@ linux - - osx.10.12 - osx.11.0 - $(ObjWriterRidWithoutPlatform)-$(ObjWriterRidPlatform) $(runtimelinuxarm64MicrosoftNETCoreRuntimeObjWriterVersion) @@ -45,8 +41,8 @@ $(runtimelinuxmuslx64MicrosoftNETCoreRuntimeObjWriterVersion) $(runtimewinarm64MicrosoftNETCoreRuntimeObjWriterVersion) $(runtimewinx64MicrosoftNETCoreRuntimeObjWriterVersion) - $(runtimeosx110arm64MicrosoftNETCoreRuntimeObjWriterVersion) - $(runtimeosx1012x64MicrosoftNETCoreRuntimeObjWriterVersion) + $(runtimeosxarm64MicrosoftNETCoreRuntimeObjWriterVersion) + $(runtimeosxx64MicrosoftNETCoreRuntimeObjWriterVersion) $(runtimefreebsdx64MicrosoftNETCoreRuntimeObjWriterVersion) $(runtimefreebsdarm64MicrosoftNETCoreRuntimeObjWriterVersion) diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props b/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props index 36ee8d1a75710..f13859dc19932 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props @@ -199,6 +199,9 @@ + + + diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index 97c2ac015caf4..a351ab717d0b2 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -602,27 +602,58 @@ if(LLVM_PREFIX) 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() + elseif(${llvm_api_version} LESS 1600) set(MONO_llvm_core_libs ${MONO_llvm_core_libs} "LLVMObjCARCOpts" "LLVMMCDisassembler" "LLVMOrcTargetProcess" "LLVMOrcShared" "LLVMDebugInfoDWARF") + else() + set(MONO_llvm_core_libs ${MONO_llvm_core_libs} "LLVMIRPrinter" "LLVMCodeGen" "LLVMObjCARCOpts" "LLVMMCDisassembler" "LLVMWindowsDriver" "LLVMOption" "LLVMOrcTargetProcess" "LLVMOrcShared" "LLVMSymbolize" "LLVMDebugInfoPDB" "LLVMDebugInfoMSF" "LLVMDebugInfoDWARF" "LLVMTargetParser") 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") + if(${llvm_api_version} GREATER_EQUAL 1600) + set(MONO_llvm_extra_libs_x86codegen ${MONO_llvm_extra_libs_x86codegen} "LLVMInstrumentation" "LLVMObjCARCOpts" "LLVMSymbolize" "LLVMDebugInfoPDB" "LLVMIRReader" "LLVMAsmParser" "LLVMTargetParser") + endif() # 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") + if(${llvm_api_version} GREATER_EQUAL 1600) + set(MONO_llvm_extra_libs_armcodegen ${MONO_llvm_extra_libs_armcodegen} "LLVMipo" "LLVMInstrumentation" "LLVMVectorize" "LLVMLinker" "LLVMFrontendOpenMP" "LLVMObjCARCOpts" "LLVMSymbolize" "LLVMDebugInfoPDB" "LLVMIRReader" "LLVMAsmParser" "LLVMTargetParser") + endif() # 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") + if(${llvm_api_version} GREATER_EQUAL 1600) + set(MONO_llvm_extra_libs_aarch64codegen ${MONO_llvm_extra_libs_aarch64codegen} "LLVMObjCARCOpts" "LLVMSymbolize" "LLVMDebugInfoPDB" "LLVMIRReader" "LLVMAsmParser" "LLVMTargetParser") + endif() + + if(HOST_LINUX AND NOT HOST_WASM AND NOT HOST_WASI AND ${llvm_api_version} GREATER_EQUAL 1600) + set(MONO_stdlib "-stdlib=libc++") + set(MONO_cxx_lib "-L${LLVM_PREFIX}/lib -lc++") + set(MONO_cxx_include "-I${LLVM_PREFIX}/include/c++/v1") + endif() + + if(${llvm_api_version} GREATER_EQUAL 1600) + if(HOST_WIN32) + set(MONO_cxx_std_version "/std:c++17") + else() + set(MONO_cxx_std_version "-std=c++17") + endif() + else() + if(HOST_WIN32) + set(MONO_cxx_std_version "/std:c++14") + else() + set(MONO_cxx_std_version "-std=c++14") + endif() + endif() # 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_cxxflags "-I${LLVM_PREFIX}/include ${MONO_cxx_include} ${MONO_cxx_std_version} ${MONO_stdlib} -fno-exceptions -fno-rtti -D__STDC_CONSTANT_MACROS -D__STD_FORMAT_MACROS -D__STDC_LIMIT_MACROS") set(llvm_includedir "${LLVM_PREFIX}/include") if(HOST_LINUX) # llvm-config --system-libs - set(llvm_system_libs "-lz" "-lrt" "-ldl" "-lpthread" "-lm") + set(llvm_system_libs ${MONO_cxx_lib} "-lz" "-lrt" "-ldl" "-lpthread" "-lm") elseif(HOST_OSX) # llvm-config --system-libs set(llvm_system_libs "-lz" "-lm") diff --git a/src/mono/Directory.Build.props b/src/mono/Directory.Build.props index a7a5977b72e90..3bf460330a1c9 100644 --- a/src/mono/Directory.Build.props +++ b/src/mono/Directory.Build.props @@ -50,8 +50,8 @@ true true true - <_MonoUseLLVMPackage Condition="'$(MonoLLVMDir)' == '' and ('$(MonoEnableLLVM)' == 'true' or $(MonoAOTEnableLLVM) == 'true')">true - $([MSBuild]::NormalizeDirectory('$(MonoObjDir)', 'llvm')) + true + $([MSBuild]::NormalizeDirectory('$(MonoObjDir)', 'llvm')) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 3947c7b4b4eab..7cfff98ac8eb3 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -55,6 +55,8 @@ false true true + $(runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion.Substring(0, $(runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion.IndexOf('.')))) + true @@ -253,8 +255,8 @@ - <_MonoLLVMTargetArchitecture Condition="'$(TargetArchitecture)' == 'wasm'">$(BuildArchitecture) - <_MonoLLVMTargetArchitecture Condition="'$(TargetArchitecture)' != 'wasm'">$(TargetArchitecture) + <_MonoLLVMTargetArchitecture Condition="'$(TargetArchitecture)' == 'wasm' and '$(MonoUseLLVMPackage)' == 'true'">$(BuildArchitecture) + <_MonoLLVMTargetArchitecture Condition="'$(TargetArchitecture)' != 'wasm' and '$(MonoUseLLVMPackage)' == 'true'">$(TargetArchitecture) <_MonoCMakeArgs Condition="'$(_MonoUseNinja)' == 'true'" Include="-G Ninja"/> @@ -270,20 +272,11 @@ <_MonoCMakeArgs Include="-DMONO_SHARED_LIB_NAME=$(MonoSharedLibName)" /> - - - <_MonoCXXFLAGS Include="-D_GLIBCXX_USE_CXX11_ABI=0" /> - - - <_MonoAOTCXXFLAGS Include="-D_GLIBCXX_USE_CXX11_ABI=0" /> - - - - - <_MonoCXXFLAGS Include="-D_GLIBCXX_USE_CXX11_ABI=1" /> - - - <_MonoAOTCXXFLAGS Include="-D_GLIBCXX_USE_CXX11_ABI=1" /> + + <_MonoCXXFLAGS Include="-I$(MonoLLVMDir)\$(_MonoLLVMTargetArchitecture)\include\c++\v1" /> + <_MonoCXXFLAGS Include="-L$(MonoLLVMDir)\$(_MonoLLVMTargetArchitecture)\lib" /> + <_MonoCXXFLAGS Include="-stdlib=libc++" /> + <_MonoCMakeArgs Include="-DMONO_SET_RPATH_ORIGIN=true" /> @@ -706,16 +699,23 @@ - <_MonoLLVMTargetArchitecture>$(BuildArchitecture) - <_MonoLLVMTargetArchitecture Condition="'$(AotHostArchitecture)' != ''">$(AotHostArchitecture) + <_MonoLLVMTargetArchitecture Condition="'$(MonoUseLLVMPackage)' == 'true'">$(BuildArchitecture) + <_MonoLLVMTargetArchitecture Condition="'$(AotHostArchitecture)' != '' and '$(MonoUseLLVMPackage)' == 'true'">$(AotHostArchitecture) + + <_MonoAOTCXXFLAGS Include="-I$(MonoLLVMDir)\$(_MonoLLVMTargetArchitecture)\include\c++\v1" /> + <_MonoAOTCXXFLAGS Include="-L$(MonoLLVMDir)\$(_MonoLLVMTargetArchitecture)\lib" /> + <_MonoAOTCXXFLAGS Include="-stdlib=libc++" /> + + + - - - - + + + + <_MonoAOTCFLAGS Condition="'$(AotHostArchitecture)' == 'arm64'" Include="-arch arm64" /> @@ -951,6 +951,18 @@ <_MonoRuntimeArtifacts Include="$(_MonoAotCrossFilePath)"> $(RuntimeBinDir)cross\$(OutputRID)\$(MonoAotCrossFileName) + <_MonoRuntimeArtifacts Condition="'$(HostOS)' == 'Linux' and '$(MonoEnableLLVM)' == 'true' and '$(TargetArchitecture)' != 'wasm' and '$(MonoUseLibCxx)' == 'true'" Include="$(MonoLLVMDir)\$(_MonoLLVMTargetArchitecture)\lib\libc++.so.1"> + $(RuntimeBinDir)libc++.so.1 + + <_MonoRuntimeArtifacts Condition="'$(HostOS)' == 'Linux' and '$(MonoEnableLLVM)' == 'true' and '$(TargetArchitecture)' != 'wasm' and '$(MonoUseLibCxx)' == 'true'" Include="$(MonoLLVMDir)\$(_MonoLLVMTargetArchitecture)\lib\libc++abi.so.1"> + $(RuntimeBinDir)libc++abi.so.1 + + <_MonoRuntimeArtifacts Condition="'$(HostOS)' == 'Linux' and (('$(MonoAOTEnableLLVM)' == 'true' and '$(MonoUseLibCxx)' == 'true') or '$(TargetArchitecture)' == 'wasm')" Include="$(MonoLLVMDir)\$(_MonoLLVMTargetArchitecture)\lib\libc++.so.1"> + $(RuntimeBinDir)cross\$(OutputRID)\libc++.so.1 + + <_MonoRuntimeArtifacts Condition="'$(HostOS)' == 'Linux' and (('$(MonoAOTEnableLLVM)' == 'true' and '$(MonoUseLibCxx)' == 'true') or '$(TargetArchitecture)' == 'wasm')" Include="$(MonoLLVMDir)\$(_MonoLLVMTargetArchitecture)\lib\libc++abi.so.1"> + $(RuntimeBinDir)cross\$(OutputRID)\libc++abi.so.1 + <_MonoRuntimeArtifacts Include="$(_MonoAotCrossPdbFilePath)" Condition="Exists('$(_MonoAotCrossPdbFilePath)')"> $(RuntimeBinDir)cross\$(OutputRID)\$(MonoAotCrossPdbFileName) diff --git a/src/mono/mono/mini/CMakeLists.txt b/src/mono/mono/mini/CMakeLists.txt index 54f20529261c8..324d09809ceaf 100644 --- a/src/mono/mono/mini/CMakeLists.txt +++ b/src/mono/mono/mini/CMakeLists.txt @@ -383,6 +383,9 @@ if(NOT DISABLE_SHARED_LIBS) target_link_libraries(monosgen-shared PRIVATE ucontext) endif(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X) set_target_properties(monosgen-shared PROPERTIES OUTPUT_NAME ${MONO_SHARED_LIB_NAME}) + if(MONO_SET_RPATH_ORIGIN) + set_target_properties(monosgen-shared PROPERTIES INSTALL_RPATH "$ORIGIN") + endif() target_link_libraries(monosgen-shared PRIVATE monoapi eglib_objects utils_objects sgen_objects metadata_objects) if(HAVE_ICU_SHIM) target_link_libraries(monosgen-shared PRIVATE icu_shim_objects) @@ -548,6 +551,9 @@ if(NOT DISABLE_EXECUTABLES) add_executable(mono-sgen "${sgen_sources}") if(MONO_CROSS_COMPILE_EXECUTABLE_NAME) set_target_properties(mono-sgen PROPERTIES OUTPUT_NAME mono-aot-cross) + if(MONO_SET_RPATH_ORIGIN) + set_target_properties(mono-sgen PROPERTIES INSTALL_RPATH "$ORIGIN") + endif() endif() target_link_libraries(mono-sgen PRIVATE monoapi eglib_api monosgen-static) if(HAVE_ICU_SHIM) diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c index 35d73ccccfa05..faa6be18c08fc 100644 --- a/src/mono/mono/mini/aot-compiler.c +++ b/src/mono/mono/mini/aot-compiler.c @@ -10726,7 +10726,14 @@ emit_llvm_file (MonoAotCompile *acfg) // FIXME: This doesn't work yet opts = g_strdup (""); } else { -#if LLVM_API_VERSION >= 1300 +#if LLVM_API_VERSION >= 1600 + /* The safepoints pass requires new pass manager syntax*/ + opts = g_strdup ("-disable-tail-calls -passes='"); + if (!acfg->aot_opts.llvm_only) { + opts = g_strdup_printf ("%sdefault,", opts); + } + opts = g_strdup_printf ("%splace-safepoints' -spp-all-backedges", opts); +#elif LLVM_API_VERSION >= 1300 /* The safepoints pass requires the old pass manager */ opts = g_strdup ("-disable-tail-calls -place-safepoints -spp-all-backedges -enable-new-pm=0"); #else @@ -10736,8 +10743,10 @@ emit_llvm_file (MonoAotCompile *acfg) if (acfg->aot_opts.llvm_opts) { opts = g_strdup_printf ("%s %s", acfg->aot_opts.llvm_opts, opts); +#if LLVM_API_VERSION < 1600 } else if (!acfg->aot_opts.llvm_only) { opts = g_strdup_printf ("-O2 %s", opts); +#endif } if (acfg->aot_opts.use_current_cpu) { diff --git a/src/mono/mono/mini/mini-llvm-cpp.cpp b/src/mono/mono/mini/mini-llvm-cpp.cpp index cd8503aee3828..b50eb471fa924 100644 --- a/src/mono/mono/mini/mini-llvm-cpp.cpp +++ b/src/mono/mono/mini/mini-llvm-cpp.cpp @@ -37,6 +37,15 @@ #pragma warning(disable:4800) // type' : forcing value to bool 'true' or 'false' (performance warning) #endif +// ArrayRef API is deprecated on C++17 +#if defined(__clang__) && (_LIBCPP_STD_VER > 17 || defined(__APPLE__)) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif +#ifdef _MSC_VER +#pragma warning(disable:4996) +#endif + #include #include #include diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c index 2c7e25a927688..c0b8cda575aec 100644 --- a/src/mono/mono/mini/mini-llvm.c +++ b/src/mono/mono/mini/mini-llvm.c @@ -2151,9 +2151,11 @@ get_callee_llvmonly (EmitContext *ctx, LLVMTypeRef llvm_sig, MonoJumpInfoType ty g_hash_table_insert (ctx->module->direct_callables, (char*)callee_name, callee); } else { +#ifndef USE_OPAQUE_POINTERS /* LLVMTypeRef's are uniqued */ if (LLVMGetElementType (LLVMTypeOf (callee)) != llvm_sig) return LLVMConstBitCast (callee, pointer_type (llvm_sig)); +#endif g_free (callee_name); } @@ -4411,7 +4413,8 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref, vretaddr = (cinfo->ret.storage == LLVMArgVtypeRetAddr || cinfo->ret.storage == LLVMArgVtypeByRef || cinfo->ret.storage == LLVMArgGsharedvtFixed || cinfo->ret.storage == LLVMArgGsharedvtVariable || cinfo->ret.storage == LLVMArgGsharedvtFixedVtype); - llvm_sig = sig_to_llvm_sig_full (ctx, sig, cinfo, NULL); + LLVMTypeRef *param_etypes; + llvm_sig = sig_to_llvm_sig_full (ctx, sig, cinfo, ¶m_etypes); if (!ctx_ok (ctx)) return; @@ -4767,7 +4770,7 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref, #endif if (is_byval) - mono_llvm_add_instr_byval_attr (lcall, 1 + ainfo->pindex, LLVMGetElementType (param_types [ainfo->pindex])); + mono_llvm_add_instr_byval_attr (lcall, 1 + ainfo->pindex, param_etypes [ainfo->pindex]); } MonoClass *retclass = mono_class_from_mono_type_internal (sig->ret); @@ -5053,7 +5056,7 @@ emit_llvmonly_landing_pad (EmitContext *ctx, int group_index, int group_size) /* Return the value set in ctx->il_state_ret */ - LLVMTypeRef ret_type = LLVMGetReturnType (LLVMGetElementType (LLVMTypeOf (ctx->lmethod))); + LLVMTypeRef ret_type = LLVMGetReturnType (ctx->method_type); LLVMValueRef addr, retval, gep, indexes [2]; builder = ctx->builder; @@ -5956,9 +5959,11 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) int width = mono_type_size (sig->ret, NULL); int elems = width / TARGET_SIZEOF_VOID_P; /* The return value might not be set if there is a throw */ - LLVMValueRef val = build_ptr_cast (builder, lhs, LLVMVectorType (IntPtrType (), elems)); + LLVMValueRef val = LLVMBuildBitCast (builder, lhs, LLVMVectorType (IntPtrType (), elems), ""); for (int i = 0; i < elems; ++i) { + LLVMTypeRef etype = LLVMStructGetTypeAtIndex (LLVMTypeOf (retval), i); LLVMValueRef element = LLVMBuildExtractElement (builder, val, const_int32 (i), ""); + element = convert (ctx, element, etype); retval = LLVMBuildInsertValue (builder, retval, element, i, "setret_simd_vtype_in_reg"); } } else { @@ -6432,6 +6437,32 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) case OP_SHR_UN_IMM: { LLVMValueRef imm; + gboolean shift_ovf = FALSE; + gboolean shift_i8 = FALSE; + switch (ins->opcode) { + case OP_ISHL_IMM: + case OP_ISHR_IMM: + case OP_ISHR_UN_IMM: + if (ins->inst_imm < 0 || ins->inst_imm >= 32) + shift_ovf = TRUE; + break; + case OP_LSHL_IMM: + case OP_LSHR_IMM: + case OP_LSHR_UN_IMM: + if (ins->inst_imm < 0 || ins->inst_imm >= 64) + shift_ovf = TRUE; + shift_i8 = TRUE; + break; + case OP_SHL_IMM: + case OP_SHR_IMM: + case OP_SHR_UN_IMM: + if (ins->inst_imm < 0 || ins->inst_imm >= TARGET_SIZEOF_VOID_P * 8) + shift_ovf = TRUE; + break; + default: + break; + } + if (spec [MONO_INST_SRC1] == 'l') { imm = const_int64 (GET_LONG_IMM (ins)); } else { @@ -6444,9 +6475,12 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) builder = ctx->builder; #if TARGET_SIZEOF_VOID_P == 4 - if (ins->opcode == OP_LSHL_IMM || ins->opcode == OP_LSHR_IMM || ins->opcode == OP_LSHR_UN_IMM) + if (shift_i8) imm = const_int32 (ins->inst_imm); #endif + if (shift_i8) + /* The IL might not be regular */ + lhs = convert (ctx, lhs, LLVMInt64Type ()); if (LLVMGetTypeKind (LLVMTypeOf (lhs)) == LLVMPointerTypeKind) lhs = convert (ctx, lhs, IntPtrType ()); @@ -6496,7 +6530,10 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) break; case OP_ISHL_IMM: case OP_LSHL_IMM: - values [ins->dreg] = LLVMBuildShl (builder, lhs, imm, dname); + if (shift_ovf) + values [ins->dreg] = LLVMConstNull (LLVMTypeOf (lhs)); + else + values [ins->dreg] = LLVMBuildShl (builder, lhs, imm, dname); break; case OP_SHL_IMM: MONO_DISABLE_WARNING(4127) /* conditional expression is constant */ @@ -6506,22 +6543,34 @@ MONO_DISABLE_WARNING(4127) /* conditional expression is constant */ imm = convert (ctx, imm, LLVMInt64Type ()); } MONO_RESTORE_WARNING - values [ins->dreg] = LLVMBuildShl (builder, lhs, imm, dname); + if (shift_ovf) + values [ins->dreg] = LLVMConstNull (LLVMTypeOf (lhs)); + else + values [ins->dreg] = LLVMBuildShl (builder, lhs, imm, dname); break; case OP_ISHR_IMM: case OP_LSHR_IMM: case OP_SHR_IMM: - values [ins->dreg] = LLVMBuildAShr (builder, lhs, imm, dname); + if (shift_ovf) + values [ins->dreg] = LLVMConstNull (LLVMTypeOf (lhs)); + else + values [ins->dreg] = LLVMBuildAShr (builder, lhs, imm, dname); break; case OP_ISHR_UN_IMM: /* This is used to implement conv.u4, so the lhs could be an i8 */ lhs = convert (ctx, lhs, LLVMInt32Type ()); imm = convert (ctx, imm, LLVMInt32Type ()); - values [ins->dreg] = LLVMBuildLShr (builder, lhs, imm, dname); + if (shift_ovf) + values [ins->dreg] = LLVMConstNull (LLVMTypeOf (lhs)); + else + values [ins->dreg] = LLVMBuildLShr (builder, lhs, imm, dname); break; case OP_LSHR_UN_IMM: case OP_SHR_UN_IMM: - values [ins->dreg] = LLVMBuildLShr (builder, lhs, imm, dname); + if (shift_ovf) + values [ins->dreg] = LLVMConstNull (LLVMTypeOf (lhs)); + else + values [ins->dreg] = LLVMBuildLShr (builder, lhs, imm, dname); break; default: g_assert_not_reached (); @@ -11967,6 +12016,12 @@ MONO_RESTORE_WARNING if (!ctx_ok (ctx)) break; +#if LLVM_API_VERSION >= 1600 + if (spec [MONO_INST_DEST] != ' ' && values [ins->dreg] && LLVMIsPoison (values [ins->dreg])) + /* These could be generated by float<->int conversions etc. */ + values [ins->dreg] = LLVMBuildFreeze (builder, values [ins->dreg], ""); +#endif + /* Convert the value to the type required by phi nodes */ if (spec [MONO_INST_DEST] != ' ' && !MONO_IS_STORE_MEMBASE (ins) && ctx->vreg_types [ins->dreg]) { if (ctx->is_vphi [ins->dreg]) @@ -12623,8 +12678,10 @@ emit_method_inner (EmitContext *ctx) is_byval |= ainfo->storage == LLVMArgVtypeByRef; #endif - if (is_byval) - mono_llvm_add_param_byval_attr (LLVMGetParam (method, pindex), LLVMGetElementType (LLVMTypeOf (LLVMGetParam (method, pindex)))); + if (is_byval) { + g_assert (ctx->param_etypes [pindex]); + mono_llvm_add_param_byval_attr (LLVMGetParam (method, pindex), ctx->param_etypes [pindex]); + } if (ainfo->storage == LLVMArgVtypeByRef || ainfo->storage == LLVMArgVtypeAddr) { /* For OP_LDADDR */ diff --git a/src/mono/mono/tools/offsets-tool/offsets-tool.py b/src/mono/mono/tools/offsets-tool/offsets-tool.py index 5f52ab268adc4..ab555b8d9db75 100644 --- a/src/mono/mono/tools/offsets-tool/offsets-tool.py +++ b/src/mono/mono/tools/offsets-tool/offsets-tool.py @@ -372,8 +372,11 @@ def gen (self): if type.size == -1: continue f.write ("DECL_SIZE2(%s,%s)\n" % (type.name, type.size)) + done_fields = {} for field in type.fields: - f.write ("DECL_OFFSET2(%s,%s,%s)\n" % (type.name, field.name, field.offset)) + if field.name not in done_fields: + f.write ("DECL_OFFSET2(%s,%s,%s)\n" % (type.name, field.name, field.offset)) + done_fields [field.name] = field.name f.write ("#endif //disable metadata check\n") f.write ("#ifndef DISABLE_JIT_OFFSETS\n") @@ -383,8 +386,11 @@ def gen (self): if type.size == -1: continue f.write ("DECL_SIZE2(%s,%s)\n" % (type.name, type.size)) + done_fields = {} for field in type.fields: - f.write ("DECL_OFFSET2(%s,%s,%s)\n" % (type.name, field.name, field.offset)) + if field.name not in done_fields: + f.write ("DECL_OFFSET2(%s,%s,%s)\n" % (type.name, field.name, field.offset)) + done_fields [field.name] = field.name f.write ("#endif //disable jit check\n") f.write ("#endif //cross compiler checks\n") diff --git a/src/tests/Common/Directory.Build.targets b/src/tests/Common/Directory.Build.targets index fd1d1af2c512e..fec20452b87bc 100644 --- a/src/tests/Common/Directory.Build.targets +++ b/src/tests/Common/Directory.Build.targets @@ -176,6 +176,8 @@ + +