Index: lldb/source/Host/common/HostInfoBase.cpp =================================================================== --- lldb/source/Host/common/HostInfoBase.cpp +++ lldb/source/Host/common/HostInfoBase.cpp @@ -209,7 +209,8 @@ normalized_triple.setVendor(host_triple.getVendor()); if (normalized_triple.getOSName().empty()) normalized_triple.setOS(host_triple.getOS()); - if (normalized_triple.getEnvironmentName().empty()) + if (normalized_triple.getEnvironmentName().empty() && + !host_triple.getEnvironmentName().empty()) normalized_triple.setEnvironment(host_triple.getEnvironment()); return ArchSpec(normalized_triple); } Index: lldb/unittests/Host/HostInfoTest.cpp =================================================================== --- lldb/unittests/Host/HostInfoTest.cpp +++ lldb/unittests/Host/HostInfoTest.cpp @@ -43,6 +43,9 @@ // Test LLDB_ARCH_DEFAULT EXPECT_EQ(HostInfo::GetAugmentedArchSpec(LLDB_ARCH_DEFAULT).GetTriple(), HostInfo::GetArchitecture(HostInfo::eArchKindDefault).GetTriple()); + EXPECT_NE( + HostInfo::GetAugmentedArchSpec("armv7k").GetTriple().getEnvironmentName(), + "unknown"); } TEST_F(HostInfoTest, GetHostname) {