[llvm] update to v14.0.3 [halide] update to v14.0.0 [mesa] update to 22.0.2 (#23734)

* [llvm] update to v14.0.0

* [llvm] BOLT sub-project support

* [llvm] fix tools install paths

* [halide] update to v14.0.0

* update versions

* [vcpkg-get-python-packages] fix "LOGNAME should be specified" warning

* [mesa] update to v22.0.1

* update versions

* update versions

* update version

* [mesa] update to 22.0.2

* update version

* [mesa] update patches

* update version

* [llvm] update to v14.0.3

* update version

* [llvm] remove depricated feature

* [llvm] allow to build OpenMP on Windows and remove incomplete cross-compile support

* update version

* [llvm] use vcpkg_cmake_get_vars

* [llvm/openmp] install CMake file in share/openmp

* [llvm] add vcpkg-cmake-get-vars dependency and slip post build check if OpenMP is enabled

* update version
This commit is contained in:
Yury Bura 2022-05-16 21:41:53 +03:00 committed by GitHub
parent ccf682927e
commit 4a2bc18713
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 4020 additions and 1124 deletions

View File

@ -1,13 +1,13 @@
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
set(HALIDE_VERSION_TAG v13.0.2)
set(HALIDE_VERSION_TAG v14.0.0)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO halide/Halide
REF ${HALIDE_VERSION_TAG}
SHA512 d2b19934ff0d759d302428f61e4075306f79c29cc1cd8802dc1ac5f325434034e0f430c435610e58f862b87cc8ef34ddcc3d0588947eeb8e1387d0bf31b9c008
HEAD_REF release/13.x
SHA512 c7b1186cca545f30d038f1e9bb28ca7231023869d191c50722213da4c7e9adfd4a53129fe395cd7938cb7cb3fb1bf80f9cd3b4b8473a0246f15b9ad8d3e40fe2
HEAD_REF release/14.x
)
vcpkg_check_features(

View File

@ -1,6 +1,6 @@
{
"name": "halide",
"version": "13.0.2",
"version": "14.0.0",
"description": "Halide is a programming language designed to make it easier to write high-performance image and array processing code on modern machines.",
"homepage": "https://github.com/halide/Halide",
"supports": "!uwp",

View File

@ -1,18 +1,20 @@
clang/cmake/modules/CMakeLists.txt | 4 ++--
flang/cmake/modules/CMakeLists.txt | 4 ++--
lld/cmake/modules/CMakeLists.txt | 4 ++--
llvm/cmake/modules/AddLLVM.cmake | 2 +-
llvm/cmake/modules/CMakeLists.txt | 2 +-
mlir/cmake/modules/CMakeLists.txt | 4 ++--
polly/cmake/CMakeLists.txt | 4 ++--
pstl/CMakeLists.txt | 4 ++--
8 files changed, 14 insertions(+), 14 deletions(-)
clang/cmake/modules/CMakeLists.txt | 4 ++--
compiler-rt/cmake/Modules/CompilerRTUtils.cmake | 2 +-
flang/cmake/modules/CMakeLists.txt | 4 ++--
lld/cmake/modules/CMakeLists.txt | 4 ++--
llvm/cmake/modules/AddLLVM.cmake | 2 +-
llvm/cmake/modules/CMakeLists.txt | 2 +-
mlir/cmake/modules/CMakeLists.txt | 4 ++--
mlir/test/CMakeLists.txt | 2 +-
openmp/tools/Modules/CMakeLists.txt | 2 +-
polly/cmake/CMakeLists.txt | 4 ++--
10 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/clang/cmake/modules/CMakeLists.txt b/clang/cmake/modules/CMakeLists.txt
index 561665d58cad..3c73878a4483 100644
index c6f6ce9fe5d6..fc886b23a1a8 100644
--- a/clang/cmake/modules/CMakeLists.txt
+++ b/clang/cmake/modules/CMakeLists.txt
@@ -3,11 +3,11 @@ include(LLVMDistributionSupport)
@@ -5,11 +5,11 @@ include(FindPrefixFromConfig)
# Generate a list of CMake library targets so that other CMake projects can
# link against them. LLVM calls its version of this file LLVMExports.cmake, but
# the usual CMake convention seems to be ${Project}Targets.cmake.
@ -26,11 +28,24 @@ index 561665d58cad..3c73878a4483 100644
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")
get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS)
diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
index 052095801aae..f3402793b60c 100644
--- a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -376,7 +376,7 @@ macro(load_llvm_config)
file(TO_CMAKE_PATH ${LLVM_CMAKE_DIR_FROM_LLVM_CONFIG} LLVM_CMAKE_DIR)
else()
file(TO_CMAKE_PATH ${LLVM_BINARY_DIR} LLVM_BINARY_DIR_CMAKE_STYLE)
- set(LLVM_CMAKE_DIR "${LLVM_BINARY_DIR_CMAKE_STYLE}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
+ set(LLVM_CMAKE_DIR "${LLVM_BINARY_DIR_CMAKE_STYLE}/share/llvm")
endif()
set(LLVM_CMAKE_INCLUDE_FILE "${LLVM_CMAKE_DIR}/LLVMConfig.cmake")
diff --git a/flang/cmake/modules/CMakeLists.txt b/flang/cmake/modules/CMakeLists.txt
index e46498a6bc35..2e922f8ca89d 100644
index 170568c80dde..1bf6d6a829e2 100644
--- a/flang/cmake/modules/CMakeLists.txt
+++ b/flang/cmake/modules/CMakeLists.txt
@@ -1,11 +1,11 @@
@@ -4,11 +4,11 @@ include(FindPrefixFromConfig)
# Generate a list of CMake library targets so that other CMake projects can
# link against them. LLVM calls its version of this file LLVMExports.cmake, but
# the usual CMake convention seems to be ${Project}Targets.cmake.
@ -45,10 +60,10 @@ index e46498a6bc35..2e922f8ca89d 100644
get_property(FLANG_EXPORTS GLOBAL PROPERTY FLANG_EXPORTS)
diff --git a/lld/cmake/modules/CMakeLists.txt b/lld/cmake/modules/CMakeLists.txt
index 62d03fa901dd..09b0f54ee8c3 100644
index 760c9d5f8d87..acd8a65808f5 100644
--- a/lld/cmake/modules/CMakeLists.txt
+++ b/lld/cmake/modules/CMakeLists.txt
@@ -1,11 +1,11 @@
@@ -4,11 +4,11 @@ include(FindPrefixFromConfig)
# Generate a list of CMake library targets so that other CMake projects can
# link against them. LLVM calls its version of this file LLVMExports.cmake, but
# the usual CMake convention seems to be ${Project}Targets.cmake.
@ -63,10 +78,10 @@ index 62d03fa901dd..09b0f54ee8c3 100644
get_property(LLD_EXPORTS GLOBAL PROPERTY LLD_EXPORTS)
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 29e40f45fef8..e9094e9b8eb2 100644
index 37bc98f9e021..7cbfa2a9a577 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -1033,7 +1033,7 @@ function(process_llvm_pass_plugins)
@@ -1049,7 +1049,7 @@ function(process_llvm_pass_plugins)
## Part 1: Extension header to be included whenever we need extension
# processing.
@ -76,11 +91,12 @@ index 29e40f45fef8..e9094e9b8eb2 100644
file(WRITE
"${llvm_cmake_builddir}/LLVMConfigExtensions.cmake"
diff --git a/llvm/cmake/modules/CMakeLists.txt b/llvm/cmake/modules/CMakeLists.txt
index 51b6a4fdc284..a818de2e116c 100644
index cea0c1df0a14..639c5422b04a 100644
--- a/llvm/cmake/modules/CMakeLists.txt
+++ b/llvm/cmake/modules/CMakeLists.txt
@@ -1,6 +1,6 @@
@@ -2,7 +2,7 @@ include(ExtendPath)
include(LLVMDistributionSupport)
include(FindPrefixFromConfig)
-set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm)
+set(LLVM_INSTALL_PACKAGE_DIR share/llvm)
@ -88,10 +104,10 @@ index 51b6a4fdc284..a818de2e116c 100644
# First for users who use an installed LLVM, create the LLVMExports.cmake file.
diff --git a/mlir/cmake/modules/CMakeLists.txt b/mlir/cmake/modules/CMakeLists.txt
index 65efc4a14987..7c3213ab0c2b 100644
index d6703993bd74..e2f6cd3ea8cb 100644
--- a/mlir/cmake/modules/CMakeLists.txt
+++ b/mlir/cmake/modules/CMakeLists.txt
@@ -3,11 +3,11 @@ include(LLVMDistributionSupport)
@@ -5,11 +5,11 @@ include(FindPrefixFromConfig)
# Generate a list of CMake library targets so that other CMake projects can
# link against them. LLVM calls its version of this file LLVMExports.cmake, but
# the usual CMake convention seems to be ${Project}Targets.cmake.
@ -105,34 +121,41 @@ index 65efc4a14987..7c3213ab0c2b 100644
set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}")
get_property(MLIR_EXPORTS GLOBAL PROPERTY MLIR_EXPORTS)
diff --git a/mlir/test/CMakeLists.txt b/mlir/test/CMakeLists.txt
index 8e44a9c37cf1..f6edc7d77ffd 100644
--- a/mlir/test/CMakeLists.txt
+++ b/mlir/test/CMakeLists.txt
@@ -8,7 +8,7 @@ endif()
# Passed to lit.site.cfg.py.so that the out of tree Standalone dialect test
# can find MLIR's CMake configuration
set(MLIR_CMAKE_DIR
- "${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/mlir")
+ "${CMAKE_BINARY_DIR}/share/mlir")
# Passed to lit.site.cfg.py.in to set up the path where to find the libraries
# for linalg integration tests.
diff --git a/openmp/tools/Modules/CMakeLists.txt b/openmp/tools/Modules/CMakeLists.txt
index 22d818eea72d..75aacc4468d4 100644
--- a/openmp/tools/Modules/CMakeLists.txt
+++ b/openmp/tools/Modules/CMakeLists.txt
@@ -12,4 +12,4 @@
install(FILES "FindOpenMPTarget.cmake"
- DESTINATION "${OPENMP_INSTALL_LIBDIR}/cmake/openmp")
+ DESTINATION "share/openmp")
diff --git a/polly/cmake/CMakeLists.txt b/polly/cmake/CMakeLists.txt
index 7cc129ba2e90..9776391cd535 100644
index 7a0190b69df6..cdd3b4f126bb 100644
--- a/polly/cmake/CMakeLists.txt
+++ b/polly/cmake/CMakeLists.txt
@@ -1,7 +1,7 @@
# Keep this in sync with llvm/cmake/CMakeLists.txt!
@@ -3,8 +3,8 @@
include(ExtendPath)
include(FindPrefixFromConfig)
-set(LLVM_INSTALL_PACKAGE_DIR "lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")
-set(POLLY_INSTALL_PACKAGE_DIR "lib${LLVM_LIBDIR_SUFFIX}/cmake/polly")
+set(LLVM_INSTALL_PACKAGE_DIR share/llvm)
+set(POLLY_INSTALL_PACKAGE_DIR share/polly)
+set(LLVM_INSTALL_PACKAGE_DIR "share/llvm")
+set(POLLY_INSTALL_PACKAGE_DIR "share/polly")
if (CMAKE_CONFIGURATION_TYPES)
set(POLLY_EXPORTS_FILE_NAME "PollyExports-$<LOWER_CASE:$<CONFIG>>.cmake")
else()
diff --git a/pstl/CMakeLists.txt b/pstl/CMakeLists.txt
index 8bea8843589b..3658c0a4414a 100644
--- a/pstl/CMakeLists.txt
+++ b/pstl/CMakeLists.txt
@@ -81,10 +81,10 @@ install(TARGETS ParallelSTL
install(EXPORT ParallelSTLTargets
FILE ParallelSTLTargets.cmake
NAMESPACE pstl::
- DESTINATION lib/cmake/ParallelSTL)
+ DESTINATION share/ParallelSTL)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ParallelSTLConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/ParallelSTLConfigVersion.cmake"
- DESTINATION lib/cmake/ParallelSTL)
+ DESTINATION share/ParallelSTL)
install(DIRECTORY include/
DESTINATION include
PATTERN "*.in" EXCLUDE)

View File

