This is an archive of the discontinued LLVM Phabricator instance.

[clang][ARM] re-use arm::isHardTPSupported for hardware TLS check
ClosedPublic

Authored by nickdesaulniers on Dec 23 2021, 12:15 PM.

Details

Summary

This conditional check for -mstack-protector-guard=tls got out of sync
with the conditional check for -mtp=cp15 by me in D114116, because I
forgot about the similar check added in D113026.

Re-use the code in arm::isHardTPSupported so that these aren't out of
sync.

Interestingly, our CI reported this when testing
-mstack-protector-guard=tls; it was only reproducible with Debian's LLVM
and not upstream LLVM due to this out of tree patch:
https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/blob/snapshot/debian/patches/930008-arm.diff

Fixes: https://github.com/ClangBuiltLinux/linux/issues/1502

Diff Detail

Event Timeline

nickdesaulniers requested review of this revision.Dec 23 2021, 12:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 23 2021, 12:15 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
nickdesaulniers planned changes to this revision.Dec 23 2021, 1:00 PM
nickdesaulniers added inline comments.
clang/lib/Driver/ToolChains/Clang.cpp
3219–3226

If I refactor arm::getReadTPMode a little, we might just be able to use that. Let me see if I can make that work like I'm imagining.

clang/lib/Driver/ToolChains/Clang.cpp
3219–3226

eh, now that I've tried that, I think this approach is cleaner as is. Sorry for the noise.

nickdesaulniers requested review of this revision.Dec 23 2021, 1:49 PM
clang/lib/Driver/ToolChains/Clang.cpp
3219–3226
ardb accepted this revision.Dec 24 2021, 1:20 AM
This revision is now accepted and ready to land.Dec 24 2021, 1:20 AM
This revision was landed with ongoing or failed builds.Dec 28 2021, 1:29 PM
This revision was automatically updated to reflect the committed changes.