[clang] [Driver][RISCV] Add the riscv*-redhat-linux triples (PR #228450)

Tulio Magno Quites Machado Filho via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 2 07:19:30 PDT 2026


https://github.com/tuliom created https://github.com/llvm/llvm-project/pull/228450

Add the redhat vendor triples for riscv*.

This is particularly important when running tests because there is no way to set compiler flags that are inherited by tests.

>From f9f82f8671079ca37a52b771997700050ecd1ae6 Mon Sep 17 00:00:00 2001
From: Tulio Magno Quites Machado Filho <tuliom at redhat.com>
Date: Wed, 30 Sep 2026 17:40:56 -0300
Subject: [PATCH] [Driver][RISCV] Add the riscv*-redhat-linux triples

Add the redhat vendor triples for riscv*.

This is particularly important when running tests because there is no
way to set compiler flags that are inherited by tests.
---
 clang/lib/Driver/ToolChains/Gnu.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index 7591d9f7fa418a..90fc71c147364d 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2456,10 +2456,12 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
 
   static const char *const RISCV32LibDirs[] = {"/lib32", "/lib"};
   static const char *const RISCV32Triples[] = {"riscv32-unknown-linux-gnu",
-                                               "riscv32-unknown-elf"};
+                                               "riscv32-unknown-elf",
+                                               "riscv32-redhat-linux"};
   static const char *const RISCV64LibDirs[] = {"/lib64", "/lib"};
   static const char *const RISCV64Triples[] = {"riscv64-unknown-linux-gnu",
-                                               "riscv64-unknown-elf"};
+                                               "riscv64-unknown-elf",
+                                               "riscv64-redhat-linux"};
 
   static const char *const RISCV32beLibDirs[] = {"/lib32", "/lib"};
   static const char *const RISCV32beTriples[] = {"riscv32be-unknown-linux-gnu",



More information about the cfe-commits mailing list