@ -1,25 +0,0 @@
openmp/runtime/src/CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
index bdb867e352f7..16a13fa959ea 100644
--- a/openmp/runtime/src/CMakeLists.txt
+++ b/openmp/runtime/src/CMakeLists.txt
@@ -159,7 +159,7 @@ else()
endif()
set_target_properties(omp PROPERTIES
- PREFIX "" SUFFIX "" OUTPUT_NAME "${LIBOMP_LIB_FILE}"
+ PREFIX "" SUFFIX "" OUTPUT_NAME "${LIBOMP_LIB_FILE}" DEBUG_POSTFIX ""
LINK_FLAGS "${LIBOMP_CONFIGURED_LDFLAGS}"
LINKER_LANGUAGE ${LIBOMP_LINKER_LANGUAGE}
)
@@ -236,7 +236,7 @@ if(WIN32)
# Create new import library that is just the previously created one + kmp_import.cpp
add_library(ompimp STATIC ${LIBOMP_GENERATED_IMP_LIB} kmp_import.cpp)
set_target_properties(ompimp PROPERTIES
- PREFIX "" SUFFIX "" OUTPUT_NAME "${LIBOMP_IMP_LIB_FILE}"
+ PREFIX "" SUFFIX "" OUTPUT_NAME "${LIBOMP_IMP_LIB_FILE}" DEBUG_POSTFIX ""
LINKER_LANGUAGE C
)
add_dependencies(ompimp omp) # ensure generated import library is created first

View File

@ -2,7 +2,7 @@
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp
index 1a2f04552d13..9370c5e28206 100644
index 8ed88f33ead4..3f2d1b98adcc 100644
--- a/llvm/tools/llvm-config/llvm-config.cpp
+++ b/llvm/tools/llvm-config/llvm-config.cpp
@@ -305,7 +305,7 @@ int main(int argc, char **argv) {

View File

@ -4,10 +4,10 @@
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/clang/lib/Headers/CMakeLists.txt b/clang/lib/Headers/CMakeLists.txt
index 8131f6005dc2..9afef2e5a4e7 100644
index 078988980c52..795f495b32d6 100644
--- a/clang/lib/Headers/CMakeLists.txt
+++ b/clang/lib/Headers/CMakeLists.txt
@@ -222,7 +222,7 @@ set_target_properties(clang-resource-headers PROPERTIES
@@ -234,7 +234,7 @@ set_target_properties(clang-resource-headers PROPERTIES
FOLDER "Misc"
RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
@ -17,10 +17,10 @@ index 8131f6005dc2..9afef2e5a4e7 100644
install(
FILES ${files} ${generated_files}
diff --git a/clang/runtime/CMakeLists.txt b/clang/runtime/CMakeLists.txt
index 61b1c60bf590..c20a5a326f15 100644
index ca7e17927ee1..87d4282b36ad 100644
--- a/clang/runtime/CMakeLists.txt
+++ b/clang/runtime/CMakeLists.txt
@@ -82,7 +82,7 @@ if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND EXISTS ${COMPILER_RT_SRC_ROOT}/)
@@ -84,7 +84,7 @@ if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND EXISTS ${COMPILER_RT_SRC_ROOT}/)
-DLLVM_LIT_ARGS=${LLVM_LIT_ARGS}
-DCOMPILER_RT_OUTPUT_DIR=${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}
-DCOMPILER_RT_EXEC_OUTPUT_DIR=${LLVM_RUNTIME_OUTPUT_INTDIR}
@ -30,10 +30,10 @@ index 61b1c60bf590..c20a5a326f15 100644
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX}
diff --git a/compiler-rt/cmake/base-config-ix.cmake b/compiler-rt/cmake/base-config-ix.cmake
index c11342e68813..61bb52135c43 100644
index d7b0124f3546..55e515cb1c7a 100644
--- a/compiler-rt/cmake/base-config-ix.cmake
+++ b/compiler-rt/cmake/base-config-ix.cmake
@@ -42,7 +42,7 @@ if (LLVM_TREE_AVAILABLE)
@@ -44,7 +44,7 @@ if (LLVM_TREE_AVAILABLE)
# Setup the paths where compiler-rt runtimes and headers should be stored.
set(COMPILER_RT_OUTPUT_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION})
set(COMPILER_RT_EXEC_OUTPUT_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})

View File

