diff --git a/.gitignore b/.gitignore index 06c0fa6..0affb0a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -SOURCES/hans-gpg-key.asc -SOURCES/llvm-11.0.0.src.tar.xz +SOURCES/llvm-12.0.0.src.tar.xz diff --git a/.llvm.metadata b/.llvm.metadata index 10f8833..99855af 100644 --- a/.llvm.metadata +++ b/.llvm.metadata @@ -1,2 +1 @@ -32fa4b0193960f05064f2ab31b5a89c7cf48a0b9 SOURCES/hans-gpg-key.asc -5723ae20d1e6e9ccfda208cb9a8cf2f87c3a6107 SOURCES/llvm-11.0.0.src.tar.xz +dbc1cf6aa2dbdeccd7ad26c9215b56963a5686d3 SOURCES/llvm-12.0.0.src.tar.xz diff --git a/SOURCES/0001-CMake-Split-static-library-exports-into-their-own-ex.patch b/SOURCES/0001-CMake-Split-static-library-exports-into-their-own-ex.patch deleted file mode 100644 index 03a439e..0000000 --- a/SOURCES/0001-CMake-Split-static-library-exports-into-their-own-ex.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff -Naur a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake ---- a/llvm/cmake/modules/AddLLVM.cmake 2020-08-20 16:24:59.000000000 +0000 -+++ b/llvm/cmake/modules/AddLLVM.cmake 2020-09-15 07:09:05.411311520 +0000 -@@ -760,7 +760,11 @@ - if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR - (in_llvm_libs AND "llvm-libraries" IN_LIST LLVM_DISTRIBUTION_COMPONENTS) OR - NOT LLVM_DISTRIBUTION_COMPONENTS) -- set(export_to_llvmexports EXPORT LLVMExports) -+ if (ARG_SHARED) -+ set(export_to_llvmexports EXPORT LLVMExports) -+ else() -+ set(export_to_llvmexports EXPORT LLVMStaticExports) -+ endif() - set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True) - endif() - -diff -Naur a/llvm/cmake/modules/CMakeLists.txt b/llvm/cmake/modules/CMakeLists.txt ---- a/llvm/cmake/modules/CMakeLists.txt 2020-08-20 16:24:59.000000000 +0000 -+++ b/llvm/cmake/modules/CMakeLists.txt 2020-09-15 07:09:05.411311520 +0000 -@@ -79,6 +79,7 @@ - # source files are put in the same cmake directory. - set(LLVM_CONFIG_EXPORTS_FILE "${LLVM_EXPORTS_FILE}") - set(LLVM_CONFIG_EXPORTS "${LLVM_EXPORTS};${LLVM_EXPORTS_BUILDTREE_ONLY}") -+set(LLVM_CONFIG_STATIC_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMStaticExports.cmake") - set(llvm_config_include_buildtree_only_exports - "include(\"${LLVM_BUILDTREEONLY_EXPORTS_FILE}\")") - configure_file( -@@ -139,6 +140,8 @@ - if(llvm_has_exports) - install(EXPORT LLVMExports DESTINATION ${LLVM_INSTALL_PACKAGE_DIR} - COMPONENT cmake-exports) -+ install(EXPORT LLVMStaticExports DESTINATION ${LLVM_INSTALL_PACKAGE_DIR} -+ COMPONENT cmake-exports) - endif() - - install(FILES -diff -Naur a/llvm/cmake/modules/LLVMConfig.cmake.in b/llvm/cmake/modules/LLVMConfig.cmake.in ---- a/llvm/cmake/modules/LLVMConfig.cmake.in 2020-08-20 16:24:59.000000000 +0000 -+++ b/llvm/cmake/modules/LLVMConfig.cmake.in 2020-09-15 07:09:05.411311520 +0000 -@@ -103,6 +103,8 @@ - set(LLVM_EXPORTED_TARGETS "@LLVM_CONFIG_EXPORTS@") - include("@LLVM_CONFIG_EXPORTS_FILE@") - @llvm_config_include_buildtree_only_exports@ -+ -+ include("@LLVM_CONFIG_STATIC_EXPORTS_FILE@" OPTIONAL) - endif() - - # By creating intrinsics_gen, omp_gen and acc_gen here, subprojects that depend diff --git a/SOURCES/0001-CMake-Split-test-binary-exports-into-their-own-expor.patch b/SOURCES/0001-CMake-Split-test-binary-exports-into-their-own-expor.patch deleted file mode 100644 index 0ba80a8..0000000 --- a/SOURCES/0001-CMake-Split-test-binary-exports-into-their-own-expor.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff -Naur a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake ---- a/llvm/cmake/modules/AddLLVM.cmake 2020-09-15 09:12:47.596424499 +0000 -+++ b/llvm/cmake/modules/AddLLVM.cmake 2020-09-15 13:36:03.509429423 +0000 -@@ -1235,7 +1235,12 @@ - set(export_to_llvmexports) - if (${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR - NOT LLVM_DISTRIBUTION_COMPONENTS) -- set(export_to_llvmexports EXPORT LLVMExports) -+ if (${name} STREQUAL "not" OR ${name} STREQUAL "count" OR -+ ${name} STREQUAL "yaml-bench" OR ${name} STREQUAL "lli-child-target") -+ set(export_to_llvmexports EXPORT LLVMTestExports) -+ else() -+ set(export_to_llvmexports EXPORT LLVMExports) -+ endif() - set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True) - endif() - -diff -Naur a/llvm/cmake/modules/CMakeLists.txt b/llvm/cmake/modules/CMakeLists.txt ---- a/llvm/cmake/modules/CMakeLists.txt 2020-09-15 09:12:47.596424499 +0000 -+++ b/llvm/cmake/modules/CMakeLists.txt 2020-09-15 09:14:33.110044977 +0000 -@@ -80,6 +80,7 @@ - set(LLVM_CONFIG_EXPORTS_FILE "${LLVM_EXPORTS_FILE}") - set(LLVM_CONFIG_EXPORTS "${LLVM_EXPORTS};${LLVM_EXPORTS_BUILDTREE_ONLY}") - set(LLVM_CONFIG_STATIC_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMStaticExports.cmake") -+set(LLVM_CONFIG_TEST_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMTestExports.cmake") - set(llvm_config_include_buildtree_only_exports - "include(\"${LLVM_BUILDTREEONLY_EXPORTS_FILE}\")") - configure_file( -@@ -142,6 +143,8 @@ - COMPONENT cmake-exports) - install(EXPORT LLVMStaticExports DESTINATION ${LLVM_INSTALL_PACKAGE_DIR} - COMPONENT cmake-exports) -+ install(EXPORT LLVMTestExports DESTINATION ${LLVM_INSTALL_PACKAGE_DIR} -+ COMPONENT cmake-exports) - endif() - - install(FILES -diff -Naur a/llvm/cmake/modules/LLVMConfig.cmake.in b/llvm/cmake/modules/LLVMConfig.cmake.in ---- a/llvm/cmake/modules/LLVMConfig.cmake.in 2020-09-15 09:12:47.597424505 +0000 -+++ b/llvm/cmake/modules/LLVMConfig.cmake.in 2020-09-15 09:14:54.261169357 +0000 -@@ -105,6 +105,7 @@ - @llvm_config_include_buildtree_only_exports@ - - include("@LLVM_CONFIG_STATIC_EXPORTS_FILE@" OPTIONAL) -+ include("@LLVM_CONFIG_TEST_EXPORTS_FILE@" OPTIONAL) - endif() - - # By creating intrinsics_gen, omp_gen and acc_gen here, subprojects that depend diff --git a/SOURCES/0001-PATCH-llvm-Do-not-set-CMAKE_CXX_VISIBILITY_PRESET-to.patch b/SOURCES/0001-PATCH-llvm-Do-not-set-CMAKE_CXX_VISIBILITY_PRESET-to.patch new file mode 100644 index 0000000..3a48faf --- /dev/null +++ b/SOURCES/0001-PATCH-llvm-Do-not-set-CMAKE_CXX_VISIBILITY_PRESET-to.patch @@ -0,0 +1,25 @@ +From f3eb34e388017c4207c7c8cc29e2222aefe7471e Mon Sep 17 00:00:00 2001 +From: serge-sans-paille +Date: Wed, 12 May 2021 18:09:03 +0200 +Subject: [PATCH] bla bla + +--- + llvm/include/llvm/ADT/Any.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/llvm/include/llvm/ADT/Any.h b/llvm/include/llvm/ADT/Any.h +index 0aded62..6fa403b 100644 +--- a/llvm/include/llvm/ADT/Any.h ++++ b/llvm/include/llvm/ADT/Any.h +@@ -23,7 +23,7 @@ + + namespace llvm { + +-class Any { ++class LLVM_EXTERNAL_VISIBILITY Any { + template struct TypeId { static const char Id; }; + + struct StorageBase { +-- +1.8.3.1 + diff --git a/SOURCES/0001-PATCH-llvm-Make-source-interleave-prefix-test-case-c.patch b/SOURCES/0001-PATCH-llvm-Make-source-interleave-prefix-test-case-c.patch new file mode 100644 index 0000000..526b25f --- /dev/null +++ b/SOURCES/0001-PATCH-llvm-Make-source-interleave-prefix-test-case-c.patch @@ -0,0 +1,29 @@ +From 60760d66030695105bcf4364f22b7f6053a25253 Mon Sep 17 00:00:00 2001 +From: serge-sans-paille +Date: Thu, 8 Apr 2021 09:33:37 +0200 +Subject: [PATCH] [PATCH][llvm] Make source-interleave-prefix test case + compatible with llvm-test + +llvm-test runs test from a directory that's not the upstream one, and that leads +to some false positive. Workaround this by forcing the current working +directory. +--- + llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test b/llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test +index 23ce55a..d260ee2 100644 +--- a/llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test ++++ b/llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test +@@ -5,7 +5,7 @@ + + ; RUN: sed -e "s,SRC_COMPDIR,./Inputs,g" %p/Inputs/source-interleave.ll > %t-relative-path.ll + ; RUN: llc -o %t-relative-path.o -filetype=obj -mtriple=x86_64-pc-linux %t-relative-path.ll +-; RUN: llvm-objdump --prefix myprefix --source %t-relative-path.o 2>&1 | \ ++; RUN: mkdir -p %t0 && cd %t0 && llvm-objdump --prefix myprefix --source %t-relative-path.o 2>&1 | \ + ; RUN: FileCheck %s --check-prefix=CHECK-BROKEN-PREFIX -DFILE=%t-relative-path.o -DPREFIX=. + ; CHECK-BROKEN-PREFIX: warning: '[[FILE]]': failed to find source [[PREFIX]]/Inputs/source-interleave-x86_64.c + +-- +1.8.3.1 + diff --git a/SOURCES/0001-SystemZ-Use-LA-instead-of-AGR-in-eliminateFrameIndex.patch b/SOURCES/0001-SystemZ-Use-LA-instead-of-AGR-in-eliminateFrameIndex.patch deleted file mode 100644 index 80d6a1e..0000000 --- a/SOURCES/0001-SystemZ-Use-LA-instead-of-AGR-in-eliminateFrameIndex.patch +++ /dev/null @@ -1,166 +0,0 @@ -From d851495f2fe614c4c860bda1bd3c80bfbe48360b Mon Sep 17 00:00:00 2001 -From: Jonas Paulsson -Date: Thu, 8 Oct 2020 13:18:29 +0200 -Subject: [PATCH] [SystemZ] Use LA instead of AGR in eliminateFrameIndex(). - -Since AGR clobbers CC it should not be used here. - -Fixes https://bugs.llvm.org/show_bug.cgi?id=47736. - -Review: Ulrich Weigand -Differential Revision: https://reviews.llvm.org/D89034 ---- - .../Target/SystemZ/SystemZRegisterInfo.cpp | 4 +-- - llvm/test/CodeGen/SystemZ/frame-14.ll | 26 +++++++++---------- - llvm/test/CodeGen/SystemZ/frame-16.ll | 4 +-- - 3 files changed, 17 insertions(+), 17 deletions(-) - -diff --git a/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp b/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp -index 53b06c6e7e6d..88212e52460f 100644 ---- a/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp -+++ b/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp -@@ -322,8 +322,8 @@ SystemZRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI, - // Load the high offset into the scratch register and use it as - // an index. - TII->loadImmediate(MBB, MI, ScratchReg, HighOffset); -- BuildMI(MBB, MI, DL, TII->get(SystemZ::AGR),ScratchReg) -- .addReg(ScratchReg, RegState::Kill).addReg(BasePtr); -+ BuildMI(MBB, MI, DL, TII->get(SystemZ::LA), ScratchReg) -+ .addReg(BasePtr, RegState::Kill).addImm(0).addReg(ScratchReg); - } - - // Use the scratch register as the base. It then dies here. -diff --git a/llvm/test/CodeGen/SystemZ/frame-14.ll b/llvm/test/CodeGen/SystemZ/frame-14.ll -index e70731249b42..193ff81123c5 100644 ---- a/llvm/test/CodeGen/SystemZ/frame-14.ll -+++ b/llvm/test/CodeGen/SystemZ/frame-14.ll -@@ -85,13 +85,13 @@ define void @f3() { - define void @f4() { - ; CHECK-NOFP-LABEL: f4: - ; CHECK-NOFP: llilh %r1, 8 --; CHECK-NOFP: agr %r1, %r15 -+; CHECK-NOFP: la %r1, 0(%r1,%r15) - ; CHECK-NOFP: mvi 0(%r1), 42 - ; CHECK-NOFP: br %r14 - ; - ; CHECK-FP-LABEL: f4: - ; CHECK-FP: llilh %r1, 8 --; CHECK-FP: agr %r1, %r11 -+; CHECK-FP: la %r1, 0(%r1,%r11) - ; CHECK-FP: mvi 0(%r1), 42 - ; CHECK-FP: br %r14 - %region1 = alloca [524104 x i8], align 8 -@@ -108,13 +108,13 @@ define void @f4() { - define void @f5() { - ; CHECK-NOFP-LABEL: f5: - ; CHECK-NOFP: llilh %r1, 8 --; CHECK-NOFP: agr %r1, %r15 -+; CHECK-NOFP: la %r1, 0(%r1,%r15) - ; CHECK-NOFP: mvi 4095(%r1), 42 - ; CHECK-NOFP: br %r14 - ; - ; CHECK-FP-LABEL: f5: - ; CHECK-FP: llilh %r1, 8 --; CHECK-FP: agr %r1, %r11 -+; CHECK-FP: la %r1, 0(%r1,%r11) - ; CHECK-FP: mvi 4095(%r1), 42 - ; CHECK-FP: br %r14 - %region1 = alloca [524104 x i8], align 8 -@@ -130,13 +130,13 @@ define void @f5() { - define void @f6() { - ; CHECK-NOFP-LABEL: f6: - ; CHECK-NOFP: llilh %r1, 8 --; CHECK-NOFP: agr %r1, %r15 -+; CHECK-NOFP: la %r1, 0(%r1,%r15) - ; CHECK-NOFP: mviy 4096(%r1), 42 - ; CHECK-NOFP: br %r14 - ; - ; CHECK-FP-LABEL: f6: - ; CHECK-FP: llilh %r1, 8 --; CHECK-FP: agr %r1, %r11 -+; CHECK-FP: la %r1, 0(%r1,%r11) - ; CHECK-FP: mviy 4096(%r1), 42 - ; CHECK-FP: br %r14 - %region1 = alloca [524104 x i8], align 8 -@@ -155,13 +155,13 @@ define void @f6() { - define void @f7() { - ; CHECK-NOFP-LABEL: f7: - ; CHECK-NOFP: llilh %r1, 23 --; CHECK-NOFP: agr %r1, %r15 -+; CHECK-NOFP: la %r1, 0(%r1,%r15) - ; CHECK-NOFP: mviy 65535(%r1), 42 - ; CHECK-NOFP: br %r14 - ; - ; CHECK-FP-LABEL: f7: - ; CHECK-FP: llilh %r1, 23 --; CHECK-FP: agr %r1, %r11 -+; CHECK-FP: la %r1, 0(%r1,%r11) - ; CHECK-FP: mviy 65535(%r1), 42 - ; CHECK-FP: br %r14 - %region1 = alloca [1048400 x i8], align 8 -@@ -178,13 +178,13 @@ define void @f7() { - define void @f8() { - ; CHECK-NOFP-LABEL: f8: - ; CHECK-NOFP: llilh %r1, 24 --; CHECK-NOFP: agr %r1, %r15 -+; CHECK-NOFP: la %r1, 0(%r1,%r15) - ; CHECK-NOFP: mvi 7(%r1), 42 - ; CHECK-NOFP: br %r14 - ; - ; CHECK-FP-LABEL: f8: - ; CHECK-FP: llilh %r1, 24 --; CHECK-FP: agr %r1, %r11 -+; CHECK-FP: la %r1, 0(%r1,%r11) - ; CHECK-FP: mvi 7(%r1), 42 - ; CHECK-FP: br %r14 - %region1 = alloca [1048408 x i8], align 8 -@@ -233,7 +233,7 @@ define void @f10(i32 *%vptr) { - ; CHECK-NOFP-LABEL: f10: - ; CHECK-NOFP: stg [[REGISTER:%r[1-9][0-4]?]], [[OFFSET:160|168]](%r15) - ; CHECK-NOFP: llilh [[REGISTER]], 8 --; CHECK-NOFP: agr [[REGISTER]], %r15 -+; CHECK-NOFP: la [[REGISTER]], 0([[REGISTER]],%r15) - ; CHECK-NOFP: mvi 0([[REGISTER]]), 42 - ; CHECK-NOFP: lg [[REGISTER]], [[OFFSET]](%r15) - ; CHECK-NOFP: br %r14 -@@ -241,7 +241,7 @@ define void @f10(i32 *%vptr) { - ; CHECK-FP-LABEL: f10: - ; CHECK-FP: stg [[REGISTER:%r[1-9][0-4]?]], [[OFFSET:160|168]](%r11) - ; CHECK-FP: llilh [[REGISTER]], 8 --; CHECK-FP: agr [[REGISTER]], %r11 -+; CHECK-FP: la [[REGISTER]], 0([[REGISTER]],%r11) - ; CHECK-FP: mvi 0([[REGISTER]]), 42 - ; CHECK-FP: lg [[REGISTER]], [[OFFSET]](%r11) - ; CHECK-FP: br %r14 -@@ -273,7 +273,7 @@ define void @f11(i32 *%vptr) { - ; CHECK-NOFP: stmg %r6, %r15, - ; CHECK-NOFP: stg [[REGISTER:%r[1-9][0-4]?]], [[OFFSET:160|168]](%r15) - ; CHECK-NOFP: llilh [[REGISTER]], 8 --; CHECK-NOFP: agr [[REGISTER]], %r15 -+; CHECK-NOFP: la [[REGISTER]], 0([[REGISTER]],%r15) - ; CHECK-NOFP: mvi 0([[REGISTER]]), 42 - ; CHECK-NOFP: lg [[REGISTER]], [[OFFSET]](%r15) - ; CHECK-NOFP: lmg %r6, %r15, -diff --git a/llvm/test/CodeGen/SystemZ/frame-16.ll b/llvm/test/CodeGen/SystemZ/frame-16.ll -index ae8a041ae110..a95c58207afb 100644 ---- a/llvm/test/CodeGen/SystemZ/frame-16.ll -+++ b/llvm/test/CodeGen/SystemZ/frame-16.ll -@@ -311,13 +311,13 @@ define void @f11(i32 *%vptr, i8 %byte) { - define void @f12(i8 %byte, i64 %index) { - ; CHECK-NOFP-LABEL: f12: - ; CHECK-NOFP: llilh %r1, 8 --; CHECK-NOFP: agr %r1, %r15 -+; CHECK-NOFP: la %r1, 0(%r1,%r15) - ; CHECK-NOFP: stc %r2, 0(%r3,%r1) - ; CHECK-NOFP: br %r14 - ; - ; CHECK-FP-LABEL: f12: - ; CHECK-FP: llilh %r1, 8 --; CHECK-FP: agr %r1, %r11 -+; CHECK-FP: la %r1, 0(%r1,%r11) - ; CHECK-FP: stc %r2, 0(%r3,%r1) - ; CHECK-FP: br %r14 - %region1 = alloca [524104 x i8], align 8 --- -2.26.2 - diff --git a/SOURCES/error-opening-permission.patch b/SOURCES/error-opening-permission.patch index faf09f0..b83a128 100644 --- a/SOURCES/error-opening-permission.patch +++ b/SOURCES/error-opening-permission.patch @@ -9,4 +9,4 @@ diff -Naur a/llvm/test/tools/llvm-ar/error-opening-permission.test b/llvm/test/t +# RUN: echo > %t/permission.b || not llvm-ar p %t/permission.b 2>&1 | \ # RUN: FileCheck %s --check-prefix=NO-PERMISSION -DARCHIVE=%t/permission.b - # NO-PERMISSION: error: unable to open '[[ARCHIVE]]': {{[pP]}}ermission denied + # NO-PERMISSION: error: unable to open '[[ARCHIVE]]': {{.*}}{{[pP]}}ermission denied diff --git a/SOURCES/llvm-11.0.0.src.tar.xz.sig b/SOURCES/llvm-11.0.0.src.tar.xz.sig deleted file mode 100644 index a7df9b4..0000000 Binary files a/SOURCES/llvm-11.0.0.src.tar.xz.sig and /dev/null differ diff --git a/SOURCES/llvm-12.0.0.src.tar.xz.sig b/SOURCES/llvm-12.0.0.src.tar.xz.sig new file mode 100644 index 0000000..f6fad36 Binary files /dev/null and b/SOURCES/llvm-12.0.0.src.tar.xz.sig differ diff --git a/SPECS/llvm.spec b/SPECS/llvm.spec index ad09a1b..56c9e89 100644 --- a/SPECS/llvm.spec +++ b/SPECS/llvm.spec @@ -8,20 +8,17 @@ %bcond_with compat_build -%global _smp_mflags -j8 - %global llvm_libdir %{_libdir}/%{name} %global build_llvm_libdir %{buildroot}%{llvm_libdir} -#%%global rc_ver 6 -%global baserelease 2 +#%%global rc_ver 5 %global llvm_srcdir llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src -%global maj_ver 11 +%global maj_ver 12 %global min_ver 0 %global patch_ver 0 %if %{with compat_build} -%global pkg_name llvm%{maj_ver}.%{min_ver} -%global exec_suffix -%{maj_ver}.%{min_ver} +%global pkg_name llvm%{maj_ver} +%global exec_suffix -%{maj_ver} %global install_prefix %{_libdir}/%{name} %global install_bindir %{install_prefix}/bin %global install_includedir %{install_prefix}/include @@ -34,10 +31,20 @@ %global pkg_name llvm %global install_prefix /usr %global install_libdir %{_libdir} +%global pkg_bindir %{_bindir} %global pkg_libdir %{install_libdir} +%global exec_suffix %{nil} +%endif + +%if 0%{?rhel} +%global targets_to_build "X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;ARM;Mips;BPF;WebAssembly" +%global experimental_targets_to_build "" +%global _smp_mflags -j8 +%else +%global targets_to_build "all" +%global experimental_targets_to_build "AVR" %endif -%global build_install_prefix %{buildroot}%{install_prefix} %if !0%{?rhel} # libedit-devel is a buildroot-only package in RHEL8, so we can't have a @@ -45,25 +52,25 @@ %global use_libedit 1 %endif +%global build_install_prefix %{buildroot}%{install_prefix} + Name: %{pkg_name} -Version: %{maj_ver}.%{min_ver}.%{patch_ver} -Release: %{baserelease}%{?rc_ver:.rc%{rc_ver}}%{?dist} +Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}} +Release: 1%{?dist} Summary: The Low Level Virtual Machine License: NCSA URL: http://llvm.org Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}%{?rc_ver:-rc%{rc_ver}}/%{llvm_srcdir}.tar.xz Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}%{?rc_ver:-rc%{rc_ver}}/%{llvm_srcdir}.tar.xz.sig -Source2: https://prereleases.llvm.org/%{version}/hans-gpg-key.asc + %if %{without compat_build} Source3: run-lit-tests Source4: lit.fedora.cfg.py %endif -# Fix coreos-installer test crash on s390x (rhbz#1883457), https://reviews.llvm.org/D89034 -Patch1: 0001-SystemZ-Use-LA-instead-of-AGR-in-eliminateFrameIndex.patch -Patch2: 0001-CMake-Split-static-library-exports-into-their-own-ex.patch -Patch3: 0001-CMake-Split-test-binary-exports-into-their-own-expor.patch +Patch0: 0001-PATCH-llvm-Make-source-interleave-prefix-test-case-c.patch +Patch1: 0001-PATCH-llvm-Do-not-set-CMAKE_CXX_VISIBILITY_PRESET-to.patch # RHEL-specific patches. Patch101: 0001-Deactivate-markdown-doc.patch @@ -98,6 +105,7 @@ BuildRequires: libedit-devel %endif # We need python3-devel for pathfix.py. BuildRequires: python3-devel +BuildRequires: python3-setuptools Requires: %{name}-libs%{?_isa} = %{version}-%{release} @@ -124,8 +132,10 @@ Requires: libedit-devel # 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: llvm-static%{?_isa} = %{version}-%{release} -Requires: llvm-test%{?_isa} = %{version}-%{release} +Requires: %{name}-static%{?_isa} = %{version}-%{release} +%if %{without compat_build} +Requires: %{name}-test%{?_isa} = %{version}-%{release} +%endif Requires(post): %{_sbindir}/alternatives @@ -155,6 +165,8 @@ Shared libraries for the LLVM compiler infrastructure. Summary: LLVM static libraries Conflicts: %{name}-devel < 8 +Provides: llvm-static(major) = %{maj_ver} + %description static Static libraries for the LLVM compiler infrastructure. @@ -199,25 +211,23 @@ pathfix.py -i %{__python3} -pn \ find -name '*.md' | while read md; do sed -r -e 's/^( )*\* /\n\1\* /' ${md} | pandoc -f markdown -o ${md%.md}.rst ; done %build -mkdir -p _build -cd _build + +mkdir -p %{_vpath_builddir} +cd %{_vpath_builddir} %ifarch s390 %{arm} %ix86 # Decrease debuginfo verbosity to reduce memory consumption during final library linking %global optflags %(echo %{optflags} | sed 's/-g /-g1 /') %endif +export LDFLAGS="${LDFLAGS} -Wl,--build-id=md5" + # force off shared libs as cmake macros turns it on. -# -# -DCMAKE_INSTALL_RPATH=";" is a workaround for llvm manually setting the -# rpath of libraries and binaries. llvm will skip the manual setting -# if CMAKE_INSTALL_RPATH is set to a value, but cmake interprets this value -# as nothing, so it sets the rpath to "" when installing. %cmake .. -G Ninja \ -DBUILD_SHARED_LIBS:BOOL=OFF \ -DLLVM_PARALLEL_LINK_JOBS=1 \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DCMAKE_INSTALL_RPATH=";" \ + -DCMAKE_SKIP_RPATH:BOOL=ON \ %ifarch s390 %{arm} %ix86 -DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ @@ -230,14 +240,16 @@ cd _build %endif %endif \ - -DLLVM_TARGETS_TO_BUILD="X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;ARM;Mips;BPF" \ + -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} \ %endif + -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=%{experimental_targets_to_build} \ \ -DLLVM_BUILD_RUNTIME:BOOL=ON \ \ @@ -285,26 +297,22 @@ cd _build %ninja_build %install -%ninja_install -C _build +%ninja_install -C %{_vpath_builddir} - -%if %{without compat_build} mkdir -p %{buildroot}/%{_bindir} -mv %{buildroot}/%{_bindir}/llvm-config %{buildroot}/%{_bindir}/llvm-config-%{__isa_bits} -# ghost presence -touch %{buildroot}%{_bindir}/llvm-config +%if %{without compat_build} # Fix some man pages -ln -s llvm-config.1 %{buildroot}%{_mandir}/man1/llvm-config-%{__isa_bits}.1 -mv %{buildroot}%{_mandir}/man1/tblgen.1 %{buildroot}%{_mandir}/man1/llvm-tblgen.1 +ln -s llvm-config.1 %{buildroot}%{_mandir}/man1/llvm-config%{exec_suffix}-%{__isa_bits}.1 +mv %{buildroot}%{_mandir}/man1/*tblgen.1 %{buildroot}%{_mandir}/man1/llvm-tblgen.1 # Install binaries needed for lit tests %global test_binaries llvm-isel-fuzzer llvm-opt-fuzzer for f in %{test_binaries} do - install -m 0755 ./_build/bin/$f %{buildroot}%{_bindir} + install -m 0755 %{_vpath_builddir}/bin/$f %{buildroot}%{_bindir} done # Remove testing of update utility tools @@ -314,9 +322,9 @@ rm -rf test/tools/UpdateTestChecks # Install libraries needed for unittests %if 0%{?__isa_bits} == 64 -%global build_libdir _build/lib64 +%global build_libdir %{_vpath_builddir}/lib64 %else -%global build_libdir _build/lib +%global build_libdir %{_vpath_builddir}/lib %endif install %{build_libdir}/libLLVMTestingSupport.a %{buildroot}%{_libdir} @@ -341,8 +349,8 @@ install -m 0644 docs/CommandGuide/dsymutil.rst %{install_srcdir}/docs/CommandGui # Generate lit config files. Strip off the last lines that initiates the # test run, so we can customize the configuration. -head -n -2 _build/test/lit.site.cfg.py >> %{lit_cfg} -head -n -2 _build/test/Unit/lit.site.cfg.py >> %{lit_unit_cfg} +head -n -2 %{_vpath_builddir}/test/lit.site.cfg.py >> %{lit_cfg} +head -n -2 %{_vpath_builddir}/test/Unit/lit.site.cfg.py >> %{lit_unit_cfg} # Install custom fedora config file cp %{SOURCE4} %{buildroot}%{lit_fedora_cfg} @@ -367,7 +375,7 @@ tar --sort=name --mtime='UTC 2020-01-01' -c test/ | gzip -n > %{install_srcdir}/ # Install the unit test binaries mkdir -p %{build_llvm_libdir} -cp -R _build/unittests %{build_llvm_libdir}/ +cp -R %{_vpath_builddir}/unittests %{build_llvm_libdir}/ rm -rf `find %{build_llvm_libdir} -iname 'cmake*'` # Install libraries used for testing @@ -388,7 +396,6 @@ ln -s %{_libdir}/LLVMgold.so %{buildroot}%{_libdir}/bfd-plugins/ %else # Add version suffix to binaries -mkdir -p %{buildroot}/%{_bindir} for f in %{buildroot}/%{install_bindir}/*; do filename=`basename $f` ln -s ../../../%{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename%{exec_suffix} @@ -400,7 +407,6 @@ ln -s ../../../%{install_includedir}/llvm %{buildroot}/%{pkg_includedir}/llvm ln -s ../../../%{install_includedir}/llvm-c %{buildroot}/%{pkg_includedir}/llvm-c # Fix multi-lib -mv %{buildroot}%{_bindir}/llvm-config{%{exec_suffix},%{exec_suffix}-%{__isa_bits}} %multilib_fix_c_header --file %{install_includedir}/llvm/Config/llvm-config.h # Create ld.so.conf.d entry @@ -421,40 +427,59 @@ rm -Rf %{build_install_prefix}/share/opt-viewer %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 +# points to the original file. + +%if %{without compat_build} + +mv %{buildroot}/%{pkg_bindir}/llvm-config %{buildroot}/%{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} + +%else + +rm %{buildroot}%{_bindir}/llvm-config%{exec_suffix} +(cd %{buildroot}/%{pkg_bindir} ; ln -s llvm-config llvm-config%{exec_suffix}-%{__isa_bits} ) + +%endif + +# ghost presence +touch %{buildroot}%{_bindir}/llvm-config%{exec_suffix} + + %check -# TODO: Fix test failures on arm -# FIXME: use %%cmake_build instead of %%__ninja -LD_LIBRARY_PATH=%{buildroot}/%{_libdir} %{__ninja} check-all -C _build || \ +# TODO: Fix the failures below %ifarch %{arm} - : -%else - false +rm test/tools/llvm-readobj/ELF/dependent-libraries.test %endif -%ldconfig_scriptlets libs +# non reproducible errors +rm test/tools/dsymutil/X86/swift-interface.test -%if %{without compat_build} +# FIXME: use %%cmake_build instead of %%__ninja +LD_LIBRARY_PATH=%{buildroot}/%{pkg_libdir} %{__ninja} check-all -C %{_vpath_builddir} + +%ldconfig_scriptlets libs %post devel -%{_sbindir}/update-alternatives --install %{_bindir}/llvm-config llvm-config %{_bindir}/llvm-config-%{__isa_bits} %{__isa_bits} +%{_sbindir}/update-alternatives --install %{_bindir}/llvm-config%{exec_suffix} llvm-config%{exec_suffix} %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits} %postun devel if [ $1 -eq 0 ]; then - %{_sbindir}/update-alternatives --remove llvm-config %{_bindir}/llvm-config-%{__isa_bits} + %{_sbindir}/update-alternatives --remove llvm-config%{exec_suffix} %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} fi -%endif - %files %license LICENSE.TXT %exclude %{_mandir}/man1/llvm-config* %{_mandir}/man1/* %{_bindir}/* +%exclude %{_bindir}/llvm-config%{exec_suffix} +%exclude %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} + %if %{without compat_build} -%exclude %{_bindir}/llvm-config -%exclude %{_bindir}/llvm-config-%{__isa_bits} %exclude %{_bindir}/not %exclude %{_bindir}/count %exclude %{_bindir}/yaml-bench @@ -463,7 +488,6 @@ fi %exclude %{_bindir}/llvm-opt-fuzzer %{_datadir}/opt-viewer %else -%exclude %{pkg_bindir}/llvm-config %{pkg_bindir} %endif @@ -490,20 +514,17 @@ fi %files devel %license LICENSE.TXT -%if %{without compat_build} -%ghost %{_bindir}/llvm-config -%{_bindir}/llvm-config-%{__isa_bits} + +%ghost %{_bindir}/llvm-config%{exec_suffix} +%{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{_mandir}/man1/llvm-config* + +%if %{without compat_build} %{_includedir}/llvm %{_includedir}/llvm-c %{_libdir}/libLLVM.so %{_libdir}/cmake/llvm -%exclude %{_libdir}/cmake/llvm/LLVMStaticExports.cmake -%exclude %{_libdir}/cmake/llvm/LLVMTestExports.cmake %else -%{_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} -%{pkg_bindir}/llvm-config -%{_mandir}/man1/llvm-config%{exec_suffix}.1.gz %{install_includedir}/llvm %{install_includedir}/llvm-c %{pkg_includedir}/llvm @@ -522,7 +543,6 @@ fi %if %{without compat_build} %{_libdir}/*.a %exclude %{_libdir}/libLLVMTestingSupport.a -%{_libdir}/cmake/llvm/LLVMStaticExports.cmake %else %{_libdir}/%{name}/lib/*.a %endif @@ -547,7 +567,6 @@ fi %{_bindir}/llvm-opt-fuzzer %{_libdir}/BugpointPasses.so %{_libdir}/LLVMHello.so -%{_libdir}/cmake/llvm/LLVMTestExports.cmake %files googletest %license LICENSE.TXT @@ -557,6 +576,9 @@ fi %endif %changelog +* Tue May 25 2021 sguelton@redhat.com - 12.0.0-1 +- Remove obsolete patch + * Thu Oct 29 2020 sguelton@redhat.com - 11.0.0-2 - Remove obsolete patch