Update to LLVM 14 (#1586)
* Skip incidental dependencies on manylinux This adds some explicit removals of external lib dependencies to avoid accidentally pulling them in from the manyLinux container environment. * Update llvm.yml * Update to LLVM 14 * update clangsharp * use earlier clangsharp * use 14.0.0-rc1 * Update nuget packages versions * Allow obsolete calls for non-opaque pointers. Co-authored-by: Bettina Heim <Bettina.Heim@microsoft.com> Co-authored-by: Ian Davis <ian.f.davis@gmail.com>
This commit is contained in:
Родитель
4a5aafab2b
Коммит
b830ba511a
|
@ -206,7 +206,7 @@ jobs:
|
|||
packagesToPack: '$(System.DefaultWorkingDirectory)/llvm-build/Microsoft.Quantum.LlvmBindings.Native.nuspec'
|
||||
packDestination: '$(Build.ArtifactStagingDirectory)'
|
||||
versioningScheme: 'byPrereleaseNumber'
|
||||
majorVersion: '13'
|
||||
majorVersion: '14'
|
||||
minorVersion: '0'
|
||||
patchVersion: '0'
|
||||
basePath: '$(System.DefaultWorkingDirectory)/llvm-build/'
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Quantum.LlvmBindings.Native" Version="13.0.0-CI-20220129-005156" PrivateAssets="All" GeneratePathProperty="true"/>
|
||||
<PackageReference Include="Microsoft.Quantum.LlvmBindings.Native" Version="13.0.0-CI-20221216-194411" PrivateAssets="All" GeneratePathProperty="true"/>
|
||||
<PackageReference Include="Microsoft.Quantum.Simulators" Version="0.27.244707" GeneratePathProperty="true" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ Write-AdoLog "Creating Interop Bindings"
|
|||
$includeDir = Join-Path '.' "$($env:LINUX_PKG_NAME)" "include"
|
||||
$generatedDir = Join-Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY generated
|
||||
New-Item -ItemType Directory -Force $generatedDir | Out-Null
|
||||
dotnet tool install --global ClangSharpPInvokeGenerator --version 13.0.0-beta1
|
||||
dotnet tool install --global ClangSharpPInvokeGenerator --version 14.0.0-rc1
|
||||
ClangSharpPInvokeGenerator `
|
||||
"@$(Join-Path $PSScriptRoot GenerateLLVM.rsp)" `
|
||||
--output $generatedDir `
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
|
||||
cmake_minimum_required(VERSION 3.4 FATAL_ERROR)
|
||||
|
@ -10,9 +10,12 @@ if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Windows")
|
|||
if(SCCACHE)
|
||||
set(LLVM_CCACHE_BUILD OFF CACHE BOOL "")
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${SCCACHE}")
|
||||
message(STATUS RULE_LAUNCH_COMPILE=${RULE_LAUNCH_COMPILE})
|
||||
set(CMAKE_C_COMPILER_LAUNCHER "sccache" CACHE STRING "")
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER "sccache" CACHE STRING "")
|
||||
get_property(rule_launch_property GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
|
||||
message(STATUS RULE_LAUNCH_COMPILE=${rule_launch_property})
|
||||
set(CMAKE_C_COMPILER_LAUNCHER "${SCCACHE}" CACHE STRING "")
|
||||
message(STATUS CMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER})
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER "${SCCACHE}" CACHE STRING "")
|
||||
message(STATUS CMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER})
|
||||
else()
|
||||
message(STATUS "Not using sccache")
|
||||
endif()
|
||||
|
@ -41,7 +44,7 @@ message(STATUS CPACK_PACKAGE_FILE_NAME=${CPACK_PACKAGE_FILE_NAME})
|
|||
|
||||
set(CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "")
|
||||
|
||||
set(LLVM_TARGETS_TO_BUILD "X86" CACHE STRING "")
|
||||
set(LLVM_TARGETS_TO_BUILD "Native" CACHE STRING "")
|
||||
|
||||
set(PACKAGE_VENDOR LLVM.org CACHE STRING "")
|
||||
|
||||
|
@ -50,6 +53,17 @@ set(LLVM_ENABLE_ASSERTIONS OFF CACHE BOOL "")
|
|||
set(LLVM_BUILD_EXAMPLES OFF CACHE BOOL "")
|
||||
set(LLVM_ENABLE_RTTI OFF CACHE BOOL "")
|
||||
|
||||
# Remove external lib dependencies
|
||||
set(LLVM_ENABLE_BINDINGS OFF CACHE BOOL "")
|
||||
set(LLVM_ENABLE_FFI OFF CACHE BOOL "")
|
||||
set(LLVM_ENABLE_LIBEDIT OFF CACHE BOOL "")
|
||||
set(LLVM_ENABLE_LIBPFM OFF CACHE BOOL "")
|
||||
set(LLVM_ENABLE_LIBXML2 OFF CACHE BOOL "")
|
||||
set(LLVM_ENABLE_OCAMLDOC OFF CACHE BOOL "")
|
||||
set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "")
|
||||
set(LLVM_ENABLE_ZLIB OFF CACHE BOOL "")
|
||||
set(LLVM_ENABLE_ZSTD OFF CACHE BOOL "")
|
||||
|
||||
# Packing
|
||||
set(CPACK_BINARY_DEB OFF CACHE BOOL "")
|
||||
set(CPACK_BINARY_FREEBSD OFF CACHE BOOL "")
|
||||
|
@ -73,6 +87,18 @@ else()
|
|||
set(CPACK_BINARY_TGZ ON CACHE BOOL "")
|
||||
endif()
|
||||
|
||||
# See https://github.com/llvm/llvm-project/blob/llvmorg-13.0.0/llvm/utils/gn/build/write_library_dependencies.py for a list
|
||||
# Apple specific changes to match their toolchain
|
||||
if(APPLE)
|
||||
set(COMPILER_RT_ENABLE_IOS OFF CACHE BOOL "")
|
||||
set(COMPILER_RT_ENABLE_WATCHOS OFF CACHE BOOL "")
|
||||
set(COMPILER_RT_ENABLE_TVOS OFF CACHE BOOL "")
|
||||
|
||||
set(CMAKE_MACOSX_RPATH ON CACHE BOOL "")
|
||||
set(CLANG_SPAWN_CC1 ON CACHE BOOL "")
|
||||
set(CMAKE_C_FLAGS "-fno-stack-protector -fno-common -Wno-profile-instr-unprofiled" CACHE STRING "")
|
||||
set(CMAKE_CXX_FLAGS "-fno-stack-protector -fno-common -Wno-profile-instr-unprofiled" CACHE STRING "")
|
||||
endif()
|
||||
|
||||
# See https://github.com/llvm/llvm-project/blob/llvmorg-14.0.6/llvm/utils/gn/build/write_library_dependencies.py for a list
|
||||
# of these dependencies and what they bring into the linked binary.
|
||||
set(LLVM_DYLIB_COMPONENTS "core;debuginfodwarf;linker;support;target;bitwriter;analysis;executionengine;runtimedyld;mcjit;bitstreamreader;bitreader;native" CACHE STRING "")
|
||||
|
|
|
@ -1 +1 @@
|
|||
llvmorg-13.0.0
|
||||
llvmorg-14.0.6
|
|
@ -33,7 +33,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="!$([MSBuild]::IsOsPlatform('Windows'))">
|
||||
<PackageReference Include="Microsoft.Quantum.LlvmBindings.Native" Version="13.0.0-CI-20220129-005156">
|
||||
<PackageReference Include="Microsoft.Quantum.LlvmBindings.Native" Version="13.0.0-CI-20221216-194411">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<Visible>false</Visible>
|
||||
<Pack>false</Pack>
|
||||
|
|
|
@ -179,14 +179,14 @@ namespace LlvmBindings.Interop
|
|||
{
|
||||
fixed (long* pAddr = addr.AsSpan())
|
||||
{
|
||||
return LLVM.DIBuilderCreateExpression(self, pAddr, (UIntPtr)length);
|
||||
return LLVM.DIBuilderCreateExpression(self, (ulong*)pAddr, (UIntPtr)length);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Convenience wrapper for <see cref="LLVM.DIBuilderCreateConstantValueExpression"/>.</summary>
|
||||
public static LLVMMetadataRef CreateConstantValueExpression(this LLVMDIBuilderRef self, long value)
|
||||
{
|
||||
return LLVM.DIBuilderCreateConstantValueExpression(self, value);
|
||||
return LLVM.DIBuilderCreateConstantValueExpression(self, (ulong)value);
|
||||
}
|
||||
|
||||
/// <summary>Convenience wrapper for <see cref="LLVM.DIBuilderCreateReplaceableCompositeType"/>.</summary>
|
||||
|
|
|
@ -6,10 +6,11 @@
|
|||
<AssemblyName>Microsoft.Quantum.LlvmBindings</AssemblyName>
|
||||
<NoWarn>$(NoWarn);CS1574</NoWarn> <!-- Wrong types in comments cref, should be removed in the follow-up -->
|
||||
<NoWarn>$(NoWarn);SA1636</NoWarn> <!-- Wrong company name in copyright header, but folder contains code from multiple sources. -->
|
||||
<NoWarn>$(NoWarn);CS0618</NoWarn> <!-- Allow obsolete calls for LLVM 14 use of non-opaque pointers. -->
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Quantum.LlvmBindings.Native" Version="13.0.0-CI-20220129-005156" PrivateAssets="All" GeneratePathProperty="true"/>
|
||||
<PackageReference Include="Microsoft.Quantum.LlvmBindings.Native" Version="13.0.0-CI-20221216-194411" PrivateAssets="All" GeneratePathProperty="true"/>
|
||||
<Compile Include="$(PkgMicrosoft_Quantum_LlvmBindings_Native)\generated\**\*" />
|
||||
<None Include="$(PkgMicrosoft_Quantum_LlvmBindings_Native)\runtimes\**\*" PackagePath="runtimes">
|
||||
<Link>runtimes\%(RecursiveDir)%(FileName)%(Extension)</Link>
|
||||
|
|
Загрузка…
Ссылка в новой задаче