The feature does not have an OS dependency.
See also D68720 and https://reviews.freebsd.org/D27366
Differential D92100
[clang] do not limit -fstack-clash-protection to Linux Authored by emaste on Nov 25 2020, 7:25 AM.
Details
The feature does not have an OS dependency. See also D68720 and https://reviews.freebsd.org/D27366
Diff Detail Event Timeline
Comment Actions lgtm
Comment Actions The backend implementation of stack-clash-protection is incompatible with Windows, see https://github.com/llvm/llvm-project/blob/master/llvm/lib/Target/X86/X86FrameLowering.cpp#L486 cpp
void X86FrameLowering::emitStackProbe(MachineFunction &MF,
MachineBasicBlock &MBB,
MachineBasicBlock::iterator MBBI,
const DebugLoc &DL, bool InProlog) const {
const X86Subtarget &STI = MF.getSubtarget<X86Subtarget>();
if (STI.isTargetWindowsCoreCLR()) {
if (InProlog) {
BuildMI(MBB, MBBI, DL, TII.get(X86::STACKALLOC_W_PROBING))
.addImm(0 /* no explicit stack size */);
} else {
emitStackProbeInline(MF, MBB, MBBI, DL, false);
}
} else {
emitStackProbeCall(MF, MBB, MBBI, DL, InProlog);
}
}This is possibly addressed by https://reviews.llvm.org/D92245 though. Comment Actions Perhaps if (EffectiveTriple.isOSWindows() || EffectiveTriple.isOSDarwin()) return; here too | ||||||||||||||||||||||||||||||||||||
IMO this comment would help. I had forgotten System Z is an architecture.