Cleanup, rename and normalize patch serie

This commit is contained in:
serge-sans-paille 2021-02-25 15:25:34 +01:00
parent 8eecd4343e
commit 2a948c78b0
6 changed files with 33 additions and 8049 deletions

View File

@ -1,48 +0,0 @@
From d146e98b7f94940386f60a902031b2a9b6237730 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Tue, 4 Jul 2017 16:03:34 +0000
Subject: [PATCH] ELF: Only unlink regular files
Summary:
If the output file is a character file (e.g. /dev/null) unlinking it could
potentially destabilize the user's system. For example,
unlinking causes `lld %input -o /dev/null` to replace /dev/null with a
regular file, which will lead to unexpected behavior in other programs
that read from /dev/null, and worse than expected peformance for
programs that write to /dev/null.
This makes it possible to run the test-release.sh script as root.
Prior to this patch, the ELF/basic.s test would replace
/dev/null with a regular file, which would cause crashes in llvm
test-suite programs that piped /dev/null to stdin.
For example, if you run the test-relase.sh script as root,
Reviewers: ruiu
Reviewed By: ruiu
Subscribers: emaste, llvm-commits
Differential Revision: https://reviews.llvm.org/D34917
---
ELF/Writer.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ELF/Writer.cpp b/ELF/Writer.cpp
index b004a4f..d52165b 100644
--- a/ELF/Writer.cpp
+++ b/ELF/Writer.cpp
@@ -1650,7 +1650,8 @@ template <class ELFT> void Writer<ELFT>::writeHeader() {
// This function spawns a background thread to call unlink.
// The calling thread returns almost immediately.
static void unlinkAsync(StringRef Path) {
- if (!Config->Threads || !sys::fs::exists(Config->OutputFile))
+ if (!Config->Threads || !sys::fs::exists(Config->OutputFile) ||
+ !sys::fs::is_regular_file(Config->OutputFile))
return;
// First, rename Path to avoid race condition. We cannot remove
--
1.8.3.1

View File

@ -1,19 +1,20 @@
From e5bdf4580677da063abe8d3880fbab9eaa7a7efe Mon Sep 17 00:00:00 2001
From 760568cd24acd6ae9083b0dfea2c7c0ea6f0adc2 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Thu, 30 Aug 2018 08:53:56 -0700
Subject: [PATCH] CMake: Check for gtest headers even if lit.py is not present
Subject: [PATCH 1/2] [PATCH][lld] CMake: Check for gtest headers even if
lit.py is not present
This makes it possible to build the unittests even withotu a full
checkout of the llvm source tree.
---
CMakeLists.txt | 15 +++++++++------
lld/CMakeLists.txt | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e2fbdbf..c9b2927 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,6 +75,15 @@ Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
diff --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt
index d4e561b..a7406d1c 100644
--- a/lld/CMakeLists.txt
+++ b/lld/CMakeLists.txt
@@ -65,6 +65,15 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(LLVM_UTILS_PROVIDED ON)
endif()
@ -29,7 +30,7 @@ index e2fbdbf..c9b2927 100644
if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
# Note: path not really used, except for checking if lit was found
set(LLVM_LIT ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
@@ -84,12 +93,6 @@ Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
@@ -74,12 +83,6 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(LLVM_UTILS_PROVIDED ON)
set(LLD_TEST_DEPS FileCheck not)
endif()

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,20 @@
diff -Naur lld-12.0.0rc1.src.orig/include/mach-o/compact_unwind_encoding.h lld-12.0.0rc1.src/include/mach-o/compact_unwind_encoding.h
--- lld-12.0.0rc1.src.orig/include/mach-o/compact_unwind_encoding.h 1970-01-01 01:00:00.000000000 +0100
+++ lld-12.0.0rc1.src/include/mach-o/compact_unwind_encoding.h 2021-02-16 19:55:22.000000000 +0100
From 43dfe54ce017c8d37eaec480a2f13a492bbc4203 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com>
Date: Thu, 25 Feb 2021 14:24:14 +0100
Subject: [PATCH 2/2] [PATCH][lld] Import compact_unwind_encoding.h from
libunwind
This avoids an implicit cross package dependency
---
lld/include/mach-o/compact_unwind_encoding.h | 477 +++++++++++++++++++++++++++
1 file changed, 477 insertions(+)
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
new file mode 100644
index 0000000..5301b10
--- /dev/null
+++ b/lld/include/mach-o/compact_unwind_encoding.h
@@ -0,0 +1,477 @@
+//===------------------ mach-o/compact_unwind_encoding.h ------------------===//
+//
@ -479,3 +493,6 @@ diff -Naur lld-12.0.0rc1.src.orig/include/mach-o/compact_unwind_encoding.h lld-1
+
+#endif
+
--
1.8.3.1

View File

@ -24,10 +24,10 @@ Source4: lit.lld-test.cfg.py
ExcludeArch: s390x
Patch0: 0001-CMake-Check-for-gtest-headers-even-if-lit.py-is-not-.patch
Patch0: 0001-PATCH-lld-CMake-Check-for-gtest-headers-even-if-lit..patch
# Bundle libunwind header need during build for MachO support
Patch1: include-libunwind-header.patch
Patch1: 0002-PATCH-lld-Import-compact_unwind_encoding.h-from-libu.patch
BuildRequires: gcc
BuildRequires: gcc-c++
@ -83,7 +83,7 @@ LLVM regression tests.
%prep
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%autosetup -n %{lld_srcdir} -p1
%autosetup -n %{lld_srcdir} -p2
%build