[clang] [Offload] Do not pass `-fcf-protection=` for offloading (PR #88402)
Artem Belevich via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 12 10:44:16 PDT 2024
================
@@ -6867,8 +6867,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-nogpulib");
if (Arg *A = Args.getLastArg(options::OPT_fcf_protection_EQ)) {
- CmdArgs.push_back(
- Args.MakeArgString(Twine("-fcf-protection=") + A->getValue()));
+ // Do not pass this argument to the offloading device if the target does not
+ // support it.
+ // TODO: We need a better way to detect incompatible options for offloading.
+ if (JA.getOffloadingDeviceKind() == Action::OFK_None ||
+ (!TC.getTriple().isAMDGPU() && !TC.getTriple().isNVPTX() &&
----------------
Artem-B wrote:
Nit: I'd collapse negations into one:
```
!(TC.getTriple().isAMDGPU() || TC.getTriple().isNVPTX() || TC.getTriple().isSPIRV())
```
https://github.com/llvm/llvm-project/pull/88402
More information about the cfe-commits
mailing list