From bca62540e9b26441b9ed1d85465f02b346fa4e2f Mon Sep 17 00:00:00 2001 From: Toshaan Bharvani Date: Fri, 17 May 2024 01:21:27 +0200 Subject: [PATCH] llvm update 17 Signed-off-by: Toshaan Bharvani --- ...01-PEI-Don-t-zero-out-noreg-operands.patch | 74 ++++ SOURCES/0101-Deactivate-markdown-doc.patch | 26 ++ SPECS/llvm.spec | 358 +++++++++++++----- 3 files changed, 356 insertions(+), 102 deletions(-) create mode 100644 SOURCES/0001-PEI-Don-t-zero-out-noreg-operands.patch create mode 100644 SOURCES/0101-Deactivate-markdown-doc.patch 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/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/SPECS/llvm.spec b/SPECS/llvm.spec index e9c02a2..02f2c17 100644 --- a/SPECS/llvm.spec +++ b/SPECS/llvm.spec @@ -1,7 +1,15 @@ +%bcond_with snapshot_build + +%if %{with snapshot_build} +# Unlock LLVM Snapshot LUA functions +%{llvm_sb} +%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 +%global gts_version 13 # Components enabled if supported by target architecture: %define gold_arches %{ix86} x86_64 %{arm} aarch64 %{power64} s390x @@ -15,21 +23,37 @@ %bcond_with bundle_compat_lib %bcond_without check +%ifarch %ix86 +# 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 13 -%global compat_ver %{compat_maj_ver}.0.1 +%global compat_maj_ver 16 +%global compat_ver %{compat_maj_ver}.0.6 %endif -%global llvm_libdir %{_libdir}/%{name} -%global build_llvm_libdir %{buildroot}%{llvm_libdir} -#global rc_ver 4 -%global maj_ver 14 +%global maj_ver 17 %global min_ver 0 %global patch_ver 6 -%if !%{maj_ver} && 0%{?rc_ver} -%global abi_revision 2 +#global rc_ver 4 + +%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} %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 +%global _lto_cflags -flto=thin %if %{with compat_build} %global pkg_name llvm%{maj_ver} @@ -39,15 +63,15 @@ %global install_includedir %{install_prefix}/include %global install_libdir %{install_prefix}/lib -%global pkg_bindir %{install_bindir} %global pkg_includedir %{_includedir}/%{name} -%global pkg_libdir %{install_libdir} +%global pkg_datadir %{install_prefix}/share %else %global pkg_name llvm %global install_prefix /usr +%global install_bindir %{_bindir} %global install_libdir %{_libdir} -%global pkg_bindir %{_bindir} -%global pkg_libdir %{install_libdir} +%global install_includedir %{_includedir} +%global pkg_datadir %{_datadir} %global exec_suffix %{nil} %endif @@ -70,37 +94,46 @@ # we need to hard-code the correct triple here. %global llvm_triple armv7l-redhat-linux-gnueabihf %else -%global llvm_triple %{_host} +%global llvm_triple %{_target_platform} %endif +# https://fedoraproject.org/wiki/Changes/PythonSafePath#Opting_out +# Don't add -P to Python shebangs +# The executable Python scripts in /usr/share/opt-viewer/ import each other +%undefine _py3_shebang_P + 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: 5%{?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: tstellar-gpg-key.asc +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 -%if %{without compat_build} -Source3: run-lit-tests -Source4: lit.fedora.cfg.py -%endif %if %{with bundle_compat_lib} -Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compat_ver}/llvm-%{compat_ver}.src.tar.xz +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 %endif - -%if 0%{?abi_revision} -Patch0: 0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch %endif -Patch1: 0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch -Patch2: 0001-Disable-CrashRecoveryTest.DumpStackCleanup-test-on-a.patch -# RHEL-specific patches -Patch101: 0001-Deactivate-markdown-doc.patch -#Patch102: 1.patch +# Backport of https://reviews.llvm.org/D156485 for rhbz#2262260/RHEL-23638 +Patch0: 0001-PEI-Don-t-zero-out-noreg-operands.patch + +# RHEL-specific patch to avoid unwanted recommonmark dep +Patch101: 0101-Deactivate-markdown-doc.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -131,7 +164,8 @@ BuildRequires: python3-setuptools # For origin certification BuildRequires: gnupg2 - +# To handle LTO debuginfo +BuildRequires: gcc-toolset-%{gts_version}-gdb Requires: %{name}-libs%{?_isa} = %{version}-%{release} @@ -151,14 +185,15 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} # app that requires the libLLVMLineEditor, so we need to make sure # libedit-devel is available. Requires: libedit-devel -# 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 @@ -194,6 +229,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 @@ -212,16 +254,47 @@ Summary: LLVM's modified googletest sources %description googletest LLVM's modified googletest sources. +%package toolset +Summary: Package that installs llvm-toolset +Requires: clang = %{version} +Requires: llvm = %{version} + +%ifnarch s390x +Requires: lld = %{version} +%endif + +%description toolset +This is the main package for llvm-toolset. + %endif %prep -%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' +%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}' +%if %{with bundle_compat_lib} +%{gpgverify} --keyring='%{SOURCE6}' --signature='%{SOURCE8}' --data='%{SOURCE7}' +%endif +%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} +%autopatch -m200 -p2 +cd .. +mv %{third_party_srcdir} third-party %if %{with bundle_compat_lib} -%setup -T -q -b 5 -n llvm-%{compat_ver}.src +%setup -T -q -b 7 -n llvm-%{compat_ver}.src %endif -%autosetup -n %{llvm_srcdir} -p2 +%setup -T -q -b 0 -n %{llvm_srcdir} +%autopatch -M200 -p2 %py3_shebang_fix \ test/BugPoint/compile-custom.ll.py \ @@ -230,19 +303,21 @@ LLVM's modified googletest sources. %build -#ifarch s390 s390x -# Fails with "exceeded PCRE's backtracking limit" +%ifarch %ix86 +# Linking libLLVM.so goes out of memory even with ThinLTO and a single link job. %global _lto_cflags %nil -#else -#global _lto_cflags -flto=thin -#endif +%endif %ifarch s390 s390x %{arm} %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 \ @@ -278,6 +353,11 @@ LLVM's modified googletest sources. \ -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 \ @@ -300,18 +380,21 @@ LLVM's modified googletest sources. %if %{without compat_build} -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 \ - %{?abi_revision:-DLLVM_ABI_REVISION=%{abi_revision}} \ - \ -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 @@ -328,13 +411,19 @@ LLVM's modified googletest sources. -DBUILD_SHARED_LIBS:BOOL=OFF \ -DLLVM_BUILD_LLVM_DYLIB=ON \ -DLLVM_ENABLE_RTTI:BOOL=ON \ - -DLLVM_TARGETS_TO_BUILD=%{targets_to_build} + -DLLVM_TARGETS_TO_BUILD=%{targets_to_build} \ + -DLLVM_INCLUDE_BENCHMARKS=OFF %ninja_build -C ../llvm-compat-libs LLVM %endif %install + +# 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` + %cmake_install %if %{with bundle_compat_lib} @@ -365,27 +454,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 -%global lit_cfg test/%{_arch}.site.cfg.py -%global lit_unit_cfg test/Unit/%{_arch}.site.cfg.py -%global lit_fedora_cfg %{_datadir}/llvm/lit.fedora.cfg.py - -# 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. @@ -398,7 +470,7 @@ ln -s -t %{buildroot}%{_libdir}/bfd-plugins/ ../LLVMgold.so # 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} + ln -s ../../%{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename%{exec_suffix} done # Move header files @@ -412,7 +484,7 @@ ln -s ../../../%{install_includedir}/llvm-c %{buildroot}/%{pkg_includedir}/llvm- # 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} +%{install_libdir} EOF # Add version suffix to man pages and move them to mandir. @@ -434,19 +506,19 @@ 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 @@ -454,7 +526,8 @@ rm %{buildroot}%{_bindir}/llvm-config%{exec_suffix} touch %{buildroot}%{_bindir}/llvm-config%{exec_suffix} %if %{without compat_build} -cp -Rv ../cmake/Modules/* %{buildroot}%{_libdir}/cmake/llvm +mkdir -p %{buildroot}%{pkg_datadir}/llvm/cmake +cp -Rv ../cmake/* %{buildroot}%{pkg_datadir}/llvm/cmake %endif @@ -473,7 +546,7 @@ 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} +LD_LIBRARY_PATH=%{buildroot}/%{install_libdir} %{__ninja} check-all -C %{_vpath_builddir} %endif %endif @@ -481,16 +554,16 @@ LD_LIBRARY_PATH=%{buildroot}/%{pkg_libdir} %{__ninja} check-all -C %{_vpath_bui %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 @@ -501,11 +574,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 @@ -514,30 +587,29 @@ 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 %{_libdir}/bfd-plugins/LLVMgold.so %endif %{_libdir}/libLLVM-%{maj_ver}.%{min_ver}*.so -%{_libdir}/libLLVM-%{maj_ver}.so%{?abi_revision:.%{abi_revision}} %{_libdir}/libLTO.so* %else %config(noreplace) %{_sysconfdir}/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* %if %{with bundle_compat_lib} %{_libdir}/libLLVM-%{compat_maj_ver}.so %endif @@ -546,24 +618,20 @@ fi %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* +%{install_includedir}/llvm +%{install_includedir}/llvm-c +%{install_libdir}/libLLVM.so +%{install_libdir}/cmake/llvm %if %{without compat_build} -%{_includedir}/llvm -%{_includedir}/llvm-c -%{_libdir}/libLLVM.so -%{_libdir}/cmake/llvm -%{pkg_bindir}/llvm-config-%{maj_ver}-%{__isa_bits} +%{install_bindir}/llvm-config-%{maj_ver}-%{__isa_bits} %ghost %{_bindir}/llvm-config-%{maj_ver} %else -%{install_includedir}/llvm -%{install_includedir}/llvm-c %{pkg_includedir}/llvm %{pkg_includedir}/llvm-c -%{pkg_libdir}/libLTO.so -%{pkg_libdir}/libLLVM.so -%{pkg_libdir}/cmake/llvm +%{install_libdir}/libLTO.so %endif %if %{with bundle_compat_lib} %{_libdir}/llvm%{compat_maj_ver}/ @@ -575,13 +643,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 @@ -595,12 +668,93 @@ 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 %endif + +%files toolset +%license LICENSE.TXT + %changelog +* Fri Feb 02 2024 Timm Bäder - 17.0.6-5 +- Backport a patch for RHEL-23638 + +* Mon Jan 08 2024 Timm Bäder - 17.0.6-4 +- Remove compat libs for real. + +* Thu Dec 14 2023 Timm Bäder - 17.0.6-3 +- Add back compat libs until all necessary packages have been rebuilt. + +* Fri Dec 08 2023 Timm Bäder - 17.0.6-2 +- Remove compat libs + +* Tue Dec 05 2023 Timm Bäder - 17.0.6-1 +- Update to 17.0.6 + +* Fri Oct 06 2023 Timm Bäder - 17.0.1-3 +- Add llvm-toolset files section back + +* Mon Oct 02 2023 Timm Bäder - 17.0.1-2 +- Rebuild with newer redhat-rpm-config + +* Tue Sep 26 2023 Timm Bäder - 17.0.1-1 +- Update to 17.0.1 + +* Fri Aug 04 2023 Tulio Magno Quites Machado Filho - 16.0.6-4 +- Re-add LDFLAGS to shared libraries + +* Thu Aug 03 2023 Tulio Magno Quites Machado Filho - 16.0.6-3 +- Fix rhbz #2226795 + +* Tue Aug 01 2023 Nikita Popov - 16.0.6-2 +- Fix CET support + +* Tue Jul 04 2023 Nikita Popov - 16.0.6-1 +- Update to LLVM 16.0.6 + +* Mon Jul 03 2023 Tulio Magno Quites Machado Filho - 16.0.1-4 +- Improve error messages for unsupported relocs on s390x (rhbz#2216906) +- Disable LLVM_UNREACHABLE_OPTIMIZE + +* Thu Jun 29 2023 Nikita Popov - 16.0.1-3 +- Use gcc-toolset-13-gdb for gdb-add-index + +* Fri May 05 2023 Nikita Popov - 16.0.1-2 +- Build with LTO + +* Fri Apr 14 2023 Nikita Popov - 16.0.1-1 +- Update to LLVM 16.0.1 + +* Fri Jan 13 2023 Konrad Kleine - 15.0.7-1 +- Update to LLVM 15.0.7 +- Remove workaround for rbhz#2048440 + +* Mon Dec 05 2022 Konrad Kleine - 15.0.6-2 +- Disabling LTO for now + +* Mon Dec 05 2022 Konrad Kleine - 15.0.6-1 +- Update to 15.0.6 + +* Mon Sep 26 2022 Konrad Kleine - 15.0.1-1 +- Update to 15.0.1 + +* Mon Sep 26 2022 Konrad Kleine - 15.0.0-3 +- Fixup: Produce toolset subpackage RPM + Related: rhbz#2118979 + +* Wed Sep 21 2022 Konrad Kleine - 15.0.0-2 +- Add toolset subpackage + Related: rhbz#2118979 + +* Fri Sep 16 2022 Konrad Kleine - 15.0.0-1 +- Update to 15.0.0 + * Mon Jul 18 2022 Timm Bäder - 14.0.6-1 - Update to 14.0.6