@ -1,184 +1,233 @@
clang-tools-extra/modularize/CMakeLists.txt | 2 +-
clang/cmake/modules/AddClang.cmake | 2 +-
clang/tools/c-index-test/CMakeLists.txt | 2 +-
clang/tools/clang-format/CMakeLists.txt | 2 +-
clang/tools/scan-build/CMakeLists.txt | 2 +-
clang/tools/scan-view/CMakeLists.txt | 2 +-
clang/utils/hmaptool/CMakeLists.txt | 2 +-
flang/cmake/modules/AddFlang.cmake | 2 +-
flang/tools/f18/CMakeLists.txt | 4 ++--
flang/tools/flang-driver/CMakeLists.txt | 2 +-
lld/cmake/modules/AddLLD.cmake | 2 +-
lld/tools/lld/CMakeLists.txt | 2 +-
lldb/cmake/modules/AddLLDB.cmake | 2 +-
13 files changed, 14 insertions(+), 14 deletions(-)
clang-tools-extra/clang-tidy/tool/CMakeLists.txt | 2 +-
clang-tools-extra/modularize/CMakeLists.txt | 2 +-
clang/cmake/modules/AddClang.cmake | 2 +-
clang/tools/c-index-test/CMakeLists.txt | 2 +-
clang/tools/clang-format/CMakeLists.txt | 2 +-
clang/tools/clang-linker-wrapper/CMakeLists.txt | 2 +-
clang/tools/clang-nvlink-wrapper/CMakeLists.txt | 2 +-
clang/tools/scan-build-py/CMakeLists.txt | 4 ++--
clang/tools/scan-build/CMakeLists.txt | 2 +-
clang/tools/scan-view/CMakeLists.txt | 2 +-
clang/utils/hmaptool/CMakeLists.txt | 2 +-
flang/cmake/modules/AddFlang.cmake | 2 +-
flang/tools/f18/CMakeLists.txt | 2 +-
flang/tools/flang-driver/CMakeLists.txt | 2 +-
lld/cmake/modules/AddLLD.cmake | 2 +-
lld/tools/lld/CMakeLists.txt | 2 +-
lldb/cmake/modules/AddLLDB.cmake | 2 +-
17 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/clang-tools-extra/clang-tidy/tool/CMakeLists.txt b/clang-tools-extra/clang-tidy/tool/CMakeLists.txt
index 3ce552872015..e09b917ae5f8 100644
--- a/clang-tools-extra/clang-tidy/tool/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/tool/CMakeLists.txt
@@ -64,6 +64,6 @@ install(PROGRAMS clang-tidy-diff.py
DESTINATION "${CMAKE_INSTALL_DATADIR}/clang"
COMPONENT clang-tidy)
install(PROGRAMS run-clang-tidy.py
- DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ DESTINATION "${LLVM_TOOLS_INSTALL_DIR}"
COMPONENT clang-tidy
RENAME run-clang-tidy)
diff --git a/clang-tools-extra/modularize/CMakeLists.txt b/clang-tools-extra/modularize/CMakeLists.txt
index 4caae81c49b6..8c459c51cc34 100644
index fb17e353c39f..4b409e47446a 100644
--- a/clang-tools-extra/modularize/CMakeLists.txt
+++ b/clang-tools-extra/modularize/CMakeLists.txt
@@ -23,5 +23,5 @@ clang_target_link_libraries(modularize
)
install(TARGETS modularize
- RUNTIME DESTINATION bin
+ RUNTIME DESTINATION tools/llvm
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ RUNTIME DESTINATION "${LLVM_TOOLS_INSTALL_DIR}"
COMPONENT clang-extras)
diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake
index 5752f4277444..00b7d21b8fef 100644
index 9bbbfc032b7d..bd238ff249cd 100644
--- a/clang/cmake/modules/AddClang.cmake
+++ b/clang/cmake/modules/AddClang.cmake
@@ -159,7 +159,7 @@ macro(add_clang_tool name)
@@ -160,7 +160,7 @@ macro(add_clang_tool name)
get_target_export_arg(${name} Clang export_to_clangtargets)
install(TARGETS ${name}
${export_to_clangtargets}
- RUNTIME DESTINATION bin
+ RUNTIME DESTINATION tools/llvm
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ RUNTIME DESTINATION "${LLVM_TOOLS_INSTALL_DIR}"
COMPONENT ${name})
if(NOT LLVM_ENABLE_IDE)
diff --git a/clang/tools/c-index-test/CMakeLists.txt b/clang/tools/c-index-test/CMakeLists.txt
index ceef4b08637c..ce6d7799475b 100644
index 0ae1b4e55244..e8a34e136194 100644
--- a/clang/tools/c-index-test/CMakeLists.txt
+++ b/clang/tools/c-index-test/CMakeLists.txt
@@ -54,7 +54,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
@@ -49,7 +49,7 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
set_property(TARGET c-index-test APPEND PROPERTY INSTALL_RPATH
"@executable_path/../../lib")
else()
- set(INSTALL_DESTINATION bin)
+ set(INSTALL_DESTINATION tools/llvm)
- set(INSTALL_DESTINATION "${CMAKE_INSTALL_BINDIR}")
+ set(INSTALL_DESTINATION "${LLVM_TOOLS_INSTALL_DIR}")
endif()
install(TARGETS c-index-test
diff --git a/clang/tools/clang-format/CMakeLists.txt b/clang/tools/clang-format/CMakeLists.txt
index 35ecdb11253c..d1b800dfdadc 100644
index bbdef93b576b..8744e414da0a 100644
--- a/clang/tools/clang-format/CMakeLists.txt
+++ b/clang/tools/clang-format/CMakeLists.txt
@@ -36,5 +36,5 @@ install(PROGRAMS clang-format.py
DESTINATION share/clang
DESTINATION "${CMAKE_INSTALL_DATADIR}/clang"
COMPONENT clang-format)
install(PROGRAMS git-clang-format
- DESTINATION bin
+ DESTINATION tools/llvm
- DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ DESTINATION "${LLVM_TOOLS_INSTALL_DIR}"
COMPONENT clang-format)
diff --git a/clang/tools/clang-linker-wrapper/CMakeLists.txt b/clang/tools/clang-linker-wrapper/CMakeLists.txt
index 1614f40fb60e..0e78982310c7 100644
--- a/clang/tools/clang-linker-wrapper/CMakeLists.txt
+++ b/clang/tools/clang-linker-wrapper/CMakeLists.txt
@@ -37,4 +37,4 @@ target_link_libraries(clang-linker-wrapper
${CLANG_LINKER_WRAPPER_LIB_DEPS}
)
-install(TARGETS clang-linker-wrapper RUNTIME DESTINATION bin)
+install(TARGETS clang-linker-wrapper RUNTIME DESTINATION "${LLVM_TOOLS_INSTALL_DIR}")
diff --git a/clang/tools/clang-nvlink-wrapper/CMakeLists.txt b/clang/tools/clang-nvlink-wrapper/CMakeLists.txt
index 2c979e509795..f22b801fe19a 100644
--- a/clang/tools/clang-nvlink-wrapper/CMakeLists.txt
+++ b/clang/tools/clang-nvlink-wrapper/CMakeLists.txt
@@ -22,4 +22,4 @@ target_link_libraries(clang-nvlink-wrapper
${CLANG_NVLINK_WRAPPER_LIB_DEPS}
)
-install(TARGETS clang-nvlink-wrapper RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+install(TARGETS clang-nvlink-wrapper RUNTIME DESTINATION "${LLVM_TOOLS_INSTALL_DIR}")
diff --git a/clang/tools/scan-build-py/CMakeLists.txt b/clang/tools/scan-build-py/CMakeLists.txt
index 061dc7ef4dd9..91499600693b 100644
--- a/clang/tools/scan-build-py/CMakeLists.txt
+++ b/clang/tools/scan-build-py/CMakeLists.txt
@@ -43,7 +43,7 @@ foreach(BinFile ${BinFiles})
${CMAKE_BINARY_DIR}/bin/scan-build-py
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/scan-build)
install (PROGRAMS "bin/scan-build"
- DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ DESTINATION "${LLVM_TOOLS_INSTALL_DIR}"
RENAME scan-build-py
COMPONENT scan-build-py)
list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/scan-build-py)
@@ -56,7 +56,7 @@ foreach(BinFile ${BinFiles})
${CMAKE_BINARY_DIR}/bin/
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile})
install(PROGRAMS bin/${BinFile}
- DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ DESTINATION "${LLVM_TOOLS_INSTALL_DIR}"
COMPONENT scan-build-py)
list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile})
endif()
diff --git a/clang/tools/scan-build/CMakeLists.txt b/clang/tools/scan-build/CMakeLists.txt
index ec0702d76f18..9a34a09921b1 100644
index 4a578b4c6f3e..05574a4919f6 100644
--- a/clang/tools/scan-build/CMakeLists.txt
+++ b/clang/tools/scan-build/CMakeLists.txt
@@ -47,7 +47,7 @@ if(CLANG_INSTALL_SCANBUILD)
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile})
list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile})
install(PROGRAMS bin/${BinFile}
- DESTINATION bin
+ DESTINATION tools/llvm
- DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ DESTINATION "${LLVM_TOOLS_INSTALL_DIR}"
COMPONENT scan-build)
endforeach()
diff --git a/clang/tools/scan-view/CMakeLists.txt b/clang/tools/scan-view/CMakeLists.txt
index eccc6b83195b..232976c0c227 100644
index 07aec76ee66f..ca6a3380ad0c 100644
--- a/clang/tools/scan-view/CMakeLists.txt
+++ b/clang/tools/scan-view/CMakeLists.txt
@@ -20,7 +20,7 @@ if(CLANG_INSTALL_SCANVIEW)
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin/${BinFile})
list(APPEND Depends ${CMAKE_BINARY_DIR}/bin/${BinFile})
install(PROGRAMS bin/${BinFile}
- DESTINATION bin
+ DESTINATION tools/llvm
- DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ DESTINATION "${LLVM_TOOLS_INSTALL_DIR}"
COMPONENT scan-view)
endforeach()
diff --git a/clang/utils/hmaptool/CMakeLists.txt b/clang/utils/hmaptool/CMakeLists.txt
index 62f2de0cb15c..38dc821c76de 100644
index f0d9866782b8..5fcdfc04425f 100644
--- a/clang/utils/hmaptool/CMakeLists.txt
+++ b/clang/utils/hmaptool/CMakeLists.txt
@@ -10,7 +10,7 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HM
list(APPEND Depends ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HMAPTOOL})
install(PROGRAMS ${CLANG_HMAPTOOL}
- DESTINATION bin
+ DESTINATION tools/llvm
- DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ DESTINATION "${LLVM_TOOLS_INSTALL_DIR}"
COMPONENT hmaptool)
add_custom_target(hmaptool ALL DEPENDS ${Depends})
diff --git a/flang/cmake/modules/AddFlang.cmake b/flang/cmake/modules/AddFlang.cmake
index 5da58a59ed12..c019d7fc50a9 100644
index 369e303e148a..3c3697c07406 100644
--- a/flang/cmake/modules/AddFlang.cmake
+++ b/flang/cmake/modules/AddFlang.cmake
@@ -108,7 +108,7 @@ macro(add_flang_tool name)
@@ -109,7 +109,7 @@ macro(add_flang_tool name)
get_target_export_arg(${name} Flang export_to_flangtargets)
install(TARGETS ${name}
${export_to_flangtargets}
- RUNTIME DESTINATION bin
+ RUNTIME DESTINATION tools/llvm
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ RUNTIME DESTINATION "${LLVM_TOOLS_INSTALL_DIR}"
COMPONENT ${name})
if(NOT LLVM_ENABLE_IDE)
diff --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt
index 239859b5e5b9..12d00f904f8a 100644
index aa77676c6229..dd15b0b7727b 100644
--- a/flang/tools/f18/CMakeLists.txt
+++ b/flang/tools/f18/CMakeLists.txt
@@ -60,7 +60,7 @@ endforeach()
add_custom_target(module_files ALL DEPENDS ${MODULE_FILES})
-install(TARGETS f18 DESTINATION bin)
+install(TARGETS f18 DESTINATION tools/llvm)
set(FLANG_DEFAULT_DRIVER "flang-new")
if (NOT FLANG_BUILD_NEW_DRIVER)
@@ -70,5 +70,5 @@ endif()
# This flang shell script will only work in a POSIX shell.
if (NOT WIN32)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/flang.in ${CMAKE_BINARY_DIR}/bin/flang @ONLY)
- install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/flang DESTINATION bin)
+ install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/flang DESTINATION tools/llvm)
@@ -50,5 +50,5 @@ if (NOT WIN32)
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/flang
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/flang ${CMAKE_BINARY_DIR}/bin)
add_custom_target(flang ALL DEPENDS ${CMAKE_BINARY_DIR}/bin/flang)
- install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/flang DESTINATION "${CMAKE_INSTALL_BINDIR}")
+ install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/flang DESTINATION "${LLVM_TOOLS_INSTALL_DIR}")
endif()
diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt
index 4c7ad220d223..f4206913e76f 100644
index b3e90746e786..b327e69aaeaa 100644
--- a/flang/tools/flang-driver/CMakeLists.txt
+++ b/flang/tools/flang-driver/CMakeLists.txt
@@ -27,4 +27,4 @@ clang_target_link_libraries(flang-new
clangBasic
)
@@ -34,4 +34,4 @@ if(FLANG_PLUGIN_SUPPORT)
export_executable_symbols_for_plugins(flang-new)
endif()
-install(TARGETS flang-new DESTINATION bin)
+install(TARGETS flang-new DESTINATION tools/llvm)
-install(TARGETS flang-new DESTINATION "${CMAKE_INSTALL_BINDIR}")
+install(TARGETS flang-new DESTINATION "${LLVM_TOOLS_INSTALL_DIR}")
diff --git a/lld/cmake/modules/AddLLD.cmake b/lld/cmake/modules/AddLLD.cmake
index 9883475d1aa5..48e46586f387 100644
index dd2898ce6236..86560bddd5e4 100644
--- a/lld/cmake/modules/AddLLD.cmake
+++ b/lld/cmake/modules/AddLLD.cmake
@@ -46,7 +46,7 @@ macro(add_lld_tool name)
@@ -47,7 +47,7 @@ macro(add_lld_tool name)
get_target_export_arg(${name} LLD export_to_lldtargets)
install(TARGETS ${name}
${export_to_lldtargets}
- RUNTIME DESTINATION bin
+ RUNTIME DESTINATION tools/llvm
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ RUNTIME DESTINATION "${LLVM_TOOLS_INSTALL_DIR}"
COMPONENT ${name})
if(NOT CMAKE_CONFIGURATION_TYPES)
diff --git a/lld/tools/lld/CMakeLists.txt b/lld/tools/lld/CMakeLists.txt
index e77b2161a873..b325b934640c 100644
index df48cc0d6c51..1363144fd8e1 100644
--- a/lld/tools/lld/CMakeLists.txt
+++ b/lld/tools/lld/CMakeLists.txt
@@ -21,7 +21,7 @@ target_link_libraries(lld
@@ -20,7 +20,7 @@ target_link_libraries(lld
)
install(TARGETS lld
- RUNTIME DESTINATION bin)
+ RUNTIME DESTINATION tools/llvm)
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+ RUNTIME DESTINATION "${LLVM_TOOLS_INSTALL_DIR}")
if(NOT LLD_SYMLINKS_TO_CREATE)
set(LLD_SYMLINKS_TO_CREATE
diff --git a/lldb/cmake/modules/AddLLDB.cmake b/lldb/cmake/modules/AddLLDB.cmake
index 8be214a8509a..4a5d0fa39be3 100644
index 3291a7c808e1..9fe9b9a7940d 100644
--- a/lldb/cmake/modules/AddLLDB.cmake
+++ b/lldb/cmake/modules/AddLLDB.cmake
@@ -187,7 +187,7 @@ function(add_lldb_executable name)
@@ -189,7 +189,7 @@ function(add_lldb_executable name)
endif()
if(ARG_GENERATE_INSTALL)
- set(install_dest bin)
+ set(install_dest tools/llvm)
+ set(install_dest "${LLVM_TOOLS_INSTALL_DIR}")
if(ARG_INSTALL_PREFIX)
set(install_dest ${ARG_INSTALL_PREFIX})
endif()

View File

@ -1,16 +1,16 @@
llvm/cmake/config-ix.cmake | 2 +-
llvm/cmake/modules/FindFFI.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index dd0aaadb47c7..279435b5b27d 100644
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -343,7 +343,7 @@ if( LLVM_ENABLE_FFI )
message(FATAL_ERROR "libffi includes are not found.")
diff --git a/llvm/cmake/modules/FindFFI.cmake b/llvm/cmake/modules/FindFFI.cmake
index b0d859af8959..a756d0c8fdb0 100644
--- a/llvm/cmake/modules/FindFFI.cmake
+++ b/llvm/cmake/modules/FindFFI.cmake
@@ -34,7 +34,7 @@ else()
endif()
endif()
- find_library(FFI_LIBRARY_PATH ffi PATHS ${FFI_LIBRARY_DIR})
+ find_library(FFI_LIBRARY_PATH NAMES ffi libffi PATHS ${FFI_LIBRARY_DIR})
if( NOT FFI_LIBRARY_PATH )
message(FATAL_ERROR "libffi is not found.")
endif()
-find_library(FFI_LIBRARIES ffi PATHS ${FFI_LIBRARY_DIR})
+find_library(FFI_LIBRARIES ffi libffi PATHS ${FFI_LIBRARY_DIR})
if(FFI_LIBRARIES)
include(CMakePushCheckState)

View File

@ -0,0 +1,22 @@
bolt/tools/driver/CMakeLists.txt | 8 --------
1 file changed, 8 deletions(-)
diff --git a/bolt/tools/driver/CMakeLists.txt b/bolt/tools/driver/CMakeLists.txt
index d50781615663..df06604c724c 100644
--- a/bolt/tools/driver/CMakeLists.txt
+++ b/bolt/tools/driver/CMakeLists.txt
@@ -33,14 +33,6 @@ set(BOLT_DEPENDS
)
add_custom_target(bolt DEPENDS ${BOLT_DEPENDS})
-install(PROGRAMS
- ${CMAKE_BINARY_DIR}/bin/llvm-bolt
- ${CMAKE_BINARY_DIR}/bin/perf2bolt
- ${CMAKE_BINARY_DIR}/bin/llvm-boltdiff
- ${CMAKE_BINARY_DIR}/bin/llvm-bolt-heatmap
- DESTINATION ${CMAKE_INSTALL_BINDIR}
- COMPONENT bolt
- )
add_llvm_install_targets(install-bolt DEPENDS bolt COMPONENT bolt)
set_target_properties(bolt PROPERTIES FOLDER "BOLT")
set_target_properties(install-bolt PROPERTIES FOLDER "BOLT")

View File

@ -1,34 +0,0 @@
clang/tools/c-index-test/CMakeLists.txt | 6 +-----
lldb/cmake/modules/LLDBConfig.cmake | 2 +-
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/clang/tools/c-index-test/CMakeLists.txt b/clang/tools/c-index-test/CMakeLists.txt
index ceef4b08637c..40b9e995597f 100644
--- a/clang/tools/c-index-test/CMakeLists.txt
+++ b/clang/tools/c-index-test/CMakeLists.txt
@@ -40,11 +40,7 @@ set_target_properties(c-index-test
# If libxml2 is available, make it available for c-index-test.
if (CLANG_HAVE_LIBXML)
- if ((CMAKE_OSX_SYSROOT) AND (EXISTS ${CMAKE_OSX_SYSROOT}/${LIBXML2_INCLUDE_DIR}))
- include_directories(SYSTEM ${CMAKE_OSX_SYSROOT}/${LIBXML2_INCLUDE_DIR})
- else()
- include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR})
- endif()
+ include_directories(SYSTEM ${LIBXML2_INCLUDE_DIRS})
target_link_libraries(c-index-test PRIVATE ${LIBXML2_LIBRARIES})
endif()
diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
index b62cd7d24438..a8c78ee1bccd 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -215,7 +215,7 @@ if (LLDB_ENABLE_LZMA)
endif()
if (LLDB_ENABLE_LIBXML2)
- include_directories(${LIBXML2_INCLUDE_DIR})
+ include_directories(${LIBXML2_INCLUDE_DIRS})
endif()
include_directories(BEFORE

View File

@ -1,4 +1,4 @@
set(LLVM_VERSION "13.0.0")
set(LLVM_VERSION "14.0.3")
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
@ -6,17 +6,16 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO llvm/llvm-project
REF llvmorg-${LLVM_VERSION}
SHA512 8004c05d32b9720fb3391783621690c1df9bd1e97e72cbff9192ed88a84b0acd303b61432145fa917b5b5e548c8cee29b24ef8547dcc8677adf4816e7a8a0eb2
SHA512 511e93fd9b1c414c38fe9e2649679ac0b16cb04f7f7838569d187b04c542a185e364d6db73e96465026e3b2533649eb75ac95507d12514af32b28bdfb66f2646
HEAD_REF master
PATCHES
0002-fix-install-paths.patch # This patch fixes paths in ClangConfig.cmake, LLVMConfig.cmake, LLDConfig.cmake etc.
0003-fix-openmp-debug.patch
0004-fix-dr-1734.patch
0005-fix-tools-path.patch
0007-fix-compiler-rt-install-path.patch
0009-fix-tools-install-path.patch
0010-fix-libffi.patch
0011-fix-libxml2.patch
0011-fix-install-bolt.patch
)
vcpkg_check_features(
@ -35,6 +34,9 @@ vcpkg_check_features(
enable-bindings LLVM_ENABLE_BINDINGS
)
vcpkg_cmake_get_vars(cmake_vars_file)
include("${cmake_vars_file}")
# LLVM generates CMake error due to Visual Studio version 16.4 is known to miscompile part of LLVM.
# LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON disables this error.
# See https://developercommunity.visualstudio.com/content/problem/845933/miscompile-boolean-condition-deduced-to-be-always.html
@ -93,6 +95,9 @@ else()
endif()
set(LLVM_ENABLE_PROJECTS)
if("bolt" IN_LIST FEATURES)
list(APPEND LLVM_ENABLE_PROJECTS "bolt")
endif()
if("clang" IN_LIST FEATURES OR "clang-tools-extra" IN_LIST FEATURES)
list(APPEND LLVM_ENABLE_PROJECTS "clang")
if("disable-clang-static-analyzer" IN_LIST FEATURES)
@ -115,7 +120,7 @@ if("compiler-rt" IN_LIST FEATURES)
list(APPEND LLVM_ENABLE_PROJECTS "compiler-rt")
endif()
if("flang" IN_LIST FEATURES)
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
if(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
message(FATAL_ERROR "Building Flang with MSVC is not supported on x86. Disable it until issues are fixed.")
endif()
list(APPEND LLVM_ENABLE_PROJECTS "flang")
@ -127,59 +132,54 @@ endif()
if("libclc" IN_LIST FEATURES)
list(APPEND LLVM_ENABLE_PROJECTS "libclc")
endif()
if("libcxx" IN_LIST FEATURES)
if(VCPKG_TARGET_IS_WINDOWS)
message(FATAL_ERROR "Building libcxx with MSVC is not supported. Disable it until issues are fixed.")
endif()
list(APPEND LLVM_ENABLE_PROJECTS "libcxx")
endif()
if("libcxxabi" IN_LIST FEATURES)
if(VCPKG_TARGET_IS_WINDOWS)
message(FATAL_ERROR "Building libcxxabi with MSVC is not supported. Disable it until issues are fixed.")
endif()
list(APPEND LLVM_ENABLE_PROJECTS "libcxxabi")
endif()
if("libunwind" IN_LIST FEATURES)
list(APPEND LLVM_ENABLE_PROJECTS "libunwind")
endif()
if("lld" IN_LIST FEATURES)
list(APPEND LLVM_ENABLE_PROJECTS "lld")
endif()
if("lldb" IN_LIST FEATURES)
list(APPEND LLVM_ENABLE_PROJECTS "lldb")
list(APPEND FEATURE_OPTIONS
-DLLDB_ENABLE_CURSES=OFF
)
endif()
if("mlir" IN_LIST FEATURES)
list(APPEND LLVM_ENABLE_PROJECTS "mlir")
endif()
if("openmp" IN_LIST FEATURES)
# Disable OpenMP on Windows (see https://bugs.llvm.org/show_bug.cgi?id=45074).
if(VCPKG_TARGET_IS_WINDOWS)
message(FATAL_ERROR "Building OpenMP with MSVC is not supported. Disable it until issues are fixed.")
endif()
list(APPEND LLVM_ENABLE_PROJECTS "openmp")
# Perl is required for the OpenMP run-time
vcpkg_find_acquire_program(PERL)
get_filename_component(PERL_PATH ${PERL} DIRECTORY)
vcpkg_add_to_path(${PERL_PATH})
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
list(APPEND FEATURE_OPTIONS
-DLIBOMP_DEFAULT_LIB_NAME=libompd
)
endif()
endif()
if("parallel-libs" IN_LIST FEATURES)
list(APPEND LLVM_ENABLE_PROJECTS "parallel-libs")
# Skip post-build check
set(VCPKG_POLICY_SKIP_DUMPBIN_CHECKS enabled)
endif()
if("polly" IN_LIST FEATURES)
list(APPEND LLVM_ENABLE_PROJECTS "polly")
endif()
if("pstl" IN_LIST FEATURES)
if(VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
message(FATAL_ERROR "Building pstl with MSVC is not supported. Disable it until issues are fixed.")
endif()
list(APPEND LLVM_ENABLE_PROJECTS "pstl")
endif()
set(LLVM_ENABLE_RUNTIMES)
if("libcxx" IN_LIST FEATURES)
if(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
message(FATAL_ERROR "Building libcxx with MSVC is not supported, as cl doesn't support the #include_next extension.")
endif()
list(APPEND LLVM_ENABLE_RUNTIMES "libcxx")
endif()
if("libcxxabi" IN_LIST FEATURES)
if(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
message(FATAL_ERROR "Building libcxxabi with MSVC is not supported. Disable it until issues are fixed.")
endif()
list(APPEND LLVM_ENABLE_RUNTIMES "libcxxabi")
endif()
if("libunwind" IN_LIST FEATURES)
list(APPEND LLVM_ENABLE_RUNTIMES "libunwind")
endif()
set(known_llvm_targets
AArch64
AMDGPU
@ -195,6 +195,7 @@ set(known_llvm_targets
RISCV
Sparc
SystemZ
VE
WebAssembly
X86
XCore
@ -212,54 +213,25 @@ vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_DIR ${PYTHON3} DIRECTORY)
vcpkg_add_to_path(${PYTHON3_DIR})
if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "${VCPKG_DETECTED_CMAKE_SYSTEM_PROCESSOR}")
# TODO: support more targets and OS
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
if(VCPKG_TARGET_IS_OSX)
list(APPEND CROSS_OPTIONS -DLLVM_HOST_TRIPLE=arm64-apple-darwin20.3.0)
list(APPEND CROSS_OPTIONS -DLLVM_DEFAULT_TARGET_TRIPLE=arm64-apple-darwin20.3.0)
elseif(VCPKG_TARGET_IS_WINDOWS)
list(APPEND CROSS_OPTIONS -DLLVM_HOST_TRIPLE=arm64-pc-win32)
list(APPEND CROSS_OPTIONS -DLLVM_DEFAULT_TARGET_TRIPLE=arm64-pc-win32)
# Remove if PR #16111 is merged
list(APPEND CROSS_OPTIONS -DCMAKE_CROSSCOMPILING=ON)
list(APPEND CROSS_OPTIONS -DCMAKE_SYSTEM_PROCESSOR:STRING=ARM64)
list(APPEND CROSS_OPTIONS -DCMAKE_SYSTEM_NAME:STRING=Windows)
endif()
list(APPEND CROSS_OPTIONS -DLLVM_TARGET_ARCH=AArch64)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
if(VCPKG_TARGET_IS_OSX)
list(APPEND CROSS_OPTIONS -DLLVM_HOST_TRIPLE=x86_64-apple-darwin20.3.0)
list(APPEND CROSS_OPTIONS -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-apple-darwin20.3.0)
endif()
list(APPEND CROSS_OPTIONS -DLLVM_TARGET_ARCH=X86)
endif()
endif()
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}/llvm
OPTIONS
${FEATURE_OPTIONS}
${CROSS_OPTIONS}
-DLLVM_INCLUDE_EXAMPLES=OFF
-DLLVM_BUILD_EXAMPLES=OFF
-DLLVM_INCLUDE_TESTS=OFF
-DLLVM_BUILD_TESTS=OFF
-DLLDB_ENABLE_CURSES=OFF
-DLLVM_INCLUDE_BENCHMARKS=OFF
-DLLVM_BUILD_BENCHMARKS=OFF
# Force TableGen to be built with optimization. This will significantly improve build time.
-DLLVM_OPTIMIZED_TABLEGEN=ON
"-DLLVM_ENABLE_PROJECTS=${LLVM_ENABLE_PROJECTS}"
"-DLLVM_ENABLE_RUNTIMES=${LLVM_ENABLE_RUNTIMES}"
"-DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS_TO_BUILD}"
-DPACKAGE_VERSION=${LLVM_VERSION}
# Limit the maximum number of concurrent link jobs to 1. This should fix low amount of memory issue for link.
-DLLVM_PARALLEL_LINK_JOBS=1
# Disable build LLVM-C.dll (Windows only) due to doesn't compile with CMAKE_DEBUG_POSTFIX
-DLLVM_BUILD_LLVM_C_DYLIB=OFF
# Path for binary subdirectory (defaults to 'bin')
-DLLVM_TOOLS_INSTALL_DIR=tools/llvm
OPTIONS_DEBUG
-DCMAKE_DEBUG_POSTFIX=d
)
vcpkg_cmake_install(ADD_BIN_TO_PATH)
@ -324,12 +296,14 @@ endif()
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/debug/tools"
)
endif()
# LLVM still generates a few DLLs in the static build:
# * LLVM-C.dll
# * libclang.dll
# * LTO.dll
# * Remarks.dll

View File

@ -1,7 +1,6 @@
{
"name": "llvm",
"version": "13.0.0",
"port-version": 5,
"version": "14.0.3",
"description": "The LLVM Compiler Infrastructure.",
"homepage": "https://llvm.org",
"license": "Apache-2.0",
@ -14,6 +13,10 @@
{
"name": "vcpkg-cmake-config",
"host": true
},
{
"name": "vcpkg-cmake-get-vars",
"host": true
}
],
"default-features": [
@ -24,6 +27,18 @@
"tools"
],
"features": {
"bolt": {
"description": "BOLT is a post-link optimizer developed to speed up large applications.",
"dependencies": [
{
"name": "llvm",
"default-features": false,
"features": [
"tools"
]
}
]
},
"clang": {
"description": "Include C Language Family Front-end.",
"dependencies": [
@ -50,7 +65,6 @@
"name": "llvm",
"default-features": false,
"features": [
"disable-abi-breaking-checks",
"disable-assertions",
"disable-clang-static-analyzer",
"enable-bindings",
@ -98,9 +112,6 @@
}
]
},
"disable-abi-breaking-checks": {
"description": "Deprecated; this is the default"
},
"disable-assertions": {
"description": "Build LLVM without assertions."
},
@ -238,9 +249,6 @@
}
]
},
"parallel-libs": {
"description": "Include parallel-libs project."
},
"polly": {
"description": "Include Polly (Polyhedral optimizations for LLVM) project.",
"dependencies": [
@ -281,6 +289,7 @@
"target-riscv",
"target-sparc",
"target-systemz",
"target-ve",
"target-webassembly",
"target-x86",
"target-xcore"
@ -327,6 +336,9 @@
"target-systemz": {
"description": "Build with SystemZ backend."
},
"target-ve": {
"description": "Build with VE backend."
},
"target-webassembly": {
"description": "Build with WebAssembly backend."
},

52
ports/mesa/clang.patch Normal file
View File

@ -0,0 +1,52 @@
diff --git a/meson.build b/meson.build
index 53ec2c2ef95e65447dd0f0eb65c0f92a5906590d..c124b5fb0d2b28424f33aac54cd4f87c4249dc40 100644
--- a/meson.build
+++ b/meson.build
@@ -1087,7 +1087,18 @@ elif host_machine.system() == 'windows'
'-DNOMINMAX',
]
else
- pre_args += ['-D__MSVCRT_VERSION__=0x0700']
+ # When the target is not mingw/ucrt
+ # NOTE: clang's stddef.h are conflict with mingw/ucrt's stddef.h
+ # So do not include headers that defined in clang for detecting
+ # _UCRT
+ if cc.compiles('''
+ #include <string.h>
+ #if defined(__MINGW32__) && defined(_UCRT)
+ #error
+ #endif
+ int main(void) { return 0; }''')
+ pre_args += ['-D__MSVCRT_VERSION__=0x0700']
+ endif
endif
elif host_machine.system() == 'openbsd'
pre_args += '-D_ISOC11_SOURCE'
diff --git a/src/compiler/nir/nir_lower_atomics_to_ssbo.c b/src/compiler/nir/nir_lower_atomics_to_ssbo.c
index c1799d0b9d0af70148928a4b224172c188c64194..448f63bdc7cc3b9cae123e3c0abe79b4b5af380b 100644
--- a/src/compiler/nir/nir_lower_atomics_to_ssbo.c
+++ b/src/compiler/nir/nir_lower_atomics_to_ssbo.c
@@ -27,10 +27,6 @@
#include "nir.h"
#include "nir_builder.h"
-#if defined(_WIN32) && !defined(snprintf)
-#define snprintf _snprintf
-#endif
-
/*
* Remap atomic counters to SSBOs, starting from the shader's next SSBO slot
* (info.num_ssbos).
diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h
index b1b40c8ee992eaeea985c58f4e8923724c1d385b..6053c2544a2628300cc8dc3311c8e4f0f69d36d5 100644
--- a/src/compiler/spirv/vtn_private.h
+++ b/src/compiler/spirv/vtn_private.h
@@ -41,7 +41,7 @@ struct vtn_builder;
struct vtn_decoration;
/* setjmp/longjmp is broken on MinGW: https://sourceforge.net/p/mingw-w64/bugs/406/ */
-#ifdef __MINGW32__
+#if defined(__MINGW32__) && !defined(_UCRT)
#define vtn_setjmp __builtin_setjmp
#define vtn_longjmp __builtin_longjmp
#else

63
ports/mesa/clover.patch Normal file
View File

@ -0,0 +1,63 @@
From b7c465dc43693cb1ad7e073cc7d8f89f5cfbd0ac Mon Sep 17 00:00:00 2001
From: pal1000 <liviuprodea@yahoo.com>
Date: Sat, 13 Nov 2021 11:39:58 +0200
Subject: [PATCH] clover: Use static pipe loader on Windows
Currently this only supports linking in swrast, but more Windows-supporting
drivers can be added pretty easily.
---
src/gallium/targets/opencl/meson.build | 18 +++++++++++++++---
src/gallium/targets/opencl/target.c | 2 ++
2 files changed, 17 insertions(+), 3 deletions(-)
create mode 100644 src/gallium/targets/opencl/target.c
diff --git a/src/gallium/targets/opencl/meson.build b/src/gallium/targets/opencl/meson.build
index ec65fcbe18e..f6ca4a28f20 100644
--- a/src/gallium/targets/opencl/meson.build
+++ b/src/gallium/targets/opencl/meson.build
@@ -85,19 +85,31 @@ if not (dep_clang.found() and dep_clang_usable)
endif
endif
+if host_machine.system() == 'windows'
+ libpipe_loader = libpipe_loader_static
+ target_files = ['target.c']
+else
+ libpipe_loader = libpipe_loader_dynamic
+ target_files = []
+endif
+
ocldef = files(opencl_libname + '.def')[0]
libopencl = shared_library(
opencl_libname,
- [],
+ target_files,
+ include_directories : [
+ inc_include, inc_util, inc_src, inc_gallium, inc_gallium_winsys, inc_gallium_drivers, inc_gallium_aux
+ ],
vs_module_defs : ocldef,
link_args : [ld_args_gc_sections, opencl_link_args],
link_depends : opencl_link_deps,
link_whole : libclover,
- link_with : [libpipe_loader_dynamic, libgallium],
+ link_with : [libpipe_loader, libgallium, libws_null, libwsw],
dependencies : [
idep_mesautil,
- dep_clock, dep_dl, dep_unwind, dep_elf, dep_clang, dep_version
+ dep_clock, dep_dl, dep_unwind, dep_elf, dep_clang, dep_version,
+ driver_swrast
],
version : '@0@.0.0'.format(opencl_version),
install : true,
diff --git a/src/gallium/targets/opencl/target.c b/src/gallium/targets/opencl/target.c
new file mode 100644
index 00000000000..308e23bb4a0
--- /dev/null
+++ b/src/gallium/targets/opencl/target.c
@@ -0,0 +1,2 @@
+#include "target-helpers/drm_helper.h"
+#include "target-helpers/sw_helper.h"
--
2.33.1.windows.1

View File

@ -1,383 +0,0 @@
diff --git a/src/gallium/frontends/d3d10umd/D3DKMT.cpp b/src/gallium/frontends/d3d10umd/D3DKMT.cpp
index 1649eddc41e8f17fd9e0854acbb8e0c882d94cb5..dc31e9931876cac6ae4e52a80f6da7aa5284415c 100644
--- a/src/gallium/frontends/d3d10umd/D3DKMT.cpp
+++ b/src/gallium/frontends/d3d10umd/D3DKMT.cpp
@@ -244,7 +244,7 @@ D3DKMTGetMultisampleMethodList(D3DKMT_GETMULTISAMPLEMETHODLIST *pData)
EXTERN_C NTSTATUS APIENTRY
-D3DKMTPresent(CONST D3DKMT_PRESENT *pData)
+D3DKMTPresent(D3DKMT_PRESENT *pData)
{
LOG_UNSUPPORTED_ENTRYPOINT();
return STATUS_NOT_IMPLEMENTED;
@@ -409,7 +409,7 @@ D3DKMTSetVidPnSourceOwner(CONST D3DKMT_SETVIDPNSOURCEOWNER *pData)
EXTERN_C NTSTATUS APIENTRY
-D3DKMTSetVidPnSourceOwner1(const void *pData)
+D3DKMTSetVidPnSourceOwner1(CONST D3DKMT_SETVIDPNSOURCEOWNER1 *pData)
{
LOG_UNSUPPORTED_ENTRYPOINT();
return STATUS_NOT_IMPLEMENTED;
diff --git a/src/gallium/frontends/d3d10umd/Device.cpp b/src/gallium/frontends/d3d10umd/Device.cpp
index afca18819ce04f28b23fee9ebdaa57b52a04426c..cd2c6cd9180eb03612500aa8d8475994a2f836fc 100644
--- a/src/gallium/frontends/d3d10umd/Device.cpp
+++ b/src/gallium/frontends/d3d10umd/Device.cpp
@@ -32,7 +32,7 @@
#include "Draw.h"
-#include "Dxgi.h"
+#include "DxgiFns.h"
#include "InputAssembly.h"
#include "OutputMerger.h"
#include "Query.h"
diff --git a/src/gallium/frontends/d3d10umd/DriverIncludes.h b/src/gallium/frontends/d3d10umd/DriverIncludes.h
index e78d46fafc55557f3266e700fdc2a72305827ce6..c7df64042b5b013680ec3c8190cfac7b4b958ded 100644
--- a/src/gallium/frontends/d3d10umd/DriverIncludes.h
+++ b/src/gallium/frontends/d3d10umd/DriverIncludes.h
@@ -43,12 +43,21 @@
#include <windows.h>
-#include "winddk/winddk_compat.h"
+#include "winddk_compat.h"
//typedef LARGE_INTEGER PHYSICAL_ADDRESS;
//typedef __success(return >= 0) LONG NTSTATUS;
-#define D3D10DDI_MINOR_HEADER_VERSION 1
+#define D3D10DDI_MINOR_HEADER_VERSION 2
+
+/* Unfortunately WinDDK's d3d10umddi.h defines D3D10.x constants as global
+ * const variables instead of preprocessor defines, causing LINK to fail due
+ * to duplicate symbols. Include d3d10_1.h to avoid the issue.
+ */
+#ifdef _MSC_VER
+#include <d3d10_1.h>
+#endif
+
#include <d3d10umddi.h>
#include "Debug.h"
diff --git a/src/gallium/frontends/d3d10umd/Dxgi.cpp b/src/gallium/frontends/d3d10umd/DxgiFns.cpp
similarity index 97%
rename from src/gallium/frontends/d3d10umd/Dxgi.cpp
rename to src/gallium/frontends/d3d10umd/DxgiFns.cpp
index 253f81ed283b55dd4bff29df8658f386c08cbc95..cd844a2b0fa19e23c46da0ddc3a92a9a2c9d81b6 100644
--- a/src/gallium/frontends/d3d10umd/Dxgi.cpp
+++ b/src/gallium/frontends/d3d10umd/DxgiFns.cpp
@@ -26,13 +26,13 @@
**************************************************************************/
/*
- * Dxgi.cpp --
+ * DxgiFns.cpp --
* DXGI related functions.
*/
#include <stdio.h>
-#include "Dxgi.h"
+#include "DxgiFns.h"
#include "Format.h"
#include "State.h"
@@ -97,11 +97,11 @@ _Present(DXGI_DDI_ARG_PRESENT *pPresentData)
void *map;
struct pipe_transfer *transfer;
- map = pipe_transfer_map(pipe,
- pSrcResource->resource,
- 0, 0, PIPE_MAP_READ,
- 0, 0, w, h,
- &transfer);
+ map = pipe_texture_map(pipe,
+ pSrcResource->resource,
+ 0, 0, PIPE_MAP_READ,
+ 0, 0, w, h,
+ &transfer);
if (map) {
BITMAPINFO bmi;
@@ -172,7 +172,7 @@ _Present(DXGI_DDI_ARG_PRESENT *pPresentData)
DeleteDC(hdcMem);
DeleteObject(hBmp);
- pipe_transfer_unmap(pipe, transfer);
+ pipe_texture_unmap(pipe, transfer);
}
ReleaseDC(hWnd, hDC);
diff --git a/src/gallium/frontends/d3d10umd/Dxgi.h b/src/gallium/frontends/d3d10umd/DxgiFns.h
similarity index 96%
rename from src/gallium/frontends/d3d10umd/Dxgi.h
rename to src/gallium/frontends/d3d10umd/DxgiFns.h
index dedc2542d6ab016111a78b713b9cbe54581ba92a..3689faa307c07deb62c3f5c39b4788dd8d60cb35 100644
--- a/src/gallium/frontends/d3d10umd/Dxgi.h
+++ b/src/gallium/frontends/d3d10umd/DxgiFns.h
@@ -26,8 +26,8 @@
**************************************************************************/
/*
- * Dxgi.h --
- * Functions that manipulate GPU resources.
+ * DxgiFns.h --
+ * DXGI related functions
*/
#ifndef WRAP_DXGI_H
diff --git a/src/gallium/frontends/d3d10umd/Resource.cpp b/src/gallium/frontends/d3d10umd/Resource.cpp
index a7910d2e3cf186597bb35d7c5a98464c4e844cf7..3dd91365b23e5608108a0e09e1296cb0a7bc65df 100644
--- a/src/gallium/frontends/d3d10umd/Resource.cpp
+++ b/src/gallium/frontends/d3d10umd/Resource.cpp
@@ -270,6 +270,7 @@ CreateResource(D3D10DDI_HDEVICE hDevice, // IN
templat.target = translate_texture_target( pCreateResource->ResourceDimension,
pCreateResource->ArraySize );
+ pResource->buffer = templat.target == PIPE_BUFFER;
if (pCreateResource->Format == DXGI_FORMAT_UNKNOWN) {
assert(pCreateResource->ResourceDimension == D3D10DDIRESOURCE_BUFFER);
@@ -315,37 +316,62 @@ CreateResource(D3D10DDI_HDEVICE hDevice, // IN
sizeof *pResource->transfers);
if (pCreateResource->pInitialDataUP) {
- for (UINT SubResource = 0; SubResource < pResource->NumSubResources; ++SubResource) {
+ if (pResource->buffer) {
+ assert(pResource->NumSubResources == 1);
const D3D10_DDIARG_SUBRESOURCE_UP* pInitialDataUP =
- &pCreateResource->pInitialDataUP[SubResource];
+ &pCreateResource->pInitialDataUP[0];
unsigned level;
struct pipe_box box;
- subResourceBox(pResource->resource, SubResource, &level, &box);
+ subResourceBox(pResource->resource, 0, &level, &box);
struct pipe_transfer *transfer;
void *map;
- map = pipe->transfer_map(pipe,
- pResource->resource,
- level,
- PIPE_MAP_WRITE |
- PIPE_MAP_UNSYNCHRONIZED,
- &box,
- &transfer);
+ map = pipe->buffer_map(pipe,
+ pResource->resource,
+ level,
+ PIPE_MAP_WRITE |
+ PIPE_MAP_UNSYNCHRONIZED,
+ &box,
+ &transfer);
assert(map);
if (map) {
- for (int z = 0; z < box.depth; ++z) {
- ubyte *dst = (ubyte*)map + z*transfer->layer_stride;
- const ubyte *src = (const ubyte*)pInitialDataUP->pSysMem + z*pInitialDataUP->SysMemSlicePitch;
- util_copy_rect(dst,
- templat.format,
- transfer->stride,
- 0, 0, box.width, box.height,
- src,
- pInitialDataUP->SysMemPitch,
- 0, 0);
+ memcpy(map, pInitialDataUP->pSysMem, box.width);
+ pipe_buffer_unmap(pipe, transfer);
+ }
+ } else {
+ for (UINT SubResource = 0; SubResource < pResource->NumSubResources; ++SubResource) {
+ const D3D10_DDIARG_SUBRESOURCE_UP* pInitialDataUP =
+ &pCreateResource->pInitialDataUP[SubResource];
+
+ unsigned level;
+ struct pipe_box box;
+ subResourceBox(pResource->resource, SubResource, &level, &box);
+
+ struct pipe_transfer *transfer;
+ void *map;
+ map = pipe->texture_map(pipe,
+ pResource->resource,
+ level,
+ PIPE_MAP_WRITE |
+ PIPE_MAP_UNSYNCHRONIZED,
+ &box,
+ &transfer);
+ assert(map);
+ if (map) {
+ for (int z = 0; z < box.depth; ++z) {
+ ubyte *dst = (ubyte*)map + z*transfer->layer_stride;
+ const ubyte *src = (const ubyte*)pInitialDataUP->pSysMem + z*pInitialDataUP->SysMemSlicePitch;
+ util_copy_rect(dst,
+ templat.format,
+ transfer->stride,
+ 0, 0, box.width, box.height,
+ src,
+ pInitialDataUP->SysMemPitch,
+ 0, 0);
+ }
+ pipe_texture_unmap(pipe, transfer);
}
- pipe_transfer_unmap(pipe, transfer);
}
}
}
@@ -423,7 +449,11 @@ DestroyResource(D3D10DDI_HDEVICE hDevice, // IN
for (UINT SubResource = 0; SubResource < pResource->NumSubResources; ++SubResource) {
if (pResource->transfers[SubResource]) {
- pipe_transfer_unmap(pipe, pResource->transfers[SubResource]);
+ if (pResource->buffer) {
+ pipe_buffer_unmap(pipe, pResource->transfers[SubResource]);
+ } else {
+ pipe_texture_unmap(pipe, pResource->transfers[SubResource]);
+ }
pResource->transfers[SubResource] = NULL;
}
}
@@ -493,12 +523,21 @@ ResourceMap(D3D10DDI_HDEVICE hDevice, // IN
assert(!pResource->transfers[SubResource]);
void *map;
- map = pipe->transfer_map(pipe,
- resource,
- level,
- usage,
- &box,
- &pResource->transfers[SubResource]);
+ if (pResource->buffer) {
+ map = pipe->buffer_map(pipe,
+ resource,
+ level,
+ usage,
+ &box,
+ &pResource->transfers[SubResource]);
+ } else {
+ map = pipe->texture_map(pipe,
+ resource,
+ level,
+ usage,
+ &box,
+ &pResource->transfers[SubResource]);
+ }
if (!map) {
DebugPrintf("%s: failed to map resource\n", __FUNCTION__);
SetError(hDevice, E_FAIL);
@@ -534,7 +573,11 @@ ResourceUnmap(D3D10DDI_HDEVICE hDevice, // IN
assert(SubResource < pResource->NumSubResources);
if (pResource->transfers[SubResource]) {
- pipe_transfer_unmap(pipe, pResource->transfers[SubResource]);
+ if (pResource->buffer) {
+ pipe_buffer_unmap(pipe, pResource->transfers[SubResource]);
+ } else {
+ pipe_texture_unmap(pipe, pResource->transfers[SubResource]);
+ }
pResource->transfers[SubResource] = NULL;
}
}
@@ -834,7 +877,8 @@ ResourceUpdateSubResourceUP(D3D10DDI_HDEVICE hDevice, // IN
}
struct pipe_context *pipe = pDevice->pipe;
- struct pipe_resource *dst_resource = CastPipeResource(hDstResource);
+ Resource *pDstResource = CastResource(hDstResource);
+ struct pipe_resource *dst_resource = pDstResource->resource;
unsigned level;
struct pipe_box box;
@@ -855,12 +899,21 @@ ResourceUpdateSubResourceUP(D3D10DDI_HDEVICE hDevice, // IN
struct pipe_transfer *transfer;
void *map;
- map = pipe->transfer_map(pipe,
- dst_resource,
- level,
- PIPE_MAP_WRITE | PIPE_MAP_DISCARD_RANGE,
- &box,
- &transfer);
+ if (pDstResource->buffer) {
+ map = pipe->buffer_map(pipe,
+ dst_resource,
+ level,
+ PIPE_MAP_WRITE | PIPE_MAP_DISCARD_RANGE,
+ &box,
+ &transfer);
+ } else {
+ map = pipe->texture_map(pipe,
+ dst_resource,
+ level,
+ PIPE_MAP_WRITE | PIPE_MAP_DISCARD_RANGE,
+ &box,
+ &transfer);
+ }
assert(map);
if (map) {
for (int z = 0; z < box.depth; ++z) {
@@ -874,7 +927,11 @@ ResourceUpdateSubResourceUP(D3D10DDI_HDEVICE hDevice, // IN
RowPitch,
0, 0);
}
- pipe_transfer_unmap(pipe, transfer);
+ if (pDstResource->buffer) {
+ pipe_buffer_unmap(pipe, transfer);
+ } else {
+ pipe_texture_unmap(pipe, transfer);
+ }
}
}
diff --git a/src/gallium/frontends/d3d10umd/ShaderParse.c b/src/gallium/frontends/d3d10umd/ShaderParse.c
index e4b6b88aa72909b6dc02c23dd13e442f9d3f4361..1995d381880d172ac49fe0d4461d439f35cf32b5 100644
--- a/src/gallium/frontends/d3d10umd/ShaderParse.c
+++ b/src/gallium/frontends/d3d10umd/ShaderParse.c
@@ -392,7 +392,7 @@ Shader_parse_opcode(struct Shader_parser *parser,
if (opcode_is_extended) {
/* NOTE: DECODE_IS_D3D10_SB_OPCODE_DOUBLE_EXTENDED is broken.
*/
- assert(!((*curr & D3D10_SB_OPCODE_DOUBLE_EXTENDED_MASK) >> D3D10_SB_OPERAND_DOUBLE_EXTENDED_SHIFT));
+ assert(!((*curr & D3D10_SB_OPERAND_DOUBLE_EXTENDED_MASK) >> D3D10_SB_OPERAND_DOUBLE_EXTENDED_SHIFT));
switch (DECODE_D3D10_SB_EXTENDED_OPCODE_TYPE(*curr)) {
case D3D10_SB_EXTENDED_OPCODE_EMPTY:
diff --git a/src/gallium/frontends/d3d10umd/ShaderParse.h b/src/gallium/frontends/d3d10umd/ShaderParse.h
index 5e8fba044ab5faf92f78d4f2bb75ec110752adb8..df95536f2b53eef900961f221100d4f2821a0f5d 100644
--- a/src/gallium/frontends/d3d10umd/ShaderParse.h
+++ b/src/gallium/frontends/d3d10umd/ShaderParse.h
@@ -35,9 +35,6 @@
#include "DriverIncludes.h"
-//#include "winddk/winddk_compat.h"
-#include "winddk/d3d10tokenizedprogramformat.hpp"
-
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/src/gallium/frontends/d3d10umd/State.h b/src/gallium/frontends/d3d10umd/State.h
index 5cb865ce69573a16e24e14df88e53a0e48c80130..3e45cb797435b40da0a4a1f5476fab2aecca08fd 100644
--- a/src/gallium/frontends/d3d10umd/State.h
+++ b/src/gallium/frontends/d3d10umd/State.h
@@ -150,6 +150,7 @@ struct Resource
DXGI_FORMAT Format;
UINT MipLevels;
UINT NumSubResources;
+ bool buffer;
struct pipe_resource *resource;
struct pipe_transfer **transfers;
struct pipe_stream_output_target *so_target;
diff --git a/src/gallium/frontends/d3d10umd/meson.build b/src/gallium/frontends/d3d10umd/meson.build
index 90774d9217d3ab5f4267974ae9018f55ab709f42..7141c8da17f7500b2d6e8e20faba9b5c70ab01d8 100644
--- a/src/gallium/frontends/d3d10umd/meson.build
+++ b/src/gallium/frontends/d3d10umd/meson.build
@@ -14,7 +14,7 @@ libd3d10umd = static_library(
'Debug.cpp',
'Device.cpp',
'Draw.cpp',
- 'Dxgi.cpp',
+ 'DxgiFns.cpp',
'Format.cpp',
'InputAssembly.cpp',
'OutputMerger.cpp',

3571
ports/mesa/def-fixes.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -3,16 +3,12 @@
# Patches are from https://github.com/pal1000/mesa-dist-win/tree/master/patches
set(PATCHES
# Fix swrAVX512 build
swravx512-post-static-link.patch
# Fix swr build with MSVC
swr-msvc-2.patch
# Fix swr build with LLVM 13
swr-llvm13.patch
# Fix radv MSVC build with LLVM 13
radv-msvc-llvm13-2.patch
# Fix d3d10sw MSVC build
d3d10sw.patch
# Fix symbols exporting for MinGW GCC x86
def-fixes.patch
# Fix MinGW clang build
clang.patch
# Clover build on Windows
clover.patch
)
vcpkg_check_linkage(ONLY_DYNAMIC_CRT)
@ -24,8 +20,8 @@ vcpkg_from_gitlab(
GITLAB_URL https://gitlab.freedesktop.org
OUT_SOURCE_PATH SOURCE_PATH
REPO mesa/mesa
REF mesa-21.2.5
SHA512 a9ead27f08e862738938cf728928b7937ff37e4c26967f2e46e40a3c8419159397f75b2f4ce43f9b453b35bb3716df581087fb7ba8434fafdfab9488c3db6f92
REF mesa-22.0.2
SHA512 1139bae1fa9f9b49727c5aaddad9b2908c7643d7c6c435544e8322c84d17c012f04aa73876bef8cab9b517e36957eb2a678b3001da2d69a32497ef4569f6172e
FILE_DISAMBIGUATOR 1
HEAD_REF master
PATCHES ${PATCHES}
@ -59,7 +55,6 @@ if(WIN32) # WIN32 HOST probably has win_flex and win_bison!
endif()
# For features https://github.com/pal1000/mesa-dist-win should be probably studied a bit more.
#string(APPEND GALLIUM_DRIVERS 'auto')
list(APPEND MESA_OPTIONS -Dzstd=enabled)
list(APPEND MESA_OPTIONS -Dshared-llvm=auto)
list(APPEND MESA_OPTIONS -Dlibunwind=disabled)
@ -70,24 +65,12 @@ list(APPEND MESA_OPTIONS -Dglx=disabled)
list(APPEND MESA_OPTIONS -Dgbm=disabled)
list(APPEND MESA_OPTIONS -Dosmesa=true)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
list(APPEND MESA_OPTIONS -Dshared-swr=false)
list(APPEND MESA_OPTIONS "-Dswr-arches=['avx']")
else()
list(APPEND MESA_OPTIONS -Dshared-swr=true)
list(APPEND MESA_OPTIONS "-Dswr-arches=['avx','avx2','knl','skx']")
endif()
string(APPEND GALLIUM_DRIVERS 'swrast')
if("llvm" IN_LIST FEATURES)
list(APPEND MESA_OPTIONS -Dllvm=enabled)
string(APPEND GALLIUM_DRIVERS ",'swr'") # SWR always requires llvm
else()
list(APPEND MESA_OPTIONS -Dllvm=disabled)
endif()
list(APPEND MESA_OPTIONS -Dgallium-drivers=[${GALLIUM_DRIVERS}])
if("gles1" IN_LIST FEATURES)
list(APPEND MESA_OPTIONS -Dgles1=enabled)
else()
@ -114,12 +97,12 @@ list(APPEND MESA_OPTIONS -Dshared-glapi=enabled) #shared GLAPI required when bu
if(VCPKG_TARGET_IS_WINDOWS)
list(APPEND MESA_OPTIONS -Dplatforms=['windows'])
list(APPEND MESA_OPTIONS -Dmicrosoft-clc=disabled)
if(NOT VCPKG_TARGET_IS_MINGW)
set(VCPKG_CXX_FLAGS "/D_CRT_DECLARE_NONSTDC_NAMES ${VCPKG_CXX_FLAGS}")
set(VCPKG_C_FLAGS "/D_CRT_DECLARE_NONSTDC_NAMES ${VCPKG_C_FLAGS}")
endif()
if(NOT VCPKG_TARGET_IS_MINGW)
set(VCPKG_CXX_FLAGS "/D_CRT_DECLARE_NONSTDC_NAMES ${VCPKG_CXX_FLAGS}")
set(VCPKG_C_FLAGS "/D_CRT_DECLARE_NONSTDC_NAMES ${VCPKG_C_FLAGS}")
endif()
endif()
vcpkg_configure_meson(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS

View File

@ -1,14 +0,0 @@
diff --git a/src/amd/compiler/aco_print_asm.cpp b/src/amd/compiler/aco_print_asm.cpp
index dcc7c4bc747..413e6464c79 100644
--- a/src/amd/compiler/aco_print_asm.cpp
+++ b/src/amd/compiler/aco_print_asm.cpp
@@ -24,6 +24,9 @@
#include "aco_ir.h"
+#if defined(_MSC_VER) && defined(restrict)
+#undef restrict
+#endif
#include "llvm/ac_llvm_util.h"
#include "llvm-c/Disassembler.h"

View File

@ -1,334 +0,0 @@
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
index 44482939c7649a2bcc39f3b2eb75720de90bcef0..1124e3773b99430c8da5ccb061d92b1b3a1bf1a6 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/JitManager.cpp
@@ -56,6 +56,14 @@
using namespace llvm;
using namespace SwrJit;
+#if LLVM_VERSION_MAJOR >= 7
+static constexpr llvm::sys::fs::OpenFlags OF_NONE = llvm::sys::fs::OF_None;
+static constexpr llvm::sys::fs::OpenFlags OF_TEXT = llvm::sys::fs::OF_Text;
+#else
+static constexpr llvm::sys::fs::OpenFlags OF_NONE = llvm::sys::fs::F_None;
+static constexpr llvm::sys::fs::OpenFlags OF_TEXT = llvm::sys::fs::F_Text;
+#endif
+
//////////////////////////////////////////////////////////////////////////
/// @brief Contructor for JitManager.
/// @param simdWidth - SIMD width to be used in generated program.
@@ -437,7 +445,7 @@ void JitManager::DumpAsm(Function* pFunction, const char* fileName)
sprintf(fName, "%s.%s.asm", funcName, fileName);
#endif
- raw_fd_ostream filestream(fName, EC, llvm::sys::fs::F_None);
+ raw_fd_ostream filestream(fName, EC, OF_NONE);
legacy::PassManager* pMPasses = new legacy::PassManager();
auto* pTarget = mpExec->getTargetMachine();
@@ -490,7 +498,7 @@ void JitManager::DumpToFile(Module* M,
#else
sprintf(fName, "%s.%s.ll", funcName, fileName);
#endif
- raw_fd_ostream fd(fName, EC, llvm::sys::fs::F_None);
+ raw_fd_ostream fd(fName, EC, OF_NONE);
M->print(fd, annotater);
fd.flush();
}
@@ -512,7 +520,7 @@ void JitManager::DumpToFile(Function* f, const char* fileName)
#else
sprintf(fName, "%s.%s.ll", funcName, fileName);
#endif
- raw_fd_ostream fd(fName, EC, llvm::sys::fs::F_None);
+ raw_fd_ostream fd(fName, EC, OF_NONE);
f->print(fd, nullptr);
#if defined(_WIN32)
@@ -522,7 +530,7 @@ void JitManager::DumpToFile(Function* f, const char* fileName)
#endif
fd.flush();
- raw_fd_ostream fd_cfg(fName, EC, llvm::sys::fs::F_Text);
+ raw_fd_ostream fd_cfg(fName, EC, OF_TEXT);
WriteGraph(fd_cfg, (const Function*)f);
fd_cfg.flush();
@@ -726,7 +734,7 @@ void JitCache::notifyObjectCompiled(const llvm::Module* M, llvm::MemoryBufferRef
{
std::error_code err;
- llvm::raw_fd_ostream fileObj(objPath.c_str(), err, llvm::sys::fs::F_None);
+ llvm::raw_fd_ostream fileObj(objPath.c_str(), err, OF_NONE);
fileObj << Obj.getBuffer();
fileObj.flush();
}
@@ -734,7 +742,7 @@ void JitCache::notifyObjectCompiled(const llvm::Module* M, llvm::MemoryBufferRef
{
std::error_code err;
- llvm::raw_fd_ostream fileObj(filePath.c_str(), err, llvm::sys::fs::F_None);
+ llvm::raw_fd_ostream fileObj(filePath.c_str(), err, OF_NONE);
uint32_t objcrc = ComputeCRC(0, Obj.getBufferStart(), Obj.getBufferSize());
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder_gfx_mem.h b/src/gallium/drivers/swr/rasterizer/jitter/builder_gfx_mem.h
index c361959b76ff0799f5102ad4b8ddf23d345105d9..64a690b47fac9ee99eba8f1259ffccf20f0e5fa0 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/builder_gfx_mem.h
+++ b/src/gallium/drivers/swr/rasterizer/jitter/builder_gfx_mem.h
@@ -41,31 +41,29 @@ namespace SwrJit
BuilderGfxMem(JitManager* pJitMgr);
virtual ~BuilderGfxMem() {}
- virtual Value* GEP(Value* Ptr, Value* Idx, Type* Ty = nullptr, bool isReadOnly = true, const Twine& Name = "");
- virtual Value* GEP(Type* Ty, Value* Ptr, Value* Idx, const Twine& Name = "");
- virtual Value*
- GEP(Value* Ptr, const std::initializer_list<Value*>& indexList, Type* Ty = nullptr);
- virtual Value*
- GEP(Value* Ptr, const std::initializer_list<uint32_t>& indexList, Type* Ty = nullptr);
+ virtual Value* GEP(Value* Ptr, Value* Idx, Type* Ty = nullptr, bool isReadOnly = true, const Twine& Name = "") override;
+ virtual Value* GEP(Type* Ty, Value* Ptr, Value* Idx, const Twine& Name = "") override;
+ virtual Value* GEP(Value* Ptr, const std::initializer_list<Value*>& indexList, Type* Ty = nullptr) override;
+ virtual Value* GEP(Value* Ptr, const std::initializer_list<uint32_t>& indexList, Type* Ty = nullptr) override;
virtual LoadInst* LOAD(Value* Ptr,
const char* Name,
Type* Ty = nullptr,
- MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL);
+ MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL) override;
virtual LoadInst* LOAD(Value* Ptr,
const Twine& Name = "",
Type* Ty = nullptr,
- MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL);
+ MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL) override;
virtual LoadInst* LOAD(Value* Ptr,
bool isVolatile,
const Twine& Name = "",
Type* Ty = nullptr,
- MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL);
+ MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL) override;
virtual LoadInst* LOAD(Value* BasePtr,
const std::initializer_list<uint32_t>& offset,
const llvm::Twine& Name = "",
Type* Ty = nullptr,
- MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL);
+ MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL) override;
virtual CallInst* MASKED_LOAD(Value* Ptr,
unsigned Align,
@@ -73,32 +71,32 @@ namespace SwrJit
Value* PassThru = nullptr,
const Twine& Name = "",
Type* Ty = nullptr,
- MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL);
+ MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL) override;
- virtual StoreInst* STORE(Value *Val, Value *Ptr, bool isVolatile = false, Type* Ty = nullptr, MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL);
-
- virtual StoreInst* STORE(Value* Val, Value* BasePtr, const std::initializer_list<uint32_t>& offset, Type* Ty = nullptr, MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL);
+ virtual StoreInst* STORE(Value *Val, Value *Ptr, bool isVolatile = false, Type* Ty = nullptr, MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL) override;
- virtual CallInst* MASKED_STORE(Value *Val, Value *Ptr, unsigned Align, Value *Mask, Type* Ty = nullptr, MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL);
+ virtual StoreInst* STORE(Value* Val, Value* BasePtr, const std::initializer_list<uint32_t>& offset, Type* Ty = nullptr, MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL) override;
+
+ virtual CallInst* MASKED_STORE(Value *Val, Value *Ptr, unsigned Align, Value *Mask, Type* Ty = nullptr, MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL) override;
virtual Value* GATHERPS(Value* src,
Value* pBase,
Value* indices,
Value* mask,
uint8_t scale = 1,
- MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL);
+ MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL) override;
virtual Value* GATHERDD(Value* src,
Value* pBase,
Value* indices,
Value* mask,
uint8_t scale = 1,
- MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL);
+ MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL) override;
virtual void SCATTERPS(Value* pDst,
Value* vSrc,
Value* vOffsets,
Value* vMask,
- MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL);
+ MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL) override;
Value* TranslateGfxAddressForRead(Value* xpGfxAddress,
Type* PtrTy = nullptr,
@@ -108,13 +106,13 @@ namespace SwrJit
Type* PtrTy = nullptr,
const Twine& Name = "",
MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL);
-
+
protected:
void AssertGFXMemoryParams(Value* ptr, MEM_CLIENT usage);
virtual void NotifyPrivateContextSet();
- virtual Value* OFFSET_TO_NEXT_COMPONENT(Value* base, Constant* offset);
+ virtual Value* OFFSET_TO_NEXT_COMPONENT(Value* base, Constant* offset) override;
Value* TranslationHelper(Value* Ptr, Type* Ty, Value* pfnTranslateGfxAddress);
void TrackerHelper(Value* Ptr, Type* Ty, MEM_CLIENT usage, bool isRead);
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp
index b5eb0a782b15214bcf954a7893cd628649a990fc..a16b5d11dbb2f2f1a0bcdc07e4d306b14a90dc4c 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp
@@ -82,7 +82,12 @@ namespace SwrJit
std::vector<Value*> indices;
for (auto i : indexList)
indices.push_back(i);
+#if LLVM_VERSION_MAJOR >= 13
+ Type *EltTy = cast<PointerType>(ptr->getType())->getElementType();
+ return IN_BOUNDS_GEP(EltTy, ptr, indices);
+#else
return IN_BOUNDS_GEP(ptr, indices);
+#endif
}
Value* Builder::IN_BOUNDS_GEP(Value* ptr, const std::initializer_list<uint32_t>& indexList)
@@ -90,7 +95,12 @@ namespace SwrJit
std::vector<Value*> indices;
for (auto i : indexList)
indices.push_back(C(i));
+#if LLVM_VERSION_MAJOR >= 13
+ Type *EltTy = cast<PointerType>(ptr->getType())->getElementType();
+ return IN_BOUNDS_GEP(EltTy, ptr, indices);
+#else
return IN_BOUNDS_GEP(ptr, indices);
+#endif
}
LoadInst* Builder::LOAD(Value* Ptr, const char* Name, Type* Ty, MEM_CLIENT usage)
@@ -130,6 +140,22 @@ namespace SwrJit
return Builder::LOAD(GEPA(basePtr, valIndices), name);
}
+ CallInst* Builder::MASKED_LOAD(Value* Ptr,
+ unsigned Align,
+ Value* Mask,
+ Value* PassThru,
+ const Twine& Name,
+ Type* Ty,
+ MEM_CLIENT usage)
+ {
+#if LLVM_VERSION_MAJOR >= 13
+ Type *EltTy = cast<PointerType>(Ptr->getType())->getElementType();
+ return IRB()->CreateMaskedLoad(EltTy, Ptr, AlignType(Align), Mask, PassThru, Name);
+#else
+ return IRB()->CreateMaskedLoad(Ptr, AlignType(Align), Mask, PassThru, Name);
+#endif
+ }
+
LoadInst* Builder::LOADV(Value* basePtr,
const std::initializer_list<Value*>& indices,
const llvm::Twine& name)
@@ -234,7 +260,12 @@ namespace SwrJit
/// @param pVecPassthru - SIMD wide vector of values to load when lane is inactive
Value* Builder::GATHER_PTR(Value* pVecSrcPtr, Value* pVecMask, Value* pVecPassthru)
{
+#if LLVM_VERSION_MAJOR >= 13
+ Type *EltTy = cast<PointerType>(pVecSrcPtr->getType())->getElementType();
+ return MASKED_GATHER(EltTy, pVecSrcPtr, AlignType(4), pVecMask, pVecPassthru);
+#else
return MASKED_GATHER(pVecSrcPtr, AlignType(4), pVecMask, pVecPassthru);
+#endif
}
void Builder::SCATTER_PTR(Value* pVecDstPtr, Value* pVecSrc, Value* pVecMask)
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h
index 429d5779a4db2a6a3b6c7a7d02169773c935bb95..6682ad892b4038d4b3172b932a34e31a89cd7790 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h
+++ b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.h
@@ -82,10 +82,7 @@ virtual CallInst* MASKED_LOAD(Value* Ptr,
Value* PassThru = nullptr,
const Twine& Name = "",
Type* Ty = nullptr,
- MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL)
-{
- return IRB()->CreateMaskedLoad(Ptr, AlignType(Align), Mask, PassThru, Name);
-}
+ MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL);
virtual StoreInst* STORE(Value *Val, Value *Ptr, bool isVolatile = false, Type* Ty = nullptr, MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL)
{
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp b/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp
index bd5f7588c9189275ddaf3075b0a75e2e8fc1ecf5..2a4cf74722bc9ef1831d25fe6c2bb2f510b8fceb 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/fetch_jit.cpp
@@ -276,7 +276,8 @@ Function* FetchJit::Create(const FETCH_COMPILE_STATE& fetchState)
JitManager::DumpToFile(fetch, "src");
#if defined(_DEBUG)
- verifyFunction(*fetch);
+ // Note that false is returned if there are no errors
+ SWR_ASSERT(!verifyFunction(*fetch, &llvm::errs()));
#endif
::FunctionPassManager setupPasses(JM()->mpCurrentModule);
diff --git a/src/gallium/drivers/swr/swr_shader.cpp b/src/gallium/drivers/swr/swr_shader.cpp
index 315036920fb3ad364d0039349e148c70e5ba1818..a643b46cd081c026b5a3558d22be557338d4f220 100644
--- a/src/gallium/drivers/swr/swr_shader.cpp
+++ b/src/gallium/drivers/swr/swr_shader.cpp
@@ -1557,8 +1557,10 @@ BuilderSWR::CompileGS(struct swr_context *ctx, swr_jit_gs_key &key)
AttributeSet attrSet = AttributeSet::get(
JM()->mContext, AttributeSet::FunctionIndex, attrBuilder);
pFunction->addAttributes(AttributeSet::FunctionIndex, attrSet);
-#else
+#elif LLVM_VERSION_MAJOR < 14
pFunction->addAttributes(AttributeList::FunctionIndex, attrBuilder);
+#else
+ pFunction->addFnAttrs(attrBuilder);
#endif
BasicBlock *block = BasicBlock::Create(JM()->mContext, "entry", pFunction);
@@ -1785,8 +1787,10 @@ BuilderSWR::CompileTES(struct swr_context *ctx, swr_jit_tes_key &key)
AttributeSet attrSet = AttributeSet::get(
JM()->mContext, AttributeSet::FunctionIndex, attrBuilder);
pFunction->addAttributes(AttributeSet::FunctionIndex, attrSet);
-#else
+#elif LLVM_VERSION_MAJOR < 14
pFunction->addAttributes(AttributeList::FunctionIndex, attrBuilder);
+#else
+ pFunction->addFnAttrs(attrBuilder);
#endif
BasicBlock *block = BasicBlock::Create(JM()->mContext, "entry", pFunction);
@@ -2086,8 +2090,10 @@ BuilderSWR::CompileTCS(struct swr_context *ctx, swr_jit_tcs_key &key)
AttributeSet attrSet = AttributeSet::get(
JM()->mContext, AttributeSet::FunctionIndex, attrBuilder);
pFunction->addAttributes(AttributeSet::FunctionIndex, attrSet);
-#else
+#elif LLVM_VERSION_MAJOR < 14
pFunction->addAttributes(AttributeList::FunctionIndex, attrBuilder);
+#else
+ pFunction->addFnAttrs(attrBuilder);
#endif
BasicBlock *block = BasicBlock::Create(JM()->mContext, "entry", pFunction);
@@ -2341,8 +2347,10 @@ BuilderSWR::CompileVS(struct swr_context *ctx, swr_jit_vs_key &key)
AttributeSet attrSet = AttributeSet::get(
JM()->mContext, AttributeSet::FunctionIndex, attrBuilder);
pFunction->addAttributes(AttributeSet::FunctionIndex, attrSet);
-#else
+#elif LLVM_VERSION_MAJOR < 14
pFunction->addAttributes(AttributeList::FunctionIndex, attrBuilder);
+#else
+ pFunction->addFnAttrs(attrBuilder);
#endif
BasicBlock *block = BasicBlock::Create(JM()->mContext, "entry", pFunction);
@@ -2646,8 +2654,10 @@ BuilderSWR::CompileFS(struct swr_context *ctx, swr_jit_fs_key &key)
AttributeSet attrSet = AttributeSet::get(
JM()->mContext, AttributeSet::FunctionIndex, attrBuilder);
pFunction->addAttributes(AttributeSet::FunctionIndex, attrSet);
-#else
+#elif LLVM_VERSION_MAJOR < 14
pFunction->addAttributes(AttributeList::FunctionIndex, attrBuilder);
+#else
+ pFunction->addFnAttrs(attrBuilder);
#endif
BasicBlock *block = BasicBlock::Create(JM()->mContext, "entry", pFunction);

View File

@ -1,57 +0,0 @@
From 68d1addf6f0cf693fdb42db3555112e257a3d771 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= <marek.olsak@amd.com>
Date: Sun, 24 Oct 2021 21:36:09 -0400
Subject: [PATCH] swr: fix MSVC build
---
src/gallium/drivers/swr/swr_draw.cpp | 6 +++---
src/gallium/drivers/swr/swr_state.cpp | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/swr/swr_draw.cpp b/src/gallium/drivers/swr/swr_draw.cpp
index 4b42a8e0390..5d862adb39d 100644
--- a/src/gallium/drivers/swr/swr_draw.cpp
+++ b/src/gallium/drivers/swr/swr_draw.cpp
@@ -62,7 +62,7 @@ swr_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info,
if (!indirect &&
!info->primitive_restart &&
- !u_trim_pipe_prim(info->mode, (unsigned*)&draws[0].count))
+ !u_trim_pipe_prim((enum pipe_prim_type)info->mode, (unsigned*)&draws[0].count))
return;
if (!swr_check_render_cond(pipe))
@@ -102,7 +102,7 @@ swr_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info,
STREAMOUT_COMPILE_STATE state = {0};
struct pipe_stream_output_info *so = &ctx->vs->pipe.stream_output;
- state.numVertsPerPrim = u_vertices_per_prim(info->mode);
+ state.numVertsPerPrim = u_vertices_per_prim((enum pipe_prim_type)info->mode);
uint32_t offsets[MAX_SO_STREAMS] = {0};
uint32_t num = 0;
@@ -221,7 +221,7 @@ swr_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info,
if (ctx->gs)
topology = (pipe_prim_type)ctx->gs->info.base.properties[TGSI_PROPERTY_GS_OUTPUT_PRIM];
else
- topology = info->mode;
+ topology = (enum pipe_prim_type)info->mode;
switch (topology) {
case PIPE_PRIM_TRIANGLE_FAN:
diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp
index 5f1464e6d0e..818328750bd 100644
--- a/src/gallium/drivers/swr/swr_state.cpp
+++ b/src/gallium/drivers/swr/swr_state.cpp
@@ -1731,7 +1731,7 @@ swr_update_derived(struct pipe_context *pipe,
/* Has to be before fragment shader, since it sets SWR_NEW_FS */
if (p_draw_info) {
bool new_prim_is_poly =
- (u_reduced_prim(p_draw_info->mode) == PIPE_PRIM_TRIANGLES) &&
+ (u_reduced_prim((enum pipe_prim_type)p_draw_info->mode) == PIPE_PRIM_TRIANGLES) &&
(ctx->derived.rastState.fillMode == SWR_FILLMODE_SOLID);
if (new_prim_is_poly != ctx->poly_stipple.prim_is_poly) {
ctx->dirty |= SWR_NEW_FS;
--
2.25.1

View File

@ -1,22 +0,0 @@
diff --git a/src/gallium/drivers/swr/meson.build b/src/gallium/drivers/swr/meson.build
index 11ea7d3f43e..f34e88b1eec 100644
--- a/src/gallium/drivers/swr/meson.build
+++ b/src/gallium/drivers/swr/meson.build
@@ -213,7 +213,7 @@ endif
if with_swr_arches.contains('skx')
swr_skx_args = cpp.first_supported_argument(
- '-march=skylake-avx512', '-target-cpu=x86-skylake', '-xCORE-AVX512',
+ '-march=skylake-avx512', '-target-cpu=x86-skylake', '-xCORE-AVX512', '/arch:AVX512',
)
if swr_skx_args == []
error('Cannot find SKX support for swr.')
@@ -252,7 +252,7 @@ endif
if with_swr_arches.contains('knl')
swr_knl_args = cpp.first_supported_argument(
- '-march=knl', '-target-cpu=mic-knl', '-xMIC-AVX512',
+ '-march=knl', '-target-cpu=mic-knl', '-xMIC-AVX512', '/arch:AVX512',
)
if swr_knl_args == []
error('Cannot find KNL support for swr.')

View File

@ -1,7 +1,6 @@
{
"name": "mesa",
"version": "21.2.5",
"port-version": 4,
"version": "22.0.2",
"description": "Mesa - The 3D Graphics Library",
"homepage": "https://www.mesa3d.org/",
"license": "MIT AND BSL-1.0 AND SGI-B-2.0",

View File

@ -9,6 +9,7 @@
"name": "llvm",
"default-features": false,
"features": [
"bolt",
"clang",
"disable-assertions",
"disable-clang-static-analyzer",
@ -21,6 +22,7 @@
"enable-zlib",
"lld",
"lldb",
"openmp",
"polly",
"target-aarch64",
"target-amdgpu",

View File

@ -2721,7 +2721,7 @@
"port-version": 1
},
"halide": {
"baseline": "13.0.2",
"baseline": "14.0.0",
"port-version": 0
},
"happly": {
@ -4265,8 +4265,8 @@
"port-version": 2
},
"llvm": {
"baseline": "13.0.0",
"port-version": 5
"baseline": "14.0.3",
"port-version": 0
},
"lmdb": {
"baseline": "0.9.29",
@ -4469,8 +4469,8 @@
"port-version": 2
},
"mesa": {
"baseline": "21.2.5",
"port-version": 4
"baseline": "22.0.2",
"port-version": 0
},
"meschach": {
"baseline": "1.2b",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "8beaf9e4b505e3a59e286d220492de1af4381154",
"version": "14.0.0",
"port-version": 0
},
{
"git-tree": "92aa2ed7a51a38dfb53cdcb2f4b9c54f58030d52",
"version": "13.0.2",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "751084451d4807176af868b2edab17131c2e4a09",
"version": "14.0.3",
"port-version": 0
},
{
"git-tree": "1c835fcc79ad542a73ac25fd939556039ff75cd1",
"version": "13.0.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "7df282d97d0ef5ec5a19b770dced8cd773e570c0",
"version": "22.0.2",
"port-version": 0
},
{
"git-tree": "32925250dd7d2e060ca2cfe9fbda1d3f4312f29a",
"version": "21.2.5",