From 90a901bd52891e5e42dd18e35c206c528637fde0 Mon Sep 17 00:00:00 2001 From: Vincent Date: Sat, 4 Oct 2025 17:28:21 +0100 Subject: [PATCH 1/2] llvm-core: add version `20.1.6` --- recipes/llvm-core/all/conandata.yml | 12 +++ .../patches/20x/0000-cmake-dependencies.patch | 93 +++++++++++++++++++ recipes/llvm-core/config.yml | 2 + 3 files changed, 107 insertions(+) create mode 100644 recipes/llvm-core/all/patches/20x/0000-cmake-dependencies.patch diff --git a/recipes/llvm-core/all/conandata.yml b/recipes/llvm-core/all/conandata.yml index dd26cdba6b0b2..43ef1c177e8c1 100644 --- a/recipes/llvm-core/all/conandata.yml +++ b/recipes/llvm-core/all/conandata.yml @@ -1,4 +1,11 @@ sources: + "20.1.6": + "llvm": + url: https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.6/llvm-20.1.6.src.tar.xz + sha256: f09e304ca98bb809f492ec34f94f587361b4b0d06ed783fb3a41e7fb218e47a1 + "cmake": + url: https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.6/cmake-20.1.6.src.tar.xz + sha256: b4b3efa5d5b01b3f211f1ba326bb6f0c318331f828202d332c95b7f30fca5f8c "19.1.7": "llvm": url: https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.7/llvm-19.1.7.src.tar.xz @@ -17,6 +24,11 @@ sources: sha256: ce8508e318a01a63d4e8b3090ab2ded3c598a50258cc49e2625b9120d4c03ea5 patches: + "20.1.6": + - patch_file: patches/20x/0000-cmake-dependencies.patch + patch_description: fix references to third party libs to match conan variables and targets + patch_type: conan + base_path: llvm-main "19.1.7": - patch_file: patches/19x/0000-cmake-dependencies.patch patch_description: fix references to third party libs to match conan variables and targets diff --git a/recipes/llvm-core/all/patches/20x/0000-cmake-dependencies.patch b/recipes/llvm-core/all/patches/20x/0000-cmake-dependencies.patch new file mode 100644 index 0000000000000..c48278fb680d2 --- /dev/null +++ b/recipes/llvm-core/all/patches/20x/0000-cmake-dependencies.patch @@ -0,0 +1,93 @@ +diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake +index 767774812ade..7a037ce02fb1 100644 +--- a/cmake/config-ix.cmake ++++ b/cmake/config-ix.cmake +@@ -173,7 +173,7 @@ if(LLVM_ENABLE_ZLIB) + # library on a 64-bit system which would result in a link-time failure. + cmake_push_check_state() + list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS}) +- list(APPEND CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARY}) ++ list(APPEND CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES}) + check_symbol_exists(compress2 zlib.h HAVE_ZLIB) + cmake_pop_check_state() + if(LLVM_ENABLE_ZLIB STREQUAL FORCE_ON AND NOT HAVE_ZLIB) +@@ -268,11 +268,11 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") + # Skip libedit if using ASan as it contains memory leaks. + if (LLVM_ENABLE_LIBEDIT AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*") + if(LLVM_ENABLE_LIBEDIT STREQUAL FORCE_ON) +- find_package(LibEdit REQUIRED) ++ find_package(editline REQUIRED) + else() +- find_package(LibEdit) ++ find_package(editline) + endif() +- set(HAVE_LIBEDIT "${LibEdit_FOUND}") ++ set(HAVE_LIBEDIT "${editline_FOUND}") + else() + set(HAVE_LIBEDIT 0) + endif() +diff --git a/lib/LineEditor/CMakeLists.txt b/lib/LineEditor/CMakeLists.txt +index c4cd91cbb0cd..b95d073d9725 100644 +--- a/lib/LineEditor/CMakeLists.txt ++++ b/lib/LineEditor/CMakeLists.txt +@@ -1,5 +1,5 @@ + if(HAVE_LIBEDIT) +- set(link_libs LibEdit::LibEdit) ++ set(link_libs editline::editline) + endif() + + add_llvm_component_library(LLVMLineEditor +diff --git a/lib/Support/CMakeLists.txt b/lib/Support/CMakeLists.txt +index a6d8a2581886..e33c86c159bc 100644 +--- a/lib/Support/CMakeLists.txt ++++ b/lib/Support/CMakeLists.txt +@@ -316,27 +316,13 @@ set(llvm_system_libs ${system_libs}) + # This block is only needed for llvm-config. When we deprecate llvm-config and + # move to using CMake export, this block can be removed. + if(LLVM_ENABLE_ZLIB) +- # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators. +- if(CMAKE_BUILD_TYPE) +- string(TOUPPER ${CMAKE_BUILD_TYPE} build_type) +- get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION_${build_type}) +- endif() +- if(NOT zlib_library) +- get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION) +- endif() ++ set(zlib_library ${ZLIB_LIBRARIES}) + get_library_name(${zlib_library} zlib_library) + set(llvm_system_libs ${llvm_system_libs} "${zlib_library}") + endif() + + if(LLVM_ENABLE_ZSTD) +- # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators. +- if(CMAKE_BUILD_TYPE) +- string(TOUPPER ${CMAKE_BUILD_TYPE} build_type) +- get_property(zstd_library TARGET ${zstd_target} PROPERTY LOCATION_${build_type}) +- endif() +- if(NOT zstd_library) +- get_property(zstd_library TARGET ${zstd_target} PROPERTY LOCATION) +- endif() ++ set(zstd_library ${zstd_LIBRARIES}) + if (zstd_target STREQUAL zstd::libzstd_shared) + get_library_name(${zstd_library} zstd_library) + set(llvm_system_libs ${llvm_system_libs} "${zstd_library}") +diff --git a/lib/WindowsManifest/CMakeLists.txt b/lib/WindowsManifest/CMakeLists.txt +index 910132a4c7de..f4d91c9d56da 100644 +--- a/lib/WindowsManifest/CMakeLists.txt ++++ b/lib/WindowsManifest/CMakeLists.txt +@@ -21,14 +21,7 @@ add_llvm_component_library(LLVMWindowsManifest + # This block is only needed for llvm-config. When we deprecate llvm-config and + # move to using CMake export, this block can be removed. + if(LLVM_ENABLE_LIBXML2) +- # CMAKE_BUILD_TYPE is only meaningful to single-configuration generators. +- if(CMAKE_BUILD_TYPE) +- string(TOUPPER ${CMAKE_BUILD_TYPE} build_type) +- get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION_${build_type}) +- endif() +- if(NOT libxml2_library) +- get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION) +- endif() ++ set(libxml2_library ${libxml2_LIBRARIES}) + get_library_name(${libxml2_library} libxml2_library) + set_property(TARGET LLVMWindowsManifest PROPERTY LLVM_SYSTEM_LIBS ${libxml2_library}) + endif() diff --git a/recipes/llvm-core/config.yml b/recipes/llvm-core/config.yml index ba4acd330c459..31fdad7103bc2 100644 --- a/recipes/llvm-core/config.yml +++ b/recipes/llvm-core/config.yml @@ -1,4 +1,6 @@ versions: + "20.1.6": + folder: all "19.1.7": folder: all "13.0.0": From 9a0f722e6913cadec89522ef07df4489a7cbd6ea Mon Sep 17 00:00:00 2001 From: Vincent Date: Sun, 5 Oct 2025 17:25:34 +0100 Subject: [PATCH 2/2] llvm-core: add SPIRV target support --- recipes/llvm-core/all/conanfile.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/recipes/llvm-core/all/conanfile.py b/recipes/llvm-core/all/conanfile.py index e82900990eeb2..f0dbb220b1dcc 100644 --- a/recipes/llvm-core/all/conanfile.py +++ b/recipes/llvm-core/all/conanfile.py @@ -46,6 +46,7 @@ "PowerPC", "RISCV", "Sparc", + "SPIRV", "SystemZ", "VE", "WebAssembly", @@ -325,7 +326,11 @@ def _targets_to_build(self): @property def _all_targets(self): - targets = LLVM_TARGETS if Version(self.version) >= 14 else LLVM_TARGETS - {"LoongArch", "VE"} + targets = LLVM_TARGETS + if Version(self.version) < 20: + targets -= {"SPIRV"} + if Version(self.version) < 14: + targets -= {"LoongArch", "VE"} return ";".join(targets) def generate(self):