getauxval was introduced with API level 18. In order to get things to work
at lower API levels (for the toolchain itself which is built at 14 for 32-bit),
we introduce an alternative implementation reading directly from
/proc/self/auxv.
Details
Diff Detail
- Build Status
Buildable 9917 Build 9917: arc lint + arc unit
Event Timeline
lib/scudo/scudo_utils.cpp | ||
---|---|---|
147 | Since you are emulating getauxval anyway, wouldn't it be more logical to do just that, define getauxval up there: // getauxval() was introduced with API level 18 on Android. # if SANITIZER_ANDROID && __ANDROID_API__ < 18 # include <fcntl.h> uptr getauxval(uptr type) { ... } # else # include <sys/auxv.h> # endif and then just use it? uptr HWCap = getauxval(AT_HWCAP); |
lib/scudo/scudo_utils.cpp | ||
---|---|---|
138 | If you agree with redefining getauxval, it should be moved next to the function definition too. |
Redefining getauxval instead of introducing a third party middleman as
suggested by @alekseyshl.
lib/scudo/scudo_utils.cpp | ||
---|---|---|
28 | It should never be defined here, right? So, we can drop #ifndef. |
lib/scudo/scudo_utils.cpp | ||
---|---|---|
28 | True, I was being more conservative than probably needed! |
Drop the #ifndef AT_HWCAP as it shouldn't be definedi there. If it is,
something is probably wrong somewhere.
It should never be defined here, right? So, we can drop #ifndef.