[llvm] [PowerPC][clang] Fix triple constructor ambiguity causing "unknown" target triple on AIX (PR #147488)
Tony Varghese via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 8 02:08:36 PDT 2025
https://github.com/tonykuttai created https://github.com/llvm/llvm-project/pull/147488
PR #145685 introduced constructor overload ambiguity in the Triple class, causing `updateTripleOSVersion()` to construct Triple objects with `unknown` instead of the configured target triple (e.g., `powerpc-ibm-aix7.3.0.0`). This results in Clang driver errors like `error: unknown target triple 'unknown'`.
Used `Twine` constructor with braced initialization to bypass ambiguity.
>From e2993ccd44f25bed932b777589cf76078fad38de Mon Sep 17 00:00:00 2001
From: Tony Varghese <tony.varghese at ibm.com>
Date: Tue, 8 Jul 2025 05:04:12 -0400
Subject: [PATCH] [PowerPC][clang] Fix triple constructor ambiguity causing
"unknown" target triple on AIX
---
llvm/lib/TargetParser/Unix/Host.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/lib/TargetParser/Unix/Host.inc b/llvm/lib/TargetParser/Unix/Host.inc
index ef9e288ee3a01..93e1a3a809ddb 100644
--- a/llvm/lib/TargetParser/Unix/Host.inc
+++ b/llvm/lib/TargetParser/Unix/Host.inc
@@ -55,7 +55,7 @@ static std::string updateTripleOSVersion(std::string TargetTripleString) {
// On AIX, the AIX version and release should be that of the current host
// unless if the version has already been specified.
if (Triple(LLVM_HOST_TRIPLE).getOS() == Triple::AIX) {
- Triple TT(std::move(TargetTripleString));
+ Triple TT{Twine(TargetTripleString)};
if (TT.getOS() == Triple::AIX && !TT.getOSMajorVersion()) {
struct utsname name;
if (uname(&name) != -1) {
More information about the llvm-commits
mailing list