Skip to content

Commit a077271

Browse files
committed
Revert code change of D63497 & D74399 for riscv64-*-linux GCC detection
This partially reverts commits 1fc2a47 and 9816e72. See D109727. Replacing config.guess in favor of {gcc,clang} -dumpmachine can avoid the riscv64-{redhat,suse}-linux GCC detection. Acked-by: Luís Marques <[email protected]>
1 parent d7d7060 commit a077271

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

clang/lib/Driver/ToolChains/Gnu.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2075,6 +2075,12 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
20752075
// Declare a bunch of static data sets that we'll select between below. These
20762076
// are specifically designed to always refer to string literals to avoid any
20772077
// lifetime or initialization issues.
2078+
//
2079+
// The *Triples variables hard code some triples so that, for example,
2080+
// --target=aarch64 (incomplete triple) can detect lib/aarch64-linux-gnu.
2081+
// They are not needed when the user has correct LLVM_DEFAULT_TARGET_TRIPLE
2082+
// and always uses the full --target (e.g. --target=aarch64-linux-gnu). The
2083+
// lists should shrink over time. Please don't add more elements to *Triples.
20782084
static const char *const AArch64LibDirs[] = {"/lib64", "/lib"};
20792085
static const char *const AArch64Triples[] = {
20802086
"aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux",
@@ -2182,9 +2188,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
21822188
static const char *const RISCV64LibDirs[] = {"/lib64", "/lib"};
21832189
static const char *const RISCV64Triples[] = {"riscv64-unknown-linux-gnu",
21842190
"riscv64-linux-gnu",
2185-
"riscv64-unknown-elf",
2186-
"riscv64-redhat-linux",
2187-
"riscv64-suse-linux"};
2191+
"riscv64-unknown-elf"};
21882192

21892193
static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"};
21902194
static const char *const SPARCv8Triples[] = {"sparc-linux-gnu",

0 commit comments

Comments
 (0)