From 49070ca9258395ab73d09f2d161a2057d47a5663 Mon Sep 17 00:00:00 2001 From: U2FsdGVkX1 Date: Thu, 14 Dec 2023 13:39:41 +0800 Subject: [PATCH] Add riscv64 support --- ...ng-back-riscv64-anolis-linux-triplet.patch | 27 +++++++++++++++++++ clang.spec | 11 +++++--- 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 0001-Bring-back-riscv64-anolis-linux-triplet.patch diff --git a/0001-Bring-back-riscv64-anolis-linux-triplet.patch b/0001-Bring-back-riscv64-anolis-linux-triplet.patch new file mode 100644 index 0000000..5e2690c --- /dev/null +++ b/0001-Bring-back-riscv64-anolis-linux-triplet.patch @@ -0,0 +1,27 @@ +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-anolis-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 55d1b37..66c809e 100644 --- a/clang.spec +++ b/clang.spec @@ -1,4 +1,4 @@ -%define anolis_release 2 +%define anolis_release 3 %global toolchain clang @@ -48,6 +48,8 @@ Patch11: 1001-add-anolis-os-support-in-driver.patch Patch12: 0001-backport-LoongArch-patches.patch Patch13: 0002-LoongArch-fix-symbol-lookup-error.patch +Patch14: 0001-Bring-back-riscv64-anolis-linux-triplet.patch + # Patches for clang-tools-extra # See https://reviews.llvm.org/D120301 Patch201: 0001-clang-tools-extra-Make-test-dependency-on-LLVMHello-.patch @@ -240,13 +242,13 @@ rm test/CodeGen/profile-filter.c # Use ThinLTO to limit build time. %define _lto_cflags -flto=thin # And disable LTO on AArch64 entirely. -%ifarch aarch64 +%ifarch aarch64 riscv64 %define _lto_cflags %{nil} %endif sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@/64/g' test/lit.cfg.py -%ifarch aarch64 +%ifarch aarch64 riscv64 # Decrease debuginfo verbosity to reduce memory consumption during final library linking %global optflags %(echo %{optflags} | sed 's/-g /-g1 /') @@ -469,6 +471,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} %{__ninja} check-all -C %{__cmake_buildd %{python3_sitelib}/clang/ %changelog +* Thu Nov 14 2023 U2FsdGVkX1 - 16.0.6-2 +- Add riscv64 support + * Fri Aug 11 2023 Chen Li - 16.0.6-2 - Backport LoongArch patches from llvmorg-17.0.0-rc2 - Add the triple of loongarch64 for anolis os -- Gitee