Update to LLVM 18.1.2

Resolves: RHEL-27724
This commit is contained in:
Tulio Magno Quites Machado Filho 2024-04-03 10:53:50 -03:00
parent 59043f2d1d
commit 2ee80c2d6d
2 changed files with 34 additions and 33 deletions

View File

@ -15,9 +15,9 @@
%bcond_without check %bcond_without check
%bcond_with compat_build %bcond_with compat_build
%global maj_ver 17 %global maj_ver 18
%global min_ver 0 %global min_ver 1
%global patch_ver 6 %global patch_ver 2
#global rc_ver 4 #global rc_ver 4
%if %{with snapshot_build} %if %{with snapshot_build}
@ -37,17 +37,19 @@
%global install_includedir %{install_prefix}/include %global install_includedir %{install_prefix}/include
%global install_libdir %{install_prefix}/lib %global install_libdir %{install_prefix}/lib
%global install_datadir %{install_prefix}/share %global install_datadir %{install_prefix}/share
%global install_bindir %{install_prefix}/bin
%else %else
%global pkg_name lld %global pkg_name lld
%global install_prefix /usr %global install_prefix /usr
%global install_includedir %{_includedir} %global install_includedir %{_includedir}
%global install_libdir %{_libdir} %global install_libdir %{_libdir}
%global install_datadir %{_datadir} %global install_datadir %{_datadir}
%global install_bindir %{_bindir}
%endif %endif
Name: %{pkg_name} Name: %{pkg_name}
Version: %{lld_version}%{?rc_ver:~rc%{rc_ver}}%{?llvm_snapshot_version_suffix:~%{llvm_snapshot_version_suffix}} Version: %{lld_version}%{?rc_ver:~rc%{rc_ver}}%{?llvm_snapshot_version_suffix:~%{llvm_snapshot_version_suffix}}
Release: 4%{?dist} Release: 1%{?dist}
Summary: The LLVM Linker Summary: The LLVM Linker
License: Apache-2.0 WITH LLVM-exception OR NCSA License: Apache-2.0 WITH LLVM-exception OR NCSA
@ -61,8 +63,6 @@ Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ve
Source2: release-keys.asc Source2: release-keys.asc
%endif %endif
ExcludeArch: s390x
# Bundle libunwind header need during build for MachO support # Bundle libunwind header need during build for MachO support
Patch1: 0002-PATCH-lld-Import-compact_unwind_encoding.h-from-libu.patch Patch1: 0002-PATCH-lld-Import-compact_unwind_encoding.h-from-libu.patch
@ -123,15 +123,6 @@ Shared libraries for LLD.
%autosetup -n %{lld_srcdir} -p2 %autosetup -n %{lld_srcdir} -p2
%if %{with compat_build}
# For compat builds, we don't want to build the actual lld binary. While there is an
# LLD_BUILD_TOOLS cmake option, it is incomplete in various ways (e.g. still leaves install
# targets and symlinks), so instead skip the tools/lld build entirely.
# We can't simply delete the binaries after the fact, because this would leave checks for
# their existence in the cmake exports.
sed 's/add_subdirectory(tools\/lld)//' -i CMakeLists.txt
%endif
%build %build
%cmake \ %cmake \
@ -143,17 +134,16 @@ sed 's/add_subdirectory(tools\/lld)//' -i CMakeLists.txt
-DLLVM_COMMON_CMAKE_UTILS=%{install_datadir}/llvm/cmake \ -DLLVM_COMMON_CMAKE_UTILS=%{install_datadir}/llvm/cmake \
-DCMAKE_SKIP_RPATH:BOOL=ON \ -DCMAKE_SKIP_RPATH:BOOL=ON \
-DPYTHON_EXECUTABLE=%{__python3} \ -DPYTHON_EXECUTABLE=%{__python3} \
%if %{with compat_build} %if %{with snapshot_build}
-DLLVM_CMAKE_DIR=%{install_libdir}/cmake/llvm \ -DLLVM_VERSION_SUFFIX="%{llvm_snapshot_version_suffix}" \
-DLLVM_INCLUDE_TESTS=OFF \ %endif
%else
-DLLVM_INCLUDE_TESTS=ON \ -DLLVM_INCLUDE_TESTS=ON \
-DLLVM_EXTERNAL_LIT=%{_bindir}/lit \ -DLLVM_EXTERNAL_LIT=%{_bindir}/lit \
-DLLVM_LIT_ARGS="-sv \ -DLLVM_LIT_ARGS="-sv \
--path %{_libdir}/llvm" \ --path %{_libdir}/llvm" \
%if %{with snapshot_build} %if %{with compat_build}
-DLLVM_VERSION_SUFFIX="%{llvm_snapshot_version_suffix}" \ -DLLVM_CMAKE_DIR=%{install_libdir}/cmake/llvm \
%endif %else
%if 0%{?__isa_bits} == 64 %if 0%{?__isa_bits} == 64
-DLLVM_LIBDIR_SUFFIX=64 \ -DLLVM_LIBDIR_SUFFIX=64 \
%else %else
@ -172,13 +162,21 @@ sed 's/add_subdirectory(tools\/lld)//' -i CMakeLists.txt
# This is generated by Patch1 during build and (probably) must be removed afterward # This is generated by Patch1 during build and (probably) must be removed afterward
rm %{buildroot}%{install_includedir}/mach-o/compact_unwind_encoding.h rm %{buildroot}%{install_includedir}/mach-o/compact_unwind_encoding.h
%if %{without compat_build} %if %{with compat_build}
# 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-%{maj_ver}
done
%else
# Required when using update-alternatives: # Required when using update-alternatives:
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Alternatives/ # https://docs.fedoraproject.org/en-US/packaging-guidelines/Alternatives/
touch %{buildroot}%{_bindir}/ld touch %{buildroot}%{_bindir}/ld
install -D -m 644 -t %{buildroot}%{_mandir}/man1/ docs/ld.lld.1 install -D -m 644 -t %{buildroot}%{_mandir}/man1/ docs/ld.lld.1
%post %post
%{_sbindir}/update-alternatives --install %{_bindir}/ld ld %{_bindir}/ld.lld 1 %{_sbindir}/update-alternatives --install %{_bindir}/ld ld %{_bindir}/ld.lld 1
@ -190,23 +188,25 @@ fi
%check %check
%if %{without compat_build}
%if %{with check} %if %{with check}
%cmake_build --target check-lld %cmake_build --target check-lld
%endif %endif
%if %{without compat_build}
%ldconfig_scriptlets libs %ldconfig_scriptlets libs
%endif %endif
%if %{without compat_build}
%files %files
%license LICENSE.TXT %license LICENSE.TXT
%ghost %{_bindir}/ld %ghost %{_bindir}/ld
%{_bindir}/lld* %{install_bindir}/lld*
%{_bindir}/ld.lld %{install_bindir}/ld.lld
%{_bindir}/ld64.lld %{install_bindir}/ld64.lld
%{_bindir}/wasm-ld %{install_bindir}/wasm-ld
%if %{without compat_build}
%{_mandir}/man1/ld.lld.1* %{_mandir}/man1/ld.lld.1*
%else
%{_bindir}/*-%{maj_ver}
%endif %endif
%files devel %files devel
@ -218,14 +218,15 @@ fi
%{install_libdir}/liblld*.so.* %{install_libdir}/liblld*.so.*
%changelog %changelog
* Wed Apr 03 2024 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 18.1.2-1
- Update to LLVM 18.1.2 (RHEL-27724)
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 17.0.6-4 * Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 17.0.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 17.0.6-3 * Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 17.0.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
%{?llvm_snapshot_changelog_entry}
* Mon Dec 18 2023 Jeremy Newton <alexjnewt at hotmail dot com> - 17.0.6-2 * Mon Dec 18 2023 Jeremy Newton <alexjnewt at hotmail dot com> - 17.0.6-2
- Add lld-devel(major) provides - Add lld-devel(major) provides

View File

@ -1,2 +1,2 @@
SHA512 (lld-17.0.6.src.tar.xz) = 55955fc24b3fb87012486618cf227a1640ad9a6d607c898d890337aa8c28f3e6a9ed48a52bd0ed57f365f0dc5081a6b3a037cb65da9a9f2cbc53a1527cb8db60 SHA512 (lld-18.1.2.src.tar.xz) = e9706fcad44f84d2021194988ae017dda5035bc0d449db54951d0058f572f958b2d52d7640d0f453332d405bd5d3e4b15c40e0afbc7990ca0f51cced5a093320
SHA512 (lld-17.0.6.src.tar.xz.sig) = e0b39e9ea4a1b27679c2c657dd31cda2f7536ee552d353010900f7c68ba5de598114a70a6edb3641c501cd5bc78327f5152748a3a8c8fea5eb4c900e1717bde2 SHA512 (lld-18.1.2.src.tar.xz.sig) = 3a60324d034e66ef5399f05bfe3a06520f7f7b83802a7b164dbbdd63023ad4fd5cf8dc3cdf7c33df7e2f5d5a3901fc9fe97c501e2125236fa1cb9235906ab143