Skip to content

Commit

Permalink
[clang][Driver] Fix Linux/sparc64 -m32 (#98124)
Browse files Browse the repository at this point in the history
`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`.
  • Loading branch information
rorth committed Jul 10, 2024
1 parent 4b2daec commit 8d17824
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions clang/lib/Driver/ToolChains/Gnu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2564,9 +2564,11 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
"riscv64-unknown-elf"};

static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"};
static const char *const SPARCv8Triples[] = {"sparcv8-linux-gnu"};
static const char *const SPARCv8Triples[] = {"sparc-linux-gnu",
"sparcv8-linux-gnu"};
static const char *const SPARCv9LibDirs[] = {"/lib64", "/lib"};
static const char *const SPARCv9Triples[] = {"sparcv9-linux-gnu"};
static const char *const SPARCv9Triples[] = {"sparc64-linux-gnu",
"sparcv9-linux-gnu"};

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

0 comments on commit 8d17824

Please sign in to comment.