This is an archive of the discontinued LLVM Phabricator instance.

Add getauxval() compat for NetBSD
ClosedPublic

Authored by krytarowski on Sep 8 2019, 8:35 AM.

Details

Summary

getauxval() is not available on NetBSD and there is no a direct equivalent.

Add a function that implements the same semantics with NetBSD internals.

Reorder the GetPageSize() functions to prefer the sysctl approach for NetBSD.
It no longer makes a difference which approach is better. Avoid changing
conditional code path.

Diff Detail

Repository
rL LLVM

Event Timeline

krytarowski created this revision.Sep 8 2019, 8:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 8 2019, 8:35 AM
vitalybuka added inline comments.Sep 12 2019, 10:58 AM
lib/sanitizer_common/sanitizer_linux.cpp
1073 ↗(On Diff #219268)

now we can't get to SANITIZER_USE_GETAUXVAL for SANITIZER_NETBSD

vitalybuka accepted this revision.Sep 12 2019, 11:00 AM
This revision is now accepted and ready to land.Sep 12 2019, 11:00 AM
krytarowski marked an inline comment as done.Sep 12 2019, 11:36 AM
krytarowski added inline comments.
lib/sanitizer_common/sanitizer_linux.cpp
1073 ↗(On Diff #219268)

sysctl returns the same value and it does not make difference. I want to keep it closer to No-Functional-Change here.

SANITIZER_USE_GETAUXVAL is wanted in LSan to get AT_BASE.

This revision was automatically updated to reflect the committed changes.