diff --git a/.gitignore b/.gitignore index b519a49..8339212 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ -SOURCES/cmake-18.1.8.src.tar.xz -SOURCES/cmake-18.1.8.src.tar.xz.sig -SOURCES/llvm-18.1.8.src.tar.xz -SOURCES/llvm-18.1.8.src.tar.xz.sig -SOURCES/third-party-18.1.8.src.tar.xz -SOURCES/third-party-18.1.8.src.tar.xz.sig +SOURCES/llvm-project-18.1.8.src.tar.xz +SOURCES/llvm-project-18.1.8.src.tar.xz.sig +SOURCES/llvm-project-19.1.7.src.tar.xz +SOURCES/llvm-project-19.1.7.src.tar.xz.sig diff --git a/.llvm.metadata b/.llvm.metadata index 9a1dc78..e8654ab 100644 --- a/.llvm.metadata +++ b/.llvm.metadata @@ -1,6 +1,4 @@ -1ea03e355b705b4cada3051bd7301a57daa19283 SOURCES/cmake-18.1.8.src.tar.xz -33c2f4327abc20c6098be064ab6bbc15536031f2 SOURCES/cmake-18.1.8.src.tar.xz.sig -f9befa4cbef3f688ab48fca42449e13c5bcb872d SOURCES/llvm-18.1.8.src.tar.xz -8310ebfda8205233b5ecb6baa7f5272efae31155 SOURCES/llvm-18.1.8.src.tar.xz.sig -ada9cf5deaec0a730c751ffd84145acedc6eafeb SOURCES/third-party-18.1.8.src.tar.xz -b87b233f778b610a7f8ed1cf9aea4112dfcd7a06 SOURCES/third-party-18.1.8.src.tar.xz.sig +6ae58ac6b089c4d2f6110b7d31c5e2168e5226d4 SOURCES/llvm-project-18.1.8.src.tar.xz +817952e0a68db979b372791a94ec9bfc46b63959 SOURCES/llvm-project-18.1.8.src.tar.xz.sig +6e4033d8b76a89e82220b5445bff58cdce64300e SOURCES/llvm-project-19.1.7.src.tar.xz +48f839c6e47a34a1138862a9db6274c150179532 SOURCES/llvm-project-19.1.7.src.tar.xz.sig diff --git a/SOURCES/0001-18-Always-build-shared-libs-for-LLD.patch b/SOURCES/0001-18-Always-build-shared-libs-for-LLD.patch new file mode 100644 index 0000000..1659800 --- /dev/null +++ b/SOURCES/0001-18-Always-build-shared-libs-for-LLD.patch @@ -0,0 +1,29 @@ +From b1c60d7fa322a2d208556087df9e7ef94bfbffb8 Mon Sep 17 00:00:00 2001 +From: Nikita Popov +Date: Wed, 8 May 2024 12:30:36 +0900 +Subject: [PATCH] Always build shared libs for LLD + +We don't want to enable BUILD_SHARED_LIBS for the whole build, +but we do want to build lld libraries. +--- + lld/cmake/modules/AddLLD.cmake | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/lld/cmake/modules/AddLLD.cmake b/lld/cmake/modules/AddLLD.cmake +index 2ee066b41535..270c03f096ac 100644 +--- a/lld/cmake/modules/AddLLD.cmake ++++ b/lld/cmake/modules/AddLLD.cmake +@@ -7,9 +7,8 @@ macro(add_lld_library name) + "" + "" + ${ARGN}) +- if(ARG_SHARED) +- set(ARG_ENABLE_SHARED SHARED) +- endif() ++ # Always build shared libs for LLD. ++ set(ARG_ENABLE_SHARED SHARED) + llvm_add_library(${name} ${ARG_ENABLE_SHARED} ${ARG_UNPARSED_ARGUMENTS}) + set_target_properties(${name} PROPERTIES FOLDER "lld libraries") + +-- +2.44.0 \ No newline at end of file diff --git a/SOURCES/0001-19-Always-build-shared-libs-for-LLD.patch b/SOURCES/0001-19-Always-build-shared-libs-for-LLD.patch new file mode 100644 index 0000000..6840554 --- /dev/null +++ b/SOURCES/0001-19-Always-build-shared-libs-for-LLD.patch @@ -0,0 +1,30 @@ +From 69faadbc396000bfa60c722f6fb9c0fc3fb2daf0 Mon Sep 17 00:00:00 2001 +From: Nikita Popov +Date: Wed, 8 May 2024 12:30:36 +0900 +Subject: [PATCH] Always build shared libs for LLD + +We don't want to enable BUILD_SHARED_LIBS for the whole build, +but we do want to build lld libraries. +--- + lld/cmake/modules/AddLLD.cmake | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/lld/cmake/modules/AddLLD.cmake b/lld/cmake/modules/AddLLD.cmake +index 9f2684b6f933..743ec87814a2 100644 +--- a/lld/cmake/modules/AddLLD.cmake ++++ b/lld/cmake/modules/AddLLD.cmake +@@ -7,9 +7,8 @@ macro(add_lld_library name) + "" + "" + ${ARGN}) +- if(ARG_SHARED) +- set(ARG_ENABLE_SHARED SHARED) +- endif() ++ # Always build shared libs for LLD. ++ set(ARG_ENABLE_SHARED SHARED) + llvm_add_library(${name} ${ARG_ENABLE_SHARED} ${ARG_UNPARSED_ARGUMENTS}) + + if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) +-- +2.45.1 + diff --git a/SOURCES/0001-19-PATCH-Bolt-CMake-Don-t-export-bolt-libraries-in-LLVM.patch b/SOURCES/0001-19-PATCH-Bolt-CMake-Don-t-export-bolt-libraries-in-LLVM.patch new file mode 100644 index 0000000..5af976e --- /dev/null +++ b/SOURCES/0001-19-PATCH-Bolt-CMake-Don-t-export-bolt-libraries-in-LLVM.patch @@ -0,0 +1,187 @@ +From ee0f56cff40b324bb06e034e247ec85ae9a846bf Mon Sep 17 00:00:00 2001 +From: Nikita Popov +Date: Wed, 8 Jan 2025 08:28:18 +0100 +Subject: [PATCH] [PATCH] [Bolt][CMake] Don't export bolt libraries in + LLVMExports.cmake + +Bolt makes use of add_llvm_library and as such ends up exporting +its libraries from LLVMExports.cmake, which is not correct. + +Bolt doesn't have its own exports file, and I assume that there +is no desire to have one either -- Bolt libraries are not intended +to be consumed as a cmake module, right? + +As such, this PR adds a NO_EXPORT option to simplify exclude these +libraries from the exports file. + +--- +This patch originates from this PR: + +https://patch-diff.githubusercontent.com/raw/llvm/llvm-project/pull/121936. + +The commit was: + +https://github.com/nikic/llvm-project/commit/4333a4dd270b5c046c5469b97846e3dae58fb221.patch + +And then it was rebased onto llvmorg-19.1.6. +--- + bolt/lib/Core/CMakeLists.txt | 1 + + bolt/lib/Passes/CMakeLists.txt | 1 + + bolt/lib/Profile/CMakeLists.txt | 1 + + bolt/lib/Rewrite/CMakeLists.txt | 1 + + bolt/lib/RuntimeLibs/CMakeLists.txt | 1 + + bolt/lib/Target/AArch64/CMakeLists.txt | 1 + + bolt/lib/Target/RISCV/CMakeLists.txt | 1 + + bolt/lib/Target/X86/CMakeLists.txt | 1 + + bolt/lib/Utils/CMakeLists.txt | 1 + + llvm/cmake/modules/AddLLVM.cmake | 12 +++++++++--- + 10 files changed, 18 insertions(+), 3 deletions(-) + +diff --git a/bolt/lib/Core/CMakeLists.txt b/bolt/lib/Core/CMakeLists.txt +index bb58667066fd..8c1f5d0bb37b 100644 +--- a/bolt/lib/Core/CMakeLists.txt ++++ b/bolt/lib/Core/CMakeLists.txt +@@ -35,6 +35,7 @@ add_llvm_library(LLVMBOLTCore + ParallelUtilities.cpp + Relocation.cpp + ++ NO_EXPORT + DISABLE_LLVM_LINK_LLVM_DYLIB + LINK_LIBS + ${LLVM_PTHREAD_LIB} +diff --git a/bolt/lib/Passes/CMakeLists.txt b/bolt/lib/Passes/CMakeLists.txt +index 407d8b03f739..7367b541545d 100644 +--- a/bolt/lib/Passes/CMakeLists.txt ++++ b/bolt/lib/Passes/CMakeLists.txt +@@ -45,6 +45,7 @@ add_llvm_library(LLVMBOLTPasses + VeneerElimination.cpp + RetpolineInsertion.cpp + ++ NO_EXPORT + DISABLE_LLVM_LINK_LLVM_DYLIB + + LINK_LIBS +diff --git a/bolt/lib/Profile/CMakeLists.txt b/bolt/lib/Profile/CMakeLists.txt +index 9aa4ba0490b0..a2bb4aa074c7 100644 +--- a/bolt/lib/Profile/CMakeLists.txt ++++ b/bolt/lib/Profile/CMakeLists.txt +@@ -7,6 +7,7 @@ add_llvm_library(LLVMBOLTProfile + YAMLProfileReader.cpp + YAMLProfileWriter.cpp + ++ NO_EXPORT + DISABLE_LLVM_LINK_LLVM_DYLIB + + LINK_COMPONENTS +diff --git a/bolt/lib/Rewrite/CMakeLists.txt b/bolt/lib/Rewrite/CMakeLists.txt +index 34993af2623b..6737e89b8451 100644 +--- a/bolt/lib/Rewrite/CMakeLists.txt ++++ b/bolt/lib/Rewrite/CMakeLists.txt +@@ -26,6 +26,7 @@ add_llvm_library(LLVMBOLTRewrite + RewriteInstance.cpp + SDTRewriter.cpp + ++ NO_EXPORT + DISABLE_LLVM_LINK_LLVM_DYLIB + + LINK_LIBS +diff --git a/bolt/lib/RuntimeLibs/CMakeLists.txt b/bolt/lib/RuntimeLibs/CMakeLists.txt +index d3ac71d3e797..b8db7e4a1553 100644 +--- a/bolt/lib/RuntimeLibs/CMakeLists.txt ++++ b/bolt/lib/RuntimeLibs/CMakeLists.txt +@@ -11,6 +11,7 @@ add_llvm_library(LLVMBOLTRuntimeLibs + HugifyRuntimeLibrary.cpp + InstrumentationRuntimeLibrary.cpp + ++ NO_EXPORT + DISABLE_LLVM_LINK_LLVM_DYLIB + ) + +diff --git a/bolt/lib/Target/AArch64/CMakeLists.txt b/bolt/lib/Target/AArch64/CMakeLists.txt +index be03e247aa96..526a9645cb54 100644 +--- a/bolt/lib/Target/AArch64/CMakeLists.txt ++++ b/bolt/lib/Target/AArch64/CMakeLists.txt +@@ -7,6 +7,7 @@ set(LLVM_LINK_COMPONENTS + add_llvm_library(LLVMBOLTTargetAArch64 + AArch64MCPlusBuilder.cpp + ++ NO_EXPORT + DISABLE_LLVM_LINK_LLVM_DYLIB + + DEPENDS +diff --git a/bolt/lib/Target/RISCV/CMakeLists.txt b/bolt/lib/Target/RISCV/CMakeLists.txt +index 7f9557606320..3955cfc0f089 100644 +--- a/bolt/lib/Target/RISCV/CMakeLists.txt ++++ b/bolt/lib/Target/RISCV/CMakeLists.txt +@@ -7,6 +7,7 @@ set(LLVM_LINK_COMPONENTS + add_llvm_library(LLVMBOLTTargetRISCV + RISCVMCPlusBuilder.cpp + ++ NO_EXPORT + DISABLE_LLVM_LINK_LLVM_DYLIB + + DEPENDS +diff --git a/bolt/lib/Target/X86/CMakeLists.txt b/bolt/lib/Target/X86/CMakeLists.txt +index 2b769bc7e7f5..00100e9b84c9 100644 +--- a/bolt/lib/Target/X86/CMakeLists.txt ++++ b/bolt/lib/Target/X86/CMakeLists.txt +@@ -9,6 +9,7 @@ add_llvm_library(LLVMBOLTTargetX86 + X86MCPlusBuilder.cpp + X86MCSymbolizer.cpp + ++ NO_EXPORT + DISABLE_LLVM_LINK_LLVM_DYLIB + + DEPENDS +diff --git a/bolt/lib/Utils/CMakeLists.txt b/bolt/lib/Utils/CMakeLists.txt +index d1403314274b..ceddcfc8f57a 100644 +--- a/bolt/lib/Utils/CMakeLists.txt ++++ b/bolt/lib/Utils/CMakeLists.txt +@@ -2,6 +2,7 @@ add_llvm_library(LLVMBOLTUtils + CommandLineOpts.cpp + Utils.cpp + ++ NO_EXPORT + DISABLE_LLVM_LINK_LLVM_DYLIB + + LINK_LIBS +diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake +index 03f4e1f190fd..addf083b7c71 100644 +--- a/llvm/cmake/modules/AddLLVM.cmake ++++ b/llvm/cmake/modules/AddLLVM.cmake +@@ -897,7 +897,7 @@ endfunction() + + macro(add_llvm_library name) + cmake_parse_arguments(ARG +- "SHARED;BUILDTREE_ONLY;MODULE;INSTALL_WITH_TOOLCHAIN" ++ "SHARED;BUILDTREE_ONLY;MODULE;INSTALL_WITH_TOOLCHAIN;NO_EXPORT" + "" + "" + ${ARGN}) +@@ -932,7 +932,11 @@ macro(add_llvm_library name) + set(umbrella) + endif() + +- get_target_export_arg(${name} LLVM export_to_llvmexports ${umbrella}) ++ if(ARG_NO_EXPORT) ++ set(export_to_llvmexports) ++ else() ++ get_target_export_arg(${name} LLVM export_to_llvmexports ${umbrella}) ++ endif() + install(TARGETS ${name} + ${export_to_llvmexports} + LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT ${name} +@@ -945,7 +949,9 @@ macro(add_llvm_library name) + COMPONENT ${name}) + endif() + endif() +- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) ++ if(NOT ARG_NO_EXPORT) ++ set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) ++ endif() + endif() + + get_subproject_title(subproject_title) +-- +2.47.1 + diff --git a/SOURCES/0001-CMake-Add-missing-dependency-108461.patch b/SOURCES/0001-CMake-Add-missing-dependency-108461.patch new file mode 100644 index 0000000..e6862fd --- /dev/null +++ b/SOURCES/0001-CMake-Add-missing-dependency-108461.patch @@ -0,0 +1,129 @@ +From 17ff6161b83e6a5e86fcb6a13c5551bba1438405 Mon Sep 17 00:00:00 2001 +From: Erick Ochoa +Date: Thu, 12 Sep 2024 21:16:58 -0400 +Subject: [PATCH 1/9] [CMake] Add missing dependency (#108461) + +The [`mlir-capi-execution-engine-test` test +executable](https://github.com/llvm/llvm-project/blob/main/mlir/test/CAPI/CMakeLists.txt#L26-L34) + +```cmake +if(MLIR_ENABLE_EXECUTION_ENGINE) + _add_capi_test_executable(mlir-capi-execution-engine-test + execution_engine.c + LINK_LIBS PRIVATE + MLIRCAPIConversion + MLIRCAPIExecutionEngine + MLIRCAPIRegisterEverything +) +endif() +``` + + +is run by lit tests, but it is not properly listed as a dependency. It +is added in places conditionally across the file +[`tests/CMakeLists.txt`](https://github.com/llvm/llvm-project/blob/main/mlir/test/CMakeLists.txt#L130-L143) + +```cmake +# The native target may not be enabled, in this case we won't +# run tests that involves executing on the host: do not build +# useless binaries. +if(LLVM_ENABLE_PIC AND TARGET ${LLVM_NATIVE_ARCH}) + list(APPEND MLIR_TEST_DEPENDS + mlir-cpu-runner + llc + mlir_async_runtime + mlir-capi-execution-engine-test + mlir_c_runner_utils + mlir_runner_utils + mlir_float16_utils + ) +endif() +``` + +But this condition is not the same as the one where the test executable +is added. [It has been reported on discord that the following error +occurred:](https://discord.com/channels/636084430946959380/642426447167881246/1283811636725022730) + +``` +FAIL: MLIR :: CAPI/execution_engine.c (2 of 2121) +******************** TEST 'MLIR :: CAPI/execution_engine.c' FAILED ******************** +Exit Code: 127 +Command Output (stdout): +-- +# RUN: at line 10 +/usr/bin/mlir-capi-execution-engine-test 2>&1 | /usr/bin/FileCheck /builddir/build/BUILD/mlir-19.1.0_rc4-build/mlir-19.1.0-rc4.src/test/CAPI/execution_engine.c +# executed command: /usr/bin/mlir-capi-execution-engine-test +# .---command stderr------------ +# | '/usr/bin/mlir-capi-execution-engine-test': command not found +# `----------------------------- +``` + +This error will not be deterministic and is dependent on the order in +which tools are built. If by any chance, +`mlir-capi-execution-engine-test` is built before the lit tests run, +then nothing will happen. But lit tests can be run before +`mlir-capi-execution-engine-test` is built. + +This patch adds the `mlir-capi-execution-engine` to the +`MLIR_TEST_DEPENDS` list when the `MLIR_ENABLE_EXECUTION_ENGINE` flag is +present. + +Happy to make changes like: +* removing `mlir-capi-execution-engine-test` from the other place where +it is included in the tests +* and merge and sort alphabetically these two commands + +```cmake +set(MLIR_TEST_DEPENDS +FileCheck count not split-file +mlir-capi-ir-test +mlir-capi-irdl-test +mlir-capi-llvm-test +mlir-capi-pass-test +mlir-capi-quant-test +mlir-capi-rewrite-test +mlir-capi-sparse-tensor-test +mlir-capi-transform-test +mlir-capi-transform-interpreter-test +mlir-capi-translation-test +mlir-linalg-ods-yaml-gen +mlir-lsp-server +mlir-opt + mlir-query + mlir-reduce + mlir-tblgen + mlir-translate + tblgen-lsp-server + tblgen-to-irdl + ) + +set(MLIR_TEST_DEPENDS ${MLIR_TEST_DEPENDS} + mlir-capi-pdl-test + mlir-pdll-lsp-server + mlir-pdll + ) +``` + +Co-authored-by: Erick Ochoa +--- + mlir/test/CMakeLists.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/mlir/test/CMakeLists.txt b/mlir/test/CMakeLists.txt +index df95e5db11f1..4d2d738b734e 100644 +--- a/mlir/test/CMakeLists.txt ++++ b/mlir/test/CMakeLists.txt +@@ -150,6 +150,10 @@ if(MLIR_ENABLE_CUDA_RUNNER) + list(APPEND MLIR_TEST_DEPENDS mlir_cuda_runtime) + endif() + ++if(MLIR_ENABLE_EXECUTION_ENGINE) ++ list(APPEND MLIR_TEST_DEPENDS mlir-capi-execution-engine-test) ++endif() ++ + if(MLIR_ENABLE_ROCM_RUNNER) + list(APPEND MLIR_TEST_DEPENDS mlir_rocm_runtime) + endif() +-- +2.46.0 + diff --git a/SOURCES/0001-CMake-Use-correct-exports-for-MLIR-tools.patch b/SOURCES/0001-CMake-Use-correct-exports-for-MLIR-tools.patch new file mode 100644 index 0000000..71547ae --- /dev/null +++ b/SOURCES/0001-CMake-Use-correct-exports-for-MLIR-tools.patch @@ -0,0 +1,38 @@ +From b443e55162861125a50048ae9bc521e98058b273 Mon Sep 17 00:00:00 2001 +From: Nikita Popov +Date: Mon, 16 Dec 2024 14:44:43 +0100 +Subject: [PATCH] [CMake] Use correct exports file for MLIR tools + +llvm_add_tool() currently does not respect the passed project and +puts all tools into LLVMExports.cmake. This means that we end up +with binaries like mlir-opt in LLVMExports.cmake instead of +MLIRTargets.cmake, where they should be. + +Adjust llvm_add_tool() to take the project into account. +--- + llvm/cmake/modules/AddLLVM.cmake | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake +index 006dfb6de3a199..6cf0ee1a54dbdb 100644 +--- a/llvm/cmake/modules/AddLLVM.cmake ++++ b/llvm/cmake/modules/AddLLVM.cmake +@@ -1483,7 +1483,7 @@ macro(llvm_add_tool project name) + + if ( ${name} IN_LIST LLVM_TOOLCHAIN_TOOLS OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) + if( LLVM_BUILD_TOOLS ) +- get_target_export_arg(${name} LLVM export_to_llvmexports) ++ get_target_export_arg(${name} ${project} export_to_llvmexports) + install(TARGETS ${name} + ${export_to_llvmexports} + RUNTIME DESTINATION ${${project}_TOOLS_INSTALL_DIR} +@@ -1497,7 +1497,8 @@ macro(llvm_add_tool project name) + endif() + endif() + if( LLVM_BUILD_TOOLS ) +- set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) ++ string(TOUPPER "${project}" project_upper) ++ set_property(GLOBAL APPEND PROPERTY ${project_upper}_EXPORTS ${name}) + endif() + endif() + get_subproject_title(subproject_title) diff --git a/SOURCES/0001-Driver-Give-devtoolset-path-precedence-over-Installe.patch b/SOURCES/0001-Driver-Give-devtoolset-path-precedence-over-Installe.patch new file mode 100644 index 0000000..92ab81c --- /dev/null +++ b/SOURCES/0001-Driver-Give-devtoolset-path-precedence-over-Installe.patch @@ -0,0 +1,41 @@ +From 73d3b4047d757ef35850e2cef38285b96be82f0f Mon Sep 17 00:00:00 2001 +From: Nikita Popov +Date: Tue, 23 May 2023 12:17:29 +0200 +Subject: [PATCH] [Driver] Give devtoolset path precedence over InstalledDir + +This is a followup to the change from c5fe10f365247c3dd9416b7ec8bad73a60b5946e. +While that commit correctly adds the bindir from devtoolset to the +path, the driver dir / install dir still comes first. This means +we'll still end up picking /usr/bin/ld rather than the one from +devtoolset. + +Unfortunately, I don't see any way to test this. In the environment +the tests are run, this would only result in a behavior difference +if there is an ld binary present in the LLVM build directory, which +isn't the case. + +Differential Revision: https://reviews.llvm.org/D151203 +--- + clang/lib/Driver/ToolChains/Linux.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index 853ff99d9fe5..aecabb46d4b9 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -244,9 +244,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) + // With devtoolset on RHEL, we want to add a bin directory that is relative + // to the detected gcc install, because if we are using devtoolset gcc then + // we want to use other tools from devtoolset (e.g. ld) instead of the +- // standard system tools. +- PPaths.push_back(Twine(GCCInstallation.getParentLibPath() + +- "/../bin").str()); ++ // standard system tools. This should take precedence over InstalledDir. ++ PPaths.insert(PPaths.begin(), ++ Twine(GCCInstallation.getParentLibPath() + "/../bin").str()); + + if (Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb) + ExtraOpts.push_back("-X"); +-- +2.40.1 + diff --git a/SOURCES/0001-Fix-page-size-constant-on-aarch64-and-ppc64le.patch b/SOURCES/0001-Fix-page-size-constant-on-aarch64-and-ppc64le.patch new file mode 100644 index 0000000..925c996 --- /dev/null +++ b/SOURCES/0001-Fix-page-size-constant-on-aarch64-and-ppc64le.patch @@ -0,0 +1,25 @@ +From 5f73befe5a0df82e455f4b1052e62f34009e98bb Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Tue, 23 Apr 2024 15:08:34 -0700 +Subject: [PATCH] Fix page size constant on aarch64 and ppc64le + +--- + compiler-rt/lib/cfi/cfi.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/compiler-rt/lib/cfi/cfi.cpp b/compiler-rt/lib/cfi/cfi.cpp +index ad1c91623514..e7e86e5807a8 100644 +--- a/compiler-rt/lib/cfi/cfi.cpp ++++ b/compiler-rt/lib/cfi/cfi.cpp +@@ -53,6 +53,8 @@ namespace __cfi { + + #if SANITIZER_LOONGARCH64 + #define kCfiShadowLimitsStorageSize 16384 // 16KiB on loongarch64 per page ++#elif defined(__aarch64__) || defined(__powerpc64__) ++#define kCfiShadowLimitsStorageSize 65536 // 1 page + #else + #define kCfiShadowLimitsStorageSize 4096 // 1 page + #endif +-- +2.40.1 + diff --git a/SOURCES/0001-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch b/SOURCES/0001-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch new file mode 100644 index 0000000..113f2a7 --- /dev/null +++ b/SOURCES/0001-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch @@ -0,0 +1,27 @@ +From 49f827b09db549de62dcaf8b90b3fcb3e08c0ee5 Mon Sep 17 00:00:00 2001 +From: Serge Guelton +Date: Mon, 6 Mar 2023 12:37:48 +0100 +Subject: [PATCH] Make -funwind-tables the default on all archs + +--- + clang/lib/Driver/ToolChains/Gnu.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 24fbdcffc07b..8fed46b49515 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2904,6 +2904,10 @@ Generic_GCC::getDefaultUnwindTableLevel(const ArgList &Args) const { + case llvm::Triple::riscv64: + case llvm::Triple::x86: + case llvm::Triple::x86_64: ++ // Enable -funwind-tables on all architectures supported by Fedora: ++ // rhbz#1655546 ++ case llvm::Triple::systemz: ++ case llvm::Triple::arm: + return UnwindTableLevel::Asynchronous; + default: + return UnwindTableLevel::None; +-- +2.39.1 + diff --git a/SOURCES/0001-Workaround-a-bug-in-ORC-on-ppc64le.patch b/SOURCES/0001-Workaround-a-bug-in-ORC-on-ppc64le.patch new file mode 100644 index 0000000..af236a1 --- /dev/null +++ b/SOURCES/0001-Workaround-a-bug-in-ORC-on-ppc64le.patch @@ -0,0 +1,30 @@ +From a2449cee8c995b56f1892502aab3dfad3d6f3ca1 Mon Sep 17 00:00:00 2001 +From: Tulio Magno Quites Machado Filho +Date: Fri, 8 Sep 2023 11:45:34 -0300 +Subject: [PATCH] Workaround a bug in ORC on ppc64le + +The Jit code appears to be returning the wrong printf symbol on ppc64le +after the transition of the default long double to IEEE 128-bit floating +point. +--- + clang/unittests/Interpreter/InterpreterTest.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/clang/unittests/Interpreter/InterpreterTest.cpp b/clang/unittests/Interpreter/InterpreterTest.cpp +index abb8e6377aab..7b6697ebc6ed 100644 +--- a/clang/unittests/Interpreter/InterpreterTest.cpp ++++ b/clang/unittests/Interpreter/InterpreterTest.cpp +@@ -243,7 +243,9 @@ TEST(IncrementalProcessing, FindMangledNameSymbol) { + EXPECT_FALSE(!Addr); + + // FIXME: Re-enable when we investigate the way we handle dllimports on Win. +-#ifndef _WIN32 ++ // FIXME: The printf symbol returned from the Jit may not be correct on ++ // ppc64le when the default long double is IEEE 128-bit fp. ++#if !defined _WIN32 && !(defined __PPC64__ && defined __LITTLE_ENDIAN__) + EXPECT_EQ((uintptr_t)&printf, Addr->getValue()); + #endif // _WIN32 + } +-- +2.41.0 + diff --git a/SOURCES/0001-mlir-Specify-deps-via-LLVM_LINK_COMPONENTS.patch b/SOURCES/0001-mlir-Specify-deps-via-LLVM_LINK_COMPONENTS.patch new file mode 100644 index 0000000..2178800 --- /dev/null +++ b/SOURCES/0001-mlir-Specify-deps-via-LLVM_LINK_COMPONENTS.patch @@ -0,0 +1,80 @@ +From c8f93f1958de1f59222a89dd64a573f91105e135 Mon Sep 17 00:00:00 2001 +From: Konrad Kleine +Date: Tue, 3 Dec 2024 20:53:29 +0100 +Subject: [PATCH] [mlir] Specify deps via `LLVM_LINK_COMPONENTS` + +This specifies the dependencies to link against with +`LLVM_LINK_COMPONENTS` for the +`mlir/test/Target/LLVM/MLIRTargetLLVMTests` binary. + +Before, the dependencies where directly added to the +`target_link_libraries()` call which caused the problems I describe +next: + +When doing a build of LLVM with MLIR I want to link against +`libLLVM.so` instead of statically linking `libLLVMSupport.a`. +MLIR on the other side seems to statically link against +`libLLVMSupport.a` because when I link to the shared library `libLLVM.so` I get: + +``` +CommandLine Error: Option 'aarch64-ptrauth-auth-checks' registered more than once! +``` + +This error indicates that the `Support` library is linked twice in the `MLIRTargetLLVMTest` binary. + +Here's the creation of the `MLIRTargetLLVMTest` binary before (Notice the +`libLLVMSupport.a`): + +``` +[6535/6847] : && /usr/bin/clang++ -O2 -flto=thin -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS --config=/usr/lib/rpm/redhat/redhat-hardened-clang.cfg -fstack-protector-strong -mbranch-protection=standard -fasynchronous-unwind-tables -D_DEFAULT_SOURCE -Dasm=__asm__ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -O2 -g -DNDEBUG -Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,now --config=/usr/lib/rpm/redhat/redhat-hardened-clang-ld.cfg -flto=thin -ffat-lto-objects -Wl,--build-id=sha1 -Wl,--gc-sections -fno-lto tools/mlir/unittests/Target/LLVM/CMakeFiles/MLIRTargetLLVMTests.dir/SerializeNVVMTarget.cpp.o tools/mlir/unittests/Target/LLVM/CMakeFiles/MLIRTargetLLVMTests.dir/SerializeROCDLTarget.cpp.o tools/mlir/unittests/Target/LLVM/CMakeFiles/MLIRTargetLLVMTests.dir/SerializeToLLVMBitcode.cpp.o -o tools/mlir/unittests/Target/LLVM/MLIRTargetLLVMTests -Wl,-rpath,/builddir/build/BUILD/llvm-19.1.3-build/llvm-project-19.1.3.src/llvm/redhat-linux-build/lib64 lib64/libllvm_gtest_main.a lib64/libllvm_gtest.a lib64/libMLIRTargetLLVM.a lib64/libMLIRNVVMTarget.a lib64/libMLIRROCDLTarget.a lib64/libMLIRGPUDialect.a lib64/libMLIRNVVMDialect.a lib64/libMLIRLLVMDialect.a lib64/libMLIRLLVMToLLVMIRTranslation.a lib64/libMLIRBuiltinToLLVMIRTranslation.a lib64/libMLIRNVVMToLLVMIRTranslation.a lib64/libMLIRROCDLToLLVMIRTranslation.a lib64/libMLIRGPUToLLVMIRTranslation.a lib64/libLLVMAArch64CodeGen.a lib64/libLLVMAArch64Desc.a lib64/libLLVMAArch64Info.a -lpthread lib64/libMLIRTargetLLVM.a lib64/libMLIRROCDLDialect.a lib64/libMLIRExecutionEngineUtils.a lib64/libMLIRGPUDialect.a lib64/libMLIRMemRefDialect.a lib64/libMLIRArithUtils.a lib64/libMLIRDialectUtils.a lib64/libMLIRComplexDialect.a lib64/libMLIRArithAttrToLLVMConversion.a lib64/libMLIRArithDialect.a lib64/libMLIRCastInterfaces.a lib64/libMLIRDialect.a lib64/libMLIRInferIntRangeCommon.a lib64/libMLIRUBDialect.a lib64/libMLIRShapedOpInterfaces.a lib64/libMLIRTargetLLVMIRExport.a lib64/libMLIRDLTIDialect.a lib64/libMLIRLLVMIRTransforms.a lib64/libMLIRNVVMDialect.a lib64/libMLIRLLVMDialect.a lib64/libMLIRFuncDialect.a lib64/libMLIRTransforms.a lib64/libMLIRMemorySlotInterfaces.a lib64/libMLIRCopyOpInterface.a lib64/libMLIRRuntimeVerifiableOpInterface.a lib64/libMLIRTranslateLib.a lib64/libMLIRParser.a lib64/libMLIRBytecodeReader.a lib64/libMLIRAsmParser.a lib64/libMLIRTransformUtils.a lib64/libMLIRSubsetOpInterface.a lib64/libMLIRValueBoundsOpInterface.a lib64/libMLIRDestinationStyleOpInterface.a lib64/libMLIRRewrite.a lib64/libMLIRRewritePDL.a lib64/libMLIRPDLToPDLInterp.a lib64/libMLIRPass.a lib64/libMLIRAnalysis.a lib64/libMLIRControlFlowInterfaces.a lib64/libMLIRInferIntRangeInterface.a lib64/libMLIRCallInterfaces.a lib64/libMLIRDataLayoutInterfaces.a lib64/libMLIRViewLikeInterface.a lib64/libMLIRLoopLikeInterface.a lib64/libMLIRPresburger.a lib64/libMLIRPDLInterpDialect.a lib64/libMLIRFunctionInterfaces.a lib64/libMLIRPDLDialect.a lib64/libMLIRSideEffectInterfaces.a lib64/libMLIRInferTypeOpInterface.a lib64/libMLIRIR.a lib64/libMLIRSupport.a lib64/libLLVM.so.19.1 lib64/libLLVMAArch64Utils.a lib64/libLLVMAsmPrinter.a lib64/libLLVMCFGuard.a lib64/libLLVMGlobalISel.a lib64/libLLVMSelectionDAG.a lib64/libLLVMCodeGen.a lib64/libLLVMScalarOpts.a lib64/libLLVMAggressiveInstCombine.a lib64/libLLVMInstCombine.a lib64/libLLVMBitWriter.a lib64/libLLVMObjCARCOpts.a lib64/libLLVMCodeGenTypes.a lib64/libLLVMTarget.a lib64/libLLVMVectorize.a lib64/libLLVMTransformUtils.a lib64/libLLVMAnalysis.a lib64/libLLVMProfileData.a lib64/libLLVMSymbolize.a lib64/libLLVMDebugInfoDWARF.a lib64/libLLVMDebugInfoPDB.a lib64/libLLVMObject.a lib64/libLLVMMCParser.a lib64/libLLVMMC.a lib64/libLLVMIRReader.a lib64/libLLVMBitReader.a lib64/libLLVMAsmParser.a lib64/libLLVMTextAPI.a lib64/libLLVMDebugInfoCodeView.a lib64/libLLVMDebugInfoMSF.a lib64/libLLVMDebugInfoBTF.a lib64/libLLVMCore.a lib64/libLLVMBinaryFormat.a lib64/libLLVMRemarks.a lib64/libLLVMBitstreamReader.a lib64/libLLVMTargetParser.a lib64/libLLVMSupport.a lib64/libLLVMDemangle.a -lrt -ldl -lm /usr/lib64/libz.so /usr/lib64/libzstd.so && : +``` + +Here's the full error: + +``` +[24/25] cd /builddir/build/BUILD/llvm-19.1.3-build/llvm-project-19.1.3.src/llvm/redhat-linux-build/tools/mlir/test && /usr/bin/python3 /builddir/build/BUILD/llvm-19.1.3-build/llvm-project-19.1.3.src/llvm/redhat-linux-build/./bin/llvm-lit -vv /builddir/build/BUILD/llvm-19.1.3-build/llvm-project-19.1.3.src/llvm/redhat-linux-build/tools/mlir/test +: CommandLine Error: Option 'aarch64-ptrauth-auth-checks' registered more than once! +LLVM ERROR: inconsistency in registered CommandLine options +llvm-lit: /builddir/build/BUILD/llvm-19.1.3-build/llvm-project-19.1.3.src/llvm/utils/lit/lit/formats/googletest.py:38: warning: unable to discover google-tests in '/builddir/build/BUILD/llvm-19.1.3-build/llvm-project-19.1.3.src/llvm/redhat-linux-build/tools/mlir/unittests/Target/LLVM/./MLIRTargetLLVMTests': Command '['/builddir/build/BUILD/llvm-19.1.3-build/llvm-project-19.1.3.src/llvm/redhat-linux-build/tools/mlir/unittests/Target/LLVM/./MLIRTargetLLVMTests', '--gtest_list_tests', '--gtest_filter=-*DISABLED_*']' died with .. Process output: b'' +error: filter did not match any tests (of 2704 discovered). Use '--allow-empty-runs' to suppress this error. +FAILED: tools/mlir/test/CMakeFiles/check-mlir /builddir/build/BUILD/llvm-19.1.3-build/llvm-project-19.1.3.src/llvm/redhat-linux-build/tools/mlir/test/CMakeFiles/check-mlir +``` + +Here's the CMake invocation: + +``` +/usr/bin/cmake -S . -B redhat-linux-build -DCMAKE_C_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_Fortran_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DLIB_SUFFIX=64 -DBUILD_SHARED_LIBS:BOOL=ON -G Ninja '' -DCLANG_BUILD_EXAMPLES:BOOL=OFF -DCLANG_CONFIG_FILE_SYSTEM_DIR=/etc/clang/ -DCLANG_DEFAULT_PIE_ON_LINUX=OFF -DCLANG_DEFAULT_UNWINDLIB=libgcc -DCLANG_ENABLE_ARCMT:BOOL=ON -DCLANG_ENABLE_STATIC_ANALYZER:BOOL=ON -DCLANG_INCLUDE_DOCS:BOOL=ON -DCLANG_INCLUDE_TESTS:BOOL=ON -DCLANG_LINK_CLANG_DYLIB=ON -DCLANG_PLUGIN_SUPPORT:BOOL=ON '-DCLANG_REPOSITORY_STRING=Fedora 19.1.3-5.fc42' -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=../clang-tools-extra -DCLANG_RESOURCE_DIR=../lib/clang/19 -DCOMPILER_RT_INCLUDE_TESTS:BOOL=OFF -DCOMPILER_RT_INSTALL_PATH=/usr/lib/clang/19 -DLLVM_ENABLE_DOXYGEN:BOOL=OFF -DLLVM_ENABLE_SPHINX:BOOL=ON -DLLVM_BUILD_DOCS:BOOL=ON -DSPHINX_EXECUTABLE=/usr/bin/sphinx-build-3 -DSPHINX_OUTPUT_HTML:BOOL=OFF -DSPHINX_OUTPUT_MAN:BOOL=ON -DSPHINX_WARNINGS_AS_ERRORS=OFF -DLLDB_DISABLE_CURSES:BOOL=OFF -DLLDB_DISABLE_LIBEDIT:BOOL=OFF -DLLDB_DISABLE_PYTHON:BOOL=OFF -DLLDB_ENFORCE_STRICT_TEST_REQUIREMENTS:BOOL=ON -DLLVM_APPEND_VC_REV:BOOL=OFF -DLLVM_BUILD_EXAMPLES:BOOL=OFF -DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=ON -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON -DLLVM_BUILD_RUNTIME:BOOL=ON -DLLVM_BUILD_TOOLS:BOOL=ON -DLLVM_BUILD_UTILS:BOOL=ON -DLLVM_COMMON_CMAKE_UTILS=/usr/share/llvm/cmake -DLLVM_DEFAULT_TARGET_TRIPLE=aarch64-redhat-linux-gnu -DLLVM_DYLIB_COMPONENTS=all -DLLVM_ENABLE_EH=ON -DLLVM_ENABLE_FFI:BOOL=ON -DLLVM_ENABLE_LIBCXX:BOOL=OFF -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON '-DLLVM_ENABLE_PROJECTS=clang;clang-tools-extra;lld;lldb;mlir' -DLLVM_ENABLE_RTTI:BOOL=ON '-DLLVM_ENABLE_RUNTIMES=compiler-rt;openmp;offload' -DLLVM_ENABLE_ZLIB:BOOL=ON -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=AVR -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_EXAMPLES:BOOL=ON -DLLVM_INCLUDE_TOOLS:BOOL=ON -DLLVM_INCLUDE_UTILS:BOOL=ON -DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF -DLLVM_INSTALL_UTILS:BOOL=ON -DLLVM_LINK_LLVM_DYLIB:BOOL=ON -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_TARGETS_TO_BUILD=all -DLLVM_TOOLS_INSTALL_DIR:PATH=bin -DLLVM_UNREACHABLE_OPTIMIZE:BOOL=OFF -DLLVM_USE_PERF:BOOL=ON -DLLVM_UTILS_INSTALL_DIR:PATH=bin -DMLIR_INCLUDE_DOCS:BOOL=ON -DMLIR_INCLUDE_TESTS:BOOL=ON -DMLIR_INCLUDE_INTEGRATION_TESTS:BOOL=OFF -DMLIR_INSTALL_AGGREGATE_OBJECTS=OFF -DMLIR_BUILD_MLIR_C_DYLIB=ON -DMLIR_ENABLE_BINDINGS_PYTHON:BOOL=ON -DOPENMP_INSTALL_LIBDIR=lib64 -DLIBOMP_INSTALL_ALIASES=OFF -DLLVM_BUILD_TESTS:BOOL=ON -DLLVM_INCLUDE_TESTS:BOOL=ON -DLLVM_INSTALL_GTEST:BOOL=ON -DLLVM_LIT_ARGS=-vv -DLLVM_UNITTEST_LINK_FLAGS=-fno-lto -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_LINKER_BUILD_ID:BOOL=ON -DOFFLOAD_INSTALL_LIBDIR=lib64 -DPython3_EXECUTABLE=/usr/bin/python3 -DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON -DPPC_LINUX_DEFAULT_IEEELONGDOUBLE=ON -DLLVM_LIBDIR_SUFFIX=64 -DLLVM_BINUTILS_INCDIR=/usr/include -DLLVM_VERSION_SUFFIX= +``` +--- + mlir/unittests/Target/LLVM/CMakeLists.txt | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/mlir/unittests/Target/LLVM/CMakeLists.txt b/mlir/unittests/Target/LLVM/CMakeLists.txt +index 6d612548a94c..0c61d222dedf 100644 +--- a/mlir/unittests/Target/LLVM/CMakeLists.txt ++++ b/mlir/unittests/Target/LLVM/CMakeLists.txt +@@ -1,11 +1,11 @@ ++set(LLVM_LINK_COMPONENTS nativecodegen) ++ + add_mlir_unittest(MLIRTargetLLVMTests + SerializeNVVMTarget.cpp + SerializeROCDLTarget.cpp + SerializeToLLVMBitcode.cpp + ) + +-llvm_map_components_to_libnames(llvm_libs nativecodegen) +- + target_link_libraries(MLIRTargetLLVMTests + PRIVATE + MLIRTargetLLVM +@@ -19,7 +19,6 @@ target_link_libraries(MLIRTargetLLVMTests + MLIRNVVMToLLVMIRTranslation + MLIRROCDLToLLVMIRTranslation + MLIRGPUToLLVMIRTranslation +- ${llvm_libs} + ) + + if (DEFINED LLVM_NATIVE_TARGET) +-- +2.46.0 + diff --git a/SOURCES/0001-mlir-python-Reuse-the-library-directory.patch b/SOURCES/0001-mlir-python-Reuse-the-library-directory.patch new file mode 100644 index 0000000..7590347 --- /dev/null +++ b/SOURCES/0001-mlir-python-Reuse-the-library-directory.patch @@ -0,0 +1,77 @@ +From 1d043550c7601ca776b0318b9b913e5ecf325baf Mon Sep 17 00:00:00 2001 +From: Tulio Magno Quites Machado Filho +Date: Tue, 5 Sep 2023 10:35:37 -0300 +Subject: [PATCH] Reuse the library directory + +Prefer to get the path to the shared libraries from config.llvm_shlib_dir. +Fallback to the previous path only if config.llvm_shlib_dir is not +defined. + +This ensures the test will pass regardless of the build configuration +used downstream. +--- + mlir/test/lit.cfg.py | 1 + + mlir/test/python/execution_engine.py | 12 +++++++----- + 2 files changed, 8 insertions(+), 5 deletions(-) + +diff --git a/mlir/test/lit.cfg.py b/mlir/test/lit.cfg.py +--- a/mlir/test/lit.cfg.py 2024-08-05 10:40:33.000000000 +0200 ++++ b/mlir/test/lit.cfg.py 2024-08-14 19:17:55.160470316 +0200 +@@ -164,6 +164,7 @@ + ToolSubst("transform-opt-ch2", unresolved="ignore"), + ToolSubst("transform-opt-ch3", unresolved="ignore"), + ToolSubst("transform-opt-ch4", unresolved="ignore"), ++ ToolSubst("%llvm_shlib_dir", config.llvm_shlib_dir, unresolved="ignore"), + ToolSubst("mlir-transform-opt", unresolved="ignore"), + ToolSubst("%mlir_lib_dir", config.mlir_lib_dir, unresolved="ignore"), + ToolSubst("%mlir_src_dir", config.mlir_src_root, unresolved="ignore"), +diff -ruN mlir-19.1.0-rc2.src.orig/test/python/execution_engine.py mlir-19.1.0-rc2.src/test/python/execution_engine.py +--- a/mlir/test/python/execution_engine.py 2024-08-05 10:40:33.000000000 +0200 ++++ b/mlir/test/python/execution_engine.py 2024-08-14 19:17:20.822219824 +0200 +@@ -1,4 +1,4 @@ +-# RUN: %PYTHON %s 2>&1 | FileCheck %s ++# RUN: env LLVM_SHLIB_DIR=%llvm_shlib_dir %PYTHON %s 2>&1 | FileCheck %s + # REQUIRES: host-supports-jit + import gc, sys, os, tempfile + from mlir.ir import * +@@ -6,6 +6,9 @@ + from mlir.execution_engine import * + from mlir.runtime import * + ++_DEFAULT_LIB_DIR = "../../../../lib" ++LIB_DIR = os.getenv("LLVM_SHLIB_DIR", _DEFAULT_LIB_DIR) ++ + + # Log everything to stderr and flush so that we have a unified stream to match + # errors/info emitted by MLIR to stderr. +@@ -613,6 +616,7 @@ + shared_libs = [ + "../../../../bin/mlir_runner_utils.dll", + "../../../../bin/mlir_c_runner_utils.dll", ++ + ] + elif sys.platform == "darwin": + shared_libs = [ +@@ -621,8 +625,9 @@ + ] + else: + shared_libs = [ +- "../../../../lib/libmlir_runner_utils.so", +- "../../../../lib/libmlir_c_runner_utils.so", ++ LIB_DIR + "/libmlir_runner_utils.so", ++ LIB_DIR + "/libmlir_c_runner_utils.so", ++ + ] + + execution_engine = ExecutionEngine( +@@ -664,8 +669,8 @@ + ] + else: + shared_libs = [ +- "../../../../lib/libmlir_runner_utils.so", +- "../../../../lib/libmlir_c_runner_utils.so", ++ LIB_DIR + "/libmlir_runner_utils.so", ++ LIB_DIR + "/libmlir_c_runner_utils.so", + ] + + execution_engine = ExecutionEngine( diff --git a/SOURCES/0001-openmp-Add-option-to-disable-tsan-tests-111548.patch b/SOURCES/0001-openmp-Add-option-to-disable-tsan-tests-111548.patch new file mode 100644 index 0000000..0e30347 --- /dev/null +++ b/SOURCES/0001-openmp-Add-option-to-disable-tsan-tests-111548.patch @@ -0,0 +1,62 @@ +From b2edeb58b8cb3268acee425cd52b406eb60a8095 Mon Sep 17 00:00:00 2001 +From: Nikita Popov +Date: Wed, 9 Oct 2024 11:29:30 +0200 +Subject: [PATCH] [openmp] Add option to disable tsan tests (#111548) + +This adds a OPENMP_TEST_ENABLE_TSAN option that allows to override +whether tests using tsan will be enabled. The option defaults to the +existing auto-detection. + +The background here is +https://github.com/llvm/llvm-project/issues/111492, where we have some +systems where tsan doesn't work, but we do still want to build it and +run tests that don't use tsan. +--- + openmp/cmake/OpenMPTesting.cmake | 3 +++ + openmp/tools/archer/tests/CMakeLists.txt | 2 +- + openmp/tools/archer/tests/lit.site.cfg.in | 2 +- + 3 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/openmp/cmake/OpenMPTesting.cmake b/openmp/cmake/OpenMPTesting.cmake +index c67ad8b1cbd9..14cc5c67d84c 100644 +--- a/openmp/cmake/OpenMPTesting.cmake ++++ b/openmp/cmake/OpenMPTesting.cmake +@@ -163,6 +163,9 @@ else() + set(OPENMP_TEST_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS 1) + endif() + ++set(OPENMP_TEST_ENABLE_TSAN "${OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS}" CACHE BOOL ++ "Whether to enable tests using tsan") ++ + # Function to set compiler features for use in lit. + function(update_test_compiler_features) + set(FEATURES "[") +diff --git a/openmp/tools/archer/tests/CMakeLists.txt b/openmp/tools/archer/tests/CMakeLists.txt +index 5de91148fa4b..412c7d63725e 100644 +--- a/openmp/tools/archer/tests/CMakeLists.txt ++++ b/openmp/tools/archer/tests/CMakeLists.txt +@@ -28,7 +28,7 @@ macro(pythonize_bool var) + endmacro() + + pythonize_bool(LIBARCHER_HAVE_LIBATOMIC) +-pythonize_bool(OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS) ++pythonize_bool(OPENMP_TEST_ENABLE_TSAN) + + set(ARCHER_TSAN_TEST_DEPENDENCE "") + if(TARGET tsan) +diff --git a/openmp/tools/archer/tests/lit.site.cfg.in b/openmp/tools/archer/tests/lit.site.cfg.in +index 55edfde9738e..ddcb7b8bc3a5 100644 +--- a/openmp/tools/archer/tests/lit.site.cfg.in ++++ b/openmp/tools/archer/tests/lit.site.cfg.in +@@ -12,7 +12,7 @@ config.omp_library_dir = "@LIBOMP_LIBRARY_DIR@" + config.omp_header_dir = "@LIBOMP_INCLUDE_DIR@" + config.operating_system = "@CMAKE_SYSTEM_NAME@" + config.has_libatomic = @LIBARCHER_HAVE_LIBATOMIC@ +-config.has_tsan = @OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS@ ++config.has_tsan = @OPENMP_TEST_ENABLE_TSAN@ + + config.test_archer_flags = "@LIBARCHER_TEST_FLAGS@" + config.libarcher_obj_root = "@CMAKE_CURRENT_BINARY_DIR@" +-- +2.46.0 + diff --git a/SOURCES/0001-openmp-Support-CET-in-z_Linux_asm.S-123213.patch b/SOURCES/0001-openmp-Support-CET-in-z_Linux_asm.S-123213.patch new file mode 100644 index 0000000..3fd4cd1 --- /dev/null +++ b/SOURCES/0001-openmp-Support-CET-in-z_Linux_asm.S-123213.patch @@ -0,0 +1,51 @@ +From 90a05f32166c4a45224a5eedbec9c5c7e21d2dbf Mon Sep 17 00:00:00 2001 +From: Nikita Popov +Date: Fri, 17 Jan 2025 09:26:49 +0100 +Subject: [PATCH] [openmp] Support CET in z_Linux_asm.S (#123213) + +When libomp is built with -cf-protection, add endbr instructions to the +start of functions for Intel CET support. +--- + openmp/runtime/src/z_Linux_asm.S | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/openmp/runtime/src/z_Linux_asm.S b/openmp/runtime/src/z_Linux_asm.S +index cc5344cdd124..0bf9f07a13f1 100644 +--- a/openmp/runtime/src/z_Linux_asm.S ++++ b/openmp/runtime/src/z_Linux_asm.S +@@ -19,6 +19,16 @@ + + #if KMP_ARCH_X86 || KMP_ARCH_X86_64 + ++# if defined(__ELF__) && defined(__CET__) && defined(__has_include) ++# if __has_include() ++# include ++# endif ++# endif ++ ++# if !defined(_CET_ENDBR) ++# define _CET_ENDBR ++# endif ++ + # if KMP_MIC + // the 'delay r16/r32/r64' should be used instead of the 'pause'. + // The delay operation has the effect of removing the current thread from +@@ -66,6 +76,7 @@ + ALIGN 4 + .globl KMP_PREFIX_UNDERSCORE($0) + KMP_PREFIX_UNDERSCORE($0): ++ _CET_ENDBR + .endmacro + # else // KMP_OS_DARWIN + # define KMP_PREFIX_UNDERSCORE(x) x //no extra underscore for Linux* OS symbols +@@ -92,6 +103,7 @@ KMP_PREFIX_UNDERSCORE($0): + .globl KMP_PREFIX_UNDERSCORE(\proc) + KMP_PREFIX_UNDERSCORE(\proc): + .cfi_startproc ++ _CET_ENDBR + .endm + .macro KMP_CFI_DEF_OFFSET sz + .cfi_def_cfa_offset \sz +-- +2.47.1 + diff --git a/SOURCES/0001-openmp-Use-core_siblings_list-if-physical_package_id.patch b/SOURCES/0001-openmp-Use-core_siblings_list-if-physical_package_id.patch new file mode 100644 index 0000000..bacb81f --- /dev/null +++ b/SOURCES/0001-openmp-Use-core_siblings_list-if-physical_package_id.patch @@ -0,0 +1,205 @@ +From 5fb4d7f6079a76b2907ccc8c53c7c509c30a3dca Mon Sep 17 00:00:00 2001 +From: Nikita Popov +Date: Thu, 10 Oct 2024 12:47:33 +0000 +Subject: [PATCH] [openmp] Use core_siblings_list if physical_package_id not + available + +On powerpc, physical_package_id may not be available. Currently, +this causes openmp to fall back to flat topology and various +affinity tests fail. + +Fix this by parsing core_siblings_list to deterimine which cpus +belong to the same socket. This matches what the testing code +does. The code to parse the CPU list format thankfully already +exists. + +Fixes https://github.com/llvm/llvm-project/issues/111809. +--- + openmp/runtime/src/kmp_affinity.cpp | 100 +++++++++++++------ + openmp/runtime/test/affinity/kmp-hw-subset.c | 2 +- + 2 files changed, 72 insertions(+), 30 deletions(-) + +diff --git a/openmp/runtime/src/kmp_affinity.cpp b/openmp/runtime/src/kmp_affinity.cpp +index cf5cad04eb57..c3d5ecf1345e 100644 +--- a/openmp/runtime/src/kmp_affinity.cpp ++++ b/openmp/runtime/src/kmp_affinity.cpp +@@ -1589,15 +1589,13 @@ kmp_str_buf_t *__kmp_affinity_str_buf_mask(kmp_str_buf_t *buf, + return buf; + } + +-// Return (possibly empty) affinity mask representing the offline CPUs +-// Caller must free the mask +-kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { +- kmp_affin_mask_t *offline; +- KMP_CPU_ALLOC(offline); +- KMP_CPU_ZERO(offline); ++static kmp_affin_mask_t *__kmp_parse_cpu_list(const char *path) { ++ kmp_affin_mask_t *mask; ++ KMP_CPU_ALLOC(mask); ++ KMP_CPU_ZERO(mask); + #if KMP_OS_LINUX + int n, begin_cpu, end_cpu; +- kmp_safe_raii_file_t offline_file; ++ kmp_safe_raii_file_t file; + auto skip_ws = [](FILE *f) { + int c; + do { +@@ -1606,29 +1604,29 @@ kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { + if (c != EOF) + ungetc(c, f); + }; +- // File contains CSV of integer ranges representing the offline CPUs ++ // File contains CSV of integer ranges representing the CPUs + // e.g., 1,2,4-7,9,11-15 +- int status = offline_file.try_open("/sys/devices/system/cpu/offline", "r"); ++ int status = file.try_open(path, "r"); + if (status != 0) +- return offline; +- while (!feof(offline_file)) { +- skip_ws(offline_file); +- n = fscanf(offline_file, "%d", &begin_cpu); ++ return mask; ++ while (!feof(file)) { ++ skip_ws(file); ++ n = fscanf(file, "%d", &begin_cpu); + if (n != 1) + break; +- skip_ws(offline_file); +- int c = fgetc(offline_file); ++ skip_ws(file); ++ int c = fgetc(file); + if (c == EOF || c == ',') { + // Just single CPU + end_cpu = begin_cpu; + } else if (c == '-') { + // Range of CPUs +- skip_ws(offline_file); +- n = fscanf(offline_file, "%d", &end_cpu); ++ skip_ws(file); ++ n = fscanf(file, "%d", &end_cpu); + if (n != 1) + break; +- skip_ws(offline_file); +- c = fgetc(offline_file); // skip ',' ++ skip_ws(file); ++ c = fgetc(file); // skip ',' + } else { + // Syntax problem + break; +@@ -1638,13 +1636,19 @@ kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { + end_cpu >= __kmp_xproc || begin_cpu > end_cpu) { + continue; + } +- // Insert [begin_cpu, end_cpu] into offline mask ++ // Insert [begin_cpu, end_cpu] into mask + for (int cpu = begin_cpu; cpu <= end_cpu; ++cpu) { +- KMP_CPU_SET(cpu, offline); ++ KMP_CPU_SET(cpu, mask); + } + } + #endif +- return offline; ++ return mask; ++} ++ ++// Return (possibly empty) affinity mask representing the offline CPUs ++// Caller must free the mask ++kmp_affin_mask_t *__kmp_affinity_get_offline_cpus() { ++ return __kmp_parse_cpu_list("/sys/devices/system/cpu/offline"); + } + + // Return the number of available procs +@@ -3175,6 +3179,37 @@ static inline const char *__kmp_cpuinfo_get_envvar() { + return envvar; + } + ++static bool __kmp_package_id_from_core_siblings_list(unsigned **threadInfo, ++ unsigned num_avail, ++ unsigned idx) { ++ if (!KMP_AFFINITY_CAPABLE()) ++ return false; ++ ++ char path[256]; ++ KMP_SNPRINTF(path, sizeof(path), ++ "/sys/devices/system/cpu/cpu%u/topology/core_siblings_list", ++ threadInfo[idx][osIdIndex]); ++ kmp_affin_mask_t *siblings = __kmp_parse_cpu_list(path); ++ for (unsigned i = 0; i < num_avail; ++i) { ++ unsigned cpu_id = threadInfo[i][osIdIndex]; ++ KMP_ASSERT(cpu_id < __kmp_affin_mask_size * CHAR_BIT); ++ if (!KMP_CPU_ISSET(cpu_id, siblings)) ++ continue; ++ if (threadInfo[i][pkgIdIndex] == UINT_MAX) { ++ // Arbitrarily pick the first index we encounter, it only matters that ++ // the value is the same for all siblings. ++ threadInfo[i][pkgIdIndex] = idx; ++ } else if (threadInfo[i][pkgIdIndex] != idx) { ++ // Contradictory sibling lists. ++ KMP_CPU_FREE(siblings); ++ return false; ++ } ++ } ++ KMP_ASSERT(threadInfo[idx][pkgIdIndex] != UINT_MAX); ++ KMP_CPU_FREE(siblings); ++ return true; ++} ++ + // Parse /proc/cpuinfo (or an alternate file in the same format) to obtain the + // affinity map. On AIX, the map is obtained through system SRAD (Scheduler + // Resource Allocation Domain). +@@ -3550,18 +3585,13 @@ static bool __kmp_affinity_create_cpuinfo_map(int *line, + return false; + } + +- // Check for missing fields. The osId field must be there, and we +- // currently require that the physical id field is specified, also. ++ // Check for missing fields. The osId field must be there. The physical ++ // id field will be checked later. + if (threadInfo[num_avail][osIdIndex] == UINT_MAX) { + CLEANUP_THREAD_INFO; + *msg_id = kmp_i18n_str_MissingProcField; + return false; + } +- if (threadInfo[0][pkgIdIndex] == UINT_MAX) { +- CLEANUP_THREAD_INFO; +- *msg_id = kmp_i18n_str_MissingPhysicalIDField; +- return false; +- } + + // Skip this proc if it is not included in the machine model. + if (KMP_AFFINITY_CAPABLE() && +@@ -3591,6 +3621,18 @@ static bool __kmp_affinity_create_cpuinfo_map(int *line, + } + *line = 0; + ++ // At least on powerpc, Linux may return -1 for physical_package_id. Try ++ // to reconstruct topology from core_siblings_list in that case. ++ for (i = 0; i < num_avail; ++i) { ++ if (threadInfo[i][pkgIdIndex] == UINT_MAX) { ++ if (!__kmp_package_id_from_core_siblings_list(threadInfo, num_avail, i)) { ++ CLEANUP_THREAD_INFO; ++ *msg_id = kmp_i18n_str_MissingPhysicalIDField; ++ return false; ++ } ++ } ++ } ++ + #if KMP_MIC && REDUCE_TEAM_SIZE + unsigned teamSize = 0; + #endif // KMP_MIC && REDUCE_TEAM_SIZE +diff --git a/openmp/runtime/test/affinity/kmp-hw-subset.c b/openmp/runtime/test/affinity/kmp-hw-subset.c +index 606fcdfbada9..0b49969bd3b1 100644 +--- a/openmp/runtime/test/affinity/kmp-hw-subset.c ++++ b/openmp/runtime/test/affinity/kmp-hw-subset.c +@@ -25,7 +25,7 @@ static int compare_hw_subset_places(const place_list_t *openmp_places, + expected_per_place = nthreads_per_core; + } else { + expected_total = nsockets; +- expected_per_place = ncores_per_socket; ++ expected_per_place = ncores_per_socket * nthreads_per_core; + } + if (openmp_places->num_places != expected_total) { + fprintf(stderr, "error: KMP_HW_SUBSET did not half each resource layer!\n"); +-- +2.47.0 + diff --git a/SOURCES/0001-profile-Use-base-vaddr-for-__llvm_write_binary_ids-n.patch b/SOURCES/0001-profile-Use-base-vaddr-for-__llvm_write_binary_ids-n.patch new file mode 100644 index 0000000..7f0a7cf --- /dev/null +++ b/SOURCES/0001-profile-Use-base-vaddr-for-__llvm_write_binary_ids-n.patch @@ -0,0 +1,86 @@ +From ccc2b792e57d632bc887b226a4e7f0a8189eab8b Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Mon, 4 Nov 2024 16:37:49 -0800 +Subject: [PATCH] [profile] Use base+vaddr for `__llvm_write_binary_ids` note + pointers + +This function is always examining its own ELF headers in memory, but it +was trying to use conditions between examining files or memory, and it +wasn't accounting for LOAD offsets at runtime. This is especially bad if +a loaded segment has additional padding that's not in the file offsets. + +Now we do a first scan of the program headers to figure out the runtime +base address based on `PT_PHDR` and/or `PT_DYNAMIC` (else assume zero), +similar to libc's `do_start`. Then each `PT_NOTE` pointer is simply the +base plus the segments's `pt_vaddr`, which includes LOAD offsets. + +Fixes #114605 +--- + .../lib/profile/InstrProfilingPlatformLinux.c | 40 ++++++++----------- + 1 file changed, 16 insertions(+), 24 deletions(-) + +diff --git a/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c b/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c +index e2c06d51e0c6..c365129a0768 100644 +--- a/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c ++++ b/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c +@@ -194,41 +194,33 @@ static int WriteBinaryIds(ProfDataWriter *Writer, const ElfW(Nhdr) * Note, + */ + COMPILER_RT_VISIBILITY int __llvm_write_binary_ids(ProfDataWriter *Writer) { + extern const ElfW(Ehdr) __ehdr_start __attribute__((visibility("hidden"))); ++ extern ElfW(Dyn) _DYNAMIC[] __attribute__((weak, visibility("hidden"))); ++ + const ElfW(Ehdr) *ElfHeader = &__ehdr_start; + const ElfW(Phdr) *ProgramHeader = + (const ElfW(Phdr) *)((uintptr_t)ElfHeader + ElfHeader->e_phoff); + ++ /* Compute the added base address in case of position-independent code. */ ++ uintptr_t Base = 0; ++ for (uint32_t I = 0; I < ElfHeader->e_phnum; I++) { ++ if (ProgramHeader[I].p_type == PT_PHDR) ++ Base = (uintptr_t)ProgramHeader - ProgramHeader[I].p_vaddr; ++ if (ProgramHeader[I].p_type == PT_DYNAMIC && _DYNAMIC) ++ Base = (uintptr_t)_DYNAMIC - ProgramHeader[I].p_vaddr; ++ } ++ + int TotalBinaryIdsSize = 0; +- uint32_t I; + /* Iterate through entries in the program header. */ +- for (I = 0; I < ElfHeader->e_phnum; I++) { ++ for (uint32_t I = 0; I < ElfHeader->e_phnum; I++) { + /* Look for the notes segment in program header entries. */ + if (ProgramHeader[I].p_type != PT_NOTE) + continue; + + /* There can be multiple notes segment, and examine each of them. */ +- const ElfW(Nhdr) * Note; +- const ElfW(Nhdr) * NotesEnd; +- /* +- * When examining notes in file, use p_offset, which is the offset within +- * the elf file, to find the start of notes. +- */ +- if (ProgramHeader[I].p_memsz == 0 || +- ProgramHeader[I].p_memsz == ProgramHeader[I].p_filesz) { +- Note = (const ElfW(Nhdr) *)((uintptr_t)ElfHeader + +- ProgramHeader[I].p_offset); +- NotesEnd = (const ElfW(Nhdr) *)((const char *)(Note) + +- ProgramHeader[I].p_filesz); +- } else { +- /* +- * When examining notes in memory, use p_vaddr, which is the address of +- * section after loaded to memory, to find the start of notes. +- */ +- Note = +- (const ElfW(Nhdr) *)((uintptr_t)ElfHeader + ProgramHeader[I].p_vaddr); +- NotesEnd = +- (const ElfW(Nhdr) *)((const char *)(Note) + ProgramHeader[I].p_memsz); +- } ++ const ElfW(Nhdr) *Note = ++ (const ElfW(Nhdr) *)(Base + ProgramHeader[I].p_vaddr); ++ const ElfW(Nhdr) *NotesEnd = ++ (const ElfW(Nhdr) *)((const char *)(Note) + ProgramHeader[I].p_memsz); + + int BinaryIdsSize = WriteBinaryIds(Writer, Note, NotesEnd); + if (TotalBinaryIdsSize == -1) +-- +2.47.0 + diff --git a/SOURCES/0003-PATCH-clang-Don-t-install-static-libraries.patch b/SOURCES/0003-PATCH-clang-Don-t-install-static-libraries.patch new file mode 100644 index 0000000..bc8fa51 --- /dev/null +++ b/SOURCES/0003-PATCH-clang-Don-t-install-static-libraries.patch @@ -0,0 +1,25 @@ +From 88704fc2eabb9dd19a9c3eb81a9b3dc37d95651c Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Fri, 31 Jan 2020 11:04:57 -0800 +Subject: [PATCH][clang] Don't install static libraries + +--- + clang/cmake/modules/AddClang.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake +index 5752f4277444..0f52822d91f0 100644 +--- a/clang/cmake/modules/AddClang.cmake ++++ b/clang/cmake/modules/AddClang.cmake +@@ -113,7 +113,7 @@ macro(add_clang_library name) + if(TARGET ${lib}) + target_link_libraries(${lib} INTERFACE ${LLVM_COMMON_LIBS}) + +- if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN) ++ if (ARG_SHARED AND (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN)) + get_target_export_arg(${name} Clang export_to_clangtargets UMBRELLA clang-libraries) + install(TARGETS ${lib} + COMPONENT ${lib} +-- +2.30.2 + diff --git a/SOURCES/0101-Deactivate-markdown-doc.patch b/SOURCES/0101-Deactivate-markdown-doc.patch deleted file mode 100644 index a8409aa..0000000 --- a/SOURCES/0101-Deactivate-markdown-doc.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/llvm/docs/conf.py b/llvm/docs/conf.py -index cf8a75980b53..b208ad138e89 100644 ---- a/llvm/docs/conf.py -+++ b/llvm/docs/conf.py -@@ -26,7 +26,7 @@ from datetime import date - - # Add any Sphinx extension module names here, as strings. They can be extensions - # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. --extensions = ["myst_parser", "sphinx.ext.intersphinx", "sphinx.ext.todo"] -+extensions = ["sphinx.ext.intersphinx", "sphinx.ext.todo"] - - # Automatic anchors for markdown titles - from llvm_slug import make_slug diff --git a/SOURCES/99273.patch b/SOURCES/18-99273.patch similarity index 100% rename from SOURCES/99273.patch rename to SOURCES/18-99273.patch diff --git a/SOURCES/cstdint.patch b/SOURCES/cstdint.patch new file mode 100644 index 0000000..d0b575c --- /dev/null +++ b/SOURCES/cstdint.patch @@ -0,0 +1,24 @@ +diff -ruN llvm-19.1.7-build.orig/llvm-project-19.1.7.src/mlir/include/mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h llvm-19.1.7-build/llvm-project-19.1.7.src/mlir/include/mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h +--- a/mlir/include/mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h 2025-01-14 10:41:02.000000000 +0100 ++++ b/mlir/include/mlir/Dialect/Affine/IR/ValueBoundsOpInterfaceImpl.h 2025-01-17 08:31:49.581864809 +0100 +@@ -9,6 +9,7 @@ + #ifndef MLIR_DIALECT_AFFINE_IR_VALUEBOUNDSOPINTERFACEIMPL_H + #define MLIR_DIALECT_AFFINE_IR_VALUEBOUNDSOPINTERFACEIMPL_H + ++#include + #include "mlir/Support/LLVM.h" + + namespace mlir { +diff -ruN llvm-19.1.7-build.orig/llvm-project-19.1.7.src/mlir/include/mlir/Support/LLVM.h llvm-19.1.7-build/llvm-project-19.1.7.src/mlir/include/mlir/Support/LLVM.h +--- a/mlir/include/mlir/Support/LLVM.h 2025-01-14 10:41:02.000000000 +0100 ++++ b/mlir/include/mlir/Support/LLVM.h 2025-01-17 10:20:19.356337873 +0100 +@@ -18,6 +18,9 @@ + #ifndef MLIR_SUPPORT_LLVM_H + #define MLIR_SUPPORT_LLVM_H + ++ ++ ++#include + // We include this header because it cannot be practically forward + // declared, and are effectively language features. + #include "llvm/Support/Casting.h" diff --git a/SOURCES/macros.clang b/SOURCES/macros.clang new file mode 100644 index 0000000..88f259d --- /dev/null +++ b/SOURCES/macros.clang @@ -0,0 +1,11 @@ +%clang_major_version @@CLANG_MAJOR_VERSION@@ +%clang_minor_version @@CLANG_MINOR_VERSION@@ +%clang_patch_version @@CLANG_PATCH_VERSION@@ + +%clang_version %{clang_major_version}.%{clang_minor_version}.%{clang_patch_version} + +# This is the path to the clang resource directory that has clang's internal +# headers and libraries. This path should be used by packages that need to +# install files into this directory. This macro's value changes every time +# clang's version changes. +%clang_resource_dir %{_prefix}/lib/clang/%{clang_major_version} diff --git a/SPECS/llvm.spec b/SPECS/llvm.spec index 4a4ed09..aa74a9a 100644 --- a/SPECS/llvm.spec +++ b/SPECS/llvm.spec @@ -1,19 +1,15 @@ +#region globals +#region version +%global maj_ver 19 +%global min_ver 1 +%global patch_ver 7 +#global rc_ver 4 + %bcond_with snapshot_build - %if %{with snapshot_build} -# Unlock LLVM Snapshot LUA functions -%{llvm_sb} +%include %{_sourcedir}/version.spec.inc %endif - -# We are building with clang for faster/lower memory LTO builds. -# See https://docs.fedoraproject.org/en-US/packaging-guidelines/#_compiler_macros -%global toolchain clang - -# Opt out of https://fedoraproject.org/wiki/Changes/fno-omit-frame-pointer -# https://bugzilla.redhat.com/show_bug.cgi?id=2158587 -%undefine _include_frame_pointers - -%global gts_version 13 +#endregion version # Components enabled if supported by target architecture: %define gold_arches %{ix86} x86_64 aarch64 %{power64} s390x @@ -23,58 +19,122 @@ %bcond_with gold %endif +# Build compat packages llvmN instead of main package for the current LLVM +# version. Used on Fedora. %bcond_with compat_build -%bcond_with bundle_compat_lib +# Bundle compat libraries for a previous LLVM version, as part of llvm-libs and +# clang-libs. Used on RHEL. +%bcond_without bundle_compat_lib %bcond_without check +%if %{with bundle_compat_lib} +%global compat_maj_ver 18 +%global compat_ver %{compat_maj_ver}.1.8 +%endif + +# Compat builds do not include python-lit and lldb +%if %{with compat_build} +%bcond_with python_lit +%bcond_with lldb +%else +%bcond_without python_lit +%bcond_without lldb +%endif + +%if %{without compat_build} && 0%{?fedora} >= 41 +%ifarch %{ix86} +%bcond_with mlir +%else +%bcond_without mlir +%endif +%else +%bcond_with mlir +%endif + +# The libcxx build condition also enables libcxxabi and libunwind. +# Fedora 41 is the first version that enabled FatLTO for clang-built files. +# Without FatLTO, we can't enable ThinLTO and link using GNU LD. +%if %{without compat_build} && 0%{?fedora} >= 41 +%bcond_without libcxx +%else +%bcond_with libcxx +%endif + +# I've called the build condition "build_bolt" to indicate that this does not +# necessarily "use" BOLT in order to build LLVM. +%if %{without compat_build} && 0%{?fedora} >= 41 +# BOLT only supports aarch64 and x86_64 +%ifarch aarch64 x86_64 +%bcond_without build_bolt +%else +%bcond_with build_bolt +%endif +%else +%bcond_with build_bolt +%endif + +# Disable LTO on x86 and riscv in order to reduce memory consumption. %ifarch %ix86 riscv64 -# Disable LTO on x86 in order to reduce memory consumption -%bcond_with lto_build -%elif %{with snapshot_build} -# Disable LTO to speed up builds %bcond_with lto_build %else %bcond_without lto_build %endif -%if %{with bundle_compat_lib} -%global compat_maj_ver 17 -%global compat_ver %{compat_maj_ver}.0.6 +%if %{without lto_build} +%global _lto_cflags %nil %endif -%global maj_ver 18 -%global min_ver 1 -%global patch_ver 8 -#global rc_ver 4 +# We are building with clang for faster/lower memory LTO builds. +# See https://docs.fedoraproject.org/en-US/packaging-guidelines/#_compiler_macros +%global toolchain clang + +%if %{defined rhel} && 0%{?rhel} < 10 +%global gts_version 14 +%endif + +# Opt out of https://fedoraproject.org/wiki/Changes/fno-omit-frame-pointer +# https://bugzilla.redhat.com/show_bug.cgi?id=2158587 +%undefine _include_frame_pointers + +# Suffixless tarball name (essentially: basename -s .tar.xz llvm-project-17.0.6.src.tar.xz) %if %{with snapshot_build} -%undefine rc_ver -%global maj_ver %{llvm_snapshot_version_major} -%global min_ver %{llvm_snapshot_version_minor} -%global patch_ver %{llvm_snapshot_version_patch} +%global src_tarball_dir llvm-project-%{llvm_snapshot_git_revision} +%else +%global src_tarball_dir llvm-project-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}.src %endif -%global llvm_srcdir llvm-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:rc%{rc_ver}}.src -%global cmake_srcdir cmake-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:rc%{rc_ver}}.src -%global third_party_srcdir third-party-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:rc%{rc_ver}}.src +#region LLVM globals %if %{with compat_build} -%global pkg_name llvm%{maj_ver} +%global pkg_name_llvm llvm%{maj_ver} +%global pkg_suffix %{maj_ver} %global exec_suffix -%{maj_ver} -%global install_prefix %{_libdir}/%{name} +%global install_prefix %{_libdir}/%{pkg_name_llvm} %global install_bindir %{install_prefix}/bin %global install_includedir %{install_prefix}/include %global install_libdir %{install_prefix}/lib +%global install_datadir %{install_prefix}/share +%global install_libexecdir %{install_prefix}/libexec +%global install_docdir %{install_datadir}/doc +%global unprefixed_libdir lib +%global build_libdir llvm/%{_vpath_builddir}/lib -%global pkg_includedir %{_includedir}/%{name} +%global pkg_includedir %{_includedir}/%{pkg_name_llvm} %global pkg_datadir %{install_prefix}/share %else -%global pkg_name llvm +%global pkg_name_llvm llvm %global install_prefix /usr %global install_bindir %{_bindir} +%global install_datadir %{_datadir} %global install_libdir %{_libdir} %global install_includedir %{_includedir} +%global install_libexecdir %{_libexecdir} +%global install_docdir %{_docdir} +%global unprefixed_libdir %{_lib} +%global build_libdir llvm/%{_vpath_builddir}/%{_lib} %global pkg_datadir %{_datadir} +%global pkg_suffix %{nil} %global exec_suffix %{nil} %endif @@ -99,57 +159,222 @@ # The executable Python scripts in /usr/share/opt-viewer/ import each other %undefine _py3_shebang_P -Name: %{pkg_name} +#endregion LLVM globals + +#region CLANG globals + +%global pkg_name_clang clang%{pkg_suffix} + +#endregion CLANG globals + +#region COMPILER-RT globals + +%global pkg_name_compiler_rt compiler-rt%{pkg_suffix} + +# TODO(kkleine): do these optflags hurt llvm and/or clang? + +# see https://sourceware.org/bugzilla/show_bug.cgi?id=25271 +%global optflags %(echo %{optflags} -D_DEFAULT_SOURCE) + +# see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93615 +%global optflags %(echo %{optflags} -Dasm=__asm__) + +# Copy CFLAGS into ASMFLAGS, so -fcf-protection is used when compiling assembly files. +# export ASMFLAGS=$CFLAGS +#endregion COMPILER-RT globals + +#region openmp globals +%global pkg_name_libomp libomp%{pkg_suffix} + +%global so_suffix %{maj_ver}.%{min_ver} + +%if %{with snapshot_build} +%global so_suffix %{maj_ver}.%{min_ver}%{llvm_snapshot_version_suffix} +%endif + +%ifarch ppc64le +%global libomp_arch ppc64 +%else +%global libomp_arch %{_arch} +%endif +#endregion openmp globals + +#region LLD globals +%global pkg_name_lld lld%{pkg_suffix} +#endregion LLD globals + +#region LLDB globals +%global pkg_name_lldb lldb +#endregion LLDB globals +#endregion globals + +#region MLIR globals +%global pkg_name_mlir mlir%{pkg_suffix} +#endregion MLIR globals + +#region libcxx globals +%global pkg_name_libcxx libcxx +%global pkg_name_libcxxabi libcxxabi +%global pkg_name_llvm_libunwind llvm-libunwind +#endregion libcxx globals + +#region BOLT globals +%global pkg_name_bolt llvm-bolt%{pkg_suffix} +#endregion BOLT globals + +#region packages +#region main package +Name: %{pkg_name_llvm} Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}}%{?llvm_snapshot_version_suffix:~%{llvm_snapshot_version_suffix}} -Release: 3%{?dist} +Release: 1%{?dist} Summary: The Low Level Virtual Machine License: Apache-2.0 WITH LLVM-exception OR NCSA URL: http://llvm.org + %if %{with snapshot_build} -Source0: %{llvm_snapshot_source_prefix}llvm-%{llvm_snapshot_yyyymmdd}.src.tar.xz -Source2: %{llvm_snapshot_source_prefix}cmake-%{llvm_snapshot_yyyymmdd}.src.tar.xz -Source4: %{llvm_snapshot_source_prefix}third-party-%{llvm_snapshot_yyyymmdd}.src.tar.xz -%{llvm_snapshot_extra_source_tags} +Source0: https://github.com/llvm/llvm-project/archive/%{llvm_snapshot_git_revision}.tar.gz %else -Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{llvm_srcdir}.tar.xz -Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{llvm_srcdir}.tar.xz.sig -Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{cmake_srcdir}.tar.xz -Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{cmake_srcdir}.tar.xz.sig -Source4: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{third_party_srcdir}.tar.xz -Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{third_party_srcdir}.tar.xz.sig -Source6: release-keys.asc +Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{src_tarball_dir}.tar.xz +Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{src_tarball_dir}.tar.xz.sig +%endif +Source6: release-keys.asc + +%if %{without compat_build} +Source2005: macros.%{pkg_name_clang} +%endif %if %{with bundle_compat_lib} -Source7: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compat_ver}/llvm-%{compat_ver}.src.tar.xz -Source8: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compat_ver}/llvm-%{compat_ver}.src.tar.xz.sig +Source3000: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compat_ver}/llvm-project-%{compat_ver}.src.tar.xz +Source3001: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compat_ver}/llvm-project-%{compat_ver}.src.tar.xz.sig %endif + +# Sources we use to split up the main spec file in sections so that we can more +# easily see what specfile sections are touched by a patch. +%if %{with snapshot_build} +Source1000: version.spec.inc %endif +# We've established the habit of numbering patches the following way: +# +# 0-499: All patches that are unconditionally applied +# 500-1000: Patches applied under certain conditions (e.g. only on RHEL8) +# 1500-1599: Patches for LLVM 15 +# 1600-1699: Patches for LLVM 16 +# 1700-1799: Patches for LLVM 17 +# ... +# 2000-2099: Patches for LLVM 20 +# +# The idea behind this is that the last range of patch numbers (e.g. 2000-2099) allow +# us to "deprecate" a patch instead of deleting it right away. +# Suppose llvm upstream in git is at version 20 and there's a patch living +# in some PR that has not been merged yet. You can copy that patch and put it +# in a line like: +# +# Patch2011: upstream.patch +# +# As time goes by, llvm moves on to LLVM 21 and meanwhile the patch has landed. +# There's no need for you to remove the "Patch2011:" line. In fact, we encourage you +# to not remove it for some time. For compat libraries and compat packages we might +# still need this patch and so we're applying it automatically for you in those +# situations. Remember that a compat library is always at least one major version +# behind the latest packaged LLVM version. + +#region OpenMP patches +Patch1900: 0001-openmp-Add-option-to-disable-tsan-tests-111548.patch +Patch1901: 0001-openmp-Use-core_siblings_list-if-physical_package_id.patch +Patch1910: 0001-openmp-Support-CET-in-z_Linux_asm.S-123213.patch +#endregion OpenMP patches + +#region CLANG patches +Patch101: 0001-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch +Patch102: 0003-PATCH-clang-Don-t-install-static-libraries.patch +#endregion CLANG patches + +# Workaround a bug in ORC on ppc64le. +# More info is available here: https://reviews.llvm.org/D159115#4641826 +Patch103: 0001-Workaround-a-bug-in-ORC-on-ppc64le.patch + +# With the introduction of --gcc-include-dir in the clang config file, +# this might no longer be needed. +Patch104: 0001-Driver-Give-devtoolset-path-precedence-over-Installe.patch + +#region MLIR patches +# See https://github.com/llvm/llvm-project/pull/108579 +Patch1904: 0001-mlir-python-Reuse-the-library-directory.patch +# See https://github.com/llvm/llvm-project/pull/108461 +Patch1905: 0001-CMake-Add-missing-dependency-108461.patch +# See https://github.com/llvm/llvm-project/pull/118542 +Patch1906: 0001-mlir-Specify-deps-via-LLVM_LINK_COMPONENTS.patch +# See https://github.com/llvm/llvm-project/pull/120079 +Patch1907: 0001-CMake-Use-correct-exports-for-MLIR-tools.patch +Patch1908: cstdint.patch +#endregion MLIR patches + +#region BOLT patches +Patch1909: 0001-19-PATCH-Bolt-CMake-Don-t-export-bolt-libraries-in-LLVM.patch +#endregion BOLT patches + +#region LLD patches +Patch1800: 0001-18-Always-build-shared-libs-for-LLD.patch +Patch1902: 0001-19-Always-build-shared-libs-for-LLD.patch +Patch2000: 0001-19-Always-build-shared-libs-for-LLD.patch +#endregion LLD patches + +#region RHEL patches +# RHEL 8 only +Patch501: 0001-Fix-page-size-constant-on-aarch64-and-ppc64le.patch +#endregion RHEL patches + # Backport with modifications from # https://github.com/llvm/llvm-project/pull/99273 # Fixes RHEL-49517. -Patch001: 99273.patch +Patch1801: 18-99273.patch -# RHEL-specific patch to avoid unwanted python3-myst-parser dep -Patch101: 0101-Deactivate-markdown-doc.patch +# Fix profiling after a binutils NOTE change. +# https://github.com/llvm/llvm-project/pull/114907 +Patch1802: 0001-profile-Use-base-vaddr-for-__llvm_write_binary_ids-n.patch +Patch1903: 0001-profile-Use-base-vaddr-for-__llvm_write_binary_ids-n.patch +%if 0%{?rhel} == 8 +%global python3_pkgversion 3.12 +%global __python3 /usr/bin/python3.12 +%endif + +%if %{defined gts_version} +# Required for 64-bit atomics on i686. +BuildRequires: gcc-toolset-%{gts_version}-libatomic-devel +BuildRequires: gcc-toolset-%{gts_version}-gcc-c++ +%endif BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: clang BuildRequires: cmake +BuildRequires: chrpath BuildRequires: ninja-build BuildRequires: zlib-devel +BuildRequires: libzstd-devel BuildRequires: libffi-devel BuildRequires: ncurses-devel -BuildRequires: python3-psutil +# This intentionally does not use python3_pkgversion. RHEL 8 does not have +# python3.12-sphinx, and we are only using it as a binary anyway. BuildRequires: python3-sphinx -%if %{undefined rhel} -BuildRequires: python3-myst-parser +%if 0%{?rhel} != 8 +# RHEL 8 does not have these packages for python3.12. However, they are only +# needed for LLDB tests. +BuildRequires: python%{python3_pkgversion}-psutil +BuildRequires: python%{python3_pkgversion}-pexpect %endif +%if %{undefined rhel} +BuildRequires: python%{python3_pkgversion}-myst-parser +%endif +# Needed for %%multilib_fix_c_header BuildRequires: multilib-rpm-config %if %{with gold} BuildRequires: binutils-devel +%if %{undefined rhel} || 0%{?rhel} > 8 +BuildRequires: binutils-gold +%endif %endif %ifarch %{valgrind_arches} # Enable extra functionality when run the LLVM JIT under valgrind. @@ -158,15 +383,71 @@ BuildRequires: valgrind-devel # LLVM's LineEditor library will use libedit if it is available. BuildRequires: libedit-devel # We need python3-devel for %%py3_shebang_fix -BuildRequires: python3-devel -BuildRequires: python3-setuptools +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools +%if 0%{?rhel} == 8 +BuildRequires: python%{python3_pkgversion}-rpm-macros +%endif -# For origin certification +# For gpg source verification BuildRequires: gnupg2 -# To handle LTO debuginfo -BuildRequires: gcc-toolset-%{gts_version}-gdb -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +BuildRequires: swig +BuildRequires: libxml2-devel +BuildRequires: doxygen + +# For clang-offload-packager +BuildRequires: elfutils-libelf-devel +BuildRequires: perl +BuildRequires: perl-Data-Dumper +BuildRequires: perl-Encode +BuildRequires: libffi-devel + +BuildRequires: perl-generators + +# According to https://fedoraproject.org/wiki/Packaging:Emacs a package +# should BuildRequires: emacs if it packages emacs integration files. +BuildRequires: emacs + +BuildRequires: libatomic + +# scan-build uses these perl modules so they need to be installed in order +# to run the tests. +BuildRequires: perl(Digest::MD5) +BuildRequires: perl(File::Copy) +BuildRequires: perl(File::Find) +BuildRequires: perl(File::Path) +BuildRequires: perl(File::Temp) +BuildRequires: perl(FindBin) +BuildRequires: perl(Hash::Util) +BuildRequires: perl(lib) +BuildRequires: perl(Term::ANSIColor) +BuildRequires: perl(Text::ParseWords) +BuildRequires: perl(Sys::Hostname) + +%if %{with mlir} +BuildRequires: python%{python3_pkgversion}-numpy +BuildRequires: python%{python3_pkgversion}-pybind11 +BuildRequires: python%{python3_pkgversion}-pyyaml +%if %{maj_ver} >= 20 +BuildRequires: python%{python3_pkgversion}-nanobind-devel +%endif +%endif + +BuildRequires: graphviz + +# This is required because we need "ps" when running LLDB tests +BuildRequires: procps-ng + +# For reproducible pyc file generation +# See https://docs.fedoraproject.org/en-US/packaging-guidelines/Python_Appendix/#_byte_compilation_reproducibility +# Since Fedora 41 this happens automatically, and RHEL 8 does not support this. +%if %{without compat_build} && ((%{defined fedora} && 0%{?fedora} < 41) || 0%{?rhel} == 9 || 0%{?rhel} == 10) +BuildRequires: /usr/bin/marshalparser +%global py_reproducible_pyc_path %{buildroot}%{python3_sitelib} +%endif + +Requires: %{pkg_name_llvm}-libs%{?_isa} = %{version}-%{release} Provides: llvm(major) = %{maj_ver} @@ -175,248 +456,969 @@ LLVM is a compiler infrastructure designed for compile-time, link-time, runtime, and idle-time optimization of programs from arbitrary programming languages. The compiler infrastructure includes mirror sets of programming tools as well as libraries with equivalent functionality. +#endregion main package -%package devel +#region LLVM lit package +%if %{with python_lit} +%package -n python%{python3_pkgversion}-lit +Summary: LLVM lit test runner for Python 3 + +BuildArch: noarch +Requires: python%{python3_pkgversion}-setuptools +%if 0%{?rhel} == 8 +# Became python3.12-clang in LLVM 19 +Obsoletes: python3-lit < 18.9 +%else +# This optional dependency is not available for python3.12 on RHEL 8. +Recommends: python%{python3_pkgversion}-psutil +%endif + +%description -n python%{python3_pkgversion}-lit +lit is a tool used by the LLVM project for executing its test suites. +%endif +#endregion LLVM lit package + +#region LLVM packages + +%package -n %{pkg_name_llvm}-devel Summary: Libraries and header files for LLVM -Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: %{pkg_name_llvm}%{?_isa} = %{version}-%{release} +Requires: %{pkg_name_llvm}-libs%{?_isa} = %{version}-%{release} # The installed LLVM cmake files will add -ledit to the linker flags for any # app that requires the libLLVMLineEditor, so we need to make sure # libedit-devel is available. Requires: libedit-devel +Requires: libzstd-devel # The installed cmake files reference binaries from llvm-test, llvm-static, and # llvm-gtest. We tried in the past to split the cmake exports for these binaries # out into separate files, so that llvm-devel would not need to Require these packages, # but this caused bugs (rhbz#1773678) and forced us to carry two non-upstream # patches. -Requires: %{name}-static%{?_isa} = %{version}-%{release} -Requires: %{name}-test%{?_isa} = %{version}-%{release} -Requires: %{name}-googletest%{?_isa} = %{version}-%{release} +Requires: %{pkg_name_llvm}-static%{?_isa} = %{version}-%{release} +Requires: %{pkg_name_llvm}-test%{?_isa} = %{version}-%{release} +Requires: %{pkg_name_llvm}-googletest%{?_isa} = %{version}-%{release} -Requires(post): /usr/sbin/alternatives -Requires(postun): /usr/sbin/alternatives +Requires(post): %{_sbindir}/alternatives +Requires(postun): %{_sbindir}/alternatives Provides: llvm-devel(major) = %{maj_ver} -%description devel +%description -n %{pkg_name_llvm}-devel This package contains library and header files needed to develop new native programs that use the LLVM infrastructure. -%package doc +%package -n %{pkg_name_llvm}-doc Summary: Documentation for LLVM BuildArch: noarch -Requires: %{name} = %{version}-%{release} +Requires: %{pkg_name_llvm} = %{version}-%{release} -%description doc +%description -n %{pkg_name_llvm}-doc Documentation for the LLVM compiler infrastructure. -%package libs +%package -n %{pkg_name_llvm}-libs Summary: LLVM shared libraries -Requires(post): /sbin/ldconfig -Requires(postun): /sbin/ldconfig -%description libs +%description -n %{pkg_name_llvm}-libs Shared libraries for the LLVM compiler infrastructure. -%package static +%package -n %{pkg_name_llvm}-static Summary: LLVM static libraries -Conflicts: %{name}-devel < 8 +Conflicts: %{pkg_name_llvm}-devel < 8 Provides: llvm-static(major) = %{maj_ver} -%description static +%description -n %{pkg_name_llvm}-static Static libraries for the LLVM compiler infrastructure. -%package cmake-utils +%package -n %{pkg_name_llvm}-cmake-utils Summary: CMake utilities shared across LLVM subprojects -%description cmake-utils +%description -n %{pkg_name_llvm}-cmake-utils CMake utilities shared across LLVM subprojects. This is for internal use by LLVM packages only. -%package test +%package -n %{pkg_name_llvm}-test Summary: LLVM regression tests -Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: %{pkg_name_llvm}%{?_isa} = %{version}-%{release} +Requires: %{pkg_name_llvm}-libs%{?_isa} = %{version}-%{release} Provides: llvm-test(major) = %{maj_ver} -%description test +%description -n %{pkg_name_llvm}-test LLVM regression tests. -%package googletest +%package -n %{pkg_name_llvm}-googletest Summary: LLVM's modified googletest sources -%description googletest +%description -n %{pkg_name_llvm}-googletest LLVM's modified googletest sources. -%if 0%{?rhel} -%package toolset -Summary: Package that installs llvm-toolset -Requires: clang = %{version} -Requires: llvm = %{version} -Requires: lld = %{version} +%if %{with snapshot_build} +%package -n %{pkg_name_llvm}-build-stats +Summary: Statistics for the RPM build -%description toolset +%description -n %{pkg_name_llvm}-build-stats +Statistics for the RPM build. Only available in snapshot builds. +%endif + +#endregion LLVM packages + +#region CLANG packages + +%package -n %{pkg_name_clang} +Summary: A C language family front-end for LLVM + +Requires: %{pkg_name_clang}-libs%{?_isa} = %{version}-%{release} + +# clang requires gcc, clang++ requires libstdc++-devel +# - https://bugzilla.redhat.com/show_bug.cgi?id=1021645 +# - https://bugzilla.redhat.com/show_bug.cgi?id=1158594 +Requires: libstdc++-devel +Requires: gcc-c++ + +Provides: clang(major) = %{maj_ver} + +Conflicts: compiler-rt < 11.0.0 + +%description -n %{pkg_name_clang} +clang: noun + 1. A loud, resonant, metallic sound. + 2. The strident call of a crane or goose. + 3. C-language family front-end toolkit. + +The goal of the Clang project is to create a new C, C++, Objective C +and Objective C++ front-end for the LLVM compiler. Its tools are built +as libraries and designed to be loosely-coupled and extensible. + +Install compiler-rt if you want the Blocks C language extension or to +enable sanitization and profiling options when building, and +libomp-devel to enable -fopenmp. + +%package -n %{pkg_name_clang}-libs +Summary: Runtime library for clang +Requires: %{pkg_name_clang}-resource-filesystem%{?_isa} = %{version}-%{release} +%if %{defined gts_version} +Requires: gcc-toolset-%{gts_version}-gcc-c++ +%endif +Recommends: %{pkg_name_compiler_rt}%{?_isa} = %{version}-%{release} +Requires: %{pkg_name_llvm}-libs = %{version}-%{release} +# atomic support is not part of compiler-rt +Recommends: libatomic%{?_isa} +# libomp-devel is required, so clang can find the omp.h header when compiling +# with -fopenmp. +Recommends: %{pkg_name_libomp}-devel%{_isa} = %{version}-%{release} +Recommends: %{pkg_name_libomp}%{_isa} = %{version}-%{release} + +%description -n %{pkg_name_clang}-libs +Runtime library for clang. + +%package -n %{pkg_name_clang}-devel +Summary: Development header files for clang +Requires: %{pkg_name_clang}-libs = %{version}-%{release} +Requires: %{pkg_name_clang}%{?_isa} = %{version}-%{release} +# The clang CMake files reference tools from clang-tools-extra. +Requires: %{pkg_name_clang}-tools-extra%{?_isa} = %{version}-%{release} +Provides: clang-devel(major) = %{maj_ver} +# For the clangd language server contained in this subpackage, +# add a Provides so users can just run "dnf install clangd." +# This Provides is only present in the primary, unversioned clang package. +# Users who want the compat versions can install them using the full name. +%if %{without compat_build} +Provides: clangd = %{version}-%{release} +%endif + +%description -n %{pkg_name_clang}-devel +Development header files for clang. + +%package -n %{pkg_name_clang}-resource-filesystem +Summary: Filesystem package that owns the clang resource directory +Provides: clang-resource-filesystem(major) = %{maj_ver} + +%description -n %{pkg_name_clang}-resource-filesystem +This package owns the clang resouce directory: $libdir/clang/$version/ + +%package -n %{pkg_name_clang}-analyzer +Summary: A source code analysis framework +License: Apache-2.0 WITH LLVM-exception OR NCSA OR MIT +BuildArch: noarch +Requires: %{pkg_name_clang} = %{version}-%{release} + +%description -n %{pkg_name_clang}-analyzer +The Clang Static Analyzer consists of both a source code analysis +framework and a standalone tool that finds bugs in C and Objective-C +programs. The standalone tool is invoked from the command-line, and is +intended to run in tandem with a build of a project or code base. + +%package -n %{pkg_name_clang}-tools-extra +Summary: Extra tools for clang +Requires: %{pkg_name_clang}-libs%{?_isa} = %{version}-%{release} +Requires: emacs-filesystem + +%description -n %{pkg_name_clang}-tools-extra +A set of extra tools built using Clang's tooling API. + +%package -n %{pkg_name_clang}-tools-extra-devel +Summary: Development header files for clang tools +Requires: %{pkg_name_clang}-tools-extra = %{version}-%{release} + +%description -n %{pkg_name_clang}-tools-extra-devel +Development header files for clang tools. + +# Put git-clang-format in its own package, because it Requires git +# and we don't want to force users to install all those dependenices if they +# just want clang. +%package -n git-clang-format%{pkg_suffix} +Summary: Integration of clang-format for git +Requires: %{pkg_name_clang}-tools-extra = %{version}-%{release} +Requires: git +Requires: python%{python3_pkgversion} + +%description -n git-clang-format%{pkg_suffix} +clang-format integration for git. + +%if %{without compat_build} +%package -n python%{python3_pkgversion}-clang +Summary: Python3 bindings for clang +Requires: %{pkg_name_clang}-devel%{?_isa} = %{version}-%{release} +Requires: python%{python3_pkgversion} +%if 0%{?rhel} == 8 +# Became python3.12-clang in LLVM 19 +Obsoletes: python3-clang < 18.9 +%endif +%description -n python%{python3_pkgversion}-clang +%{summary}. + + +%endif + +#endregion CLANG packages + +#region COMPILER-RT packages + +%package -n %{pkg_name_compiler_rt} +Summary: LLVM "compiler-rt" runtime libraries + +License: Apache-2.0 WITH LLVM-exception OR NCSA OR MIT + +Requires: clang-resource-filesystem%{?_isa} = %{version}-%{release} +Provides: compiler-rt(major) = %{maj_ver} + +%description -n %{pkg_name_compiler_rt} +The compiler-rt project is a part of the LLVM project. It provides +implementation of the low-level target-specific hooks required by +code generation, sanitizer runtimes and profiling library for code +instrumentation, and Blocks C language extension. + +#endregion COMPILER-RT packages + +#region OPENMP packages + +%package -n %{pkg_name_libomp} +Summary: OpenMP runtime for clang + +URL: http://openmp.llvm.org + +Requires: %{pkg_name_llvm}-libs%{?_isa} = %{version}-%{release} +Requires: elfutils-libelf%{?_isa} + +Provides: libomp(major) = %{maj_ver} + +%description -n %{pkg_name_libomp} +OpenMP runtime for clang. + +%package -n %{pkg_name_libomp}-devel +Summary: OpenMP header files + +URL: http://openmp.llvm.org + +Requires: %{pkg_name_libomp}%{?_isa} = %{version}-%{release} +Requires: clang-resource-filesystem%{?_isa} = %{version}-%{release} + +Provides: libomp-devel(major) = %{maj_ver} + +%description -n %{pkg_name_libomp}-devel +OpenMP header files. +URL: http://openmp.llvm.org + +#endregion OPENMP packages + +#region LLD packages + +%package -n %{pkg_name_lld} +Summary: The LLVM Linker + +Requires(post): %{_sbindir}/update-alternatives +Requires(preun): %{_sbindir}/update-alternatives + +Requires: %{pkg_name_lld}-libs = %{version}-%{release} +Provides: lld(major) = %{maj_ver} + +%description -n %{pkg_name_lld} +The LLVM project linker. + +%package -n %{pkg_name_lld}-devel +Summary: Libraries and header files for LLD +Requires: %{pkg_name_lld}-libs%{?_isa} = %{version}-%{release} +%if %{without compat_build} +# lld tools are referenced in the cmake files, so we need to add lld as a +# dependency. +Requires: %{pkg_name_lld}%{?_isa} = %{version}-%{release} +%endif +Provides: lld-devel(major) = %{maj_ver} + +%description -n %{pkg_name_lld}-devel +This package contains library and header files needed to develop new native +programs that use the LLD infrastructure. + +%package -n %{pkg_name_lld}-libs +Summary: LLD shared libraries + +Requires: %{pkg_name_llvm}-libs%{?_isa} = %{version}-%{release} + +%description -n %{pkg_name_lld}-libs +Shared libraries for LLD. + +#endregion LLD packages + +#region Toolset package +%if 0%{?rhel} +%package -n %{pkg_name_llvm}-toolset +Summary: Package that installs llvm-toolset +Requires: clang = %{version}-%{release} +Requires: llvm = %{version}-%{release} +Requires: lld = %{version}-%{release} + +%description -n %{pkg_name_llvm}-toolset This is the main package for llvm-toolset. %endif +#endregion Toolset package +#region LLDB packages +%if %{with lldb} +%package -n %{pkg_name_lldb} +Summary: Next generation high-performance debugger +License: Apache-2.0 WITH LLVM-exception OR NCSA +URL: http://lldb.llvm.org/ + +Requires: %{pkg_name_clang}-libs%{?_isa} = %{version}-%{release} +Requires: python%{python3_pkgversion}-lldb + +%description -n %{pkg_name_lldb} +LLDB is a next generation, high-performance debugger. It is built as a set +of reusable components which highly leverage existing libraries in the +larger LLVM Project, such as the Clang expression parser and LLVM +disassembler. + +%package -n %{pkg_name_lldb}-devel +Summary: Development header files for LLDB +Requires: %{pkg_name_lldb}%{?_isa} = %{version}-%{release} + +%description -n %{pkg_name_lldb}-devel +The package contains header files for the LLDB debugger. + +%package -n python%{python3_pkgversion}-lldb +%{?python_provide:%python_provide python%{python3_pkgversion}-lldb} +Summary: Python module for LLDB + +Requires: %{pkg_name_lldb}%{?_isa} = %{version}-%{release} + +%if 0%{?rhel} == 8 +# Became python3.12-lldb in LLVM 19 +Obsoletes: python3-lldb < 18.9 +%endif + +%description -n python%{python3_pkgversion}-lldb +The package contains the LLDB Python module. +%endif +#endregion LLDB packages + +#region MLIR packages +%if %{with mlir} +%package -n %{pkg_name_mlir} +Summary: Multi-Level Intermediate Representation Overview +License: Apache-2.0 WITH LLVM-exception +URL: http://mlir.llvm.org + +%description -n %{pkg_name_mlir} +The MLIR project is a novel approach to building reusable and extensible +compiler infrastructure. MLIR aims to address software fragmentation, +improve compilation for heterogeneous hardware, significantly reduce +the cost of building domain specific compilers, and aid in connecting +existing compilers together. + +%package -n %{pkg_name_mlir}-static +Summary: MLIR static files +Requires: %{pkg_name_mlir}%{?_isa} = %{version}-%{release} + +%description -n %{pkg_name_mlir}-static +MLIR static files. + +%package -n %{pkg_name_mlir}-devel +Summary: MLIR development files +Requires: %{pkg_name_mlir}%{?_isa} = %{version}-%{release} +Requires: %{pkg_name_mlir}-static%{?_isa} = %{version}-%{release} + +%description -n %{pkg_name_mlir}-devel +MLIR development files. + +%package -n python%{python3_pkgversion}-mlir +%{?python_provide:%python_provide python%{python3_pkgversion}-mlir} +Summary: MLIR python bindings + +Requires: python%{python3_pkgversion} +Requires: python%{python3_pkgversion}-numpy + +%description -n python%{python3_pkgversion}-mlir +MLIR python bindings. +%endif +#endregion MLIR packages + +#region libcxx packages +%if %{with libcxx} +%package -n %{pkg_name_libcxx} +Summary: C++ standard library targeting C++11 +License: Apache-2.0 WITH LLVM-exception OR MIT OR NCSA +URL: http://libcxx.llvm.org/ + +Requires: %{pkg_name_libcxxabi}%{?_isa} = %{version}-%{release} + +%description -n %{pkg_name_libcxx} +libc++ is a new implementation of the C++ standard library, targeting C++11 and above. + + +%package -n %{pkg_name_libcxx}-devel +Summary: Headers and libraries for %{pkg_name_libcxx} devel +Requires: %{pkg_name_libcxx}%{?_isa} = %{version}-%{release} +Requires: %{pkg_name_libcxxabi}-devel + +%description -n %{pkg_name_libcxx}-devel +Headers and libraries for %{pkg_name_libcxx} devel. + +%package -n %{pkg_name_libcxx}-static +Summary: Static libraries for %{pkg_name_libcxx} + +%description -n %{pkg_name_libcxx}-static +Static libraries for %{pkg_name_libcxx}. + +%package -n %{pkg_name_libcxxabi} +Summary: Low level support for a standard C++ library + +%description -n %{pkg_name_libcxxabi} +libcxxabi provides low level support for a standard C++ library. + +%package -n %{pkg_name_libcxx}abi-devel +Summary: Headers and libraries for %{pkg_name_libcxxabi} devel +Requires: %{pkg_name_libcxxabi}%{?_isa} = %{version}-%{release} + +%description -n %{pkg_name_libcxxabi}-devel +Headers and libraries for %{pkg_name_libcxxabi} devel. + +%package -n %{pkg_name_libcxxabi}-static +Summary: Static libraries for %{pkg_name_libcxxabi} + +%description -n %{pkg_name_libcxxabi}-static +Static libraries for %{pkg_name_libcxxabi}. + +%package -n %{pkg_name_llvm_libunwind} +Summary: LLVM libunwind + +%description -n %{pkg_name_llvm_libunwind} + +LLVM libunwind is an implementation of the interface defined by the HP libunwind +project. It was contributed Apple as a way to enable clang++ to port to +platforms that do not have a system unwinder. It is intended to be a small and +fast implementation of the ABI, leaving off some features of HP's libunwind +that never materialized (e.g. remote unwinding). + +%package -n %{pkg_name_llvm_libunwind}-devel +Summary: LLVM libunwind development files +Provides: %{pkg_name_llvm_libunwind}(major) = %{maj_ver} +Requires: %{pkg_name_llvm_libunwind}%{?_isa} = %{version}-%{release} + +%description -n %{pkg_name_llvm_libunwind}-devel +Unversioned shared library for LLVM libunwind + +%package -n %{pkg_name_llvm_libunwind}-static +Summary: Static library for LLVM libunwind + +%description -n %{pkg_name_llvm_libunwind}-static +Static library for LLVM libunwind. + +%endif +#endregion libcxx packages + +#region BOLT packages +%if %{with build_bolt} +%package -n %{pkg_name_bolt} +Summary: A post-link optimizer developed to speed up large applications +License: Apache-2.0 WITH LLVM-exception +URL: https://github.com/llvm/llvm-project/tree/main/bolt + +# As hinted by bolt documentation +Recommends: gperftools-devel + +%description -n %{pkg_name_bolt} + +BOLT is a post-link optimizer developed to speed up large applications. +It achieves the improvements by optimizing application's code layout based on +execution profile gathered by sampling profiler, such as Linux `perf` tool. +%endif +#endregion BOLT packages + +#endregion packages + +#region prep %prep +%if %{without snapshot_build} +# llvm %{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE1}' --data='%{SOURCE0}' -%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE3}' --data='%{SOURCE2}' -%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE5}' --data='%{SOURCE4}' -%if %{with bundle_compat_lib} -%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE8}' --data='%{SOURCE7}' %endif -%setup -T -q -b 2 -n %{cmake_srcdir} -# TODO: It would be more elegant to set -DLLVM_COMMON_CMAKE_UTILS=%{_builddir}/%{cmake_srcdir}, -# but this is not a CACHED variable, so we can't actually set it externally :( -cd .. -mv %{cmake_srcdir} cmake -%setup -T -q -b 4 -n %{third_party_srcdir} -cd .. -mv %{third_party_srcdir} third-party - %if %{with bundle_compat_lib} -%setup -T -q -b 7 -n llvm-%{compat_ver}.src +%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE3001}' --data='%{SOURCE3000}' +%setup -T -q -b 3000 -n llvm-project-%{compat_ver}.src + +# Apply all patches with number < 500 (unconditionally) +# See https://rpm-software-management.github.io/rpm/manual/autosetup.html +%autopatch -M499 -p1 + +# automatically apply patches based on LLVM version +%autopatch -m%{compat_maj_ver}00 -M%{compat_maj_ver}99 -p1 + %endif -%setup -T -q -b 0 -n %{llvm_srcdir} -%autopatch -M%{?!rhel:100}%{?rhel:200} -p2 +# -T : Do Not Perform Default Archive Unpacking (without this, the th source would be unpacked twice) +# -b : Unpack The nth Sources Before Changing Directory +# -n : Set Name of Build Directory +# +# see http://ftp.rpm.org/max-rpm/s1-rpm-inside-macros.html +%autosetup -N -T -b 0 -n %{src_tarball_dir} + +# Apply all patches with number < 500 (unconditionally) +# See https://rpm-software-management.github.io/rpm/manual/autosetup.html +%autopatch -M499 -p1 + +# automatically apply patches based on LLVM version +%autopatch -m%{maj_ver}00 -M%{maj_ver}99 -p1 + +%if %{defined rhel} && 0%{?rhel} == 8 +%patch -p1 -P501 +%endif + +#region LLVM preparation %py3_shebang_fix \ - test/BugPoint/compile-custom.ll.py \ - tools/opt-viewer/*.py \ - utils/update_cc_test_checks.py + llvm/test/BugPoint/compile-custom.ll.py \ + llvm/tools/opt-viewer/*.py \ + llvm/utils/update_cc_test_checks.py +#endregion LLVM preparation + +#region CLANG preparation + +%py3_shebang_fix \ + clang-tools-extra/clang-tidy/tool/ \ + clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py + +%py3_shebang_fix \ + clang/tools/clang-format/ \ + clang/tools/clang-format/git-clang-format \ + clang/utils/hmaptool/hmaptool \ + clang/tools/scan-view/bin/scan-view \ + clang/tools/scan-view/share/Reporter.py \ + clang/tools/scan-view/share/startfile.py \ + clang/tools/scan-build-py/bin/* \ + clang/tools/scan-build-py/libexec/* + +#endregion CLANG preparation + +#region COMPILER-RT preparation + +%py3_shebang_fix compiler-rt/lib/hwasan/scripts/hwasan_symbolize + +#endregion COMPILER-RT preparation + +#region libcxx preparation +%if %{with libcxx} +%py3_shebang_fix libcxx/utils/ +%endif +#endregion libcxx preparation + +#endregion prep + +#region build %build - -%if %{without lto_build} -%global _lto_cflags %nil +# TODO(kkleine): In clang we had this %ifarch s390 s390x aarch64 %ix86 ppc64le +# Decrease debuginfo verbosity to reduce memory consumption during final library linking. +%global reduce_debuginfo 0 +%ifarch %ix86 +%global reduce_debuginfo 1 +%endif +%if 0%{?rhel} == 8 +%global reduce_debuginfo 1 %endif -%ifarch s390 s390x %ix86 riscv64 +%if %reduce_debuginfo == 1 # Decrease debuginfo verbosity to reduce memory consumption during final library linking %global optflags %(echo %{optflags} | sed 's/-g /-g1 /') %endif +%global projects clang;clang-tools-extra;lld +%global runtimes compiler-rt;openmp;offload + +%if %{with lldb} +%global projects %{projects};lldb +%endif + +%if %{with mlir} +%global projects %{projects};mlir +%endif + +%if %{with build_bolt} +%global projects %{projects};bolt +%endif + +%if %{with libcxx} +%global runtimes %{runtimes};libcxx;libcxxabi;libunwind +%endif + +%global cfg_file_content --gcc-triple=%{_target_cpu}-redhat-linux + +# We want to use DWARF-5 on all snapshot builds. +%if %{without snapshot_build} && %{defined rhel} && 0%{?rhel} < 10 +%global cfg_file_content %{cfg_file_content} -gdwarf-4 -g0 +%endif + +%if %{defined gts_version} +%global cfg_file_content %{cfg_file_content} --gcc-install-dir=/opt/rh/gcc-toolset-%{gts_version}/root/%{_exec_prefix}/lib/gcc/%{_target_cpu}-redhat-linux/%{gts_version} +%endif + +# Already use the new clang config file for the current build. This ensures +# consistency between the runtimes and non-runtimes builds and makes sure that +# the new configuration will work without going through a rebuild cycle. +# Don't do this on RHEL 8, which does not build using clang. +%if %{defined gts_version} && 0%{?rhel} != 8 +echo "%{cfg_file_content}" > /tmp/clang.cfg +%global optflags %{optflags} --config /tmp/clang.cfg +%endif + # Copy CFLAGS into ASMFLAGS, so -fcf-protection is used when compiling assembly files. export ASMFLAGS="%{build_cflags}" -# force off shared libs as cmake macros turns it on. -# TODO: Disable LLVM_UNREACHABLE_OPTIMIZE. -%cmake -G Ninja \ - -DBUILD_SHARED_LIBS:BOOL=OFF \ - -DLLVM_PARALLEL_LINK_JOBS=1 \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DCMAKE_SKIP_RPATH:BOOL=ON \ -%ifarch s390 %ix86 riscv64 - -DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ - -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ +# We set CLANG_DEFAULT_PIE_ON_LINUX=OFF and PPC_LINUX_DEFAULT_IEEELONGDOUBLE=ON to match the +# defaults used by Fedora's GCC. + +# Disable dwz on aarch64, because it takes a huge amount of time to decide not to optimize things. +# This is copied from clang. +%ifarch aarch64 +%define _find_debuginfo_dwz_opts %{nil} %endif + +cd llvm + +#region LLVM lit +%if %{with python_lit} +pushd utils/lit +%py3_build +popd +%endif +#endregion LLVM lit + +%if 0%{?rhel} == 8 +%undefine __cmake_in_source_build +%endif + +#region cmake options + +# Common cmake arguments used by both the normal build and bundle_compat_lib. +# Any ABI-affecting flags should be in here. +%global cmake_common_args \\\ + -DLLVM_ENABLE_EH=ON \\\ + -DLLVM_ENABLE_RTTI=ON \\\ + -DLLVM_USE_PERF=ON \\\ + -DLLVM_TARGETS_TO_BUILD=%{targets_to_build} \\\ + -DBUILD_SHARED_LIBS=OFF \\\ + -DLLVM_BUILD_LLVM_DYLIB=ON + +%global cmake_config_args %{cmake_common_args} + +#region clang options +%global cmake_config_args %{cmake_config_args} \\\ + -DCLANG_BUILD_EXAMPLES:BOOL=OFF \\\ + -DCLANG_CONFIG_FILE_SYSTEM_DIR=%{_sysconfdir}/%{pkg_name_clang}/ \\\ + -DCLANG_DEFAULT_PIE_ON_LINUX=OFF \\\ + -DCLANG_DEFAULT_UNWINDLIB=libgcc \\\ + -DCLANG_ENABLE_ARCMT:BOOL=ON \\\ + -DCLANG_ENABLE_STATIC_ANALYZER:BOOL=ON \\\ + -DCLANG_INCLUDE_DOCS:BOOL=ON \\\ + -DCLANG_INCLUDE_TESTS:BOOL=ON \\\ + -DCLANG_LINK_CLANG_DYLIB=ON \\\ + -DCLANG_PLUGIN_SUPPORT:BOOL=ON \\\ + -DCLANG_REPOSITORY_STRING="%{?dist_vendor} %{version}-%{release}" \\\ + -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=../clang-tools-extra +%if %{with compat_build} + %global cmake_config_args %{cmake_config_args} -DCLANG_RESOURCE_DIR=../../../lib/clang/%{maj_ver} +%else + %global cmake_config_args %{cmake_config_args} -DCLANG_RESOURCE_DIR=../lib/clang/%{maj_ver} +%endif +#endregion clang options + +#region compiler-rt options +%global cmake_config_args %{cmake_config_args} \\\ + -DCOMPILER_RT_INCLUDE_TESTS:BOOL=OFF \\\ + -DCOMPILER_RT_INSTALL_PATH=%{_prefix}/lib/clang/%{maj_ver} +#endregion compiler-rt options + +#region docs options + +# Add all *enabled* documentation targets (no doxygen but sphinx) +%global cmake_config_args %{cmake_config_args} \\\ + -DLLVM_ENABLE_DOXYGEN:BOOL=OFF \\\ + -DLLVM_ENABLE_SPHINX:BOOL=ON \\\ + -DLLVM_BUILD_DOCS:BOOL=ON + +# Configure sphinx: +# Build man-pages but no HTML docs using sphinx +%global cmake_config_args %{cmake_config_args} \\\ + -DSPHINX_EXECUTABLE=%{_bindir}/sphinx-build-3 \\\ + -DSPHINX_OUTPUT_HTML:BOOL=OFF \\\ + -DSPHINX_OUTPUT_MAN:BOOL=ON \\\ + -DSPHINX_WARNINGS_AS_ERRORS=OFF +#endregion docs options + +#region lldb options +%if %{with lldb} + %global cmake_config_args %{cmake_config_args} -DLLDB_DISABLE_CURSES:BOOL=OFF + %global cmake_config_args %{cmake_config_args} -DLLDB_DISABLE_LIBEDIT:BOOL=OFF + %global cmake_config_args %{cmake_config_args} -DLLDB_DISABLE_PYTHON:BOOL=OFF +%ifarch ppc64le + %global cmake_config_args %{cmake_config_args} -DLLDB_TEST_USER_ARGS=--skip-category=watchpoint +%endif +%if 0%{?rhel} == 8 + %global cmake_config_args %{cmake_config_args} -DLLDB_INCLUDE_TESTS:BOOL=OFF +%else + %global cmake_config_args %{cmake_config_args} -DLLDB_ENFORCE_STRICT_TEST_REQUIREMENTS:BOOL=ON +%endif +%endif +#endregion lldb options + +#region libcxx options +%if %{with libcxx} +%global cmake_config_args %{cmake_config_args} \\\ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \\\ + -DLIBCXX_INCLUDE_BENCHMARKS=OFF \\\ + -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \\\ + -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=ON \\\ + -DLIBCXXABI_USE_LLVM_UNWINDER=OFF \\\ + -DLIBUNWIND_INSTALL_INCLUDE_DIR=%{_includedir}/llvm-libunwind + +# If we don't set the .._INSTALL_LIBRARY_DIR variables, +# the *.so files will be placed in a subdirectory that includes the triple +%global cmake_config_args %{cmake_config_args} \\\ + -DLIBCXX_INSTALL_LIBRARY_DIR=%{_libdir} \\\ + -DLIBCXXABI_INSTALL_LIBRARY_DIR=%{_libdir} \\\ + -DLIBUNWIND_INSTALL_LIBRARY_DIR=%{_libdir} + +# If we don't adjust this, we will install into this unwanted location: +# /usr/include/i686-redhat-linux-gnu/c++/v1/__config_site +%global cmake_config_args %{cmake_config_args} \\\ + -DLIBCXX_INSTALL_INCLUDE_TARGET_DIR=%{_includedir}/c++/v1 + +%endif +#endregion libcxx options + +#region llvm options +%global cmake_config_args %{cmake_config_args} \\\ + -DLLVM_APPEND_VC_REV:BOOL=OFF \\\ + -DLLVM_BUILD_EXAMPLES:BOOL=OFF \\\ + -DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=ON \\\ + -DLLVM_BUILD_RUNTIME:BOOL=ON \\\ + -DLLVM_BUILD_TOOLS:BOOL=ON \\\ + -DLLVM_BUILD_UTILS:BOOL=ON \\\ + -DLLVM_COMMON_CMAKE_UTILS=%{install_datadir}/llvm/cmake \\\ + -DLLVM_DEFAULT_TARGET_TRIPLE=%{llvm_triple} \\\ + -DLLVM_DYLIB_COMPONENTS="all" \\\ + -DLLVM_ENABLE_FFI:BOOL=ON \\\ + -DLLVM_ENABLE_LIBCXX:BOOL=OFF \\\ + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON \\\ + -DLLVM_ENABLE_PROJECTS="%{projects}" \\\ + -DLLVM_ENABLE_RUNTIMES="%{runtimes}" \\\ + -DLLVM_ENABLE_ZLIB:BOOL=FORCE_ON \\\ + -DLLVM_ENABLE_ZSTD:BOOL=FORCE_ON \\\ + -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=%{experimental_targets_to_build} \\\ + -DLLVM_INCLUDE_BENCHMARKS=OFF \\\ + -DLLVM_INCLUDE_EXAMPLES:BOOL=OFF \\\ + -DLLVM_INCLUDE_TOOLS:BOOL=ON \\\ + -DLLVM_INCLUDE_UTILS:BOOL=ON \\\ + -DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF \\\ + -DLLVM_INSTALL_UTILS:BOOL=ON \\\ + -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \\\ + -DLLVM_PARALLEL_LINK_JOBS=1 \\\ + -DLLVM_TOOLS_INSTALL_DIR:PATH=bin \\\ + -DLLVM_UNREACHABLE_OPTIMIZE:BOOL=OFF \\\ + -DLLVM_UTILS_INSTALL_DIR:PATH=bin +#endregion llvm options + +#region mlir options +%if %{with mlir} +%global cmake_config_args %{cmake_config_args} \\\ + -DMLIR_INCLUDE_DOCS:BOOL=ON \\\ + -DMLIR_INCLUDE_TESTS:BOOL=ON \\\ + -DMLIR_INCLUDE_INTEGRATION_TESTS:BOOL=OFF \\\ + -DMLIR_INSTALL_AGGREGATE_OBJECTS=OFF \\\ + -DMLIR_BUILD_MLIR_C_DYLIB=ON \\\ + -DMLIR_ENABLE_BINDINGS_PYTHON:BOOL=ON +%endif +#endregion mlir options + +#region openmp options +%global cmake_config_args %{cmake_config_args} \\\ + -DOPENMP_INSTALL_LIBDIR=%{unprefixed_libdir} \\\ + -DLIBOMP_INSTALL_ALIASES=OFF +#endregion openmp options + +#region test options +%global cmake_config_args %{cmake_config_args} \\\ + -DLLVM_BUILD_TESTS:BOOL=ON \\\ + -DLLVM_INCLUDE_TESTS:BOOL=ON \\\ + -DLLVM_INSTALL_GTEST:BOOL=ON \\\ + -DLLVM_LIT_ARGS="-vv" + +%if %{with lto_build} +%if 0%{?fedora} >= 41 + %global cmake_config_args %{cmake_config_args} -DLLVM_UNITTEST_LINK_FLAGS="-fno-lto" +%else + %global cmake_config_args %{cmake_config_args} -DLLVM_UNITTEST_LINK_FLAGS="-Wl,-plugin-opt=O0" +%endif +%endif +#endregion test options + +#region misc options +%global cmake_config_args %{cmake_config_args} \\\ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \\\ + -DCMAKE_INSTALL_PREFIX=%{install_prefix} \\\ + -DENABLE_LINKER_BUILD_ID:BOOL=ON \\\ + -DOFFLOAD_INSTALL_LIBDIR=%{unprefixed_libdir} \\\ + -DPython3_EXECUTABLE=%{__python3} + +# During the build, we use both the system clang and the just-built clang, and +# they need to use the system and just-built shared objects respectively. If +# we use LD_LIBRARY_PATH to point to our build directory, the system clang +# may use the just-built shared objects instead, which may not be compatible +# even if the version matches (e.g. when building compat libs or different rcs). +# Instead, we make use of rpath during the build and only strip it on +# installation using the CMAKE_SKIP_INSTALL_RPATH option. +%global cmake_config_args %{cmake_config_args} -DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON + +%if 0%{?fedora} || 0%{?rhel} > 9 + %global cmake_config_args %{cmake_config_args} -DPPC_LINUX_DEFAULT_IEEELONGDOUBLE=ON +%endif + +%if %reduce_debuginfo == 1 + %global cmake_config_args %{cmake_config_args} -DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" + %global cmake_config_args %{cmake_config_args} -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" +%endif + %if %{without compat_build} %if 0%{?__isa_bits} == 64 - -DLLVM_LIBDIR_SUFFIX=64 \ + %global cmake_config_args %{cmake_config_args} -DLLVM_LIBDIR_SUFFIX=64 %else - -DLLVM_LIBDIR_SUFFIX= \ + %global cmake_config_args %{cmake_config_args} -DLLVM_LIBDIR_SUFFIX= %endif %endif - \ - -DLLVM_TARGETS_TO_BUILD=%{targets_to_build} \ - -DLLVM_ENABLE_LIBCXX:BOOL=OFF \ - -DLLVM_ENABLE_ZLIB:BOOL=ON \ - -DLLVM_ENABLE_FFI:BOOL=ON \ - -DLLVM_ENABLE_RTTI:BOOL=ON \ - -DLLVM_USE_PERF:BOOL=ON \ + %if %{with gold} - -DLLVM_BINUTILS_INCDIR=%{_includedir} \ + %global cmake_config_args %{cmake_config_args} -DLLVM_BINUTILS_INCDIR=%{_includedir} %endif - -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=%{experimental_targets_to_build} \ - \ - -DLLVM_BUILD_RUNTIME:BOOL=ON \ - \ - -DLLVM_INCLUDE_TOOLS:BOOL=ON \ - -DLLVM_BUILD_TOOLS:BOOL=ON \ - \ - -DLLVM_INCLUDE_TESTS:BOOL=ON \ - -DLLVM_BUILD_TESTS:BOOL=ON \ - -DLLVM_INSTALL_GTEST:BOOL=ON \ - -DLLVM_LIT_ARGS=-v \ - \ - -DLLVM_INCLUDE_EXAMPLES:BOOL=ON \ - -DLLVM_BUILD_EXAMPLES:BOOL=OFF \ - \ - -DLLVM_INCLUDE_UTILS:BOOL=ON \ - -DLLVM_INSTALL_UTILS:BOOL=ON \ - -DLLVM_UTILS_INSTALL_DIR:PATH=bin \ - -DLLVM_TOOLS_INSTALL_DIR:PATH=bin \ - \ - -DLLVM_INCLUDE_DOCS:BOOL=ON \ - -DLLVM_BUILD_DOCS:BOOL=ON \ - -DLLVM_ENABLE_SPHINX:BOOL=ON \ - -DLLVM_ENABLE_DOXYGEN:BOOL=OFF \ - \ + %if %{with snapshot_build} - -DLLVM_VERSION_SUFFIX="%{llvm_snapshot_version_suffix}" \ + %global cmake_config_args %{cmake_config_args} -DLLVM_VERSION_SUFFIX="%{llvm_snapshot_version_suffix}" %else - -DLLVM_VERSION_SUFFIX='' \ +%if %{without compat_build} + %global cmake_config_args %{cmake_config_args} -DLLVM_VERSION_SUFFIX='' %endif - -DLLVM_UNREACHABLE_OPTIMIZE:BOOL=ON \ - -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \ - -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \ - -DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=ON \ - -DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF \ - -DLLVM_DEFAULT_TARGET_TRIPLE=%{llvm_triple} \ - -DSPHINX_WARNINGS_AS_ERRORS=OFF \ - -DCMAKE_INSTALL_PREFIX=%{install_prefix} \ - -DLLVM_INSTALL_SPHINX_HTML_DIR=%{_pkgdocdir}/html \ - -DSPHINX_EXECUTABLE=/usr/bin/sphinx-build-3 \ - -DLLVM_INCLUDE_BENCHMARKS=OFF \ -%if %{with lto_build} - -DLLVM_UNITTEST_LINK_FLAGS="-Wl,-plugin-opt=O0" \ %endif + %ifarch x86_64 - -DCMAKE_SHARED_LINKER_FLAGS="$LDFLAGS -Wl,-z,cet-report=error" + %global cmake_config_args %{cmake_config_args} -DCMAKE_SHARED_LINKER_FLAGS="$LDFLAGS -Wl,-z,cet-report=error" %endif +%if 0%{?rhel} == 8 + %global cmake_config_args %{cmake_config_args} -DLLVM_RAM_PER_COMPILE_JOB=2048 +%endif +#endregion misc options + +extra_cmake_args='' +# TSan does not support 5-level page tables (https://github.com/llvm/llvm-project/issues/111492) +# so do not run tests using tsan on systems that potentially use 5-level page tables. +if grep 'flags.*la57' /proc/cpuinfo; then + extra_cmake_args="$extra_cmake_args -DOPENMP_TEST_ENABLE_TSAN=OFF" +fi +#endregion cmake options + +%cmake -G Ninja %cmake_config_args $extra_cmake_args + # Build libLLVM.so first. This ensures that when libLLVM.so is linking, there # are no other compile jobs running. This will help reduce OOM errors on the # builders without having to artificially limit the number of concurrent jobs. %cmake_build --target LLVM + +# Also build libclang-cpp.so separately to avoid OOM errors. +# This is to fix occasional OOM errors on the ppc64le COPR builders. +%cmake_build --target libclang-cpp.so + %cmake_build -%if %{with bundle_compat_lib} +# If we don't build the runtimes target here, we'll have to wait for the %%check +# section until these files are available but they need to be installed. +# +# /usr/lib64/libomptarget.devicertl.a +# /usr/lib64/libomptarget-amdgpu-*.bc +# /usr/lib64/libomptarget-nvptx-*.bc -%cmake -S ../llvm-%{compat_ver}.src -B ../llvm-compat-libs -G Ninja \ - -DCMAKE_INSTALL_PREFIX=%{buildroot}%{_libdir}/llvm%{compat_maj_ver}/ \ - -DCMAKE_SKIP_RPATH:BOOL=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS:BOOL=OFF \ - -DLLVM_BUILD_LLVM_DYLIB=ON \ - -DLLVM_ENABLE_RTTI:BOOL=ON \ - -DLLVM_TARGETS_TO_BUILD=%{targets_to_build} \ - -DLLVM_INCLUDE_BENCHMARKS=OFF +%cmake_build --target runtimes + +#region compat lib +cd .. + +%if %{with bundle_compat_lib} +%cmake -S ../llvm-project-%{compat_ver}.src/llvm -B ../llvm-compat-libs -G Ninja \ + -DCMAKE_INSTALL_PREFIX=%{buildroot}%{_libdir}/llvm%{compat_maj_ver}/ \ + -DCMAKE_SKIP_RPATH=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DLLVM_ENABLE_PROJECTS="clang;lldb" \ + -DLLVM_INCLUDE_BENCHMARKS=OFF \ + -DLLVM_INCLUDE_TESTS=OFF \ + %{cmake_common_args} %ninja_build -C ../llvm-compat-libs LLVM +%ninja_build -C ../llvm-compat-libs libclang.so +%ninja_build -C ../llvm-compat-libs libclang-cpp.so +%ninja_build -C ../llvm-compat-libs liblldb.so %endif +#endregion compat lib +#endregion build +#region install %install +#region LLVM installation -# Use newer GDB for gdb-add-index step, as system GDB can't handle the LTO debuginfo. -source scl_source enable gcc-toolset-%{gts_version} -export GDB=`which gdb` +pushd llvm + +%if %{with python_lit} +pushd utils/lit +%py3_install + +# Strip out #!/usr/bin/env python +sed -i -e '1{\@^#!/usr/bin/env python@d}' %{buildroot}%{python3_sitelib}/lit/*.py +popd +%endif %cmake_install -%if %{with bundle_compat_lib} -install -m 0755 ../llvm-compat-libs/lib/libLLVM-%{compat_maj_ver}.so %{buildroot}%{_libdir} -%ninja_build -C ../llvm-compat-libs install-llvm-headers install-llvm-config -# Delete build files to save disk space -rm -Rf ../llvm-compat-libs -%endif +popd mkdir -p %{buildroot}/%{_bindir} @@ -425,19 +1427,11 @@ mkdir -p %{buildroot}/%{_bindir} for f in %{test_binaries} do - install -m 0755 %{_vpath_builddir}/bin/$f %{buildroot}%{install_bindir} + install -m 0755 llvm/%{_vpath_builddir}/bin/$f %{buildroot}%{install_bindir} + chrpath --delete %{buildroot}%{install_bindir}/$f done -# Remove testing of update utility tools -rm -rf test/tools/UpdateTestChecks - # Install libraries needed for unittests -%if %{without compat_build} -%global build_libdir %{_vpath_builddir}/%{_lib} -%else -%global build_libdir %{_vpath_builddir}/lib -%endif - install %{build_libdir}/libLLVMTestingSupport.a %{buildroot}%{install_libdir} install %{build_libdir}/libLLVMTestingAnnotations.a %{buildroot}%{install_libdir} @@ -457,15 +1451,9 @@ ln -s -t %{buildroot}%{_libdir}/bfd-plugins/ ../LLVMgold.so %else -# Add version suffix to binaries -for f in %{buildroot}/%{install_bindir}/*; do - filename=`basename $f` - ln -s ../../%{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename%{exec_suffix} -done - # Create ld.so.conf.d entry -mkdir -p %{buildroot}/etc/ld.so.conf.d -cat >> %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf << EOF +mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d +cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{pkg_name_llvm}-%{_arch}.conf << EOF %{install_libdir} EOF @@ -478,6 +1466,272 @@ done %endif +mkdir -p %{buildroot}%{pkg_datadir}/llvm/cmake +cp -Rv cmake/* %{buildroot}%{pkg_datadir}/llvm/cmake + +# Install a placeholder to redirect users of the formerly shipped +# HTML documentation to the upstream HTML documentation. +mkdir -pv %{buildroot}%{_pkgdocdir}/html +cat < %{buildroot}%{_pkgdocdir}/html/index.html + + + + LLVM %{maj_ver}.%{min_ver} documentation + + +

