Skip to content

Commit 47b73eb

Browse files
authored
When building for baremetal targets, accept any arch that LLVM supports (#67093)
1 parent 8df508c commit 47b73eb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/Basic/LangOptions.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,14 @@ std::pair<bool, bool> LangOptions::setTarget(llvm::Triple triple) {
390390
break;
391391
default:
392392
UnsupportedArch = true;
393+
394+
if (Target.getOSName() == "none") {
395+
if (Target.getArch() != llvm::Triple::ArchType::UnknownArch) {
396+
auto ArchName = llvm::Triple::getArchTypeName(Target.getArch());
397+
addPlatformConditionValue(PlatformConditionKind::Arch, ArchName);
398+
UnsupportedArch = false;
399+
}
400+
}
393401
}
394402

395403
if (UnsupportedOS || UnsupportedArch)

0 commit comments

Comments
 (0)