This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Enable stack clash protection for AArch64 linux in clang
Needs ReviewPublic

Authored by ostannard on Feb 4 2021, 2:31 AM.

Details

Summary

This allows the -fstack-clash-protection option to be used for AArch64
Linux.

Linux for AArch64 uses a 64k stack guard, instead of the 4k guard
assumed by the backend, so we set the stack-probe-size function
attribute to configure this, and the -mstack-probe-size= option can be
used to override this.

Diff Detail

Event Timeline

ostannard created this revision.Feb 4 2021, 2:31 AM
ostannard requested review of this revision.Feb 4 2021, 2:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 4 2021, 2:31 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
lkail added a subscriber: lkail.Feb 5 2021, 2:14 AM
ostannard updated this revision to Diff 321689.Feb 5 2021, 2:38 AM
alex added a subscriber: alex.Feb 22 2021, 4:32 PM
lzutao added a subscriber: lzutao.Feb 22 2021, 7:21 PM
emaste added a subscriber: emaste.Aug 23 2021, 11:51 AM
samtebbs added inline comments.
clang/lib/CodeGen/CodeGenModule.cpp
1669–1672

Would it be worth always setting the stack-probe-size attribute so that it is always correct and to avoid the risk of it going out-of-sync in case of changes to the assumed size in the backend?

Herald added a project: Restricted Project. · View Herald TranscriptNov 3 2022, 4:57 AM
Herald added a subscriber: MaskRay. · View Herald Transcript
emaste added inline comments.Feb 21 2023, 2:06 PM
clang/lib/Driver/ToolChains/Clang.cpp
3090

Why is this limited to isOSLinux() only?