Skip to content

Commit 06cd000

Browse files
committed
When building for baremetal targets, accept any arch that LLVM supports
1 parent cb61903 commit 06cd000

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/Basic/LangOptions.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,14 @@ std::pair<bool, bool> LangOptions::setTarget(llvm::Triple triple) {
389389
addPlatformConditionValue(PlatformConditionKind::Arch, "riscv64");
390390
break;
391391
default:
392-
UnsupportedArch = true;
392+
if ((Target.getOSName() == "none") &&
393+
(Target.getArch() != llvm::Triple::ArchType::UnknownArch)) {
394+
addPlatformConditionValue(
395+
PlatformConditionKind::Arch,
396+
llvm::Triple::getArchTypeName(Target.getArch()));
397+
} else {
398+
UnsupportedArch = true;
399+
}
393400
}
394401

395402
if (UnsupportedOS || UnsupportedArch)

0 commit comments

Comments
 (0)