This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Read ARM feature bits using Fuchsia APIs.
ClosedPublic

Authored by flowerhack on Apr 20 2018, 12:29 PM.

Details

Summary
Fuchsia uses zx_system_get_features in lieu of getauxval.

Use this call when checking for CRC32 support.

Diff Detail

Event Timeline

flowerhack created this revision.Apr 20 2018, 12:29 PM
cryptoad added inline comments.Apr 20 2018, 1:10 PM
compiler-rt/lib/scudo/scudo_utils.cpp
32

I would move this in the arm #if with an else for the rest, so we don't even have to include getauxval.
Adjust the # spacing accordingly.

133

Same here, I would move this under the arm #if, as a whole function, and put all the rest in the #else.

134

We could probably use u32 here instead for consistency.
To stick with the LLVM standard, please capitalize the variable name (eg: HWCap probably or something like that).
Same for rc under.

flowerhack marked 3 inline comments as done.
cryptoad added inline comments.Apr 20 2018, 2:29 PM
compiler-rt/lib/scudo/scudo_utils.cpp
19

So Fuchsia is not POSIX, that block can go in the #else as well.

89

Same here, everything in the #else.

flowerhack marked 2 inline comments as done.
flowerhack added inline comments.
compiler-rt/lib/scudo/scudo_utils.cpp
19

I actually find the nested preprocessor if/elses a little trickier to read, personally o.o;;;

but, made the changes!

cryptoad updated this revision to Diff 143456.Apr 21 2018, 9:45 AM

Sorry, you were right! The initial version was less complicated.
I'm updating this to fallback to it, with the style changes included.

Herald added subscribers: Restricted Project, llvm-commits, delcypher. · View Herald TranscriptApr 21 2018, 9:45 AM
cryptoad accepted this revision.Apr 21 2018, 2:31 PM
This revision is now accepted and ready to land.Apr 21 2018, 2:31 PM
This revision was automatically updated to reflect the committed changes.