From our tree..
Disable the Load Stack Guard for OpenBSD on AArch64. We don't use it
on any other platform and it causes a segfault in combination with our
IR Stack Guard.
Differential D30407
AArch64: Disable the Load Stack Guard on OpenBSD/aarch64 brad on Feb 27 2017, 7:34 AM. Authored by
Details
Diff Detail
Event TimelineComment Actions OK, I've digged a bit more deeply and I don't think this is the right fix. Currently we seem to have 2 relevant toggles:
In most places (that return nullptr in the first case), useLoadStackGuardNode switches between a pseudo-instruction that will load from the specified global, and an explicit load from that global in the DAG. However, in the one place where you have an @llvm.stackprotector call the load is (correctly) skipped, unless useLoadStackGuardNode returns true. So we've got two issues here:
The newer (SDAG) scheme appears to have enhanced security (no spills of the guard, better epilogue behaviour), so it's probably in OpenBSD's best interests to switch. Comment Actions Oh, some references:
This is SelectionDAGBuilder.cpp:5461 in trunk.
This might be as simple as moving OpenBSD's special case in TargetLoweringBase.cpp (getIRStackGuard) to the following 2 functions, possibly with some light refactoring to avoid duplication. |