[Lldb-commits] [lldb] [lldb][AArch64] Fix launching Arm32 applications on AArch64 Linux (PR #211692)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 24 06:47:57 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);
----------------
DavidSpickett wrote:

Typical triples:
```
arm-linux-gnueabi
arm-linux-gnueabihf
arm-linux-musleabi
arm-linux-musleabihf
```
The `hf` hard float vs. soft float it's fine to remove, because soft float doesn't require anything and hard float can run on any AArch64 machine.

The C library part, I suppose we can say that if you run a `-musl` binary and it fails because you don't have musl, that's on you to figure out. Just as it would be if you ran it normally outside of lldb.

(and you usually need 32-bit libraries installed anyway and that's certainly not up to lldb to check)

So I agree with this change, but could you please update the comment to state that justification? Assuming you agree with that logic.

https://github.com/llvm/llvm-project/pull/211692


More information about the lldb-commits mailing list