[llvm] [clang] main (PR #74441)

Andreas Schwab via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 5 01:38:17 PST 2023


https://github.com/andreas-schwab created https://github.com/llvm/llvm-project/pull/74441

- [Bazel] Add support for targeting Linux riscv64
- [Driver] Add riscv64-suse-linux triple


>From fa28e94a057a8916843178c4948d9f7a8ab7c146 Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab at suse.de>
Date: Mon, 2 May 2022 16:10:05 +0200
Subject: [PATCH 1/2] [Bazel] Add support for targeting Linux riscv64

---
 utils/bazel/llvm-project-overlay/llvm/config.bzl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/utils/bazel/llvm-project-overlay/llvm/config.bzl b/utils/bazel/llvm-project-overlay/llvm/config.bzl
index b15ec9e1bb399..6538da1cf38b4 100644
--- a/utils/bazel/llvm-project-overlay/llvm/config.bzl
+++ b/utils/bazel/llvm-project-overlay/llvm/config.bzl
@@ -93,6 +93,7 @@ llvm_config_defines = os_defines + select({
     "@bazel_tools//src/conditions:darwin_x86_64": native_arch_defines("X86", "x86_64-unknown-darwin"),
     "@bazel_tools//src/conditions:linux_aarch64": native_arch_defines("AArch64", "aarch64-unknown-linux-gnu"),
     "@bazel_tools//src/conditions:linux_ppc64le": native_arch_defines("PowerPC", "powerpc64le-unknown-linux-gnu"),
+    "@bazel_tools//src/conditions:linux_riscv64": native_arch_defines("RISCV", "riscv64-unknown-linux-gnu"),
     "@bazel_tools//src/conditions:linux_s390x": native_arch_defines("SystemZ", "systemz-unknown-linux_gnu"),
     "//conditions:default": native_arch_defines("X86", "x86_64-unknown-linux-gnu"),
 }) + [

>From 488ecd555ff5572663d75cd3a92de3ea856d5d57 Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab at suse.de>
Date: Mon, 4 Dec 2023 15:47:24 +0100
Subject: [PATCH 2/2] [Driver] Add riscv64-suse-linux triple

Fixes: 72256
---
 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 b875991844fff..00269e2d52e1c 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2423,7 +2423,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-suse-linux"};
 
   static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"};
   static const char *const SPARCv8Triples[] = {"sparc-linux-gnu",



More information about the cfe-commits mailing list