[Lldb-commits] [lldb] [lldb][AArch64] Fix launching Arm32 applications on AArch64 Linux (PR #211692)
Igor Kudrin via lldb-commits
lldb-commits at lists.llvm.org
Fri Jul 24 19:16:23 PDT 2026
================
@@ -147,6 +147,12 @@ void HostInfoLinux::ComputeHostArchitectureSupport(ArchSpec &arch_32,
if (arch_32.IsValid()) {
if (arch_32.GetTriple().getVendor() == llvm::Triple::UnknownVendor)
arch_32.GetTriple().setVendorName(llvm::StringRef());
+ // For Linux/AArch64, the environment components of triples for 64- and
+ // 32-bit targets do not match, for example, "aarch64--linux-gnu" and
+ // "arm--linux-eabihf". Clear the borrowed environment.
+ if (arch_64.IsValid() && arch_64.GetTriple().isAArch64() &&
+ arch_64.GetTriple().getEnvironment() == llvm::Triple::GNU)
+ arch_32.GetTriple().setEnvironment(llvm::Triple::UnknownEnvironment);
----------------
igorkudrin wrote:
Do you mean something like this (generated with the help of ChatGPT):
```
// The supported 32-bit architecture is derived from the host triple by
// replacing only the architecture component, preserving the host's
// environment (e.g. "gnu" from "aarch64-unknown-linux-gnu"). Native Arm32
// targets commonly use environments such as "gnueabihf" or "musleabi",
// causing the triples to compare as incompatible. These environment
// differences describe the target ABI or C library and are not relevant when
// determining whether a Linux/AArch64 host can support Arm32 targets, so
// clear the environment before matching.
```
https://github.com/llvm/llvm-project/pull/211692
More information about the lldb-commits
mailing list