-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clang] UEFI handle unsupported triples. #124824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The only architecture currently being supported (still a WIP) is x86_64. Other UEFI triples targeting other architectures will now report an error.
@llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-clang Author: Prabhuk (Prabhuk) ChangesFull diff: https://github.com/llvm/llvm-project/pull/124824.diff 1 Files Affected:
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 87855fdb799710..f1cd6353234a90 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -6677,6 +6677,8 @@ const ToolChain &Driver::getToolChain(const ArgList &Args,
TC = std::make_unique<toolchains::AMDGPUToolChain>(*this, Target, Args);
break;
case llvm::Triple::UEFI:
+ if(Target.getArch() != llvm::Triple::x86_64)
+ llvm::report_fatal_error("Currently the only architecture supported by *-uefi triples are x86_64.");
TC = std::make_unique<toolchains::UEFI>(*this, Target, Args);
break;
case llvm::Triple::Win32:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch needs a test for the new driver logic. I'd also suggest adding some error handling in LLVM, so that it isn't possible to try an generate wrong code if this triple is supplied somewhere else (e.g. by another frontend or through opt).
✅ With the latest revision this PR passed the C/C++ code formatter. |
+1 for a test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Lets try to follow up w/ something on the llvm side too though.
The only architecture currently being supported (still a WIP) is
x86_64. Other UEFI triples targeting other architectures will now
report an
unknown target triple
error.