[llvm-branch-commits] [clang] [Driver] Temporarily probe aarch64-linux-gnu GCC installation (PR #102039)

Fangrui Song via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Aug 5 12:05:03 PDT 2024


https://github.com/MaskRay created https://github.com/llvm/llvm-project/pull/102039

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.

Fix #101525

>From 5d45d1a088ad969ef26186c71ee2b782b0cd559e Mon Sep 17 00:00:00 2001
From: Fangrui Song <i at maskray.me>
Date: Mon, 5 Aug 2024 11:52:52 -0700
Subject: [PATCH] [Driver] Temporarily probe aarch64-linux-gnu GCC installation

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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index 52c2ee90b1b28..543f3965dfd4f 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -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"};
 



More information about the llvm-branch-commits mailing list