Update to LLVM 17.0.0 RC1

This is also a squashed merge commit from upstream-snapshot (commit ID
793e0363467b802a) into rawhide whose most important commits from
upstream-snapshot are:

Konrad Kleine (21):
      Generated patches again rebased llvm-project
      Prepared lld for snapshot builds
      Fix indention
      Rebased patches from streamline branch of llvm-project
      Fix installed (but unpacked) file(s) found for ld64.ldd.darwinold
      Disable checks when building snapshots
      Experiment to find out how version suffix may look like
      Make download path for snapshot sources-easily adjustable
      Fix RPM build error:
      Use new llvm_snashot_changelog_entry macro
      Don't install unittests dir because as of https://reviews.llvm.org/D114842 that no longer exist
      Try fix RPM build
      Use llvm_snapshot_version_suffix
      Compile with DWARFv4
      Fix: cp: cannot stat 'redhat-linux-build/lib64/libgtest*so*': No such file or directory
      Merge remote-tracking branch 'upstream/rawhide' into upstream-snapshot
      Make lld use the llvm-snapshot-builder
      Use %{llvm_snapshot_extra_source_tags} macro
      Rebase patch
      Fix error by adding cmake tarball
      Merge remote-tracking branch 'origin/rawhide' into upstream-snapshot

Nikita Popov (1):
      Remove Unit site.cfg.py handling

Tom Stellard (3):
      Remove lld-test package
      Drop gtest detection patch
      copr: Install llvm-snapshot-builder from the local COPR project
This commit is contained in:
Tulio Magno Quites Machado Filho 2023-08-02 10:00:24 -03:00
parent 044c91ccdf
commit 7f0682b594
6 changed files with 64 additions and 87 deletions

17
.copr/Makefile Normal file
View File

@ -0,0 +1,17 @@
# See https://docs.pagure.org/copr.copr/user_documentation.html#make-srpm
# See for the --setopt option in the enabling of copr repo see:
# https://pagure.io/copr/copr/issue/184
COPR_USERNAME=$(shell rpm --eval %copr_username)
COPR_PROJECT=$(shell rpm --eval %copr_projectname)
.PHONY: srpm
srpm:
dnf install -y dnf-plugins-core fedora-packager
dnf copr enable -y --setopt=reposdir=/tmp/yum.repos.d $(COPR_USERNAME)/$(COPR_PROJECT)
dnf install -y --setopt=reposdir=/tmp/yum.repos.d llvm-snapshot-builder
rpmbuild \
--define "_srcrpmdir $(outdir)" \
--define "_sourcedir $(shell pwd)" \
--define "_disable_source_fetch 0" \
-bs $(spec)

View File

@ -1,30 +0,0 @@
From 015c43178f9d8531b6bcd1685dbf72b7d837cf5a Mon Sep 17 00:00:00 2001
From: Jacek Caban <jacek@codeweavers.com>
Date: Fri, 10 Mar 2023 21:54:14 -0500
Subject: [PATCH] [lld] Pass random.randint stop parameter as int.
It's required by Python 3.12, from https://docs.python.org/3.12/library/random.html "Changed in version 3.12: Automatic conversion of non-integer types is no longer supported."
Reviewed By: #lld-macho, int3
Differential Revision: https://reviews.llvm.org/D145826
---
lld/test/MachO/tools/generate-cfi-funcs.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lld/test/MachO/tools/generate-cfi-funcs.py b/lld/test/MachO/tools/generate-cfi-funcs.py
index 3f22008349f4..e2b75d0cd9a5 100755
--- a/lld/test/MachO/tools/generate-cfi-funcs.py
+++ b/lld/test/MachO/tools/generate-cfi-funcs.py
@@ -23,7 +23,7 @@ def print_function(name):
global lsda_odds
have_lsda = (random.random() < lsda_odds)
frame_size = random.randint(4, 64) * 16
- frame_offset = -random.randint(0, (frame_size/16 - 4)) * 16
+ frame_offset = -random.randint(0, int(frame_size/16 - 4)) * 16
global func_size_low, func_size_high
func_size = random.randint(func_size_low, func_size_high) * 0x10
func_size_high += 1
--
2.41.0

