From 27ffcc82c850937c0346e337b975832a68a07e66 Mon Sep 17 00:00:00 2001 From: David Abdurachmanov Date: Mon, 24 Apr 2023 11:30:32 +0300 Subject: [PATCH] Replace riscv64 patch (adjusted to Clang 16) Signed-off-by: David Abdurachmanov --- 0001-Add-support-for-riscv64.patch | 43 +++++++++++++++++++ ...ng-back-riscv64-redhat-linux-triplet.patch | 27 ------------ clang.spec | 2 +- 3 files changed, 44 insertions(+), 28 deletions(-) create mode 100644 0001-Add-support-for-riscv64.patch delete mode 100644 0001-Bring-back-riscv64-redhat-linux-triplet.patch diff --git a/0001-Add-support-for-riscv64.patch b/0001-Add-support-for-riscv64.patch new file mode 100644 index 0000000..cd8f49b --- /dev/null +++ b/0001-Add-support-for-riscv64.patch @@ -0,0 +1,43 @@ +From 44bea1c1866d1d8e623f5a17db1bca0ea5abce83 Mon Sep 17 00:00:00 2001 +From: David Abdurachmanov +Date: Mon, 24 Apr 2023 08:28:31 +0000 +Subject: [PATCH] Add support for riscv64 + +Signed-off-by: David Abdurachmanov +--- + clang-16.0.1.src/lib/Driver/ToolChains/Gnu.cpp | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/clang-16.0.1.src/lib/Driver/ToolChains/Gnu.cpp b/clang-16.0.1.src/lib/Driver/ToolChains/Gnu.cpp +index 8fdf4de4..d682410d 100644 +--- a/clang-16.0.1.src/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang-16.0.1.src/lib/Driver/ToolChains/Gnu.cpp +@@ -1994,6 +1994,7 @@ static const char *ConvertToGccTriple(StringRef CandidateTriple) { + .Case("aarch64-redhat-linux-gnu", "aarch64-redhat-linux") + .Case("i686-redhat-linux-gnu", "i686-redhat-linux") + .Case("ppc64le-redhat-linux-gnu", "ppc64le-redhat-linux") ++ .Case("riscv64-redhat-linux-gnu", "riscv64-redhat-linux") + .Case("s390x-redhat-linux-gnu", "s390x-redhat-linux") + .Case("x86_64-redhat-linux-gnu", "x86_64-redhat-linux") + .Default(NULL); +@@ -2346,7 +2347,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( + static const char *const RISCV64LibDirs[] = {"/lib64", "/lib"}; + static const char *const RISCV64Triples[] = {"riscv64-unknown-linux-gnu", + "riscv64-linux-gnu", +- "riscv64-unknown-elf"}; ++ "riscv64-unknown-elf", ++ "riscv64-redhat-linux"}; + + static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"}; + static const char *const SPARCv8Triples[] = {"sparc-linux-gnu", +@@ -2890,6 +2892,7 @@ Generic_GCC::getDefaultUnwindTableLevel(const ArgList &Args) const { + // rhbz#1655546 + case llvm::Triple::systemz: + case llvm::Triple::arm: ++ case llvm::Triple::riscv64: + return UnwindTableLevel::Asynchronous; + default: + return UnwindTableLevel::None; +-- +2.40.0 + diff --git a/0001-Bring-back-riscv64-redhat-linux-triplet.patch b/0001-Bring-back-riscv64-redhat-linux-triplet.patch deleted file mode 100644 index 993f0a0..0000000 --- a/0001-Bring-back-riscv64-redhat-linux-triplet.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 2dcf8703706e0a5b7b45991e5cd10dd38f1d8c4b Mon Sep 17 00:00:00 2001 -From: David Abdurachmanov -Date: Thu, 24 Nov 2022 06:26:46 +0200 -Subject: [PATCH] Bring back riscv64-redhat-linux triplet - -Signed-off-by: David Abdurachmanov ---- - clang/lib/Driver/ToolChains/Gnu.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp -index e955835b..e5c17544 100644 ---- a/clang/lib/Driver/ToolChains/Gnu.cpp -+++ b/clang/lib/Driver/ToolChains/Gnu.cpp -@@ -2302,7 +2302,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( - static const char *const RISCV64LibDirs[] = {"/lib64", "/lib"}; - static const char *const RISCV64Triples[] = {"riscv64-unknown-linux-gnu", - "riscv64-linux-gnu", -- "riscv64-unknown-elf"}; -+ "riscv64-unknown-elf", -+ "riscv64-redhat-linux"}; - - static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"}; - static const char *const SPARCv8Triples[] = {"sparc-linux-gnu", --- -2.37.1 - diff --git a/clang.spec b/clang.spec index 2807cef..68c9d54 100644 --- a/clang.spec +++ b/clang.spec @@ -78,7 +78,7 @@ Patch8: D138472.diff Patch10: fix-ieee128-cross.diff -Patch20: 0001-Bring-back-riscv64-redhat-linux-triplet.patch +Patch20: 0001-Add-support-for-riscv64.patch %if %{without compat_build} # Patches for clang-tools-extra