Skip to content

Commit 8d17824

Browse files
authored
[clang][Driver] Fix Linux/sparc64 -m32 (llvm#98124)
`clang` currently fails to find a GCC installation on Linux/sparc64 with `-m32`. `strace` reveals that `clang` tries to access `/usr/lib/gcc/sparcv9-linux-gnu` (which doesn't exist) instead of `/usr/lib/gcc/sparc64-linux-gnu`. It turns out that 20d497c was overeager in removing some of the necessary directories. Fixed by reverting the Linux/sparc* part of the patch. Tested on `sparc64-unknown-linux-gnu`.
1 parent 4b2daec commit 8d17824

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clang/lib/Driver/ToolChains/Gnu.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,9 +2564,11 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
25642564
"riscv64-unknown-elf"};
25652565

25662566
static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"};
2567-
static const char *const SPARCv8Triples[] = {"sparcv8-linux-gnu"};
2567+
static const char *const SPARCv8Triples[] = {"sparc-linux-gnu",
2568+
"sparcv8-linux-gnu"};
25682569
static const char *const SPARCv9LibDirs[] = {"/lib64", "/lib"};
2569-
static const char *const SPARCv9Triples[] = {"sparcv9-linux-gnu"};
2570+
static const char *const SPARCv9Triples[] = {"sparc64-linux-gnu",
2571+
"sparcv9-linux-gnu"};
25702572

25712573
static const char *const SystemZLibDirs[] = {"/lib64", "/lib"};
25722574
static const char *const SystemZTriples[] = {

0 commit comments

Comments
 (0)