diff --git a/ports/halide/portfile.cmake b/ports/halide/portfile.cmake index 486726c289e395..1b7dea6d572c5f 100644 --- a/ports/halide/portfile.cmake +++ b/ports/halide/portfile.cmake @@ -1,11 +1,13 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) +set(HALIDE_VERSION_TAG v13.0.2) + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO halide/Halide - REF 5dabcaa9effca1067f907f6c8ea212f3d2b1d99a # v12.0.1 - SHA512 5ab44703850885561337e23d8b538a5adfe1611e24e8daa4a1313756b4f9dfeb54e89bf8400d46a3340c00234402681b4f44ba3ed5322027fd6cb5dfbd525acd - HEAD_REF release/12.x + REF ${HALIDE_VERSION_TAG} + SHA512 d2b19934ff0d759d302428f61e4075306f79c29cc1cd8802dc1ac5f325434034e0f430c435610e58f862b87cc8ef34ddcc3d0588947eeb8e1387d0bf31b9c008 + HEAD_REF release/13.x ) vcpkg_check_features( @@ -68,8 +70,5 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/tutorial) -file(GLOB readmes "${CURRENT_PACKAGES_DIR}/share/${PORT}/*.md") -file(REMOVE ${readmes}) - configure_file(${SOURCE_PATH}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) -configure_file(${CMAKE_CURRENT_LIST_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/${PORT}/usage COPYONLY) +configure_file(${CMAKE_CURRENT_LIST_DIR}/usage.in ${CURRENT_PACKAGES_DIR}/share/${PORT}/usage @ONLY) diff --git a/ports/halide/usage b/ports/halide/usage deleted file mode 100644 index 591e497db458ef..00000000000000 --- a/ports/halide/usage +++ /dev/null @@ -1,14 +0,0 @@ -The package halide provides CMake targets: - - find_package(Halide REQUIRED) - - # JIT mode: - target_link_libraries(main PRIVATE Halide::Halide) - - # AOT mode: - target_link_libraries(gen PRIVATE Halide::Generator) - add_halide_library(filter FROM gen) - target_link_libraries(main PRIVATE filter) - -For more information see: - https://github.com/halide/Halide/blob/v12.0.1/README_cmake.md diff --git a/ports/halide/usage.in b/ports/halide/usage.in new file mode 100644 index 00000000000000..70cb98bd390f0a --- /dev/null +++ b/ports/halide/usage.in @@ -0,0 +1,27 @@ +The package halide provides CMake targets: + + set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD_REQUIRED YES) + set(CMAKE_CXX_EXTENSIONS NO) + + find_package(Halide REQUIRED) + + # JIT mode: + add_executable(my_halide_app main.cpp) + target_link_libraries(my_halide_app PRIVATE Halide::Halide) + + # AOT mode: + add_executable(my_generators my_generators.cpp) + target_link_libraries(my_generators PRIVATE Halide::Generator) + add_halide_library(my_first_generator FROM my_generators) + add_halide_library(my_second_generator FROM my_generators + PARAMS parallel=false scale=3.0 rotation=ccw output.type=uint16) + add_halide_library(my_second_generator_2 FROM my_generators + GENERATOR my_second_generator + PARAMS scale=9.0 rotation=ccw output.type=float32) + add_halide_library(my_second_generator_3 FROM my_generators + GENERATOR my_second_generator + PARAMS parallel=false output.type=float64) + +For more information see: + https://github.com/halide/Halide/blob/@HALIDE_VERSION_TAG@/README_cmake.md diff --git a/ports/halide/vcpkg.json b/ports/halide/vcpkg.json index baa99449ae8893..4e54393fe62d91 100644 --- a/ports/halide/vcpkg.json +++ b/ports/halide/vcpkg.json @@ -1,7 +1,6 @@ { "name": "halide", - "version": "12.0.1", - "port-version": 1, + "version": "13.0.2", "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", diff --git a/ports/llvm/0002-fix-install-paths.patch b/ports/llvm/0002-fix-install-paths.patch index 84d973f6537fbb..3582bcbfd2cc61 100644 --- a/ports/llvm/0002-fix-install-paths.patch +++ b/ports/llvm/0002-fix-install-paths.patch @@ -9,10 +9,10 @@ 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/clang/cmake/modules/CMakeLists.txt b/clang/cmake/modules/CMakeLists.txt -index d233f552f01f..26f502ad2d23 100644 +index 561665d58cad..3c73878a4483 100644 --- a/clang/cmake/modules/CMakeLists.txt +++ b/clang/cmake/modules/CMakeLists.txt -@@ -1,11 +1,11 @@ +@@ -3,11 +3,11 @@ include(LLVMDistributionSupport) # 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. @@ -27,7 +27,7 @@ index d233f552f01f..26f502ad2d23 100644 get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS) diff --git a/flang/cmake/modules/CMakeLists.txt b/flang/cmake/modules/CMakeLists.txt -index 4822124ca412..1ca3eff8f14e 100644 +index e46498a6bc35..2e922f8ca89d 100644 --- a/flang/cmake/modules/CMakeLists.txt +++ b/flang/cmake/modules/CMakeLists.txt @@ -1,11 +1,11 @@ @@ -45,7 +45,7 @@ index 4822124ca412..1ca3eff8f14e 100644 get_property(FLANG_EXPORTS GLOBAL PROPERTY FLANG_EXPORTS) diff --git a/lld/cmake/modules/CMakeLists.txt b/lld/cmake/modules/CMakeLists.txt -index fa505a533762..90413be34120 100644 +index 62d03fa901dd..09b0f54ee8c3 100644 --- a/lld/cmake/modules/CMakeLists.txt +++ b/lld/cmake/modules/CMakeLists.txt @@ -1,11 +1,11 @@ @@ -63,10 +63,10 @@ index fa505a533762..90413be34120 100644 get_property(LLD_EXPORTS GLOBAL PROPERTY LLD_EXPORTS) diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake -index b74adc11ade9..0638aea2f8f6 100644 +index 29e40f45fef8..e9094e9b8eb2 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake -@@ -974,7 +974,7 @@ function(process_llvm_pass_plugins) +@@ -1033,7 +1033,7 @@ function(process_llvm_pass_plugins) ## Part 1: Extension header to be included whenever we need extension # processing. @@ -76,20 +76,22 @@ index b74adc11ade9..0638aea2f8f6 100644 file(WRITE "${llvm_cmake_builddir}/LLVMConfigExtensions.cmake" diff --git a/llvm/cmake/modules/CMakeLists.txt b/llvm/cmake/modules/CMakeLists.txt -index 4b8879f65fe4..9e097ab223b5 100644 +index 51b6a4fdc284..a818de2e116c 100644 --- a/llvm/cmake/modules/CMakeLists.txt +++ b/llvm/cmake/modules/CMakeLists.txt -@@ -1,4 +1,4 @@ +@@ -1,6 +1,6 @@ + include(LLVMDistributionSupport) + -set(LLVM_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm) +set(LLVM_INSTALL_PACKAGE_DIR share/llvm) set(llvm_cmake_builddir "${LLVM_BINARY_DIR}/${LLVM_INSTALL_PACKAGE_DIR}") # 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 b9fb9adce2ea..85a54f699f30 100644 +index 65efc4a14987..7c3213ab0c2b 100644 --- a/mlir/cmake/modules/CMakeLists.txt +++ b/mlir/cmake/modules/CMakeLists.txt -@@ -1,11 +1,11 @@ +@@ -3,11 +3,11 @@ include(LLVMDistributionSupport) # 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. @@ -104,7 +106,7 @@ index b9fb9adce2ea..85a54f699f30 100644 get_property(MLIR_EXPORTS GLOBAL PROPERTY MLIR_EXPORTS) diff --git a/polly/cmake/CMakeLists.txt b/polly/cmake/CMakeLists.txt -index 211f95512717..2abe3803f910 100644 +index 7cc129ba2e90..9776391cd535 100644 --- a/polly/cmake/CMakeLists.txt +++ b/polly/cmake/CMakeLists.txt @@ -1,7 +1,7 @@ @@ -118,7 +120,7 @@ index 211f95512717..2abe3803f910 100644 set(POLLY_EXPORTS_FILE_NAME "PollyExports-$>.cmake") else() diff --git a/pstl/CMakeLists.txt b/pstl/CMakeLists.txt -index 8e6e1354707b..2ae7f7090025 100644 +index 8bea8843589b..3658c0a4414a 100644 --- a/pstl/CMakeLists.txt +++ b/pstl/CMakeLists.txt @@ -81,10 +81,10 @@ install(TARGETS ParallelSTL diff --git a/ports/llvm/0003-fix-openmp-debug.patch b/ports/llvm/0003-fix-openmp-debug.patch index adf3c8ad01289e..3eff4fa538902a 100644 --- a/ports/llvm/0003-fix-openmp-debug.patch +++ b/ports/llvm/0003-fix-openmp-debug.patch @@ -2,10 +2,10 @@ 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt -index 822f9ca2b825..814e25864610 100644 +index bdb867e352f7..16a13fa959ea 100644 --- a/openmp/runtime/src/CMakeLists.txt +++ b/openmp/runtime/src/CMakeLists.txt -@@ -157,7 +157,7 @@ else() +@@ -159,7 +159,7 @@ else() endif() set_target_properties(omp PROPERTIES @@ -14,7 +14,7 @@ index 822f9ca2b825..814e25864610 100644 LINK_FLAGS "${LIBOMP_CONFIGURED_LDFLAGS}" LINKER_LANGUAGE ${LIBOMP_LINKER_LANGUAGE} ) -@@ -232,7 +232,7 @@ if(WIN32) +@@ -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 diff --git a/ports/llvm/0004-fix-dr-1734.patch b/ports/llvm/0004-fix-dr-1734.patch index adfbe5a131e21d..3a2f4a28e3e956 100644 --- a/ports/llvm/0004-fix-dr-1734.patch +++ b/ports/llvm/0004-fix-dr-1734.patch @@ -1,13 +1,16 @@ + llvm/include/llvm/Support/type_traits.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + diff --git a/llvm/include/llvm/Support/type_traits.h b/llvm/include/llvm/Support/type_traits.h -index b7d48e8e1ad..53ba24efc00 100644 +index 7b7d5d991f3f..469b681deea3 100644 --- a/llvm/include/llvm/Support/type_traits.h +++ b/llvm/include/llvm/Support/type_traits.h -@@ -177,7 +177,8 @@ class is_trivially_copyable { +@@ -176,7 +176,8 @@ class is_trivially_copyable { (has_deleted_copy_assign || has_trivial_copy_assign) && (has_deleted_copy_constructor || has_trivial_copy_constructor); - + -#ifdef HAVE_STD_IS_TRIVIALLY_COPYABLE -+ // due to DR 1734, a type can be std::is_trivially_copyable but not llvm::is_trivially_copyable ++// due to DR 1734, a type can be std::is_trivially_copyable but not llvm::is_trivially_copyable +#if 0 static_assert(value == std::is_trivially_copyable::value, "inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable"); diff --git a/ports/llvm/0005-fix-tools-path.patch b/ports/llvm/0005-fix-tools-path.patch index bdfad617cc97f5..06fc8fc249ede7 100644 --- a/ports/llvm/0005-fix-tools-path.patch +++ b/ports/llvm/0005-fix-tools-path.patch @@ -1,14 +1,16 @@ + llvm/tools/llvm-config/llvm-config.cpp | 2 +- + 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 53ba24efc00..0badcafe000 100644 +index 1a2f04552d13..9370c5e28206 100644 --- a/llvm/tools/llvm-config/llvm-config.cpp +++ b/llvm/tools/llvm-config/llvm-config.cpp -@@ -304,8 +304,8 @@ int main(int argc, char **argv) { - // Create an absolute path, and pop up one directory (we expect to be inside a +@@ -305,7 +305,7 @@ int main(int argc, char **argv) { // bin dir). sys::fs::make_absolute(CurrentPath); CurrentExecPrefix = - sys::path::parent_path(sys::path::parent_path(CurrentPath)).str(); + sys::path::parent_path(sys::path::parent_path(sys::path::parent_path(CurrentPath))).str(); - + // Check to see if we are inside a development tree by comparing to possible // locations (prefix style or CMake style). diff --git a/ports/llvm/0007-fix-compiler-rt-install-path.patch b/ports/llvm/0007-fix-compiler-rt-install-path.patch index 286604623a24e1..6a585cd429da4a 100644 --- a/ports/llvm/0007-fix-compiler-rt-install-path.patch +++ b/ports/llvm/0007-fix-compiler-rt-install-path.patch @@ -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 0692fe75a441..65f72c2da7da 100644 +index 8131f6005dc2..9afef2e5a4e7 100644 --- a/clang/lib/Headers/CMakeLists.txt +++ b/clang/lib/Headers/CMakeLists.txt -@@ -208,7 +208,7 @@ set_target_properties(clang-resource-headers PROPERTIES +@@ -222,7 +222,7 @@ set_target_properties(clang-resource-headers PROPERTIES FOLDER "Misc" RUNTIME_OUTPUT_DIRECTORY "${output_dir}") @@ -17,23 +17,23 @@ index 0692fe75a441..65f72c2da7da 100644 install( FILES ${files} ${generated_files} diff --git a/clang/runtime/CMakeLists.txt b/clang/runtime/CMakeLists.txt -index 61bbbf8faedd..f6d0b73d9913 100644 +index 61b1c60bf590..c20a5a326f15 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}/) -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} -- -DCOMPILER_RT_INSTALL_PATH:STRING=lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION} -+ -DCOMPILER_RT_INSTALL_PATH:STRING=tools/llvm/lib/clang/${CLANG_VERSION} +- -DCOMPILER_RT_INSTALL_PATH:PATH=lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION} ++ -DCOMPILER_RT_INSTALL_PATH:PATH=tools/llvm/lib/clang/${CLANG_VERSION} -DCOMPILER_RT_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS} -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 964dd598f102..7379a1ba06d1 100644 +index c11342e68813..61bb52135c43 100644 --- a/compiler-rt/cmake/base-config-ix.cmake +++ b/compiler-rt/cmake/base-config-ix.cmake -@@ -43,7 +43,7 @@ if (LLVM_TREE_AVAILABLE) +@@ -42,7 +42,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}) diff --git a/ports/llvm/0008-fix-libcxx-install.patch b/ports/llvm/0008-fix-libcxx-install.patch deleted file mode 100644 index ec4019dc2f86f4..00000000000000 --- a/ports/llvm/0008-fix-libcxx-install.patch +++ /dev/null @@ -1,18 +0,0 @@ - libcxx/src/CMakeLists.txt | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/libcxx/src/CMakeLists.txt b/libcxx/src/CMakeLists.txt -index 9965104cb5b2..0d2a33c6b33c 100644 ---- a/libcxx/src/CMakeLists.txt -+++ b/libcxx/src/CMakeLists.txt -@@ -372,9 +372,7 @@ endif() - # NOTE: This install command must go after the cxx install command otherwise - # it will not be executed after the library symlinks are installed. - if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT) -- # Replace the libc++ filename with $ -- # after we required CMake 3.0. -- install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}" -+ install(FILES "$" - DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} - COMPONENT libcxx) - endif() diff --git a/ports/llvm/0009-fix-tools-install-path.patch b/ports/llvm/0009-fix-tools-install-path.patch index b544feec08ede3..bfc5c5fc2bb4b7 100644 --- a/ports/llvm/0009-fix-tools-install-path.patch +++ b/ports/llvm/0009-fix-tools-install-path.patch @@ -7,10 +7,11 @@ 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 +- - 12 files changed, 13 insertions(+), 13 deletions(-) + 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/clang-tools-extra/modularize/CMakeLists.txt b/clang-tools-extra/modularize/CMakeLists.txt index 4caae81c49b6..8c459c51cc34 100644 @@ -24,11 +25,11 @@ index 4caae81c49b6..8c459c51cc34 100644 + RUNTIME DESTINATION tools/llvm COMPONENT clang-extras) diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake -index 704278a0e93b..e8a87f574474 100644 +index 5752f4277444..00b7d21b8fef 100644 --- a/clang/cmake/modules/AddClang.cmake +++ b/clang/cmake/modules/AddClang.cmake -@@ -170,7 +170,7 @@ macro(add_clang_tool name) - +@@ -159,7 +159,7 @@ macro(add_clang_tool name) + get_target_export_arg(${name} Clang export_to_clangtargets) install(TARGETS ${name} ${export_to_clangtargets} - RUNTIME DESTINATION bin @@ -74,10 +75,10 @@ index ec0702d76f18..9a34a09921b1 100644 endforeach() diff --git a/clang/tools/scan-view/CMakeLists.txt b/clang/tools/scan-view/CMakeLists.txt -index dd3d33439299..ded0b5530ad9 100644 +index eccc6b83195b..232976c0c227 100644 --- a/clang/tools/scan-view/CMakeLists.txt +++ b/clang/tools/scan-view/CMakeLists.txt -@@ -19,7 +19,7 @@ if(CLANG_INSTALL_SCANVIEW) +@@ -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} @@ -100,11 +101,11 @@ index 62f2de0cb15c..38dc821c76de 100644 add_custom_target(hmaptool ALL DEPENDS ${Depends}) diff --git a/flang/cmake/modules/AddFlang.cmake b/flang/cmake/modules/AddFlang.cmake -index ba36a234babf..1197a8d8ff32 100644 +index 5da58a59ed12..c019d7fc50a9 100644 --- a/flang/cmake/modules/AddFlang.cmake +++ b/flang/cmake/modules/AddFlang.cmake -@@ -119,7 +119,7 @@ macro(add_flang_tool name) - +@@ -108,7 +108,7 @@ macro(add_flang_tool name) + get_target_export_arg(${name} Flang export_to_flangtargets) install(TARGETS ${name} ${export_to_flangtargets} - RUNTIME DESTINATION bin @@ -113,30 +114,41 @@ index ba36a234babf..1197a8d8ff32 100644 if(NOT LLVM_ENABLE_IDE) diff --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt -index 2e5350aecdc6..b4ab145846b5 100644 +index 239859b5e5b9..12d00f904f8a 100644 --- a/flang/tools/f18/CMakeLists.txt +++ b/flang/tools/f18/CMakeLists.txt -@@ -63,12 +63,12 @@ endforeach() +@@ -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) - file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/flang - DESTINATION ${CMAKE_BINARY_DIR}/bin - FILE_PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE) + 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) endif() +diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt +index 4c7ad220d223..f4206913e76f 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 + ) + +-install(TARGETS flang-new DESTINATION bin) ++install(TARGETS flang-new DESTINATION tools/llvm) diff --git a/lld/cmake/modules/AddLLD.cmake b/lld/cmake/modules/AddLLD.cmake -index 23df41312403..86f4eafeed07 100644 +index 9883475d1aa5..48e46586f387 100644 --- a/lld/cmake/modules/AddLLD.cmake +++ b/lld/cmake/modules/AddLLD.cmake -@@ -54,7 +54,7 @@ macro(add_lld_tool name) - +@@ -46,7 +46,7 @@ macro(add_lld_tool name) + get_target_export_arg(${name} LLD export_to_lldtargets) install(TARGETS ${name} ${export_to_lldtargets} - RUNTIME DESTINATION bin @@ -145,7 +157,7 @@ index 23df41312403..86f4eafeed07 100644 if(NOT CMAKE_CONFIGURATION_TYPES) diff --git a/lld/tools/lld/CMakeLists.txt b/lld/tools/lld/CMakeLists.txt -index 5cff736ff57f..32f43bc1c9be 100644 +index e77b2161a873..b325b934640c 100644 --- a/lld/tools/lld/CMakeLists.txt +++ b/lld/tools/lld/CMakeLists.txt @@ -21,7 +21,7 @@ target_link_libraries(lld @@ -158,7 +170,7 @@ index 5cff736ff57f..32f43bc1c9be 100644 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 4ed5c647c5d2..cb31901dddbb 100644 +index 8be214a8509a..4a5d0fa39be3 100644 --- a/lldb/cmake/modules/AddLLDB.cmake +++ b/lldb/cmake/modules/AddLLDB.cmake @@ -187,7 +187,7 @@ function(add_lldb_executable name) diff --git a/ports/llvm/0010-fix-libffi.patch b/ports/llvm/0010-fix-libffi.patch index e98825595d3c69..93d0cb4da4d421 100644 --- a/ports/llvm/0010-fix-libffi.patch +++ b/ports/llvm/0010-fix-libffi.patch @@ -2,10 +2,10 @@ 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake -index 818fafbce148..66fc9f509ac7 100644 +index dd0aaadb47c7..279435b5b27d 100644 --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake -@@ -335,7 +335,7 @@ if( LLVM_ENABLE_FFI ) +@@ -343,7 +343,7 @@ if( LLVM_ENABLE_FFI ) message(FATAL_ERROR "libffi includes are not found.") endif() diff --git a/ports/llvm/0011-fix-libxml2.patch b/ports/llvm/0011-fix-libxml2.patch index b5deff09f9b60f..d3f953f320df6b 100644 --- a/ports/llvm/0011-fix-libxml2.patch +++ b/ports/llvm/0011-fix-libxml2.patch @@ -3,7 +3,7 @@ 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 ceef4b086..40b9e9955 100644 +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 @@ -20,10 +20,10 @@ index ceef4b086..40b9e9955 100644 endif() diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake -index 2fdf1502d..beeeeb9b1 100644 +index b62cd7d24438..a8c78ee1bccd 100644 --- a/lldb/cmake/modules/LLDBConfig.cmake +++ b/lldb/cmake/modules/LLDBConfig.cmake -@@ -214,7 +214,7 @@ if (LLDB_ENABLE_LZMA) +@@ -215,7 +215,7 @@ if (LLDB_ENABLE_LZMA) endif() if (LLDB_ENABLE_LIBXML2) diff --git a/ports/llvm/portfile.cmake b/ports/llvm/portfile.cmake index 1b2dcf6939360f..fe9a001dba7073 100644 --- a/ports/llvm/portfile.cmake +++ b/ports/llvm/portfile.cmake @@ -1,4 +1,4 @@ -set(LLVM_VERSION "12.0.1") +set(LLVM_VERSION "13.0.0") vcpkg_check_linkage(ONLY_STATIC_LIBRARY) @@ -6,7 +6,7 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO llvm/llvm-project REF llvmorg-${LLVM_VERSION} - SHA512 6eb0dc18e2c25935fabfdfc48b0114be0939158dfdef7b85b395fe2e71042672446af0e68750aae003c9847d10d1f63316fe95d3df738d18f249174292b1b9e1 + SHA512 8004c05d32b9720fb3391783621690c1df9bd1e97e72cbff9192ed88a84b0acd303b61432145fa917b5b5e548c8cee29b24ef8547dcc8677adf4816e7a8a0eb2 HEAD_REF master PATCHES 0002-fix-install-paths.patch # This patch fixes paths in ClangConfig.cmake, LLVMConfig.cmake, LLDConfig.cmake etc. @@ -14,7 +14,6 @@ vcpkg_from_github( 0004-fix-dr-1734.patch 0005-fix-tools-path.patch 0007-fix-compiler-rt-install-path.patch - 0008-fix-libcxx-install.patch 0009-fix-tools-install-path.patch 0010-fix-libffi.patch 0011-fix-libxml2.patch @@ -112,9 +111,8 @@ if("compiler-rt" IN_LIST FEATURES) list(APPEND LLVM_ENABLE_PROJECTS "compiler-rt") endif() if("flang" IN_LIST FEATURES) - # Disable Flang on Windows (see http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html). - if(VCPKG_TARGET_IS_WINDOWS) - message(FATAL_ERROR "Building Flang with MSVC is not supported. Disable it until issues are fixed.") + if(VCPKG_TARGET_IS_WINDOWS 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") list(APPEND FEATURE_OPTIONS @@ -157,9 +155,8 @@ if("openmp" IN_LIST FEATURES) list(APPEND LLVM_ENABLE_PROJECTS "openmp") # Perl is required for the OpenMP run-time vcpkg_find_acquire_program(PERL) - list(APPEND FEATURE_OPTIONS - "-DPERL_EXECUTABLE=${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 @@ -236,9 +233,8 @@ if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL "${VCPKG_DETECTED_CMAKE_SYSTEM_PROCESS endif() endif() -vcpkg_configure_cmake( +vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH}/llvm - PREFER_NINJA OPTIONS ${FEATURE_OPTIONS} ${CROSS_OPTIONS} @@ -261,57 +257,63 @@ vcpkg_configure_cmake( -DCMAKE_DEBUG_POSTFIX=d ) -vcpkg_install_cmake() - -vcpkg_fixup_cmake_targets(CONFIG_PATH "share/llvm" TARGET_PATH "share/llvm") -file(INSTALL ${SOURCE_PATH}/llvm/LICENSE.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/llvm RENAME copyright) -file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/llvm_usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/llvm RENAME usage) - -if("clang" IN_LIST FEATURES) - vcpkg_fixup_cmake_targets(CONFIG_PATH "share/clang" TARGET_PATH "share/clang" DO_NOT_DELETE_PARENT_CONFIG_PATH) - file(INSTALL ${SOURCE_PATH}/clang/LICENSE.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/clang RENAME copyright) - file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/clang_usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/clang RENAME usage) -endif() +vcpkg_cmake_install(ADD_BIN_TO_PATH) -if("clang-tools-extra" IN_LIST FEATURES) - # Remove empty include directory include/clang-tidy/plugin - file(GLOB_RECURSE INCLUDE_CLANG_TIDY_PLUGIN_FILES "${CURRENT_PACKAGES_DIR}/include/clang-tidy/plugin/*") - if(NOT INCLUDE_CLANG_TIDY_PLUGIN_FILES) - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/clang-tidy/plugin") +function(llvm_cmake_package_config_fixup package_name) + cmake_parse_arguments("arg" "DO_NOT_DELETE_PARENT_CONFIG_PATH" "FEATURE_NAME" "" ${ARGN}) + if(NOT DEFINED arg_FEATURE_NAME) + set(arg_FEATURE_NAME ${package_name}) endif() -endif() - -if("flang" IN_LIST FEATURES) - vcpkg_fixup_cmake_targets(CONFIG_PATH "share/flang" TARGET_PATH "share/flang" DO_NOT_DELETE_PARENT_CONFIG_PATH) - file(INSTALL ${SOURCE_PATH}/flang/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/flang RENAME copyright) - file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/flang_usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/flang RENAME usage) - # Remove empty include directory /include/flang/Config - file(GLOB_RECURSE INCLUDE_FLANG_CONFIG_FILES "${CURRENT_PACKAGES_DIR}/include/flang/Config/*") - if(NOT INCLUDE_FLANG_CONFIG_FILES) - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/flang/Config") + if("${arg_FEATURE_NAME}" STREQUAL "${PORT}" OR "${arg_FEATURE_NAME}" IN_LIST FEATURES) + set(args) + list(APPEND args PACKAGE_NAME "${package_name}") + if(arg_DO_NOT_DELETE_PARENT_CONFIG_PATH) + list(APPEND args "DO_NOT_DELETE_PARENT_CONFIG_PATH") + endif() + vcpkg_cmake_config_fixup(${args}) + file(INSTALL "${SOURCE_PATH}/${package_name}/LICENSE.TXT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${package_name}" RENAME copyright) + if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${package_name}_usage") + file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/${package_name}_usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${package_name}" RENAME usage) + endif() endif() -endif() +endfunction() -if("lld" IN_LIST FEATURES) - vcpkg_fixup_cmake_targets(CONFIG_PATH "share/lld" TARGET_PATH "share/lld" DO_NOT_DELETE_PARENT_CONFIG_PATH) - file(INSTALL ${SOURCE_PATH}/lld/LICENSE.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/lld RENAME copyright) - file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/lld_usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/lld RENAME usage) -endif() +llvm_cmake_package_config_fixup("clang" DO_NOT_DELETE_PARENT_CONFIG_PATH) +llvm_cmake_package_config_fixup("flang" DO_NOT_DELETE_PARENT_CONFIG_PATH) +llvm_cmake_package_config_fixup("lld" DO_NOT_DELETE_PARENT_CONFIG_PATH) +llvm_cmake_package_config_fixup("mlir" DO_NOT_DELETE_PARENT_CONFIG_PATH) +llvm_cmake_package_config_fixup("polly" DO_NOT_DELETE_PARENT_CONFIG_PATH) +llvm_cmake_package_config_fixup("ParallelSTL" FEATURE_NAME "pstl" DO_NOT_DELETE_PARENT_CONFIG_PATH) +llvm_cmake_package_config_fixup("llvm") -if("mlir" IN_LIST FEATURES) - vcpkg_fixup_cmake_targets(CONFIG_PATH "share/mlir" TARGET_PATH "share/mlir" DO_NOT_DELETE_PARENT_CONFIG_PATH) - file(INSTALL ${SOURCE_PATH}/mlir/LICENSE.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/mlir RENAME copyright) - file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/mlir_usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/mlir RENAME usage) +set(empty_dirs) + +if("clang-tools-extra" IN_LIST FEATURES) + list(APPEND empty_dirs "${CURRENT_PACKAGES_DIR}/include/clang-tidy/plugin") endif() -if("polly" IN_LIST FEATURES) - vcpkg_fixup_cmake_targets(CONFIG_PATH "share/polly" TARGET_PATH "share/polly" DO_NOT_DELETE_PARENT_CONFIG_PATH) - file(INSTALL ${SOURCE_PATH}/polly/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/polly RENAME copyright) +if("flang" IN_LIST FEATURES) + list(APPEND empty_dirs "${CURRENT_PACKAGES_DIR}/include/flang/Config") + list(APPEND empty_dirs "${CURRENT_PACKAGES_DIR}/include/flang/CMakeFiles") + list(APPEND empty_dirs "${CURRENT_PACKAGES_DIR}/include/flang/Optimizer/CMakeFiles") + list(APPEND empty_dirs "${CURRENT_PACKAGES_DIR}/include/flang/Optimizer/CodeGen/CMakeFiles") + list(APPEND empty_dirs "${CURRENT_PACKAGES_DIR}/include/flang/Optimizer/Dialect/CMakeFiles") + list(APPEND empty_dirs "${CURRENT_PACKAGES_DIR}/include/flang/Optimizer/Transforms/CMakeFiles") endif() -if("pstl" IN_LIST FEATURES) - vcpkg_fixup_cmake_targets(CONFIG_PATH "share/ParallelSTL" TARGET_PATH "share/ParallelSTL" DO_NOT_DELETE_PARENT_CONFIG_PATH) - file(INSTALL ${SOURCE_PATH}/pstl/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/ParallelSTL RENAME copyright) +if(empty_dirs) + foreach(empty_dir IN LISTS empty_dirs) + if(NOT EXISTS "${empty_dir}") + message(SEND_ERROR "Directory '${empty_dir}' is not exist. Please remove it from the checking.") + else() + file(GLOB_RECURSE files_in_dir "${empty_dir}/*") + if(files_in_dir) + message(SEND_ERROR "Directory '${empty_dir}' is not empty. Please remove it from the checking.") + else() + file(REMOVE_RECURSE "${empty_dir}") + endif() + endif() + endforeach() endif() vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) diff --git a/ports/llvm/vcpkg.json b/ports/llvm/vcpkg.json index afa41a8abe7ebd..12ac5a1878a239 100644 --- a/ports/llvm/vcpkg.json +++ b/ports/llvm/vcpkg.json @@ -1,9 +1,19 @@ { "name": "llvm", - "version-string": "12.0.1", + "version": "13.0.0", "description": "The LLVM Compiler Infrastructure.", "homepage": "https://llvm.org", - "supports": "!uwp", + "supports": "!uwp & !(arm & windows)", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], "default-features": [ "clang", "default-options", @@ -150,6 +160,7 @@ "name": "llvm", "default-features": false, "features": [ + "clang", "mlir", "tools" ] diff --git a/ports/mesa/d3d10sw.patch b/ports/mesa/d3d10sw.patch new file mode 100644 index 00000000000000..98221873b0673b --- /dev/null +++ b/ports/mesa/d3d10sw.patch @@ -0,0 +1,383 @@ +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 + +-#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 ++#endif ++ + #include + + #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 + +-#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', diff --git a/ports/mesa/portfile.cmake b/ports/mesa/portfile.cmake index 0039249051c52f..6f00ba81512b99 100644 --- a/ports/mesa/portfile.cmake +++ b/ports/mesa/portfile.cmake @@ -5,6 +5,14 @@ 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 ) vcpkg_check_linkage(ONLY_DYNAMIC_CRT) @@ -16,8 +24,8 @@ vcpkg_from_gitlab( GITLAB_URL https://gitlab.freedesktop.org OUT_SOURCE_PATH SOURCE_PATH REPO mesa/mesa - REF mesa-21.2.0 - SHA512 4837e42474d69861fbce4fa03d120b56997094d61b3045c417bbab73774dda86e4b7adf54af98585511a3517860c33c77898e6171cd845f760bada4b000ff52d + REF mesa-21.2.5 + SHA512 24387ce5ea0f200b39f930a842fc56fa120dd5cc6a94d175374ce788356dc7ac73e6390a7ffa6a1f2b0eb212cc00f556c7204548118ececb69d3555f0a259bc0 HEAD_REF master PATCHES ${PATCHES} ) @@ -192,6 +200,6 @@ file(REMOVE ${_double_files}) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/GLES) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/GLES2) -# # Handle copyright +# Handle copyright file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}") file(TOUCH "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright") diff --git a/ports/mesa/radv-msvc-llvm13-2.patch b/ports/mesa/radv-msvc-llvm13-2.patch new file mode 100644 index 00000000000000..039ef66d93fe0f --- /dev/null +++ b/ports/mesa/radv-msvc-llvm13-2.patch @@ -0,0 +1,14 @@ +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" diff --git a/ports/mesa/swr-llvm13.patch b/ports/mesa/swr-llvm13.patch new file mode 100644 index 00000000000000..e0da05bf5b53c8 --- /dev/null +++ b/ports/mesa/swr-llvm13.patch @@ -0,0 +1,334 @@ +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& indexList, Type* Ty = nullptr); +- virtual Value* +- GEP(Value* Ptr, const std::initializer_list& 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& indexList, Type* Ty = nullptr) override; ++ virtual Value* GEP(Value* Ptr, const std::initializer_list& 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& 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& 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& 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 indices; + for (auto i : indexList) + indices.push_back(i); ++#if LLVM_VERSION_MAJOR >= 13 ++ Type *EltTy = cast(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& indexList) +@@ -90,7 +95,12 @@ namespace SwrJit + std::vector indices; + for (auto i : indexList) + indices.push_back(C(i)); ++#if LLVM_VERSION_MAJOR >= 13 ++ Type *EltTy = cast(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(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& 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(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); diff --git a/ports/mesa/swr-msvc-2.patch b/ports/mesa/swr-msvc-2.patch new file mode 100644 index 00000000000000..f202fa0e865dc6 --- /dev/null +++ b/ports/mesa/swr-msvc-2.patch @@ -0,0 +1,57 @@ +From 68d1addf6f0cf693fdb42db3555112e257a3d771 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= +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 + diff --git a/ports/mesa/vcpkg.json b/ports/mesa/vcpkg.json index 30639334243765..add7ffe48fb559 100644 --- a/ports/mesa/vcpkg.json +++ b/ports/mesa/vcpkg.json @@ -1,7 +1,6 @@ { "name": "mesa", - "version": "21.2.0", - "port-version": 1, + "version": "21.2.5", "description": "Mesa - The 3D Graphics Library", "homepage": "https://www.mesa3d.org/", "supports": "!(windows & arm)", diff --git a/ports/opencv4/portfile.cmake b/ports/opencv4/portfile.cmake index 484742639cefcc..c616a3990b03f4 100644 --- a/ports/opencv4/portfile.cmake +++ b/ports/opencv4/portfile.cmake @@ -373,6 +373,16 @@ if("ffmpeg" IN_LIST FEATURES) endif() endif() +if("halide" IN_LIST FEATURES) + list(APPEND ADDITIONAL_BUILD_FLAGS + # Halide 13 requires C++17 + "-DCMAKE_CXX_STANDARD=17" + "-DCMAKE_CXX_STANDARD_REQUIRED=ON" + "-DCMAKE_DISABLE_FIND_PACKAGE_Halide=ON" + "-DHALIDE_ROOT_DIR=${CURRENT_INSTALLED_DIR}" + ) +endif() + if("qt" IN_LIST FEATURES) list(APPEND ADDITIONAL_BUILD_FLAGS "-DCMAKE_AUTOMOC=ON") endif() @@ -448,8 +458,6 @@ vcpkg_cmake_configure( ###### customized properties ## Options from vcpkg_check_features() ${FEATURE_OPTIONS} - -DCMAKE_DISABLE_FIND_PACKAGE_Halide=ON - -DHALIDE_ROOT_DIR=${CURRENT_INSTALLED_DIR} -DWITH_GTK=${WITH_GTK} -DWITH_QT=${WITH_QT} -DWITH_IPP=${WITH_IPP} diff --git a/ports/opencv4/vcpkg.json b/ports/opencv4/vcpkg.json index 2f9ade0ecc84f3..5f97c6cf53e9d6 100644 --- a/ports/opencv4/vcpkg.json +++ b/ports/opencv4/vcpkg.json @@ -1,7 +1,7 @@ { "name": "opencv4", "version": "4.5.4", - "port-version": 1, + "port-version": 2, "description": "computer vision library", "homepage": "https://github.com/opencv/opencv", "dependencies": [ diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 88689adb9c38ea..f29445d95b6e6b 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -764,9 +764,6 @@ live555:x64-windows-static-md=fail live555:x86-windows=fail llgl:arm-uwp=fail llgl:x64-uwp=fail -llvm:arm64-windows=fail -llvm:arm-uwp=fail -llvm:x64-uwp=fail lmdb:arm-uwp=fail lmdb:x64-uwp=fail log4cplus:arm-uwp=fail diff --git a/scripts/test_ports/vcpkg-ci-llvm/portfile.cmake b/scripts/test_ports/vcpkg-ci-llvm/portfile.cmake new file mode 100644 index 00000000000000..0015715fb66c72 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-llvm/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) \ No newline at end of file diff --git a/scripts/test_ports/vcpkg-ci-llvm/vcpkg.json b/scripts/test_ports/vcpkg-ci-llvm/vcpkg.json new file mode 100644 index 00000000000000..d04286b65641d6 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-llvm/vcpkg.json @@ -0,0 +1,38 @@ +{ + "name": "vcpkg-ci-llvm", + "version-string": "0", + "description": "LLVM features testing within CI.", + "supports": "!uwp & !(arm & windows)", + "dependencies": [ + { + "name": "llvm", + "default-features": false, + "features": [ + "clang", + "enable-abi-breaking-checks", + "disable-assertions", + "disable-clang-static-analyzer", + "enable-bindings", + "enable-eh", + "enable-rtti", + "enable-terminfo", + "enable-threads", + "enable-zlib", + "lld", + "lldb", + "polly", + "target-all", + "tools", + "utils" + ] + }, + { + "name": "llvm", + "default-features": false, + "features": [ + "flang" + ], + "platform": "!(x86 & windows)" + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 8f110801d4c84c..ce4b882bebed9a 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2645,8 +2645,8 @@ "port-version": 1 }, "halide": { - "baseline": "12.0.1", - "port-version": 1 + "baseline": "13.0.2", + "port-version": 0 }, "happly": { "baseline": "2021-03-19", @@ -4149,7 +4149,7 @@ "port-version": 2 }, "llvm": { - "baseline": "12.0.1", + "baseline": "13.0.0", "port-version": 0 }, "lmdb": { @@ -4345,8 +4345,8 @@ "port-version": 2 }, "mesa": { - "baseline": "21.2.0", - "port-version": 1 + "baseline": "21.2.5", + "port-version": 0 }, "meschach": { "baseline": "1.2b", @@ -4958,7 +4958,7 @@ }, "opencv4": { "baseline": "4.5.4", - "port-version": 1 + "port-version": 2 }, "opendnp3": { "baseline": "3.1.1", diff --git a/versions/h-/halide.json b/versions/h-/halide.json index 8a2628d869f258..c313ea05b6b22d 100644 --- a/versions/h-/halide.json +++ b/versions/h-/halide.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "92aa2ed7a51a38dfb53cdcb2f4b9c54f58030d52", + "version": "13.0.2", + "port-version": 0 + }, { "git-tree": "512cb4dd40ca40afbf0c6a35f7bdc595589a0b10", "version": "12.0.1", diff --git a/versions/l-/llvm.json b/versions/l-/llvm.json index 6874e9e106f292..512f009fd477ea 100644 --- a/versions/l-/llvm.json +++ b/versions/l-/llvm.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "fe86b4985609d9beb13e17327c52af54fb4869d4", + "version": "13.0.0", + "port-version": 0 + }, { "git-tree": "3726ade4edd3bd8e47f0cddbfac1e67803e7adea", "version-string": "12.0.1", diff --git a/versions/m-/mesa.json b/versions/m-/mesa.json index 635a3154795293..3e7707d7b84889 100644 --- a/versions/m-/mesa.json +++ b/versions/m-/mesa.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "55d54a8cf6adc14ea9d2ac84621f75295a367a07", + "version": "21.2.5", + "port-version": 0 + }, { "git-tree": "5308d779b4070c295771c630e4b2251582e16d0c", "version": "21.2.0", diff --git a/versions/o-/opencv4.json b/versions/o-/opencv4.json index 92371593ae56e1..2bde4f038f4c55 100644 --- a/versions/o-/opencv4.json +++ b/versions/o-/opencv4.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "537abba5a070d173cf42510f86ff4ffe057dd77f", + "version": "4.5.4", + "port-version": 2 + }, { "git-tree": "6a5d8c17cfd9a4e3caa7acf4625876fec8880fe2", "version": "4.5.4",