View File

@ -1,37 +0,0 @@
From 56464ba865b7df5bf3edb9be7dc3b6a0fbe21e21 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Mon, 13 Mar 2023 18:22:31 +0100
Subject: [PATCH] [lld] Use installed llvm_gtest in standalone builds
Use the installed llvm_gtest library instead of rebuilding it locally
when standalone builds are used. This change is now required
as otherwise the build fails due to duplicate llvm_gtest target.
This is based on 82169103958583d3320b3a9a1e6542e8d32ef8da in clang.
Differential Revision: https://reviews.llvm.org/D145964
---
lld/CMakeLists.txt | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt
index 3d6225646fe6..1e9e47393196 100644
--- a/lld/CMakeLists.txt
+++ b/lld/CMakeLists.txt
@@ -75,11 +75,9 @@ if(LLD_BUILT_STANDALONE)
set(LLVM_UTILS_PROVIDED ON)
set(LLD_TEST_DEPS FileCheck not)
endif()
- set(UNITTEST_DIR ${LLVM_THIRD_PARTY_DIR}/unittest)
- if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
- AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
- AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
- add_subdirectory(${UNITTEST_DIR} third-party/unittest)
+
+ if (NOT TARGET llvm_gtest)
+ message(FATAL_ERROR "llvm-gtest not found. Please install llvm-gtest or disable tests with -DLLVM_INCLUDE_TESTS=OFF")
endif()
else()
# Seek installed Lit.
--
2.39.2

View File

@ -1,18 +1,17 @@
From 43dfe54ce017c8d37eaec480a2f13a492bbc4203 Mon Sep 17 00:00:00 2001 From 9df81767571465ef1f2e7370299e21c64fe34f40 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com> From: serge-sans-paille <sguelton@redhat.com>
Date: Thu, 25 Feb 2021 14:24:14 +0100 Date: Thu, 25 Feb 2021 14:24:14 +0100
Subject: [PATCH 2/2] [PATCH][lld] Import compact_unwind_encoding.h from Subject: [PATCH][lld] Import compact_unwind_encoding.h from libunwind
libunwind
This avoids an implicit cross package dependency This avoids an implicit cross package dependency
--- ---
lld/include/mach-o/compact_unwind_encoding.h | 477 +++++++++++++++++++++++++++ lld/include/mach-o/compact_unwind_encoding.h | 477 +++++++++++++++++++
1 file changed, 477 insertions(+) 1 file changed, 477 insertions(+)
create mode 100644 lld/include/mach-o/compact_unwind_encoding.h create mode 100644 lld/include/mach-o/compact_unwind_encoding.h
diff --git a/lld/include/mach-o/compact_unwind_encoding.h b/lld/include/mach-o/compact_unwind_encoding.h diff --git a/lld/include/mach-o/compact_unwind_encoding.h b/lld/include/mach-o/compact_unwind_encoding.h
new file mode 100644 new file mode 100644
index 0000000..5301b10 index 000000000000..5301b1055ef9
--- /dev/null --- /dev/null
+++ b/lld/include/mach-o/compact_unwind_encoding.h +++ b/lld/include/mach-o/compact_unwind_encoding.h
@@ -0,0 +1,477 @@ @@ -0,0 +1,477 @@
@ -494,5 +493,5 @@ index 0000000..5301b10
+#endif +#endif
+ +
-- --
1.8.3.1 2.30.2

View File