+ LLVM %{maj_ver}.%{min_ver} Documentation +

+ + + +EOF + +#endregion LLVM installation + +#region CLANG installation + +# Add a symlink in /usr/bin to clang-format-diff +ln -s %{install_datadir}/clang/clang-format-diff.py %{buildroot}%{install_bindir}/clang-format-diff + +# File in the macros file for other packages to use. We are not doing this +# in the compat package, because the version macros would # conflict with +# eachother if both clang and the clang compat package were installed together. +%if %{without compat_build} +install -p -m0644 -D %{SOURCE2005} %{buildroot}%{_rpmmacrodir}/macros.%{pkg_name_clang} +sed -i -e "s|@@CLANG_MAJOR_VERSION@@|%{maj_ver}|" \ + -e "s|@@CLANG_MINOR_VERSION@@|%{min_ver}|" \ + -e "s|@@CLANG_PATCH_VERSION@@|%{patch_ver}|" \ + %{buildroot}%{_rpmmacrodir}/macros.%{pkg_name_clang} + +# install clang python bindings +mkdir -p %{buildroot}%{python3_sitelib}/clang/ +# If we don't default to true here, we'll see this error: +# install: omitting directory 'bindings/python/clang/__pycache__' +# NOTE: this only happens if we include the gdb plugin of libomp. +# Remove the plugin with command and we're good: rm -rf %{buildroot}/%{_datarootdir}/gdb +install -p -m644 clang/bindings/python/clang/* %{buildroot}%{python3_sitelib}/clang/ +%py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/clang + +# install scanbuild-py to python sitelib. +mv %{buildroot}%{_prefix}/lib/{libear,libscanbuild} %{buildroot}%{python3_sitelib} +# Cannot use {libear,libscanbuild} style expansion in py_byte_compile. +%py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/libear +%py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/libscanbuild + +# Move emacs integration files to the correct directory +mkdir -p %{buildroot}%{_emacs_sitestartdir} +for f in clang-format.el clang-include-fixer.el; do +mv %{buildroot}{%{_datadir}/clang,%{_emacs_sitestartdir}}/$f +done +%if %{maj_ver} < 20 +mv %{buildroot}{%{_datadir}/clang,%{_emacs_sitestartdir}}/clang-rename.el +%endif + +# Add clang++-{version} symlink +ln -s clang++ %{buildroot}%{_bindir}/clang++-%{maj_ver} + +%else + +# Fix permission +chmod u-x %{buildroot}%{_mandir}/man1/scan-build%{exec_suffix}.1* + +# Not sure where to put these python modules for the compat build. +rm -Rf %{buildroot}%{install_libdir}/{libear,libscanbuild} + +# Not sure where to put the emacs integration files for the compat build. +rm -Rf %{buildroot}%{install_datadir}/clang/*.el + +# Add clang++-{version} symlink +ln -s clang++ %{buildroot}%{install_bindir}/clang++-%{maj_ver} + +%endif + +# Create Manpage symlinks +ln -s clang%{exec_suffix}.1.gz %{buildroot}%{_mandir}/man1/clang++%{exec_suffix}.1.gz +%if %{without compat_build} +ln -s clang.1.gz %{buildroot}%{_mandir}/man1/clang-%{maj_ver}.1.gz +ln -s clang.1.gz %{buildroot}%{_mandir}/man1/clang++-%{maj_ver}.1.gz +%endif + +# Fix permissions of scan-view scripts +chmod a+x %{buildroot}%{install_datadir}/scan-view/{Reporter.py,startfile.py} + +# multilib fix +%multilib_fix_c_header --file %{install_includedir}/clang/Config/config.h + +# remove editor integrations (bbedit, sublime, emacs, vim) +rm -vf %{buildroot}%{install_datadir}/clang/clang-format-bbedit.applescript +rm -vf %{buildroot}%{install_datadir}/clang/clang-format-sublime.py* + +# Remove unpackaged files +rm -Rvf %{buildroot}%{install_datadir}/clang-doc/clang-doc-default-stylesheet.css +rm -Rvf %{buildroot}%{install_datadir}/clang-doc/index.js + +# TODO: What are the Fedora guidelines for packaging bash autocomplete files? +rm -vf %{buildroot}%{install_datadir}/clang/bash-autocomplete.sh + +# Create sub-directories in the clang resource directory that will be +# populated by other packages +mkdir -p %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/{bin,include,lib,share}/ + +# Add versioned resource directory macro +mkdir -p %{buildroot}%{_rpmmacrodir}/ +echo "%%clang%{maj_ver}_resource_dir %%{_prefix}/lib/clang/%{maj_ver}" >> %{buildroot}%{_rpmmacrodir}/macros.%{pkg_name_clang} + +# Install config file for clang +%if %{maj_ver} >=18 +%global cfg_file_content --gcc-triple=%{_target_cpu}-redhat-linux + +# We want to use DWARF-5 on all snapshot builds. +%if %{without snapshot_build} && %{defined rhel} && 0%{?rhel} < 10 +%global cfg_file_content %{cfg_file_content} -gdwarf-4 -g0 +%endif + +%if %{defined gts_version} +%global cfg_file_content %{cfg_file_content} --gcc-install-dir=/opt/rh/gcc-toolset-%{gts_version}/root/%{_exec_prefix}/lib/gcc/%{_target_cpu}-redhat-linux/%{gts_version} +%endif + +mkdir -p %{buildroot}%{_sysconfdir}/%{pkg_name_clang}/ +echo " %{cfg_file_content}" >> %{buildroot}%{_sysconfdir}/%{pkg_name_clang}/%{_target_platform}-clang.cfg +echo " %{cfg_file_content}" >> %{buildroot}%{_sysconfdir}/%{pkg_name_clang}/%{_target_platform}-clang++.cfg +%ifarch x86_64 +# On x86_64, install an additional set of config files so -m32 works. +echo " %{cfg_file_content}" >> %{buildroot}%{_sysconfdir}/%{pkg_name_clang}/i386-redhat-linux-gnu-clang.cfg +echo " %{cfg_file_content}" >> %{buildroot}%{_sysconfdir}/%{pkg_name_clang}/i386-redhat-linux-gnu-clang++.cfg +%endif +%endif + + +#endregion CLANG installation + +#region COMPILER-RT installation + +# Triple where compiler-rt libs are installed. If it differs from llvm_triple, then there is +# also a symlink llvm_triple -> compiler_rt_triple. +%global compiler_rt_triple %{llvm_triple} + +%ifarch ppc64le +# Fix install path on ppc64le so that the directory name matches the triple used +# by clang. +mv %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/lib/powerpc64le-redhat-linux-gnu %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple} +%endif + +%ifarch %{ix86} +# Fix install path on ix86 so that the directory name matches the triple used +# by clang on both actual ix86 (i686) and on x86_64 with -m32 (i386): +%global compiler_rt_triple i386-redhat-linux-gnu +%if "%{llvm_triple}" != "%{compiler_rt_triple}" +ln -s %{compiler_rt_triple} %{buildroot}%{_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple} +%endif +%endif + +#endregion COMPILER-RT installation + +#region OPENMP installation + +# Remove static libraries with equivalent shared libraries +rm -rf %{buildroot}%{install_libdir}/libarcher_static.a + +# Remove the openmp gdb plugin for now +rm -rf %{buildroot}/%{install_datadir}/gdb +# # TODO(kkleine): These was added to avoid a permission issue +# chmod go+w %{buildroot}/%{_datarootdir}/gdb/python/ompd/ompdModule.so +# chmod +w %{buildroot}/%{_datarootdir}/gdb/python/ompd/ompdModule.so + +%ifnarch %{ix86} +# Remove files that we don't package, yet. +%if %{maj_ver} >= 20 +rm %{buildroot}%{install_bindir}/llvm-offload-device-info +%else +rm %{buildroot}%{install_bindir}/llvm-omp-device-info +%endif +rm %{buildroot}%{install_bindir}/llvm-omp-kernel-replay +%endif + +#endregion OPENMP installation + +#region LLD installation + +%if %{without compat_build} +# Required when using update-alternatives: +# https://docs.fedoraproject.org/en-US/packaging-guidelines/Alternatives/ +touch %{buildroot}%{_bindir}/ld + +install -D -m 644 -t %{buildroot}%{_mandir}/man1/ lld/docs/ld.lld.1 +%endif + +#endregion LLD installation + +#region LLDB installation +%if %{with lldb} +%multilib_fix_c_header --file %{install_includedir}/lldb/Host/Config.h + +# python: fix binary libraries location +liblldb=$(basename $(readlink -e %{buildroot}%{_libdir}/liblldb.so)) +ln -vsf "../../../${liblldb}" %{buildroot}%{python3_sitearch}/lldb/_lldb.so +%py_byte_compile %{__python3} %{buildroot}%{python3_sitearch}/lldb +%endif +#endregion LLDB installation + +#region mlir installation +%if %{with mlir} +mkdir -p %{buildroot}/%{python3_sitearch} +mv %{buildroot}%{_prefix}/python_packages/mlir_core/mlir %{buildroot}/%{python3_sitearch} +# These directories should be empty now. +rmdir %{buildroot}%{_prefix}/python_packages/mlir_core %{buildroot}%{_prefix}/python_packages +# Unneeded files. +rm -rf %{buildroot}%{_prefix}/src/python +%endif +#endregion mlir installation + +#region libcxx installation +%if %{with libcxx} +# We can't install the unversionned path on default location because that would conflict with +# https://src.fedoraproject.org/rpms/libunwind +# +# The versionned path has a different soname (libunwind.so.1 compared to +# libunwind.so.8) so they can live together in %%{_libdir} +# +# ABI wise, even though llvm-libunwind's library is named libunwind, it doesn't +# have the exact same ABI as gcc's libunwind (it actually provides a subset). +rm %{buildroot}%{_libdir}/libunwind.so +mkdir -p %{buildroot}/%{_libdir}/llvm-unwind/ + +pushd %{buildroot}/%{_libdir}/llvm-unwind +ln -s ../libunwind.so.1.0 libunwind.so +popd +%endif +#endregion libcxx installation + +#region BOLT installation +# We don't ship libLLVMBOLT*.a +rm -f %{buildroot}%{_libdir}/libLLVMBOLT*.a +#endregion BOLT installation + +%if %{with compat_build} +# Add version suffix to binaries. Do this at the end so it includes any +# additional binaries that may be been added by other steps. +for f in %{buildroot}/%{install_bindir}/*; do + filename=`basename $f` + if echo $filename | grep -e '%{maj_ver}'; then + continue + fi + ln -s ../../%{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename%{exec_suffix} +done +%endif + # llvm-config special casing. llvm-config is managed by update-alternatives. # the original file must remain available for compatibility with the CMake # infrastructure. Without compat, cmake points to the symlink, with compat it @@ -504,47 +1758,442 @@ rm %{buildroot}%{_bindir}/llvm-config%{exec_suffix} # ghost presence touch %{buildroot}%{_bindir}/llvm-config%{exec_suffix} -mkdir -p %{buildroot}%{pkg_datadir}/llvm/cmake -cp -Rv ../cmake/* %{buildroot}%{pkg_datadir}/llvm/cmake +%if %{with bundle_compat_lib} +install -m 0755 ../llvm-compat-libs/lib/libLLVM.so.%{compat_maj_ver}* %{buildroot}%{_libdir} +install -m 0755 ../llvm-compat-libs/lib/libclang.so.%{compat_maj_ver}* %{buildroot}%{_libdir} +install -m 0755 ../llvm-compat-libs/lib/libclang-cpp.so.%{compat_maj_ver}* %{buildroot}%{_libdir} +install -m 0755 ../llvm-compat-libs/lib/liblldb.so.%{compat_maj_ver}* %{buildroot}%{_libdir} +%endif +#endregion install +#region check %check +# TODO(kkleine): Instead of deleting test files we should mark them as expected +# to fail. See https://llvm.org/docs/CommandGuide/lit.html#cmdoption-lit-xfail + +%ifarch ppc64le +# TODO: Re-enable when ld.gold fixed its internal error. +rm llvm/test/tools/gold/PowerPC/mtriple.ll +%endif + # non reproducible errors -rm test/tools/dsymutil/X86/swift-interface.test +# TODO(kkleine): Add this to XFAIL instead? +rm llvm/test/tools/dsymutil/X86/swift-interface.test %if %{with check} -# FIXME: use %%cmake_build instead of %%__ninja -LD_LIBRARY_PATH=%{buildroot}/%{install_libdir} %{__ninja} check-all -C %{_vpath_builddir} + +cd llvm + +#region Helper functions +# Call this function before setting up a next component to test. +function reset_test_opts() +{ + # Some libraries will not be found if we don't set this + export LD_LIBRARY_PATH="%{buildroot}/%{install_libdir}:%{buildroot}/%{_libdir}"; + + # See https://llvm.org/docs/CommandGuide/lit.html#general-options + export LIT_OPTS="-vv --time-tests" + + # Set to mark tests as expected to fail. + # See https://llvm.org/docs/CommandGuide/lit.html#cmdoption-lit-xfail + unset LIT_XFAIL + + # Set to mark tests to not even run. + # See https://llvm.org/docs/CommandGuide/lit.html#cmdoption-lit-filter-out + # Unfortunately LIT_FILTER_OUT is not accepting a list but a regular expression. + # To make this easily maintainable, we'll create an associate array in bash, + # to which you can append and later we'll join that array and escape dots (".") + # in your test paths. The following line resets this array. + # See also the function "test_list_to_regex". + test_list_filter_out=() + unset LIT_FILTER_OUT + + # Set for filtering out unit tests. + # See http://google.github.io/googletest/advanced.html#running-a-subset-of-the-tests + unset GTEST_FILTER + + # Some test (e.g. mlir) require this to be set. + unset PYTHONPATH +} + +# Convert array of test names into a regex. +# Call this function with an indexed array. +# +# Example: +# +# testlist=() +# testlist+=("foo") +# testlist+=("bar") +# export LIT_FILTER_OUT=$(test_list_to_regex testlist) +# +# Then $LIT_FILTER_OUT should evaluate to: (foo|bar) +function test_list_to_regex() +{ + local -n arr=$1 + # Prepare LIT_FILTER_OUT regex from index bash array + # Join each element with a pipe symbol (regex for "or") + arr=$(printf "|%s" "${arr[@]}") + # Remove the initial pipe symbol + arr=${arr:1} + # Properly escape path dots (".") for use in regular expression + arr=$(echo $arr | sed 's/\./\\./g') + # Add enclosing parenthesis + echo "($arr)" +} + +# Similar to test_list_to_regex() except that this function exports +# the LIT_FILTER_OUT if there are tests in the given list. +# If there are no tests, the LIT_FILTER_OUT is unset in order to +# avoid issues with the llvm test system. +function adjust_lit_filter_out() +{ + local -n arr=$1 + local res=$(test_list_to_regex test_list_filter_out) + if [[ "$res" != "()" ]]; then + export LIT_FILTER_OUT=$res + else + unset LIT_FILTER_OUT + fi +} +#endregion Helper functions + +#region Test LLVM lit +# It's fine to always run this, even if we're not shipping python-lit. +reset_test_opts +%cmake_build --target check-lit +#endregion Test LLVM lit + +#region Test LLVM +reset_test_opts +# Xfail testing of update utility tools +export LIT_XFAIL="tools/UpdateTestChecks" +%cmake_build --target check-llvm +#endregion Test LLVM + +#region Test CLANG +reset_test_opts +export LIT_XFAIL="$LIT_XFAIL;clang/test/CodeGen/profile-filter.c" +%cmake_build --target check-clang +#endregion Test Clang + +#region Test Clang Tools +reset_test_opts +%ifarch %ix86 +# Clang Tools :: clang-tidy/checkers/altera/struct-pack-align.cpp +export LIT_XFAIL="$LIT_XFAIL;clang-tidy/checkers/altera/struct-pack-align.cpp" +%endif +%cmake_build --target check-clang-tools +#endregion Test Clang Tools + +#region Test OPENMP +reset_test_opts + +# TODO(kkleine): OpenMP tests are currently not run on rawhide (see https://bugzilla.redhat.com/show_bug.cgi?id=2252966): +# +# + /usr/bin/cmake --build redhat-linux-build -j6 --verbose --target check-openmp +# Change Dir: '/builddir/build/BUILD/openmp-17.0.6.src/redhat-linux-build' +# Run Build Command(s): /usr/bin/ninja-build -v -j 6 check-openmp +# [1/1] cd /builddir/build/BUILD/openmp-17.0.6.src/redhat-linux-build && /usr/bin/cmake -E echo check-openmp\ does\ nothing,\ dependencies\ not\ found. +# +# We're marking the tests that are failing with the follwing error as expected to fail (XFAIL): +# +# gdb.error: No symbol "ompd_sizeof____kmp_gtid" in current context +# +# NOTE: It could be a different symbol in some tests. +export LIT_XFAIL="api_tests/test_ompd_get_curr_task_handle.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_enclosing_parallel_handle.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_generating_task_handle.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_icv_from_scope.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_scheduling_task_handle.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_state.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_task_frame.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_task_function.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_task_in_parallel.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_task_parallel_handle.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_thread_id.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_thread_in_parallel.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_parallel_handle_compare.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_rel_parallel_handle.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_rel_task_handle.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_rel_thread_handle.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_task_handle_compare.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_thread_handle_compare.c" +export LIT_XFAIL="$LIT_XFAIL;openmp_examples/ompd_icvs.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_curr_parallel_handle.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_display_control_vars.c" +export LIT_XFAIL="$LIT_XFAIL;api_tests/test_ompd_get_thread_handle.c" + +# The following test is flaky and we'll filter it out +test_list_filter_out+=("libomp :: ompt/teams/distribute_dispatch.c") +test_list_filter_out+=("libomp :: affinity/kmp-abs-hw-subset.c") +test_list_filter_out+=("libomp :: parallel/bug63197.c") +test_list_filter_out+=("libomp :: tasking/issue-69733.c") +test_list_filter_out+=("libarcher :: races/task-taskgroup-unrelated.c") + +# These tests fail more often than not, but not always. +test_list_filter_out+=("libomp :: worksharing/for/omp_collapse_many_GELTGT_int.c") +test_list_filter_out+=("libomp :: worksharing/for/omp_collapse_many_GTGEGT_int.c") +test_list_filter_out+=("libomp :: worksharing/for/omp_collapse_many_LTLEGE_int.c") +test_list_filter_out+=("libomp :: worksharing/for/omp_collapse_one_int.c") + +%ifarch s390x +test_list_filter_out+=("libomp :: flush/omp_flush.c") +test_list_filter_out+=("libomp :: worksharing/for/omp_for_schedule_guided.c") %endif -%if %{with compat_build} -# Packages that install files in /etc/ld.so.conf have to manually run -# ldconfig. -# See https://bugzilla.redhat.com/show_bug.cgi?id=2001328 and -# https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_linker_configuration_files -%post -p /sbin/ldconfig libs -%postun -p /sbin/ldconfig libs +%ifarch aarch64 s390x +# The following test has been failing intermittently on aarch64 and s390x. +# Re-enable it after https://github.com/llvm/llvm-project/issues/117773 +# gets fixed. +test_list_filter_out+=("libarcher :: races/taskwait-depend.c") %endif -%post devel -/usr/sbin/update-alternatives --install %{_bindir}/llvm-config%{exec_suffix} llvm-config%{exec_suffix} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits} +# The following tests seem pass on ppc64le and x86_64 and aarch64 only: +%ifnarch ppc64le x86_64 s390x aarch64 +# Passes on ppc64le: +# libomptarget :: powerpc64le-ibm-linux-gnu :: mapping/target_derefence_array_pointrs.cpp +# libomptarget :: powerpc64le-ibm-linux-gnu-LTO :: mapping/target_derefence_array_pointrs.cpp +# Passes on x86_64: +# libomptarget :: x86_64-pc-linux-gnu :: mapping/target_derefence_array_pointrs.cpp +# libomptarget :: x86_64-pc-linux-gnu-LTO :: mapping/target_derefence_array_pointrs.cpp +# Passes on s390x: +# libomptarget :: s390x-ibm-linux-gnu :: mapping/target_derefence_array_pointrs.cpp +# libomptarget :: s390x-ibm-linux-gnu-LTO :: mapping/target_derefence_array_pointrs.cpp +export LIT_XFAIL="$LIT_XFAIL;mapping/target_derefence_array_pointrs.cpp" +%endif + +%ifnarch x86_64 +# Passes on x86_64: +# libomptarget :: x86_64-pc-linux-gnu :: api/ompx_3d.c +# libomptarget :: x86_64-pc-linux-gnu :: api/ompx_3d.cpp +# libomptarget :: x86_64-pc-linux-gnu-LTO :: api/ompx_3d.c +# libomptarget :: x86_64-pc-linux-gnu-LTO :: api/ompx_3d.cpp +# libomptarget :: aarch64-unknown-linux-gnu :: +export LIT_XFAIL="$LIT_XFAIL;api/ompx_3d.c" +export LIT_XFAIL="$LIT_XFAIL;api/ompx_3d.cpp" +%endif + +%ifarch ppc64le +export LIT_XFAIL="$LIT_XFAIL;barrier/barrier.c" +export LIT_XFAIL="$LIT_XFAIL;critical/critical.c" +export LIT_XFAIL="$LIT_XFAIL;critical/lock-nested.c" +export LIT_XFAIL="$LIT_XFAIL;critical/lock.c" +export LIT_XFAIL="$LIT_XFAIL;parallel/parallel-firstprivate.c" +export LIT_XFAIL="$LIT_XFAIL;parallel/parallel-nosuppression.c" +export LIT_XFAIL="$LIT_XFAIL;parallel/parallel-simple.c" +export LIT_XFAIL="$LIT_XFAIL;parallel/parallel-simple2.c" +export LIT_XFAIL="$LIT_XFAIL;races/critical-unrelated.c" +export LIT_XFAIL="$LIT_XFAIL;races/lock-nested-unrelated.c" +export LIT_XFAIL="$LIT_XFAIL;races/lock-unrelated.c" +export LIT_XFAIL="$LIT_XFAIL;races/parallel-simple.c" +export LIT_XFAIL="$LIT_XFAIL;races/task-dependency.c" +export LIT_XFAIL="$LIT_XFAIL;races/task-taskgroup-unrelated.c" +export LIT_XFAIL="$LIT_XFAIL;races/task-taskwait-nested.c" +export LIT_XFAIL="$LIT_XFAIL;races/task-two.c" +export LIT_XFAIL="$LIT_XFAIL;races/taskwait-depend.c" +export LIT_XFAIL="$LIT_XFAIL;reduction/parallel-reduction-nowait.c" +export LIT_XFAIL="$LIT_XFAIL;reduction/parallel-reduction.c" +export LIT_XFAIL="$LIT_XFAIL;task/omp_task_depend_all.c" +export LIT_XFAIL="$LIT_XFAIL;task/task-barrier.c" +export LIT_XFAIL="$LIT_XFAIL;task/task-create.c" +export LIT_XFAIL="$LIT_XFAIL;task/task-dependency.c" +export LIT_XFAIL="$LIT_XFAIL;task/task-taskgroup-nested.c" +export LIT_XFAIL="$LIT_XFAIL;task/task-taskgroup.c" +export LIT_XFAIL="$LIT_XFAIL;task/task-taskwait-nested.c" +export LIT_XFAIL="$LIT_XFAIL;task/task-taskwait.c" +export LIT_XFAIL="$LIT_XFAIL;task/task_early_fulfill.c" +export LIT_XFAIL="$LIT_XFAIL;task/task_late_fulfill.c" +export LIT_XFAIL="$LIT_XFAIL;task/taskwait-depend.c" +export LIT_XFAIL="$LIT_XFAIL;worksharing/ordered.c" +export LIT_XFAIL="$LIT_XFAIL;api/omp_dynamic_shared_memory.c" +export LIT_XFAIL="$LIT_XFAIL;jit/empty_kernel_lvl1.c" +export LIT_XFAIL="$LIT_XFAIL;jit/empty_kernel_lvl2.c" +export LIT_XFAIL="$LIT_XFAIL;jit/type_punning.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/barrier_fence.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/bug49334.cpp" +export LIT_XFAIL="$LIT_XFAIL;offloading/default_thread_limit.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/ompx_bare.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/ompx_coords.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/ompx_saxpy_mixed.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/small_trip_count.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/small_trip_count_thread_limit.cpp" +export LIT_XFAIL="$LIT_XFAIL;offloading/spmdization.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/target_critical_region.cpp" +export LIT_XFAIL="$LIT_XFAIL;offloading/thread_limit.c" +export LIT_XFAIL="$LIT_XFAIL;api/omp_dynamic_shared_memory.c" +export LIT_XFAIL="$LIT_XFAIL;jit/empty_kernel_lvl1.c" +export LIT_XFAIL="$LIT_XFAIL;jit/empty_kernel_lvl2.c" +export LIT_XFAIL="$LIT_XFAIL;jit/type_punning.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/barrier_fence.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/bug49334.cpp" +export LIT_XFAIL="$LIT_XFAIL;offloading/default_thread_limit.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/ompx_bare.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/ompx_coords.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/ompx_saxpy_mixed.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/small_trip_count.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/small_trip_count_thread_limit.cpp" +export LIT_XFAIL="$LIT_XFAIL;offloading/spmdization.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/target_critical_region.cpp" +export LIT_XFAIL="$LIT_XFAIL;offloading/thread_limit.c" +export LIT_XFAIL="$LIT_XFAIL;mapping/auto_zero_copy.cpp" +export LIT_XFAIL="$LIT_XFAIL;mapping/auto_zero_copy_globals.cpp" +export LIT_XFAIL="$LIT_XFAIL;offloading/workshare_chunk.c" +export LIT_XFAIL="$LIT_XFAIL;ompt/target_memcpy.c" +export LIT_XFAIL="$LIT_XFAIL;ompt/target_memcpy_emi.c" +%endif + +%ifarch s390x ppc64le +export LIT_XFAIL="$LIT_XFAIL;offloading/thread_state_1.c" +export LIT_XFAIL="$LIT_XFAIL;offloading/thread_state_2.c" +%endif + +adjust_lit_filter_out test_list_filter_out + +%if 0%{?rhel} +# libomp tests are often very slow on s390x brew builders +%ifnarch s390x +%cmake_build --target check-openmp +%endif +%else +%cmake_build --target check-openmp +%endif +#endregion Test OPENMP + +%if %{with lldb} +# Don't run LLDB tests on s390x because more than 150 tests are failing there +%ifnarch s390x +## TODO(kkleine): Come back and re-enable testing for LLDB +## #region LLDB unit tests +## reset_test_opts +## %%cmake_build --target check-lldb-unit +## #endregion LLDB unit tests +## +## #region LLDB SB API tests +## reset_test_opts +## %%cmake_build --target check-lldb-api +## #endregion LLDB SB API tests +## +## #region LLDB shell tests +## reset_test_opts +## %%cmake_build --target check-lldb-shell +## #endregion LLDB shell tests +%endif +%endif + +#region test libcxx +# TODO(kkleine): Fedora rawhide didn't contain check runs. Evaluate if we want them here. +#endregion test libcxx + + +#region Test LLD +reset_test_opts +%cmake_build --target check-lld +#endregion Test LLD + +#region Test MLIR +%if %{with mlir} +reset_test_opts + +%if %{maj_ver} < 20 +# The ml_dtypes python module required by mlir/test/python/execution_engine.py +# isn't packaged. But in LLVM 20 the execution_engine.py is modified to only +# run certain tests if ml_dtypes is present. +test_list_filter_out+=("MLIR :: python/execution_engine.py") +test_list_filter_out+=("MLIR :: python/multithreaded_tests.py") +%endif + +%ifarch s390x +# s390x does not support half-float +test_list_filter_out+=("MLIR :: python/ir/array_attributes.py") +%endif + +adjust_lit_filter_out test_list_filter_out + +export PYTHONPATH=%{buildroot}/%{python3_sitearch} +%cmake_build --target check-mlir +%endif +#endregion Test MLIR + +#region BOLT tests +%if %{with build_bolt} +%if %{maj_ver} < 20 +export LIT_XFAIL="$LIT_XFAIL;AArch64/build_id.c" +export LIT_XFAIL="$LIT_XFAIL;AArch64/plt-call.test" +export LIT_XFAIL="$LIT_XFAIL;X86/linux-static-keys.s" +export LIT_XFAIL="$LIT_XFAIL;X86/plt-call.test" +%endif + +# Beginning with LLVM 20 this test has the "non-root-user" requirement +# and then the test should pass. But now it is flaky, hence we can only +# filter it out. +test_list_filter_out+=("BOLT :: unreadable-profile.test") + +%ifarch aarch64 +# Failing test cases on aarch64 +# TODO(kkleine): The following used to fail on aarch64 but passed today. +#export LIT_XFAIL="$LIT_XFAIL;cache+-deprecated.test" +#export LIT_XFAIL="$LIT_XFAIL;bolt-icf.test" +#export LIT_XFAIL="$LIT_XFAIL;R_ABS.pic.lld.cpp" + +# The following tests require LSE in order to run. +# More info at: https://github.com/llvm/llvm-project/issues/86485 +if ! grep -q atomics /proc/cpuinfo; then + test_list_filter_out+=("BOLT :: runtime/AArch64/basic-instrumentation.test") + test_list_filter_out+=("BOLT :: runtime/AArch64/hook-fini.test") + test_list_filter_out+=("BOLT :: runtime/AArch64/instrumentation-ind-call.c") + test_list_filter_out+=("BOLT :: runtime/exceptions-instrumentation.test") + test_list_filter_out+=("BOLT :: runtime/instrumentation-indirect-2.c") + test_list_filter_out+=("BOLT :: runtime/pie-exceptions-split.test") +fi +%endif + +%if %{maj_ver} < 20 +%ifarch x86_64 +# BOLT-ERROR: instrumentation of static binary currently does not support profile output on binary +# finalization, so it requires -instrumentation-sleep-time=N (N>0) usage +export LIT_XFAIL="$LIT_XFAIL;X86/internal-call-instrument.s" +%endif +%endif + +%cmake_build --target check-bolt +%endif +#endregion BOLT tests + +%endif + +%if %{with snapshot_build} +# Do this here instead of in install so the check targets are also included. +cp %{_vpath_builddir}/.ninja_log %{buildroot}%{pkg_datadir} +%endif + +#endregion check + +#region misc +%ldconfig_scriptlets -n %{pkg_name-llvm}-libs + %if %{without compat_build} -/usr/sbin/update-alternatives --install %{_bindir}/llvm-config-%{maj_ver} llvm-config-%{maj_ver} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits} +%ldconfig_scriptlets -n %{pkg_name_lld}-libs +%endif + +%post -n %{pkg_name_llvm}-devel +%{_sbindir}/update-alternatives --install %{_bindir}/llvm-config%{exec_suffix} llvm-config%{exec_suffix} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits} +%if %{without compat_build} +%{_sbindir}/update-alternatives --install %{_bindir}/llvm-config-%{maj_ver} llvm-config-%{maj_ver} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits} # During the upgrade from LLVM 16 (F38) to LLVM 17 (F39), we found out the # main llvm-devel package was leaving entries in the alternatives system. # Try to remove them now. for v in 14 15 16; do if [[ -e %{_bindir}/llvm-config-$v - && "x$(%{_bindir}/llvm-config-$v --version | awk -F . '{ print $1 }')" != "x$v" ]]; then - /usr/sbin/update-alternatives --remove llvm-config-$v %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} + && "x$(%{_bindir}/llvm-config-$v --version | awk -F . '{ print $1 }')" != "x$v" ]]; then + %{_sbindir}/update-alternatives --remove llvm-config-$v %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} fi done %endif - -%postun devel +%postun -n %{pkg_name_llvm}-devel if [ $1 -eq 0 ]; then - /usr/sbin/update-alternatives --remove llvm-config%{exec_suffix} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} + %{_sbindir}/update-alternatives --remove llvm-config%{exec_suffix} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} fi %if %{without compat_build} # When upgrading between minor versions (i.e. from x.y.1 to x.y.2), we must @@ -553,19 +2202,277 @@ fi # alternative must be removed in order to give priority to a newly installed # compat package. if [[ $1 -eq 0 - || "x$(%{_bindir}/llvm-config-%{maj_ver} --version | awk -F . '{ print $1 }')" != "x%{maj_ver}" ]]; then - /usr/sbin/update-alternatives --remove llvm-config-%{maj_ver} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} + || "x$(%{_bindir}/llvm-config%{exec_suffix} --version | awk -F . '{ print $1 }')" != "x%{maj_ver}" ]]; then + %{_sbindir}/update-alternatives --remove llvm-config-%{maj_ver} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} fi %endif -%files -%license LICENSE.TXT +%if %{without compat_build} +%post -n %{pkg_name_lld} +%{_sbindir}/update-alternatives --install %{_bindir}/ld ld %{_bindir}/ld.lld 1 + +%postun -n %{pkg_name_lld} +if [ $1 -eq 0 ] ; then + %{_sbindir}/update-alternatives --remove ld %{_bindir}/ld.lld +fi +%endif +#endregion misc + +#region files +#region LLVM lit files +%if %{with python_lit} +%files -n python%{python3_pkgversion}-lit +%license llvm/utils/lit/LICENSE.TXT +%doc llvm/utils/lit/README.rst +%{python3_sitelib}/lit/ +%{python3_sitelib}/lit-*-info/ +%{_bindir}/lit +%endif +#endregion LLVM lit files + +#region LLVM files + +%files -n %{pkg_name_llvm} +%license llvm/LICENSE.TXT %exclude %{_mandir}/man1/llvm-config* -%{_mandir}/man1/* -%{install_bindir}/* + +%{_mandir}/man1/bugpoint%{exec_suffix}.1.gz +%{_mandir}/man1/clang-tblgen%{exec_suffix}.1.gz +%{_mandir}/man1/dsymutil%{exec_suffix}.1.gz +%{_mandir}/man1/FileCheck%{exec_suffix}.1.gz +%{_mandir}/man1/lit%{exec_suffix}.1.gz +%{_mandir}/man1/llc%{exec_suffix}.1.gz +%{_mandir}/man1/lldb-tblgen%{exec_suffix}.1.gz +%{_mandir}/man1/lli%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-addr2line%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-ar%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-as%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-bcanalyzer%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-cov%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-cxxfilt%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-cxxmap%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-debuginfo-analyzer%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-diff%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-dis%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-dwarfdump%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-dwarfutil%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-exegesis%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-extract%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-ifs%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-install-name-tool%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-lib%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-libtool-darwin%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-link%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-lipo%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-locstats%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-mc%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-mca%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-nm%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-objcopy%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-objdump%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-opt-report%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-otool%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-pdbutil%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-profdata%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-profgen%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-ranlib%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-readelf%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-readobj%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-reduce%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-remarkutil%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-size%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-stress%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-strings%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-strip%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-symbolizer%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-tblgen%{exec_suffix}.1.gz +%{_mandir}/man1/llvm-tli-checker%{exec_suffix}.1.gz +%{_mandir}/man1/mlir-tblgen%{exec_suffix}.1.gz +%{_mandir}/man1/opt%{exec_suffix}.1.gz +%{_mandir}/man1/tblgen%{exec_suffix}.1.gz +%if %{maj_ver} >= 20 +%{_mandir}/man1/llvm-cgdata%{exec_suffix}.1.gz +%endif + +%{install_bindir}/bugpoint +%{install_bindir}/dsymutil +%{install_bindir}/FileCheck +%{install_bindir}/llc +%{install_bindir}/lli +%{install_bindir}/llvm-addr2line +%{install_bindir}/llvm-ar +%{install_bindir}/llvm-as +%{install_bindir}/llvm-bcanalyzer +%{install_bindir}/llvm-bitcode-strip +%{install_bindir}/llvm-c-test +%{install_bindir}/llvm-cat +%{install_bindir}/llvm-cfi-verify +%{install_bindir}/llvm-cov +%{install_bindir}/llvm-cvtres +%{install_bindir}/llvm-cxxdump +%{install_bindir}/llvm-cxxfilt +%{install_bindir}/llvm-cxxmap +%{install_bindir}/llvm-debuginfo-analyzer +%{install_bindir}/llvm-debuginfod +%{install_bindir}/llvm-debuginfod-find +%{install_bindir}/llvm-diff +%{install_bindir}/llvm-dis +%{install_bindir}/llvm-dlltool +%{install_bindir}/llvm-dwarfdump +%{install_bindir}/llvm-dwarfutil +%{install_bindir}/llvm-dwp +%{install_bindir}/llvm-exegesis +%{install_bindir}/llvm-extract +%{install_bindir}/llvm-gsymutil +%{install_bindir}/llvm-ifs +%{install_bindir}/llvm-install-name-tool +%{install_bindir}/llvm-jitlink +%{install_bindir}/llvm-jitlink-executor +%{install_bindir}/llvm-lib +%{install_bindir}/llvm-libtool-darwin +%{install_bindir}/llvm-link +%{install_bindir}/llvm-lipo +%{install_bindir}/llvm-lto +%{install_bindir}/llvm-lto2 +%{install_bindir}/llvm-mc +%{install_bindir}/llvm-mca +%{install_bindir}/llvm-ml +%{install_bindir}/llvm-modextract +%{install_bindir}/llvm-mt +%{install_bindir}/llvm-nm +%{install_bindir}/llvm-objcopy +%{install_bindir}/llvm-objdump +%{install_bindir}/llvm-opt-report +%{install_bindir}/llvm-otool +%{install_bindir}/llvm-pdbutil +%{install_bindir}/llvm-PerfectShuffle +%{install_bindir}/llvm-profdata +%{install_bindir}/llvm-profgen +%{install_bindir}/llvm-ranlib +%{install_bindir}/llvm-rc +%{install_bindir}/llvm-readelf +%{install_bindir}/llvm-readobj +%{install_bindir}/llvm-readtapi +%{install_bindir}/llvm-reduce +%{install_bindir}/llvm-remarkutil +%{install_bindir}/llvm-rtdyld +%{install_bindir}/llvm-sim +%{install_bindir}/llvm-size +%{install_bindir}/llvm-split +%{install_bindir}/llvm-stress +%{install_bindir}/llvm-strings +%{install_bindir}/llvm-strip +%{install_bindir}/llvm-symbolizer +%{install_bindir}/llvm-tblgen +%{install_bindir}/llvm-tli-checker +%{install_bindir}/llvm-undname +%{install_bindir}/llvm-windres +%{install_bindir}/llvm-xray +%{install_bindir}/reduce-chunk-list +%{install_bindir}/obj2yaml +%{install_bindir}/opt +%{install_bindir}/sancov +%{install_bindir}/sanstats +%{install_bindir}/split-file +%{install_bindir}/UnicodeNameMappingGenerator +%{install_bindir}/verify-uselistorder +%{install_bindir}/yaml2obj +%if %{maj_ver} >= 20 +%{install_bindir}/llvm-cgdata +%{install_bindir}/llvm-ctxprof-util +%endif + + %if %{with compat_build} # This is for all the binaries with the version suffix. -%{_bindir}/*%{exec_suffix} +%{_bindir}/bugpoint%{exec_suffix} +%{_bindir}/dsymutil%{exec_suffix} +%{_bindir}/FileCheck%{exec_suffix} +%{_bindir}/llc%{exec_suffix} +%{_bindir}/lli%{exec_suffix} +%{_bindir}/llvm-addr2line%{exec_suffix} +%{_bindir}/llvm-ar%{exec_suffix} +%{_bindir}/llvm-as%{exec_suffix} +%{_bindir}/llvm-bcanalyzer%{exec_suffix} +%{_bindir}/llvm-bitcode-strip%{exec_suffix} +%{_bindir}/llvm-c-test%{exec_suffix} +%{_bindir}/llvm-cat%{exec_suffix} +%{_bindir}/llvm-cfi-verify%{exec_suffix} +%{_bindir}/llvm-cov%{exec_suffix} +%{_bindir}/llvm-cvtres%{exec_suffix} +%{_bindir}/llvm-cxxdump%{exec_suffix} +%{_bindir}/llvm-cxxfilt%{exec_suffix} +%{_bindir}/llvm-cxxmap%{exec_suffix} +%{_bindir}/llvm-debuginfo-analyzer%{exec_suffix} +%{_bindir}/llvm-debuginfod%{exec_suffix} +%{_bindir}/llvm-debuginfod-find%{exec_suffix} +%{_bindir}/llvm-diff%{exec_suffix} +%{_bindir}/llvm-dis%{exec_suffix} +%{_bindir}/llvm-dlltool%{exec_suffix} +%{_bindir}/llvm-dwarfdump%{exec_suffix} +%{_bindir}/llvm-dwarfutil%{exec_suffix} +%{_bindir}/llvm-dwp%{exec_suffix} +%{_bindir}/llvm-exegesis%{exec_suffix} +%{_bindir}/llvm-extract%{exec_suffix} +%{_bindir}/llvm-gsymutil%{exec_suffix} +%{_bindir}/llvm-ifs%{exec_suffix} +%{_bindir}/llvm-install-name-tool%{exec_suffix} +%{_bindir}/llvm-jitlink%{exec_suffix} +%{_bindir}/llvm-jitlink-executor%{exec_suffix} +%{_bindir}/llvm-lib%{exec_suffix} +%{_bindir}/llvm-libtool-darwin%{exec_suffix} +%{_bindir}/llvm-link%{exec_suffix} +%{_bindir}/llvm-lipo%{exec_suffix} +%{_bindir}/llvm-lto%{exec_suffix} +%{_bindir}/llvm-lto2%{exec_suffix} +%{_bindir}/llvm-mc%{exec_suffix} +%{_bindir}/llvm-mca%{exec_suffix} +%{_bindir}/llvm-ml%{exec_suffix} +%{_bindir}/llvm-modextract%{exec_suffix} +%{_bindir}/llvm-mt%{exec_suffix} +%{_bindir}/llvm-nm%{exec_suffix} +%{_bindir}/llvm-objcopy%{exec_suffix} +%{_bindir}/llvm-objdump%{exec_suffix} +%{_bindir}/llvm-opt-report%{exec_suffix} +%{_bindir}/llvm-otool%{exec_suffix} +%{_bindir}/llvm-pdbutil%{exec_suffix} +%{_bindir}/llvm-PerfectShuffle%{exec_suffix} +%{_bindir}/llvm-profdata%{exec_suffix} +%{_bindir}/llvm-profgen%{exec_suffix} +%{_bindir}/llvm-ranlib%{exec_suffix} +%{_bindir}/llvm-rc%{exec_suffix} +%{_bindir}/llvm-readelf%{exec_suffix} +%{_bindir}/llvm-readobj%{exec_suffix} +%{_bindir}/llvm-readtapi%{exec_suffix} +%{_bindir}/llvm-reduce%{exec_suffix} +%{_bindir}/llvm-remarkutil%{exec_suffix} +%{_bindir}/llvm-rtdyld%{exec_suffix} +%{_bindir}/llvm-sim%{exec_suffix} +%{_bindir}/llvm-size%{exec_suffix} +%{_bindir}/llvm-split%{exec_suffix} +%{_bindir}/llvm-stress%{exec_suffix} +%{_bindir}/llvm-strings%{exec_suffix} +%{_bindir}/llvm-strip%{exec_suffix} +%{_bindir}/llvm-symbolizer%{exec_suffix} +%{_bindir}/llvm-tblgen%{exec_suffix} +%{_bindir}/llvm-tli-checker%{exec_suffix} +%{_bindir}/llvm-undname%{exec_suffix} +%{_bindir}/llvm-windres%{exec_suffix} +%{_bindir}/llvm-xray%{exec_suffix} +%{_bindir}/reduce-chunk-list%{exec_suffix} +%{_bindir}/obj2yaml%{exec_suffix} +%{_bindir}/opt%{exec_suffix} +%{_bindir}/sancov%{exec_suffix} +%{_bindir}/sanstats%{exec_suffix} +%{_bindir}/split-file%{exec_suffix} +%{_bindir}/UnicodeNameMappingGenerator%{exec_suffix} +%{_bindir}/verify-uselistorder%{exec_suffix} +%{_bindir}/yaml2obj%{exec_suffix} +%if %{maj_ver} >= 20 +%{_bindir}/llvm-cgdata%{exec_suffix} +%{_bindir}/llvm-ctxprof-util%{exec_suffix} +%endif + %endif %exclude %{_bindir}/llvm-config%{exec_suffix} @@ -581,70 +2488,76 @@ fi %exclude %{install_bindir}/llvm-opt-fuzzer %{pkg_datadir}/opt-viewer -%files libs -%license LICENSE.TXT -%{install_libdir}/libLLVM-%{maj_ver}%{?llvm_snapshot_version_suffix:%{llvm_snapshot_version_suffix}}.so +%files -n %{pkg_name_llvm}-libs +%license llvm/LICENSE.TXT +%{install_libdir}/libLLVM-%{maj_ver}%{?llvm_snapshot_version_suffix}.so %if %{with gold} %{install_libdir}/LLVMgold.so %if %{without compat_build} %{_libdir}/bfd-plugins/LLVMgold.so %endif %endif -%{install_libdir}/libLLVM-%{maj_ver}.so -%{install_libdir}/libLLVM.so.%{maj_ver}.%{min_ver} +%{install_libdir}/libLLVM.so.%{maj_ver}.%{min_ver}%{?llvm_snapshot_version_suffix} %{install_libdir}/libLTO.so* %{install_libdir}/libRemarks.so* %if %{with compat_build} -%config(noreplace) /etc/ld.so.conf.d/%{name}-%{_arch}.conf +%config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{pkg_name_llvm}-%{_arch}.conf %endif %if %{with bundle_compat_lib} -%{_libdir}/libLLVM-%{compat_maj_ver}.so +%{_libdir}/libLLVM.so.%{compat_maj_ver}* %endif -%files devel -%license LICENSE.TXT +%files -n %{pkg_name_llvm}-devel +%license llvm/LICENSE.TXT + +%if %{without compat_build} +%ghost %{_bindir}/llvm-config +%{install_bindir}/llvm-config-%{__isa_bits} +%else +%{install_bindir}/llvm-config +%endif +%ghost %{_bindir}/llvm-config-%{maj_ver} +%{install_bindir}/llvm-config-%{maj_ver}-%{__isa_bits} -%ghost %{_bindir}/llvm-config%{exec_suffix} -%{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{_mandir}/man1/llvm-config* - %{install_includedir}/llvm %{install_includedir}/llvm-c %{install_libdir}/libLLVM.so %{install_libdir}/cmake/llvm -%{install_bindir}/llvm-config-%{maj_ver}-%{__isa_bits} -%ghost %{_bindir}/llvm-config-%{maj_ver} -%if %{with bundle_compat_lib} -%{_libdir}/llvm%{compat_maj_ver}/ -%endif -%files doc -%license LICENSE.TXT -%doc %{_pkgdocdir}/html +%files -n %{pkg_name_llvm}-doc +%license llvm/LICENSE.TXT +%doc %{_pkgdocdir}/html/index.html -%files static -%license LICENSE.TXT -%{install_libdir}/*.a +%files -n %{pkg_name_llvm}-static +%license llvm/LICENSE.TXT +%{install_libdir}/libLLVM*.a %exclude %{install_libdir}/libLLVMTestingSupport.a %exclude %{install_libdir}/libLLVMTestingAnnotations.a -%exclude %{install_libdir}/libllvm_gtest.a -%exclude %{install_libdir}/libllvm_gtest_main.a -%files cmake-utils -%license LICENSE.TXT +%files -n %{pkg_name_llvm}-cmake-utils +%license llvm/LICENSE.TXT %{pkg_datadir}/llvm/cmake -%files test -%license LICENSE.TXT +%files -n %{pkg_name_llvm}-test +%license llvm/LICENSE.TXT %{install_bindir}/not %{install_bindir}/count %{install_bindir}/yaml-bench %{install_bindir}/lli-child-target %{install_bindir}/llvm-isel-fuzzer %{install_bindir}/llvm-opt-fuzzer +%if %{with compat_build} +%{_bindir}/not%{exec_suffix} +%{_bindir}/count%{exec_suffix} +%{_bindir}/yaml-bench%{exec_suffix} +%{_bindir}/lli-child-target%{exec_suffix} +%{_bindir}/llvm-isel-fuzzer%{exec_suffix} +%{_bindir}/llvm-opt-fuzzer%{exec_suffix} +%endif -%files googletest -%license LICENSE.TXT +%files -n %{pkg_name_llvm}-googletest +%license llvm/LICENSE.TXT %{install_libdir}/libLLVMTestingSupport.a %{install_libdir}/libLLVMTestingAnnotations.a %{install_libdir}/libllvm_gtest.a @@ -652,12 +2565,513 @@ fi %{install_includedir}/llvm-gtest %{install_includedir}/llvm-gmock +%if %{with snapshot_build} +%files -n %{pkg_name_llvm}-build-stats +%{pkg_datadir}/.ninja_log +%endif + +#endregion LLVM files + +#region CLANG files + +%files -n %{pkg_name_clang} +%license clang/LICENSE.TXT +%{install_bindir}/clang +%{install_bindir}/clang++ +%{install_bindir}/clang-%{maj_ver} +%{install_bindir}/clang++-%{maj_ver} +%{install_bindir}/clang-cl +%{install_bindir}/clang-cpp +%{_sysconfdir}/%{pkg_name_clang}/%{_target_platform}-clang.cfg +%{_sysconfdir}/%{pkg_name_clang}/%{_target_platform}-clang++.cfg +%ifarch x86_64 +%{_sysconfdir}/%{pkg_name_clang}/i386-redhat-linux-gnu-clang.cfg +%{_sysconfdir}/%{pkg_name_clang}/i386-redhat-linux-gnu-clang++.cfg +%endif +%{_mandir}/man1/clang-%{maj_ver}.1.gz +%{_mandir}/man1/clang++-%{maj_ver}.1.gz +%if %{without compat_build} +%{_mandir}/man1/clang.1.gz +%{_mandir}/man1/clang++.1.gz +%else +%{_bindir}/clang-%{maj_ver} +%{_bindir}/clang++-%{maj_ver} +%{_bindir}/clang-cl-%{maj_ver} +%{_bindir}/clang-cpp-%{maj_ver} +%endif + +%files -n %{pkg_name_clang}-libs +%license clang/LICENSE.TXT +%{_prefix}/lib/clang/%{maj_ver}/include/* +%{install_libdir}/libclang.so.%{maj_ver}* +%{install_libdir}/libclang-cpp.so.%{maj_ver}* +%if %{with bundle_compat_lib} +%{_libdir}/libclang.so.%{compat_maj_ver}* +%{_libdir}/libclang-cpp.so.%{compat_maj_ver}* +%endif + +%files -n %{pkg_name_clang}-devel +%license clang/LICENSE.TXT +%{install_libdir}/libclang-cpp.so +%{install_libdir}/libclang.so +%{install_includedir}/clang/ +%{install_includedir}/clang-c/ +%{install_libdir}/cmake/clang +%{install_bindir}/clang-tblgen +%if %{with compat_build} +%{_bindir}/clang-tblgen-%{maj_ver} +%endif +%dir %{install_datadir}/clang/ + +%files -n %{pkg_name_clang}-resource-filesystem +%license clang/LICENSE.TXT +%dir %{_prefix}/lib/clang/ +%dir %{_prefix}/lib/clang/%{maj_ver}/ +%dir %{_prefix}/lib/clang/%{maj_ver}/bin/ +%dir %{_prefix}/lib/clang/%{maj_ver}/include/ +%dir %{_prefix}/lib/clang/%{maj_ver}/lib/ +%dir %{_prefix}/lib/clang/%{maj_ver}/share/ +%{_rpmmacrodir}/macros.%{pkg_name_clang} + +%files -n %{pkg_name_clang}-analyzer +%license clang/LICENSE.TXT +%{install_bindir}/scan-view +%{install_bindir}/scan-build +%{install_bindir}/analyze-build +%{install_bindir}/intercept-build +%{install_bindir}/scan-build-py +%if %{with compat_build} +%{_bindir}/scan-view-%{maj_ver} +%{_bindir}/scan-build-%{maj_ver} +%{_bindir}/analyze-build-%{maj_ver} +%{_bindir}/intercept-build-%{maj_ver} +%{_bindir}/scan-build-py-%{maj_ver} +%endif +%{install_libexecdir}/ccc-analyzer +%{install_libexecdir}/c++-analyzer +%{install_libexecdir}/analyze-c++ +%{install_libexecdir}/analyze-cc +%{install_libexecdir}/intercept-c++ +%{install_libexecdir}/intercept-cc +%{install_datadir}/scan-view/ +%{install_datadir}/scan-build/ +%{_mandir}/man1/scan-build%{exec_suffix}.1.* +%if %{without compat_build} +%{python3_sitelib}/libear +%{python3_sitelib}/libscanbuild +%endif -%files toolset +%files -n %{pkg_name_clang}-tools-extra +%license clang-tools-extra/LICENSE.TXT +%{install_bindir}/amdgpu-arch +%{install_bindir}/clang-apply-replacements +%{install_bindir}/clang-change-namespace +%{install_bindir}/clang-check +%{install_bindir}/clang-doc +%{install_bindir}/clang-extdef-mapping +%{install_bindir}/clang-format +%{install_bindir}/clang-include-cleaner +%{install_bindir}/clang-include-fixer +%{install_bindir}/clang-installapi +%{install_bindir}/clang-move +%{install_bindir}/clang-offload-bundler +%{install_bindir}/clang-offload-packager +%{install_bindir}/clang-linker-wrapper +%{install_bindir}/clang-nvlink-wrapper +%{install_bindir}/clang-query +%{install_bindir}/clang-refactor +%{install_bindir}/clang-reorder-fields +%{install_bindir}/clang-repl +%{install_bindir}/clang-scan-deps +%if %{maj_ver} >= 20 +%{install_bindir}/clang-sycl-linker +%endif +%{install_bindir}/clang-tidy +%{install_bindir}/clangd +%{install_bindir}/diagtool +%{install_bindir}/hmaptool +%{install_bindir}/nvptx-arch +%{install_bindir}/pp-trace +%{install_bindir}/c-index-test +%{install_bindir}/find-all-symbols +%{install_bindir}/modularize +%{install_bindir}/clang-format-diff +%{install_bindir}/run-clang-tidy +%if %{maj_ver} < 20 +%{install_bindir}/clang-pseudo +%{install_bindir}/clang-rename +%endif +%if %{with compat_build} +%{_bindir}/amdgpu-arch-%{maj_ver} +%{_bindir}/clang-apply-replacements-%{maj_ver} +%{_bindir}/clang-change-namespace-%{maj_ver} +%{_bindir}/clang-check-%{maj_ver} +%{_bindir}/clang-doc-%{maj_ver} +%{_bindir}/clang-extdef-mapping-%{maj_ver} +%{_bindir}/clang-format-%{maj_ver} +%{_bindir}/clang-include-cleaner-%{maj_ver} +%{_bindir}/clang-include-fixer-%{maj_ver} +%{_bindir}/clang-installapi-%{maj_ver} +%{_bindir}/clang-move-%{maj_ver} +%{_bindir}/clang-offload-bundler-%{maj_ver} +%{_bindir}/clang-offload-packager-%{maj_ver} +%{_bindir}/clang-linker-wrapper-%{maj_ver} +%{_bindir}/clang-nvlink-wrapper-%{maj_ver} +%{_bindir}/clang-query-%{maj_ver} +%{_bindir}/clang-refactor-%{maj_ver} +%{_bindir}/clang-reorder-fields-%{maj_ver} +%{_bindir}/clang-repl-%{maj_ver} +%{_bindir}/clang-scan-deps-%{maj_ver} +%if %{maj_ver} >= 20 +%{_bindir}/clang-sycl-linker-%{maj_ver} +%endif +%{_bindir}/clang-tidy-%{maj_ver} +%{_bindir}/clangd-%{maj_ver} +%{_bindir}/diagtool-%{maj_ver} +%{_bindir}/hmaptool-%{maj_ver} +%{_bindir}/nvptx-arch-%{maj_ver} +%{_bindir}/pp-trace-%{maj_ver} +%{_bindir}/c-index-test-%{maj_ver} +%{_bindir}/find-all-symbols-%{maj_ver} +%{_bindir}/modularize-%{maj_ver} +%{_bindir}/clang-format-diff-%{maj_ver} +%{_bindir}/run-clang-tidy-%{maj_ver} +%if %{maj_ver} < 20 +%{_bindir}/clang-pseudo-%{maj_ver} +%{_bindir}/clang-rename-%{maj_ver} +%endif +%else +%{_emacs_sitestartdir}/clang-format.el +%if %{maj_ver} < 20 +%{_emacs_sitestartdir}/clang-rename.el +%endif +%{_emacs_sitestartdir}/clang-include-fixer.el +%endif +%{_mandir}/man1/diagtool%{exec_suffix}.1.gz +%{_mandir}/man1/extraclangtools%{exec_suffix}.1.gz +%{install_datadir}/clang/clang-format.py* +%{install_datadir}/clang/clang-format-diff.py* +%{install_datadir}/clang/clang-include-fixer.py* +%{install_datadir}/clang/clang-tidy-diff.py* +%{install_datadir}/clang/run-find-all-symbols.py* +%if %{maj_ver} < 20 +%{install_datadir}/clang/clang-rename.py* +%endif + + +%files -n %{pkg_name_clang}-tools-extra-devel +%license clang-tools-extra/LICENSE.TXT +%{install_includedir}/clang-tidy/ + +%files -n git-clang-format%{pkg_suffix} +%license clang/LICENSE.TXT +%{install_bindir}/git-clang-format +%if %{with compat_build} +%{_bindir}/git-clang-format-%{maj_ver} +%endif + +%if %{without compat_build} +%files -n python%{python3_pkgversion}-clang +%license clang/LICENSE.TXT +%{python3_sitelib}/clang/ +%endif + +#endregion CLANG files + +#region COMPILER-RT files + +%files -n %{pkg_name_compiler_rt} +%license compiler-rt/LICENSE.TXT +%ifarch x86_64 aarch64 riscv64 +%{_prefix}/lib/clang/%{maj_ver}/bin/hwasan_symbolize +%endif +%{_prefix}/lib/clang/%{maj_ver}/include/fuzzer +%{_prefix}/lib/clang/%{maj_ver}/include/orc +%{_prefix}/lib/clang/%{maj_ver}/include/profile +%{_prefix}/lib/clang/%{maj_ver}/include/sanitizer +%{_prefix}/lib/clang/%{maj_ver}/include/xray + +%{_prefix}/lib/clang/%{maj_ver}/share/*.txt + +# Files that appear on all targets +%{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/libclang_rt.* + +%ifnarch s390x +%{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/clang_rt.crtbegin.o +%{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/clang_rt.crtend.o +%endif + +%ifnarch %{ix86} s390x +%{_prefix}/lib/clang/%{maj_ver}/lib/%{compiler_rt_triple}/liborc_rt.a +%endif + +# Additional symlink if two triples are in use. +%if "%{llvm_triple}" != "%{compiler_rt_triple}" +%{_prefix}/lib/clang/%{maj_ver}/lib/%{llvm_triple} +%endif + +#endregion COMPILER-RT files + +#region OPENMP files + +%files -n %{pkg_name_libomp} +%license openmp/LICENSE.TXT +%{install_libdir}/libomp.so +%{install_libdir}/libompd.so +%{install_libdir}/libarcher.so +%ifnarch %{ix86} +# libomptarget is not supported on 32-bit systems. +# s390x does not support the offloading plugins. +%{install_libdir}/libomptarget.so.%{so_suffix} +%if %{maj_ver} >= 20 +%{install_libdir}/libLLVMOffload.so.%{so_suffix} +%endif +%endif + +%files -n %{pkg_name_libomp}-devel +%license openmp/LICENSE.TXT +%{_prefix}/lib/clang/%{maj_ver}/include/omp.h +%{_prefix}/lib/clang/%{maj_ver}/include/ompx.h +%{_prefix}/lib/clang/%{maj_ver}/include/omp-tools.h +%{_prefix}/lib/clang/%{maj_ver}/include/ompt.h +%{_prefix}/lib/clang/%{maj_ver}/include/ompt-multiplex.h +%{install_libdir}/cmake/openmp/ +%ifnarch %{ix86} +# libomptarget is not supported on 32-bit systems. +# s390x does not support the offloading plugins. +%{install_libdir}/libomptarget.devicertl.a +%if %{maj_ver} >= 20 +%{install_libdir}/libomptarget-amdgpu*.bc +%{install_libdir}/libomptarget-nvptx*.bc +%else +%{install_libdir}/libomptarget-amdgpu-*.bc +%{install_libdir}/libomptarget-nvptx-*.bc +%endif +%{install_libdir}/libomptarget.so +%if %{maj_ver} >= 20 +%{install_libdir}/libLLVMOffload.so +%{install_includedir}/offload +%endif +%endif + +#endregion OPENMP files + +#region LLD files + +%files -n %{pkg_name_lld} +%license lld/LICENSE.TXT +%ghost %{_bindir}/ld +%{install_bindir}/lld +%{install_bindir}/lld-link +%{install_bindir}/ld.lld +%{install_bindir}/ld64.lld +%{install_bindir}/wasm-ld +%if %{without compat_build} +%{_mandir}/man1/ld.lld.1* +%else +%{_bindir}/lld%{exec_suffix} +%{_bindir}/lld-link%{exec_suffix} +%{_bindir}/ld.lld%{exec_suffix} +%{_bindir}/ld64.lld%{exec_suffix} +%{_bindir}/wasm-ld%{exec_suffix} +%endif + +%files -n %{pkg_name_lld}-devel +%license lld/LICENSE.TXT +%{install_includedir}/lld +%{install_libdir}/liblldCOFF.so +%{install_libdir}/liblldCommon.so +%{install_libdir}/liblldELF.so +%{install_libdir}/liblldMachO.so +%{install_libdir}/liblldMinGW.so +%{install_libdir}/liblldWasm.so +%{install_libdir}/cmake/lld/ + +%files -n %{pkg_name_lld}-libs +%license lld/LICENSE.TXT +%{install_libdir}/liblldCOFF.so.* +%{install_libdir}/liblldCommon.so.* +%{install_libdir}/liblldELF.so.* +%{install_libdir}/liblldMachO.so.* +%{install_libdir}/liblldMinGW.so.* +%{install_libdir}/liblldWasm.so.* + +#endregion LLD files + +#region Toolset files +%if 0%{?rhel} +%files -n %{pkg_name_llvm}-toolset %license LICENSE.TXT +%endif +#endregion Toolset files +#region LLDB files +%if %{with lldb} +%files -n %{pkg_name_lldb} +%license lldb/LICENSE.TXT +%{install_bindir}/lldb* +# Usually, *.so symlinks are kept in devel subpackages. However, the python +# bindings depend on this symlink at runtime. +%{install_libdir}/liblldb*.so +%{install_libdir}/liblldb.so.* +%{install_libdir}/liblldbIntelFeatures.so.* +%{_mandir}/man1/lldb-server%{exec_suffix}.1.gz +%{_mandir}/man1/lldb%{exec_suffix}.1.gz +%if %{with bundle_compat_lib} +%{_libdir}/liblldb.so.%{compat_maj_ver}* +%endif + +%files -n %{pkg_name_lldb}-devel +%{install_includedir}/lldb + +%files -n python%{python3_pkgversion}-lldb +%{python3_sitearch}/lldb +%endif +#endregion LLDB files + + +#region MLIR files +%if %{with mlir} +%files -n %{pkg_name_mlir} +%license LICENSE.TXT +%{_libdir}/libmlir_arm_runner_utils.so.%{maj_ver}* +%{_libdir}/libmlir_arm_sme_abi_stubs.so.%{maj_ver}* +%{_libdir}/libmlir_async_runtime.so.%{maj_ver}* +%{_libdir}/libmlir_c_runner_utils.so.%{maj_ver}* +%{_libdir}/libmlir_float16_utils.so.%{maj_ver}* +%{_libdir}/libmlir_runner_utils.so.%{maj_ver}* +%{_libdir}/libMLIR*.so.%{maj_ver}* + +%files -n %{pkg_name_mlir}-static +%{_libdir}/libMLIR*.a + +%files -n %{pkg_name_mlir}-devel +%{_bindir}/mlir-cpu-runner +%{_bindir}/mlir-linalg-ods-yaml-gen +%{_bindir}/mlir-lsp-server +%{_bindir}/mlir-opt +%{_bindir}/mlir-pdll +%{_bindir}/mlir-pdll-lsp-server +%{_bindir}/mlir-query +%{_bindir}/mlir-reduce +%if %{maj_ver} >= 20 +%{_bindir}/mlir-rewrite +%endif +%{_bindir}/mlir-tblgen +%{_bindir}/mlir-translate +%{_bindir}/tblgen-lsp-server +%{_bindir}/tblgen-to-irdl +%{_includedir}/mlir +%{_includedir}/mlir-c +%{_libdir}/cmake/mlir +%{_libdir}/libmlir_arm_runner_utils.so +%{_libdir}/libmlir_arm_sme_abi_stubs.so +%{_libdir}/libmlir_async_runtime.so +%{_libdir}/libmlir_c_runner_utils.so +%{_libdir}/libmlir_float16_utils.so +%{_libdir}/libmlir_runner_utils.so +%{_libdir}/libMLIR*.so + +%files -n python%{python3_pkgversion}-%{pkg_name_mlir} +%{python3_sitearch}/mlir/ +%endif +#endregion MLIR files + +#region libcxx files +%if %{with libcxx} + +%files -n %{pkg_name_libcxx} +%license libcxx/LICENSE.TXT +%doc libcxx/CREDITS.TXT libcxx/TODO.TXT +%{_libdir}/libc++.so.* + +%files -n %{pkg_name_libcxx}-devel +%{_includedir}/c++/ +%exclude %{_includedir}/c++/v1/cxxabi.h +%exclude %{_includedir}/c++/v1/__cxxabi_config.h +%{_libdir}/libc++.so +%{_libdir}/libc++.modules.json +%{_datadir}/libc++/v1/* + +%files -n %{pkg_name_libcxx}-static +%license libcxx/LICENSE.TXT +%{_libdir}/libc++.a +%{_libdir}/libc++experimental.a + +%files -n %{pkg_name_libcxxabi} +%license libcxxabi/LICENSE.TXT +%doc libcxxabi/CREDITS.TXT +%{_libdir}/libc++abi.so.* + +%files -n %{pkg_name_libcxxabi}-devel +%{_includedir}/c++/v1/cxxabi.h +%{_includedir}/c++/v1/__cxxabi_config.h +%{_libdir}/libc++abi.so + +%files -n %{pkg_name_libcxxabi}-static +%{_libdir}/libc++abi.a + +%files -n %{pkg_name_llvm_libunwind} +%license libunwind/LICENSE.TXT +%{_libdir}/libunwind.so.1 +%{_libdir}/libunwind.so.1.0 + +%files -n %{pkg_name_llvm_libunwind}-devel +%{_includedir}/llvm-libunwind/__libunwind_config.h +%{_includedir}/llvm-libunwind/libunwind.h +%{_includedir}/llvm-libunwind/libunwind.modulemap +%{_includedir}/llvm-libunwind/mach-o/compact_unwind_encoding.h +%{_includedir}/llvm-libunwind/unwind.h +%{_includedir}/llvm-libunwind/unwind_arm_ehabi.h +%{_includedir}/llvm-libunwind/unwind_itanium.h +%dir %{_libdir}/llvm-unwind +%{_libdir}/llvm-unwind/libunwind.so + +%files -n %{pkg_name_llvm_libunwind}-static +%{_libdir}/libunwind.a +%endif +#endregion libcxx files + +#region BOLT files +%if %{with build_bolt} +%files -n %{pkg_name_bolt} +%license bolt/LICENSE.TXT +%{_bindir}/llvm-bolt +%if %{maj_ver} >= 20 +%{_bindir}/llvm-bolt-binary-analysis +%endif +%{_bindir}/llvm-boltdiff +%{_bindir}/llvm-bolt-heatmap +%{_bindir}/merge-fdata +%{_bindir}/perf2bolt + +%{_libdir}/libbolt_rt_hugify.a +%{_libdir}/libbolt_rt_instr.a +%endif +#endregion BOLT files + +#endregion files + +#region changelog %changelog +* Thu Jan 23 2025 Konrad Kleine - 19.1.7-1 +* Update to LLVM 19.1.7 (RHEL-57460) + +* Mon Dec 09 2024 Konrad Kleine - 19.1.5-2 +- Disable libomp tests on s390x RHEL entirely. + +* Wed Dec 04 2024 Konrad Kleine - 19.1.5-1 +- Update to 19.1.5 +- Enable LLVM_ENABLE_ZSTD (rhbz#2321848) +- Remove HTML documentation +- Add lldb man pages +- Fix profiling after a binutils NOTE change (rhbz#2322754) +- Install i386 config files on x86_64 + +* Sat Nov 09 2024 Konrad Kleine - 19.1.3-1 +- Update to 19.1.3 + * Thu Aug 15 2024 Konrad Kleine - 18.1.8-3 - Workaround for GFX11.5 export priority (RHEL-49517) @@ -1331,3 +3745,5 @@ fi * Tue Oct 06 2015 Jan Vcelak 3.7.0-100 - initial version using cmake build system + +#endregion changelog