diff --git a/README.md b/README.md index 6406339c27..e653aa5260 100644 --- a/README.md +++ b/README.md @@ -203,8 +203,8 @@ For more information please consult our [PhASAR wiki pages](https://github.com/s ## How to use with Conan v2 ? To export the recipe and dependencies execute from repo root: -- `conan export utils/conan/llvm-core/ --version 14.0.6 --user secure-software-engineering` -- `conan export utils/conan/clang/ --version 14.0.6 --user secure-software-engineering` +- `conan export utils/conan/llvm-core/ --version 15.0.7 --user secure-software-engineering` +- `conan export utils/conan/clang/ --version 15.0.7 --user secure-software-engineering` - `conan export .` - View exported `conan list "phasar/*"` - [Consume the package](https://docs.conan.io/2/tutorial/consuming_packages.html) diff --git a/conanfile.py b/conanfile.py index 8ce3c40477..af1dfe05bf 100644 --- a/conanfile.py +++ b/conanfile.py @@ -121,12 +121,14 @@ class PhasarRecipe(ConanFile): "shared": [True, False], "fPIC": [True, False], "tests": [True, False], + "llvm_version": ["ANY"], } default_options = { "with_z3": True, "shared": False, "fPIC": True, "tests": False, + "llvm_version": "15.0.7" } def _parse_gitignore(self, folder, additional_exclusions = [], invert=False): @@ -208,7 +210,7 @@ def set_version(self): git = Git(self, self.recipe_folder) # XXX consider git.coordinates_to_conandata() if git.is_dirty(): - raise ConanException("Repository is dirty. I can't calculate a correct version and this is a potential leak because all files visible to git will be exported. Please stash or commit.") + raise ConanException("Repository is dirty. I can't calculate a correct version and this is a potential leak because all files visible to git will be exported. Please stash or commit, to skip this for local testing use \"--version dev\".") self.output.info("No version information set, retrieving from git.") calver = git.run("show -s --date=format:'%Y.%m.%d' --format='%cd'") short_hash = git.run("show -s --format='%h'") @@ -228,7 +230,7 @@ def config_options(self): def requirements(self): self.requires("boost/[>1.72.0 <=1.86.0]") self.requires("sqlite3/[>=3 <4]") - self.requires("clang/14.0.6@secure-software-engineering", transitive_libs=True, transitive_headers=True) + self.requires(f"clang/{self.options.llvm_version}@secure-software-engineering", transitive_libs=True, transitive_headers=True) self.requires("nlohmann_json/3.11.3", transitive_headers=True) self.requires("json-schema-validator/2.3.0", transitive_libs=True, transitive_headers=True) @@ -238,7 +240,7 @@ def requirements(self): if self.options.with_z3: self.requires("z3/[>=4.7.1 <5]") llvm_options["with_z3"] = True - self.requires("llvm-core/14.0.6@secure-software-engineering", transitive_libs=True, transitive_headers=True, options=llvm_options) + self.requires(f"llvm-core/{self.options.llvm_version}@secure-software-engineering", transitive_libs=True, transitive_headers=True, options=llvm_options) def build_requirements(self): self.tool_requires("cmake/[>=3.25.0 <4.0.0]") # find_program validator diff --git a/utils/conan/clang/conandata.yml b/utils/conan/clang/conandata.yml index dcca509be6..72e0caa08f 100644 --- a/utils/conan/clang/conandata.yml +++ b/utils/conan/clang/conandata.yml @@ -2,10 +2,22 @@ sources: "18.1.7": url: https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.7/clang-18.1.7.src.tar.xz sha256: c9191e4896e43425a8fbbb29e3b25b3a83050781809fbd4d0ad2382bc4a5c43d + "15.0.7": + "clang": + url: https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.7/clang-15.0.7.src.tar.xz + sha256: a6b673ef15377fb46062d164e8ddc4d05c348ff8968f015f7f4af03f51000067 + "cmake": + url: https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.7/cmake-15.0.7.src.tar.xz + sha256: 8986f29b634fdaa9862eedda78513969fe9788301c9f2d938f4c10a3e7a3e7ea "14.0.6": url: https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/clang-14.0.6.src.tar.xz sha256: 2b5847b6a63118b9efe5c85548363c81ffe096b66c3b3675e953e26342ae4031 patches: + "15.0.7": + - patch_file: patches/15x/0000-force-import-original-llvm-config.patch + patch_description: Imports definitions from original LLVMConfig + patch_type: conan + base_path: clang "14.0.6": - patch_file: patches/14x/0000-force-import-original-llvm-config.patch patch_description: Imports definitions from original LLVMConfig diff --git a/utils/conan/clang/conanfile.py b/utils/conan/clang/conanfile.py index 5205624bd5..a6124cfe3b 100644 --- a/utils/conan/clang/conanfile.py +++ b/utils/conan/clang/conanfile.py @@ -95,12 +95,17 @@ def validate(self): ) def source(self): - get(self, **self.conan_data["sources"][self.version]) - - clang_folder=f"clang-{self.version}.src" - rename(self, "cmake/Modules", "cmake/modules") - copy(self, pattern="*", src=clang_folder, dst=".") - rmdir(self, clang_folder) + if Version(self.version) >= 15: + sources = self.conan_data["sources"][self.version] + get(self, **sources["clang"], destination='clang', strip_root=True) + get(self, **sources["cmake"], destination='cmake', strip_root=True) + else: + get(self, **self.conan_data["sources"][self.version]) + clang_folder=f"clang-{self.version}.src" + if Path("cmake/Modules").exists(): + rename(self, "cmake/Modules", "cmake/modules") + copy(self, pattern="*", src=clang_folder, dst=".") + rmdir(self, clang_folder) @property def _get_llvm_path(self): @@ -123,7 +128,10 @@ def generate(self): def build(self): apply_conandata_patches(self) cmake = CMake(self) - cmake.configure(cli_args=['--graphviz=graph/clang.dot']) + if Version(self.version) >= 15: + cmake.configure(build_script_folder="clang", cli_args=['--graphviz=graph/clang.dot']) + else: + cmake.configure(cli_args=['--graphviz=graph/clang.dot']) cmake.build() def _clang_build_info(self): diff --git a/utils/conan/clang/patches/15x/0000-force-import-original-llvm-config.patch b/utils/conan/clang/patches/15x/0000-force-import-original-llvm-config.patch new file mode 100644 index 0000000000..b7f8eb4069 --- /dev/null +++ b/utils/conan/clang/patches/15x/0000-force-import-original-llvm-config.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e3bc4b468fb6..cf7a094ebb6e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -70,6 +70,7 @@ if(CLANG_BUILT_STANDALONE) + mark_as_advanced(LLVM_ENABLE_ASSERTIONS) + endif() + ++ include(LLVMConfig.original) + find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}") + list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}") + diff --git a/utils/conan/llvm-core/conandata.yml b/utils/conan/llvm-core/conandata.yml index 2d1054c18e..c8eadde41b 100644 --- a/utils/conan/llvm-core/conandata.yml +++ b/utils/conan/llvm-core/conandata.yml @@ -1,9 +1,36 @@ sources: + "15.0.7": + "llvm": + url: https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.7/llvm-15.0.7.src.tar.xz + sha256: 4ad8b2cc8003c86d0078d15d987d84e3a739f24aae9033865c027abae93ee7a4 + "cmake": + url: https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.7/cmake-15.0.7.src.tar.xz + sha256: 8986f29b634fdaa9862eedda78513969fe9788301c9f2d938f4c10a3e7a3e7ea + "14.0.6": url: https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/llvm-14.0.6.src.tar.xz sha256: 050922ecaaca5781fdf6631ea92bc715183f202f9d2f15147226f023414f619a patches: + "15.0.7": + - patch_file: patches/15x/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 + - patch_file: patches/15x/0001-calculate-job-pools.patch + patch_description: calculate resource limits for compiling LLVM + patch_type: portability + patch_source: https://github.com/llvm/llvm-project/pull/65274 + base_path: llvm-main + - patch_file: patches/15x/0003-no-build-with-install-rpath.patch + patch_description: do not build shared libs with install rpath + patch_type: conan + base_path: llvm-main + - patch_file: patches/15x/0004-remove-lto-exports.patch + patch_description: remove LTO exports causing link error with lld + patch_source: https://github.com/llvm/llvm-project-release-prs/pull/279 + patch_type: portability + base_path: llvm-main "14.0.6": - patch_file: patches/14x/0000-cmake-dependencies.patch patch_description: fix references to third party libs to match conan variables and targets diff --git a/utils/conan/llvm-core/conanfile.py b/utils/conan/llvm-core/conanfile.py index d06658e022..64c2d249ca 100644 --- a/utils/conan/llvm-core/conanfile.py +++ b/utils/conan/llvm-core/conanfile.py @@ -40,8 +40,8 @@ "BPF", "Hexagon", "Lanai", - "Mips", "MSP430", + "Mips", "NVPTX", "PowerPC", "RISCV", @@ -94,6 +94,8 @@ class LLVMCoreConan(ConanFile): "with_zlib": [True, False], "with_xml2": [True, False], "with_z3": [True, False], + 'with_zstd': [True, False], + 'with_httplib': [True, False], } default_options = { "shared": False, @@ -116,6 +118,8 @@ class LLVMCoreConan(ConanFile): "with_xml2": True, "with_z3": True, # not default "with_zlib": True, + 'with_zstd': True, + 'with_httplib': False, } @property @@ -143,6 +147,9 @@ def config_options(self): release = Version(self.version).major if release < 14: del self.options.with_curl + if release < 15: + del self.options.with_zstd + del self.options.with_httplib def configure(self): if self.options.shared: @@ -167,6 +174,9 @@ def requirements(self): self.requires('libcurl/[>=7.78.0 <9]') # no version requirement in llvm 14-19 if self.options.get_safe("with_zstd"): self.requires("zstd/[>=1.4.3 <2]") # no version required llvm 15-19, <1.4.3 doesn't work + if self.options.get_safe('with_httplib'): + # no version number in llvm 15-17 + self.requires('cpp-httplib/[>=0.5.4 <1.0.0]') def build_requirements(self): self.tool_requires("ninja/[>=1.10.2 <2]") @@ -202,6 +212,9 @@ def validate(self): # see also https://llvm.org/docs/HowToCrossCompileLLVM.html raise ConanInvalidConfiguration("Cross compilation is not supported. Contributions are welcome!") + if self.options.get_safe("with_libedit") and self.options.use_sanitizer != 'None': + raise ConanInvalidConfiguration("libedit can't be used with sanitizers") + def validate_build(self): if getenv("CONAN_CENTER_BUILD_SERVICE") and self.settings.build_type == "Debug": if self.settings.os == "Linux": @@ -210,12 +223,17 @@ def validate_build(self): raise ConanInvalidConfiguration("Shared Debug build is not supported on CCI due to resource limitations") def source(self): - get(self, **self.conan_data["sources"][self.version]) - - llvm_folder=f"llvm-{self.version}.src" - rename(self, "cmake/Modules", "cmake/modules") - copy(self, pattern="*", src=llvm_folder, dst=".") - rmdir(self, llvm_folder) + if Version(self.version) >= 15: + sources = self.conan_data["sources"][self.version] + get(self, **sources["llvm"], destination='llvm-main', strip_root=True) + get(self, **sources["cmake"], destination='cmake', strip_root=True) + else: + get(self, **self.conan_data["sources"][self.version]) + llvm_folder=f"llvm-{self.version}.src" + if Path("cmake/Modules").exists(): + rename(self, "cmake/Modules", "cmake/modules") + copy(self, pattern="*", src=llvm_folder, dst=".") + rmdir(self, llvm_folder) def _apply_resource_limits(self, cmake_definitions): if getenv("CONAN_CENTER_BUILD_SERVICE"): @@ -244,12 +262,17 @@ def _all_targets(self): ver = Version(self.version).major if ver >= 14: targets.add("VE") - if ver >= 15: + if ver >= 16: # its available in 15 but not by default with "all" targets.add("LoongArch") return ";".join(targets) def generate(self): tc = CMakeToolchain(self, generator="Ninja") + + is_zstd_static = False + if self.options.get_safe('with_zstd', False): + is_zstd_static = not self.dependencies["zstd"].options.shared + # https://releases.llvm.org/12.0.0/docs/CMake.html # https://releases.llvm.org/13.0.0/docs/CMake.html # https://releases.llvm.org/14.0.0/docs/CMake.html @@ -285,7 +308,10 @@ def generate(self): "LLVM_ENABLE_FFI": self.options.with_ffi, "LLVM_ENABLE_ZLIB": "FORCE_ON" if self.options.with_zlib else False, "LLVM_ENABLE_LIBXML2": "FORCE_ON" if self.options.with_xml2 else False, - "LLVM_ENABLE_TERMINFO": self.options.with_terminfo + "LLVM_ENABLE_TERMINFO": self.options.with_terminfo, + 'LLVM_ENABLE_ZSTD': 'FORCE_ON' if self.options.get_safe('with_zstd', False) else False, + 'LLVM_USE_STATIC_ZSTD': is_zstd_static, + 'LLVM_ENABLE_HTTPLIB': 'FORCE_ON' if self.options.get_safe('with_httplib', False) else False, } if self.options.targets != "all": cmake_variables["LLVM_TARGETS_TO_BUILD"] = self.options.targets @@ -316,12 +342,17 @@ def generate(self): tc.generate() tc = CMakeDeps(self) + tc.set_property("editline", "cmake_file_name", "LibEdit") + tc.set_property("editline", "cmake_target_name", "LibEdit::LibEdit") tc.generate() def build(self): apply_conandata_patches(self) cmake = CMake(self) - cmake.configure() + if Version(self.version) >= 15: + cmake.configure(build_script_folder="llvm-main") + else: + cmake.configure() cmake.build() @property @@ -335,7 +366,10 @@ def _sanitized_components(deps_list): replacements = { "LibXml2::LibXml2": "libxml2::libxml2", "ZLIB::ZLIB": "zlib::zlib", - "CURL::libcurl": "libcurl::libcurl" + "CURL::libcurl": "libcurl::libcurl", + "LibEdit::LibEdit": "editline::editline", + "httplib::httplib": "cpp-httplib::cpp-httplib", + "zstd::libzstd_static": "zstd::zstd", } for dep in deps_list.split(";"): match = match_genex.search(dep) diff --git a/utils/conan/llvm-core/patches/15x/0000-cmake-dependencies.patch b/utils/conan/llvm-core/patches/15x/0000-cmake-dependencies.patch new file mode 100644 index 0000000000..d0e92f5adc --- /dev/null +++ b/utils/conan/llvm-core/patches/15x/0000-cmake-dependencies.patch @@ -0,0 +1,70 @@ +diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake +index 7e657fd1532d..29f524927b30 100644 +--- a/cmake/config-ix.cmake ++++ b/cmake/config-ix.cmake +@@ -126,7 +126,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) +@@ -203,7 +203,7 @@ if(LLVM_ENABLE_HTTPLIB) + # Check if the "httplib" we found is usable; for example there may be another + # library with the same name. + cmake_push_check_state() +- list(APPEND CMAKE_REQUIRED_LIBRARIES ${HTTPLIB_LIBRARY}) ++ list(APPEND CMAKE_REQUIRED_LIBRARIES ${HTTPLIB_LIBRARIES}) + check_cxx_symbol_exists(CPPHTTPLIB_HTTPLIB_H ${HTTPLIB_HEADER_PATH} HAVE_HTTPLIB) + cmake_pop_check_state() + if(LLVM_ENABLE_HTTPLIB STREQUAL FORCE_ON AND NOT HAVE_HTTPLIB) +@@ -220,7 +220,7 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") + if (NOT PURE_WINDOWS) + # Skip libedit if using ASan as it contains memory leaks. + if (LLVM_ENABLE_LIBEDIT AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*") +- find_package(LibEdit) ++ find_package(LibEdit REQUIRED) + set(HAVE_LIBEDIT ${LibEdit_FOUND}) + else() + set(HAVE_LIBEDIT 0) +diff --git a/lib/Support/CMakeLists.txt b/lib/Support/CMakeLists.txt +index ff23ec74df96..213605ebdea6 100644 +--- a/lib/Support/CMakeLists.txt ++++ b/lib/Support/CMakeLists.txt +@@ -293,7 +293,7 @@ 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}) ++ set(zlib_library ${ZLIB_LIBRARIES}) + endif() + if(NOT zlib_library) + get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION) +@@ -306,7 +306,7 @@ 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}) ++ set(zstd_library ${zstd_LIBRARIES}) + endif() + if(NOT zstd_library) + get_property(zstd_library TARGET ${zstd_target} PROPERTY LOCATION) +diff --git a/lib/WindowsManifest/CMakeLists.txt b/lib/WindowsManifest/CMakeLists.txt +index 910132a4c7de..266d3b7faaa9 100644 +--- a/lib/WindowsManifest/CMakeLists.txt ++++ b/lib/WindowsManifest/CMakeLists.txt +@@ -21,10 +21,11 @@ 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) ++ find_package(libxml2 REQUIRED CONFIG) + # 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}) ++ set(libxml2_library ${libxml2_LIBRARIES}) + endif() + if(NOT libxml2_library) + get_property(libxml2_library TARGET LibXml2::LibXml2 PROPERTY LOCATION) diff --git a/utils/conan/llvm-core/patches/15x/0001-calculate-job-pools.patch b/utils/conan/llvm-core/patches/15x/0001-calculate-job-pools.patch new file mode 100644 index 0000000000..149a9cd9b5 --- /dev/null +++ b/utils/conan/llvm-core/patches/15x/0001-calculate-job-pools.patch @@ -0,0 +1,44 @@ +diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake +index 0fca934be9cf..ca80ea67f5b9 100644 +--- a/cmake/modules/HandleLLVMOptions.cmake ++++ b/cmake/modules/HandleLLVMOptions.cmake +@@ -34,6 +34,21 @@ string(TOUPPER "${LLVM_ENABLE_LTO}" uppercase_LLVM_ENABLE_LTO) + # The following only works with the Ninja generator in CMake >= 3.0. + set(LLVM_PARALLEL_COMPILE_JOBS "" CACHE STRING + "Define the maximum number of concurrent compilation jobs (Ninja only).") ++if(LLVM_RAM_PER_COMPILE_JOB OR LLVM_RAM_PER_LINK_JOB) ++ cmake_host_system_information(RESULT available_physical_memory QUERY AVAILABLE_PHYSICAL_MEMORY) ++ cmake_host_system_information(RESULT number_of_logical_cores QUERY NUMBER_OF_LOGICAL_CORES) ++endif() ++if(LLVM_RAM_PER_COMPILE_JOB) ++ math(EXPR jobs_with_sufficient_memory "${available_physical_memory} / ${LLVM_RAM_PER_COMPILE_JOB}" OUTPUT_FORMAT DECIMAL) ++ if (jobs_with_sufficient_memory LESS 1) ++ set(jobs_with_sufficient_memory 1) ++ endif() ++ if (jobs_with_sufficient_memory LESS number_of_logical_cores) ++ set(LLVM_PARALLEL_COMPILE_JOBS "${jobs_with_sufficient_memory}") ++ else() ++ set(LLVM_PARALLEL_COMPILE_JOBS "${number_of_logical_cores}") ++ endif() ++endif() + if(LLVM_PARALLEL_COMPILE_JOBS) + if(NOT CMAKE_GENERATOR MATCHES "Ninja") + message(WARNING "Job pooling is only available with Ninja generators.") +@@ -45,6 +60,17 @@ endif() + + set(LLVM_PARALLEL_LINK_JOBS "" CACHE STRING + "Define the maximum number of concurrent link jobs (Ninja only).") ++if(LLVM_RAM_PER_LINK_JOB) ++math(EXPR jobs_with_sufficient_memory "${available_physical_memory} / ${LLVM_RAM_PER_LINK_JOB}" OUTPUT_FORMAT DECIMAL) ++if (jobs_with_sufficient_memory LESS 1) ++ set(jobs_with_sufficient_memory 1) ++endif() ++if (jobs_with_sufficient_memory LESS number_of_logical_cores) ++ set(LLVM_PARALLEL_LINK_JOBS "${jobs_with_sufficient_memory}") ++else() ++ set(LLVM_PARALLEL_LINK_JOBS "${number_of_logical_cores}") ++endif() ++endif() + if(CMAKE_GENERATOR MATCHES "Ninja") + if(NOT LLVM_PARALLEL_LINK_JOBS AND uppercase_LLVM_ENABLE_LTO STREQUAL "THIN") + message(STATUS "ThinLTO provides its own parallel linking - limiting parallel link jobs to 2.") diff --git a/utils/conan/llvm-core/patches/15x/0003-no-build-with-install-rpath.patch b/utils/conan/llvm-core/patches/15x/0003-no-build-with-install-rpath.patch new file mode 100644 index 0000000000..715a46740f --- /dev/null +++ b/utils/conan/llvm-core/patches/15x/0003-no-build-with-install-rpath.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake +index 1f0507f395cf..5e6fddfe9db5 100644 +--- a/cmake/modules/AddLLVM.cmake ++++ b/cmake/modules/AddLLVM.cmake +@@ -2296,7 +2296,7 @@ function(llvm_setup_rpath name) + + # Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set. + if("${CMAKE_BUILD_RPATH}" STREQUAL "") +- set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON) ++ set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH OFF) + endif() + + set_target_properties(${name} PROPERTIES diff --git a/utils/conan/llvm-core/patches/15x/0004-remove-lto-exports.patch b/utils/conan/llvm-core/patches/15x/0004-remove-lto-exports.patch new file mode 100644 index 0000000000..944d4d2f36 --- /dev/null +++ b/utils/conan/llvm-core/patches/15x/0004-remove-lto-exports.patch @@ -0,0 +1,32 @@ +diff --git a/tools/lto/lto.exports b/tools/lto/lto.exports +index 3abae5f0fcba..4164c3919a97 100644 +--- a/tools/lto/lto.exports ++++ b/tools/lto/lto.exports +@@ -45,12 +45,6 @@ lto_codegen_compile_optimized + lto_codegen_set_should_internalize + lto_codegen_set_should_embed_uselists + lto_set_debug_options +-LLVMCreateDisasm +-LLVMCreateDisasmCPU +-LLVMDisasmDispose +-LLVMDisasmInstruction +-LLVMSetDisasmOptions +-LLVMCreateDisasmCPUFeatures + thinlto_create_codegen + thinlto_codegen_dispose + thinlto_codegen_add_module +diff --git a/tools/remarks-shlib/CMakeLists.txt b/tools/remarks-shlib/CMakeLists.txt +index f22cedd9ead7..bc4bd67e2c9e 100644 +--- a/tools/remarks-shlib/CMakeLists.txt ++++ b/tools/remarks-shlib/CMakeLists.txt +@@ -9,7 +9,9 @@ if(LLVM_ENABLE_PIC) + libremarks.cpp + ) + +- set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports) ++ if (NOT (BUILD_SHARED_LIBS OR LLVM_LINK_LLVM_DYLIB)) ++ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports) ++ endif() + + add_llvm_library(Remarks SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES}) +