@ -1,3 +1,11 @@
%bcond_with snapshot_build
%if %{with snapshot_build}
# Unlock LLVM Snapshot LUA functions
%{llvm_sb_verbose}
%{llvm_sb}
%endif
%global toolchain clang %global toolchain clang
# Opt out of https://fedoraproject.org/wiki/Changes/fno-omit-frame-pointer # Opt out of https://fedoraproject.org/wiki/Changes/fno-omit-frame-pointer
@ -7,11 +15,21 @@
%bcond_without check %bcond_without check
%bcond_with compat_build %bcond_with compat_build
#global rc_ver 4 %global maj_ver 17
%global lld_srcdir lld-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:rc%{rc_ver}}.src
%global maj_ver 16
%global min_ver 0 %global min_ver 0
%global patch_ver 6 %global patch_ver 0
%global rc_ver 1
%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 lld_version %{maj_ver}.%{min_ver}.%{patch_ver}
%global lld_srcdir lld-%{lld_version}%{?rc_ver:rc%{rc_ver}}.src
%if %{with compat_build} %if %{with compat_build}
%global pkg_name lld%{maj_ver} %global pkg_name lld%{maj_ver}
@ -28,27 +46,26 @@
%endif %endif
Name: %{pkg_name} Name: %{pkg_name}
Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}} Version: %{lld_version}%{?rc_ver:~rc%{rc_ver}}%{?llvm_snapshot_version_suffix:~%{llvm_snapshot_version_suffix}}
Release: 2%{?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
URL: http://llvm.org URL: http://llvm.org
%if %{with snapshot_build}
Source0: %{llvm_snapshot_source_prefix}lld-%{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}}/%{lld_srcdir}.tar.xz Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{lld_srcdir}.tar.xz
Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{lld_srcdir}.tar.xz.sig Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{lld_srcdir}.tar.xz.sig
Source2: release-keys.asc Source2: release-keys.asc
%endif
ExcludeArch: s390x 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
# Backport from LLVM 17.
Patch2: 0001-lld-Use-installed-llvm_gtest-in-standalone-builds.patch
# Backport from LLVM 17.
Patch3: 0001-lld-Pass-random.randint-stop-parameter-as-int.patch
BuildRequires: clang BuildRequires: clang
BuildRequires: cmake BuildRequires: cmake
BuildRequires: ninja-build BuildRequires: ninja-build
@ -99,7 +116,10 @@ Summary: LLD shared libraries
Shared libraries for LLD. Shared libraries for LLD.
%prep %prep
%if %{without snapshot_build}
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%endif
%autosetup -n %{lld_srcdir} -p2 %autosetup -n %{lld_srcdir} -p2
%if %{with compat_build} %if %{with compat_build}
@ -130,6 +150,9 @@ sed 's/add_subdirectory(tools\/lld)//' -i CMakeLists.txt
-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}
-DLLVM_VERSION_SUFFIX="%{llvm_snapshot_version_suffix}" \
%endif
%if 0%{?__isa_bits} == 64 %if 0%{?__isa_bits} == 64
-DLLVM_LIBDIR_SUFFIX=64 \ -DLLVM_LIBDIR_SUFFIX=64 \
%else %else
@ -194,6 +217,11 @@ fi
%{install_libdir}/liblld*.so.* %{install_libdir}/liblld*.so.*
%changelog %changelog
%{?llvm_snapshot_changelog_entry}
* Wed Aug 02 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0.0~rc1-1
- Update to LLVM 17.0.0 RC1
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 16.0.6-2 * Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 16.0.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

View File

@ -1,2 +1,2 @@
SHA512 (lld-16.0.6.src.tar.xz) = 8df248785cd77e683f3daf9cab76a4a230305b881a7a844ef644b6a55fee366d5fcca23593ca09945ba8ddae0ae119042afe3f43547c106571e98004dbc7f1e6 SHA512 (lld-17.0.0rc1.src.tar.xz) = 3e4b24b34f24275bf265fa411573950bb4ea2d7944847d10aaeeff5ff1fd5269559ad4b218d9f569887e9b1a5c05d419a50905ab5340d4ef5749af72eab11e3f
SHA512 (lld-16.0.6.src.tar.xz.sig) = a9daa6804e9029b6f3acb80f1d391c557494d395dec6d49f4f5c922500b69e3bb7358c99948c74732c6ce9c560860218159bb485b18a7065b260b088cfc792c7 SHA512 (lld-17.0.0rc1.src.tar.xz.sig) = 06f0e8d3eba97cd6ac2eb28fabb3f4bbc50b63d7a313e5a557a775280040cd8f830f24c02740c19014b1303f4f7eebcbad0b0cd576ffba1a5b1af6e3954c1c3f