[Driver] Temporarily probe aarch64-linux-gnu GCC installation
authorFangrui Song <i@maskray.me>
Mon, 5 Aug 2024 18:52:52 +0000 (11:52 -0700)
committerTobias Hieta <tobias@hieta.se>
Sat, 10 Aug 2024 09:58:27 +0000 (11:58 +0200)
As the comment explains, `*Triples[]` lists are discouraged and not
comprehensive anyway (e.g.
aarch64-unknown-linux-gnu/aarch64-unknown-linux-musl/aarch64-amazon-linux
do not work).

Boost incorrectly specifies --target=arm64-pc-linux ("arm64" should not
be used for Linux) and expects to probe "aarch64-linux-gnu". Add this
temporary workaround for the 19.x releases.

clang/lib/Driver/ToolChains/Gnu.cpp

index 52c2ee90b1b286cb54bb0e466165748824bb9e92..543f3965dfd4f6f08c3f7db3587d37230ed82711 100644 (file)
@@ -2463,7 +2463,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
   // lists should shrink over time. Please don't add more elements to *Triples.
   static const char *const AArch64LibDirs[] = {"/lib64", "/lib"};
   static const char *const AArch64Triples[] = {
-      "aarch64-none-linux-gnu", "aarch64-redhat-linux", "aarch64-suse-linux"};
+      "aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux",
+      "aarch64-suse-linux"};
   static const char *const AArch64beLibDirs[] = {"/lib"};
   static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu"};