From 14fcfe5e706a4ca90c0b10274eda78f53d2dbe05 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Wed, 22 May 2024 13:18:53 +0000 Subject: [PATCH] import UBI llvm-17.0.6-2.module+el8.10.0+21256+978ccea6 --- .gitignore | 9 +- .llvm.metadata | 9 +- SOURCES/0001-Deactivate-markdown-doc.patch | 25 -- ...01-PEI-Don-t-zero-out-noreg-operands.patch | 74 +++++ ...abstract-variable.ll-test-on-ppc64le.patch | 33 -- SOURCES/0101-Deactivate-markdown-doc.patch | 26 ++ SOURCES/cmake-15.0.7.src.tar.xz.sig | Bin 566 -> 0 bytes SOURCES/lit.fedora.cfg.py | 17 - SOURCES/llvm-15.0.7.src.tar.xz.sig | Bin 566 -> 0 bytes SOURCES/release-keys.asc | 104 ++++++ SOURCES/run-lit-tests | 59 ---- SPECS/llvm.spec | 296 +++++++++++------- 12 files changed, 397 insertions(+), 255 deletions(-) delete mode 100644 SOURCES/0001-Deactivate-markdown-doc.patch create mode 100644 SOURCES/0001-PEI-Don-t-zero-out-noreg-operands.patch delete mode 100644 SOURCES/0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch create mode 100644 SOURCES/0101-Deactivate-markdown-doc.patch delete mode 100644 SOURCES/cmake-15.0.7.src.tar.xz.sig delete mode 100644 SOURCES/lit.fedora.cfg.py delete mode 100644 SOURCES/llvm-15.0.7.src.tar.xz.sig create mode 100644 SOURCES/release-keys.asc delete mode 100755 SOURCES/run-lit-tests diff --git a/.gitignore b/.gitignore index d01d408..f45c346 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ -SOURCES/cmake-15.0.7.src.tar.xz -SOURCES/llvm-15.0.7.src.tar.xz -SOURCES/release-keys.asc +SOURCES/cmake-17.0.6.src.tar.xz +SOURCES/cmake-17.0.6.src.tar.xz.sig +SOURCES/llvm-17.0.6.src.tar.xz +SOURCES/llvm-17.0.6.src.tar.xz.sig +SOURCES/third-party-17.0.6.src.tar.xz +SOURCES/third-party-17.0.6.src.tar.xz.sig diff --git a/.llvm.metadata b/.llvm.metadata index f22ad14..581cbc0 100644 --- a/.llvm.metadata +++ b/.llvm.metadata @@ -1,3 +1,6 @@ -8f06060871953422820098346da9a3b63b90120d SOURCES/cmake-15.0.7.src.tar.xz -497ca3b2010cc0e3e38bc9dc6dda19041dbd7066 SOURCES/llvm-15.0.7.src.tar.xz -347bdd5ee6d6b93c9644c268511815912c0fb2dc SOURCES/release-keys.asc +4b397344260c934e687be7efa0f8456a9dd46f44 SOURCES/cmake-17.0.6.src.tar.xz +fa31d348b6780478403484e22139d25f403503d4 SOURCES/cmake-17.0.6.src.tar.xz.sig +860a3605f08a0a56a8de4e073e26a259871623a6 SOURCES/llvm-17.0.6.src.tar.xz +2ad479ab00a6d5e61ecb953997cfeef6650a687a SOURCES/llvm-17.0.6.src.tar.xz.sig +a35dc22cd3d983a556f6e4a63c8dac6a84e01caf SOURCES/third-party-17.0.6.src.tar.xz +12128cdab7414aeedd573c61cbc2fa82e75491db SOURCES/third-party-17.0.6.src.tar.xz.sig diff --git a/SOURCES/0001-Deactivate-markdown-doc.patch b/SOURCES/0001-Deactivate-markdown-doc.patch deleted file mode 100644 index 92e048d..0000000 --- a/SOURCES/0001-Deactivate-markdown-doc.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff -Naur a/llvm/docs/conf.py b/llvm/docs/conf.py ---- a/llvm/docs/conf.py 2020-09-15 09:12:24.318287611 +0000 -+++ b/llvm/docs/conf.py 2020-09-15 15:01:00.025893199 +0000 -@@ -36,20 +36,7 @@ - '.rst': 'restructuredtext', - } - --try: -- import recommonmark --except ImportError: -- # manpages do not use any .md sources -- if not tags.has('builder-man'): -- raise --else: -- import sphinx -- if sphinx.version_info >= (3, 0): -- # This requires 0.5 or later. -- extensions.append('recommonmark') -- else: -- source_parsers = {'.md': 'recommonmark.parser.CommonMarkParser'} -- source_suffix['.md'] = 'markdown' -+import sphinx - - # The encoding of source files. - #source_encoding = 'utf-8-sig' diff --git a/SOURCES/0001-PEI-Don-t-zero-out-noreg-operands.patch b/SOURCES/0001-PEI-Don-t-zero-out-noreg-operands.patch new file mode 100644 index 0000000..0f16465 --- /dev/null +++ b/SOURCES/0001-PEI-Don-t-zero-out-noreg-operands.patch @@ -0,0 +1,74 @@ +From 9d1f05a7b8537deb5f626cd1b7b26ef2678f4c8e Mon Sep 17 00:00:00 2001 +From: Arthur Eubanks +Date: Thu, 27 Jul 2023 13:27:58 -0700 +Subject: [PATCH] [PEI] Don't zero out noreg operands + +A tail call may have $noreg operands. + +Fixes a crash. + +Reviewed By: xgupta + +Differential Revision: https://reviews.llvm.org/D156485 + +(cherry picked from commit f800c1f3b207e7bcdc8b4c7192928d9a078242a0) +--- + llvm/lib/CodeGen/PrologEpilogInserter.cpp | 9 +++++++-- + llvm/test/CodeGen/X86/zero-call-used-regs.ll | 14 ++++++++++++++ + 2 files changed, 21 insertions(+), 2 deletions(-) + +diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp +index e323aaaeefaf..49047719fdaa 100644 +--- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp ++++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp +@@ -1285,6 +1285,8 @@ void PEI::insertZeroCallUsedRegs(MachineFunction &MF) { + continue; + + MCRegister Reg = MO.getReg(); ++ if (!Reg) ++ continue; + + // This picks up sibling registers (e.q. %al -> %ah). + for (MCRegUnit Unit : TRI.regunits(Reg)) +@@ -1308,8 +1310,11 @@ void PEI::insertZeroCallUsedRegs(MachineFunction &MF) { + if (!MO.isReg()) + continue; + +- for (const MCPhysReg &Reg : +- TRI.sub_and_superregs_inclusive(MO.getReg())) ++ MCRegister Reg = MO.getReg(); ++ if (!Reg) ++ continue; ++ ++ for (const MCPhysReg Reg : TRI.sub_and_superregs_inclusive(Reg)) + RegsToZero.reset(Reg); + } + } +diff --git a/llvm/test/CodeGen/X86/zero-call-used-regs.ll b/llvm/test/CodeGen/X86/zero-call-used-regs.ll +index 63d51c916bb9..97ad5ce9c8cb 100644 +--- a/llvm/test/CodeGen/X86/zero-call-used-regs.ll ++++ b/llvm/test/CodeGen/X86/zero-call-used-regs.ll +@@ -241,6 +241,20 @@ entry: + ret i32 %x + } + ++define dso_local void @tailcall(ptr %p) local_unnamed_addr #0 "zero-call-used-regs"="used-gpr" { ++; I386-LABEL: tailcall: ++; I386: # %bb.0: ++; I386-NEXT: movl {{[0-9]+}}(%esp), %eax ++; I386-NEXT: jmpl *(%eax) # TAILCALL ++; ++; X86-64-LABEL: tailcall: ++; X86-64: # %bb.0: ++; X86-64-NEXT: jmpq *(%rdi) # TAILCALL ++ %c = load ptr, ptr %p ++ tail call void %c() ++ ret void ++} ++ + ; Don't emit zeroing registers in "main" function. + define dso_local i32 @main() local_unnamed_addr #1 { + ; I386-LABEL: main: +-- +2.43.0 + diff --git a/SOURCES/0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch b/SOURCES/0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch deleted file mode 100644 index 0f4acd3..0000000 --- a/SOURCES/0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 01529ba2c76be37e41713cf7f3eca8b61833e320 Mon Sep 17 00:00:00 2001 -From: Tom Stellard -Date: Tue, 9 Nov 2021 15:05:07 +0100 -Subject: [PATCH] XFAIL missing-abstract-variable.ll test on ppc64le - -It's seems the strategy with this test is to XFAIL it on all -architectures that it fails on. I wonder if we should be passing -it a specific triple? Also, from what I can tell, this tests only -runs when llvm is configured with LLVM_DEFAULT_TARGET_TRIPLE set -to a non-empty value, which is why it may not fail in every build -configuration. - -Differential Revision: https://reviews.llvm.org/D109806 ---- - llvm/test/DebugInfo/Generic/missing-abstract-variable.ll | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/llvm/test/DebugInfo/Generic/missing-abstract-variable.ll b/llvm/test/DebugInfo/Generic/missing-abstract-variable.ll -index 8f8d404..07a8778 100644 ---- a/llvm/test/DebugInfo/Generic/missing-abstract-variable.ll -+++ b/llvm/test/DebugInfo/Generic/missing-abstract-variable.ll -@@ -4,7 +4,7 @@ - ; powerpc64 (and on x86_64 at at least -O2). Presumably this is a SelectionDAG - ; issue. - ; FIXME: arm64 is an alias for aarch64 on macs, apparently? --; XFAIL: powerpc64, aarch64, arm64, hexagon, riscv, sparc -+; XFAIL: powerpc64, aarch64, arm64, hexagon, riscv, sparc, ppc64le - - ; Build from the following source with clang -O2. - --- -1.8.3.1 - diff --git a/SOURCES/0101-Deactivate-markdown-doc.patch b/SOURCES/0101-Deactivate-markdown-doc.patch new file mode 100644 index 0000000..603cb39 --- /dev/null +++ b/SOURCES/0101-Deactivate-markdown-doc.patch @@ -0,0 +1,26 @@ +diff -Naur a/llvm/docs/conf.py b/llvm/docs/conf.py +--- a/llvm/docs/conf.py 2020-09-15 09:12:24.318287611 +0000 ++++ b/llvm/docs/conf.py 2020-09-15 15:01:00.025893199 +0000 +@@ -36,21 +36,7 @@ + ".rst": "restructuredtext", + } + +-try: +- import recommonmark +-except ImportError: +- # manpages do not use any .md sources +- if not tags.has("builder-man"): +- raise +-else: +- import sphinx +- +- if sphinx.version_info >= (3, 0): +- # This requires 0.5 or later. +- extensions.append("recommonmark") +- else: +- source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} +- source_suffix[".md"] = "markdown" ++import sphinx + + # The encoding of source files. + # source_encoding = 'utf-8-sig' diff --git a/SOURCES/cmake-15.0.7.src.tar.xz.sig b/SOURCES/cmake-15.0.7.src.tar.xz.sig deleted file mode 100644 index 95cf13cd087f74626ff9fa0786d9a734794a0c52..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 566 zcmV-60?GY}0y6{v0SEvc79j*jP9iaCzek0rjBbvi$CRmtL7j>P0%O0rKmZB}5TeJF zsfIzFiXDCs0Iz<^nQf@2pYn3BZ&-6oJDC#;B81EHPTq8-H$>Up2!2O~(sX&5S~y&z zIYh&MMeK=!X}{$RDmz9bHZtu(GzM}K*CsYe_glyt@hly9@E$OHWu0y`iUQc#*`@nY z%k{I+KhT}1i>p!11S9+GWcf~R601$i>+Vj0j6`#TuYiS^&b__9({`~~jW=Gtu2LT&{B_Ntf6c>Cv`lkOpPO9HN9D`p>u-^bVvvZ^K zv~Q|3#7C-jA@jgc_Zk4vas8MM9NX=xN|&qydY9jHsEprJ1-fn#IDkA3&OaPt32xx> zMG+m+fc0>cca}3Uwrbf6myC>-{Pg?zk#oq~`wW-(4ttw>fQQv$KRoC~@%heMWf=CU z_ON!+67_U8=nWMAhUJnYplWP0%O0rK>!K~5TeJF zsfIzFiuQpI{v)z9E<&4l@q#DJgTAuK+YL<{Q zLy3@lw`VbO-*4XFNQR;A15g_7G&rf1LV<7d6|w7MNitA%D! zBa*wopcv#nwpn9S>N1!PPv|7q2N%tbDbjvH4EOC}mtjC;P`tK0I3ubF 8 %global use_libedit 1 %endif - -%else -########## -# FEDORA # -########## -%global targets_to_build "all" -%global experimental_targets_to_build "AVR" %endif ################################################################################ @@ -90,27 +117,32 @@ Name: %{pkg_name} -Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}} -Release: 1%{?dist} +Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}}%{?llvm_snapshot_version_suffix:~%{llvm_snapshot_version_suffix}} +Release: 2%{?dist} Summary: The Low Level Virtual Machine -License: NCSA +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} +%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: release-keys.asc - -%if %{without compat_build} -Source5: run-lit-tests -Source6: lit.fedora.cfg.py +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 %endif -Patch2: 0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch +# Backport of https://reviews.llvm.org/D156485 for RHEL-23865. +Patch0: 0001-PEI-Don-t-zero-out-noreg-operands.patch -# RHEL-specific patches. -Patch101: 0001-Deactivate-markdown-doc.patch +# RHEL-specific patch to avoid unwanted recommonmark dep +Patch101: 0101-Deactivate-markdown-doc.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -122,6 +154,9 @@ BuildRequires: libffi-devel BuildRequires: ncurses-devel BuildRequires: python3-psutil BuildRequires: python3-sphinx +%if %{undefined rhel} +BuildRequires: python3-recommonmark +%endif BuildRequires: multilib-rpm-config %if %{with gold} BuildRequires: binutils-devel @@ -136,9 +171,6 @@ BuildRequires: libedit-devel %endif # Need pandoc to cover markdown to rst, because RHEL does not have recommonmark, # so we can't build the documentation as is. -%if !0%{?rhel} -BuildRequires: python3-recommonmark -%endif %if 0%{?rhel} == 8 # RHEL8 has pandoc which we can use instead of python3-recommonmark for some things. BuildRequires: pandoc @@ -171,14 +203,15 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} %if 0%{?use_libedit} Requires: libedit-devel %endif -# The installed cmake files reference binaries from llvm-test and llvm-static. -# 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, +# 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} %if %{without compat_build} Requires: %{name}-test%{?_isa} = %{version}-%{release} +Requires: %{name}-googletest%{?_isa} = %{version}-%{release} %endif @@ -214,6 +247,13 @@ Provides: llvm-static(major) = %{maj_ver} %description static Static libraries for the LLVM compiler infrastructure. +%package cmake-utils +Summary: CMake utilities shared across LLVM subprojects + +%description cmake-utils +CMake utilities shared across LLVM subprojects. +This is for internal use by LLVM packages only. + %if %{without compat_build} %package test @@ -228,6 +268,8 @@ LLVM regression tests. %package googletest Summary: LLVM's modified googletest sources +# libllvm_gtest.a moved from llvm-static to llvm-googletest +Conflicts: %{name}-static < 17.0.0 %description googletest LLVM's modified googletest sources. @@ -249,14 +291,22 @@ This is the main package for llvm-toolset. %endif %prep -%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE1}' --data='%{SOURCE0}' -%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE3}' --data='%{SOURCE2}' +%if %{without snapshot_build} +%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE1}' --data='%{SOURCE0}' +%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE3}' --data='%{SOURCE2}' +%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE5}' --data='%{SOURCE4}' +%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 -%autosetup -n %{llvm_srcdir} -p2 +%setup -T -q -b 4 -n %{third_party_srcdir} +cd .. +mv %{third_party_srcdir} third-party + +%setup -T -q -b 0 -n %{llvm_srcdir} +%autopatch -M%{?!rhel:100}%{?rhel:200} -p2 %py3_shebang_fix \ test/BugPoint/compile-custom.ll.py \ @@ -271,25 +321,26 @@ find -name '*.md' | while read md; do sed -r -e 's/^( )*\* /\n\1\* /' ${md} | pa %build -%ifarch s390 s390x -# Fails with "exceeded PCRE's backtracking limit" +%if %{without lto_build} %global _lto_cflags %nil -%else -%global _lto_cflags -flto=thin %endif -%ifarch s390 s390x %{arm} %ix86 +%ifarch s390 s390x %ix86 # Decrease debuginfo verbosity to reduce memory consumption during final library linking %global optflags %(echo %{optflags} | sed 's/-g /-g1 /') %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 %{arm} %ix86 +%ifarch s390 %ix86 -DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ %endif @@ -319,6 +370,11 @@ find -name '*.md' | while read md; do sed -r -e 's/^( )*\* /\n\1\* /' ${md} | pa \ -DLLVM_INCLUDE_TESTS:BOOL=ON \ -DLLVM_BUILD_TESTS:BOOL=ON \ +%if %{with compat_build} + -DLLVM_INSTALL_GTEST:BOOL=OFF \ +%else + -DLLVM_INSTALL_GTEST:BOOL=ON \ +%endif -DLLVM_LIT_ARGS=-v \ \ -DLLVM_INCLUDE_EXAMPLES:BOOL=ON \ @@ -338,20 +394,26 @@ find -name '*.md' | while read md; do sed -r -e 's/^( )*\* /\n\1\* /' ${md} | pa -DLLVM_ENABLE_SPHINX:BOOL=ON \ -DLLVM_ENABLE_DOXYGEN:BOOL=OFF \ \ -%if %{without compat_build} +%if %{with snapshot_build} + -DLLVM_VERSION_SUFFIX="%{llvm_snapshot_version_suffix}" \ +%else -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=%{_bindir}/sphinx-build-3 \ - -DLLVM_INCLUDE_BENCHMARKS=OFF + -DLLVM_INCLUDE_BENCHMARKS=OFF \ +%if %{with lto_build} + -DLLVM_UNITTEST_LINK_FLAGS="-Wl,-plugin-opt=O0" \ +%endif + -DCMAKE_SHARED_LINKER_FLAGS="$LDFLAGS -Wl,-z,cet-report=error" # 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 @@ -383,24 +445,10 @@ rm -rf test/tools/UpdateTestChecks %multilib_fix_c_header --file %{_includedir}/llvm/Config/llvm-config.h # Install libraries needed for unittests -%if 0%{?__isa_bits} == 64 -%global build_libdir %{_vpath_builddir}/lib64 -%else -%global build_libdir %{_vpath_builddir}/lib -%endif +%global build_libdir %{_vpath_builddir}/%{_lib} install %{build_libdir}/libLLVMTestingSupport.a %{buildroot}%{_libdir} - -%global install_srcdir %{buildroot}%{_datadir}/llvm/src - -# Install gtest sources so clang can use them for gtest -install -d %{install_srcdir} -install -d %{install_srcdir}/utils/ -cp -R utils/unittest %{install_srcdir}/utils/ - -# Clang needs these for running lit tests. -cp utils/update_cc_test_checks.py %{install_srcdir}/utils/ -cp -R utils/UpdateTestChecks %{install_srcdir}/utils/ +install %{build_libdir}/libLLVMTestingAnnotations.a %{buildroot}%{_libdir} %if %{with gold} # Add symlink to lto plugin in the binutils plugin directory. @@ -425,9 +473,9 @@ ln -s ../../../%{install_includedir}/llvm-c %{buildroot}/%{pkg_includedir}/llvm- %multilib_fix_c_header --file %{install_includedir}/llvm/Config/llvm-config.h # Create ld.so.conf.d entry -mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d -cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf << EOF -%{pkg_libdir} +mkdir -p %{buildroot}/etc/ld.so.conf.d +cat >> %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf << EOF +%{install_libdir} EOF # Add version suffix to man pages and move them to mandir. @@ -449,63 +497,51 @@ rm -Rf %{build_install_prefix}/share/opt-viewer %if %{without compat_build} -mv %{buildroot}/%{pkg_bindir}/llvm-config %{buildroot}/%{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} +mv %{buildroot}/%{install_bindir}/llvm-config %{buildroot}/%{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} # We still maintain a versionned symlink for consistency across llvm versions. # This is specific to the non-compat build and matches the exec prefix for # compat builds. An isa-agnostic versionned symlink is also maintained in the (un)install # steps. -(cd %{buildroot}/%{pkg_bindir} ; ln -s llvm-config%{exec_suffix}-%{__isa_bits} llvm-config-%{maj_ver}-%{__isa_bits} ) +(cd %{buildroot}/%{install_bindir} ; ln -s llvm-config%{exec_suffix}-%{__isa_bits} llvm-config-%{maj_ver}-%{__isa_bits} ) # ghost presence touch %{buildroot}%{_bindir}/llvm-config-%{maj_ver} %else rm %{buildroot}%{_bindir}/llvm-config%{exec_suffix} -(cd %{buildroot}/%{pkg_bindir} ; ln -s llvm-config llvm-config%{exec_suffix}-%{__isa_bits} ) +(cd %{buildroot}/%{install_bindir} ; ln -s llvm-config llvm-config%{exec_suffix}-%{__isa_bits} ) %endif # ghost presence touch %{buildroot}%{_bindir}/llvm-config%{exec_suffix} -%if %{without compat_build} -cp -Rv ../cmake/Modules/* %{buildroot}%{_libdir}/cmake/llvm -%endif - +mkdir -p %{buildroot}%{pkg_datadir}/llvm/cmake +cp -Rv ../cmake/* %{buildroot}%{pkg_datadir}/llvm/cmake %check -# Disable check section on arm due to some kind of memory related failure. -# Possibly related to https://bugzilla.redhat.com/show_bug.cgi?id=1920183 -%ifnarch %{arm} - -# TODO: Fix the failures below -%ifarch %{arm} -rm test/tools/llvm-readobj/ELF/dependent-libraries.test -%endif # non reproducible errors rm test/tools/dsymutil/X86/swift-interface.test %if %{with check} # FIXME: use %%cmake_build instead of %%__ninja -LD_LIBRARY_PATH=%{buildroot}/%{pkg_libdir} %{__ninja} check-all -C %{_vpath_builddir} -%endif - +LD_LIBRARY_PATH=%{buildroot}/%{install_libdir} %{__ninja} check-all -C %{_vpath_builddir} %endif %ldconfig_scriptlets libs %post devel -%{_sbindir}/update-alternatives --install %{_bindir}/llvm-config%{exec_suffix} llvm-config%{exec_suffix} %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits} +%{_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} %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits} +%{_sbindir}/update-alternatives --install %{_bindir}/llvm-config-%{maj_ver} llvm-config-%{maj_ver} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits} %endif %postun devel if [ $1 -eq 0 ]; then - %{_sbindir}/update-alternatives --remove llvm-config%{exec_suffix} %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} + %{_sbindir}/update-alternatives --remove llvm-config%{exec_suffix} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %if %{without compat_build} - %{_sbindir}/update-alternatives --remove llvm-config-%{maj_ver} %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} + %{_sbindir}/update-alternatives --remove llvm-config-%{maj_ver} %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %endif fi @@ -516,11 +552,11 @@ fi %{_bindir}/* %exclude %{_bindir}/llvm-config%{exec_suffix} -%exclude %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} +%exclude %{install_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %if %{without compat_build} %exclude %{_bindir}/llvm-config-%{maj_ver} -%exclude %{pkg_bindir}/llvm-config-%{maj_ver}-%{__isa_bits} +%exclude %{install_bindir}/llvm-config-%{maj_ver}-%{__isa_bits} %exclude %{_bindir}/not %exclude %{_bindir}/count %exclude %{_bindir}/yaml-bench @@ -529,12 +565,12 @@ fi %exclude %{_bindir}/llvm-opt-fuzzer %{_datadir}/opt-viewer %else -%{pkg_bindir} +%{install_bindir} %endif %files libs %license LICENSE.TXT -%{pkg_libdir}/libLLVM-%{maj_ver}.so +%{install_libdir}/libLLVM-%{maj_ver}%{?llvm_snapshot_version_suffix:%{llvm_snapshot_version_suffix}}.so %if %{without compat_build} %if %{with gold} %{_libdir}/LLVMgold.so @@ -543,38 +579,34 @@ fi %{_libdir}/libLLVM-%{maj_ver}.%{min_ver}*.so %{_libdir}/libLTO.so* %else -%config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf +%config(noreplace) /etc/ld.so.conf.d/%{name}-%{_arch}.conf %if %{with gold} %{_libdir}/%{name}/lib/LLVMgold.so %endif -%{pkg_libdir}/libLLVM-%{maj_ver}.%{min_ver}*.so -%{pkg_libdir}/libLTO.so* -%exclude %{pkg_libdir}/libLTO.so +%{install_libdir}/libLLVM-%{maj_ver}.%{min_ver}*.so +%{install_libdir}/libLTO.so* +%exclude %{install_libdir}/libLTO.so %endif -%{pkg_libdir}/libRemarks.so* +%{install_libdir}/libRemarks.so* %files devel %license LICENSE.TXT %ghost %{_bindir}/llvm-config%{exec_suffix} -%{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} +%{install_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 -%{pkg_bindir}/llvm-config-%{maj_ver}-%{__isa_bits} -%ghost %{_bindir}/llvm-config-%{maj_ver} -%else %{install_includedir}/llvm %{install_includedir}/llvm-c +%{install_libdir}/libLLVM.so +%{install_libdir}/cmake/llvm +%if %{without compat_build} +%{install_bindir}/llvm-config-%{maj_ver}-%{__isa_bits} +%ghost %{_bindir}/llvm-config-%{maj_ver} +%else %{pkg_includedir}/llvm %{pkg_includedir}/llvm-c -%{pkg_libdir}/libLTO.so -%{pkg_libdir}/libLLVM.so -%{pkg_libdir}/cmake/llvm +%{install_libdir}/libLTO.so %endif %files doc @@ -583,13 +615,18 @@ fi %files static %license LICENSE.TXT +%{install_libdir}/*.a %if %{without compat_build} -%{_libdir}/*.a -%exclude %{_libdir}/libLLVMTestingSupport.a -%else -%{_libdir}/%{name}/lib/*.a +%exclude %{install_libdir}/libLLVMTestingSupport.a +%exclude %{install_libdir}/libLLVMTestingAnnotations.a +%exclude %{install_libdir}/libllvm_gtest.a +%exclude %{install_libdir}/libllvm_gtest_main.a %endif +%files cmake-utils +%license LICENSE.TXT +%{pkg_datadir}/llvm/cmake + %if %{without compat_build} %files test @@ -603,8 +640,12 @@ fi %files googletest %license LICENSE.TXT -%{_datadir}/llvm/src/utils -%{_libdir}/libLLVMTestingSupport.a +%{install_libdir}/libLLVMTestingSupport.a +%{install_libdir}/libLLVMTestingAnnotations.a +%{install_libdir}/libllvm_gtest.a +%{install_libdir}/libllvm_gtest_main.a +%{install_includedir}/llvm-gtest +%{install_includedir}/llvm-gmock %if 0%{?rhel} %files toolset @@ -614,6 +655,31 @@ fi %endif %changelog +* Fri Feb 02 2024 Nikita Popov - 17.0.6-2 +- Fix crash with -fzero-call-used-regs (RHEL-23865) + +* Wed Nov 29 2023 Nikita Popov - 17.0.6-1 +- Update to LLVM 17.0.6 + +* Mon Oct 23 2023 Nikita Popov - 17.0.2-2 +- Add Conflicts to llvm-googletest + +* Wed Oct 04 2023 Nikita Popov - 17.0.2-1 +- Update to LLVM 17.0.2 + +* Thu Aug 03 2023 Tulio Magno Quites Machado Filho - 16.0.6-3 +- Fix rhbz #2228944 + +* Wed Jul 19 2023 Tulio Magno Quites Machado Filho - 16.0.6-2 +- Improve error messages for unsupported relocs on s390x (rhbz#2216906) +- Disable LLVM_UNREACHABLE_OPTIMIZE + +* Sat Jun 17 2023 Tom Stellard - 16.0.6-1 +- 16.0.6 Release + +* Wed Apr 05 2023 Timm Bäder - 16.0.0-1 +- 16.0.0 Release + * Thu Jan 19 2023 Tom Stellard - 15.0.7-1 - 15.0.7 Release