This is an archive of the discontinued LLVM Phabricator instance.

Remove lazy thread-initialisation
ClosedPublic

Authored by mmalcomson on Oct 29 2019, 10:55 AM.

Details

Reviewers
eugenis
pcc
Group Reviewers
Restricted Project
Commits
rG91167e22eca5: [hwasan] Remove lazy thread-initialisation
Summary

As I asked in the comments of https://reviews.llvm.org/D69199, if we're no longer accounting for the late-binding feature then I believe we can remove this lazy thread initialisation complexity.
I've tested with clang and gcc on linux that various threading programs work as expected.

Remove lazy thread initialisation

This was an experiment made possible by a non-standard feature of the Android
dynamic loader.

It required introducing a flag to tell the compiler which ABI was being targeted.
This flag is no longer needed, since the generated code now works for both ABI's.

We leave that flag untouched for backwards compatibility. This also means that
if we need to distinguish between targeted ABI's again we can do that without
disturbing any existing workflows.

We leave a comment in the source code and mention in the help text to explain
this for any confused person reading the code in the future.

Diff Detail

Event Timeline

mmalcomson created this revision.Oct 29 2019, 10:55 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 29 2019, 10:55 AM

LGTM keeping the flag looks like the right thing to do.
I'll leave this for @pcc to accept.

Ping @pcc -- does this change to remove lazy thread initialisation look OK?

(I'm looking to start upstreaming hwasan instrumentation to GCC soon, and need to know whether GCC must insert the thread initialisation code in function prologues)

pcc accepted this revision.Nov 1 2019, 8:34 AM

LGTM

This revision is now accepted and ready to land.Nov 1 2019, 8:34 AM
This revision was automatically updated to reflect the committed changes.
llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp