diff mbox series

[3/4] clang/llvm: add missing instance of Distro class in Linux.cpp

Message ID 20260622132021.37598-4-joaomarcos.costa@bootlin.com
State Under Review
Headers show
Series llvm/clang: fix some syntax issues in llvm-project-source | expand

Commit Message

João Marcos Costa June 22, 2026, 1:20 p.m. UTC
As in the own patch's message:

This instance will be used to perform the checks added by do_preconfigure
task, such as "Distro.IsOpenEmbedded()", or "Distro.IsPOKY()".

Without such instance, the compiler raises an "expected unqualified-id" error.

Something similar is performed by another patch, by the way:

0009-clang-Define-releative-gcc-installation-dir.patch:+  Distro Distro(D.getVFS(), TargetTriple);
0009-clang-Define-releative-gcc-installation-dir.patch:+           Distro.IsOpenEmbedded()},

Signed-off-by: João Marcos Costa <joaomarcos.costa@bootlin.com>
---
 ...istro-instance-to-getMultiarchTriple.patch | 35 +++++++++++++++++++
 meta/recipes-devtools/clang/common.inc        |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 meta/recipes-devtools/clang/clang/0001-llvm-clang-Add-Distro-instance-to-getMultiarchTriple.patch
diff mbox series

Patch

diff --git a/meta/recipes-devtools/clang/clang/0001-llvm-clang-Add-Distro-instance-to-getMultiarchTriple.patch b/meta/recipes-devtools/clang/clang/0001-llvm-clang-Add-Distro-instance-to-getMultiarchTriple.patch
new file mode 100644
index 0000000000..90dd51865b
--- /dev/null
+++ b/meta/recipes-devtools/clang/clang/0001-llvm-clang-Add-Distro-instance-to-getMultiarchTriple.patch
@@ -0,0 +1,35 @@ 
+From ef7b8a5409c9a1789c6e6679a7e67e8cebe7ab6f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jo=C3=A3o=20Marcos=20Costa?= <joaomarcos.costa@bootlin.com>
+Date: Sun, 21 Jun 2026 17:33:10 +0000
+Subject: [PATCH] llvm/clang: Add Distro instance to getMultiarchTriple()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This instance will be used to perform the checks added by do_preconfigure
+task, such as "Distro.IsOpenEmbedded()", or "Distro.IsPOKY()".
+
+Without such instance, the compiler raises an "expected unqualified-id" error.
+
+Upstream-Status: Inappropriate [oe-core specific]
+
+Signed-off-by: João Marcos Costa <joaomarcos.costa@bootlin.com>
+---
+ clang/lib/Driver/ToolChains/Linux.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
+index c6d6e20db..52c27f559 100644
+--- a/clang/lib/Driver/ToolChains/Linux.cpp
++++ b/clang/lib/Driver/ToolChains/Linux.cpp
+@@ -45,6 +45,7 @@ std::string Linux::getMultiarchTriple(const Driver &D,
+   bool IsAndroid = TargetTriple.isAndroid();
+   bool IsMipsR6 = TargetTriple.getSubArch() == llvm::Triple::MipsSubArch_r6;
+   bool IsMipsN32Abi = TargetTriple.getEnvironment() == llvm::Triple::GNUABIN32;
++  Distro Distro(D.getVFS(), TargetTriple);
+ 
+   // For most architectures, just use whatever we have rather than trying to be
+   // clever.
+-- 
+2.39.5
+
diff --git a/meta/recipes-devtools/clang/common.inc b/meta/recipes-devtools/clang/common.inc
index 441ea099a9..19b43d6613 100644
--- a/meta/recipes-devtools/clang/common.inc
+++ b/meta/recipes-devtools/clang/common.inc
@@ -60,6 +60,7 @@  SRC_URI = "\
     file://0039-Rename-UNUSED-and-UNKNOWN-elements-of-OffloadArch-enum.patch \
     file://0040-libcxxabi-declare-__gnu_unwind_frame-in-cxa_personal.patch \
     file://0041-Consolidate-and-fix-sysroot-based-compiler-rt-search.patch \
+    file://0001-llvm-clang-Add-Distro-instance-to-getMultiarchTriple.patch \
 "
 # Fallback to no-PIE if not set
 GCCPIE ??= ""