This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] Expose getauxval as weak declaration to fix TSanitizer-x86_64-Test-Nolibc
AbandonedPublic

Authored by MaskRay on Nov 6 2018, 10:16 AM.

Details

Summary

After rCRT346215, TSanitizer-x86_64-Test-Nolibc does not link as getauxval() is a libc dependency.

This patch unifies include <sys/auxv.h> and weak declaration to just use
the weak declaration. If SANITIZER_USE_GETAUXVAL is 1, getauxval() is
guaranteed to be non-null and we can use it for AT_BASE AT_EXECFN and
other purposes.

Event Timeline

MaskRay created this revision.Nov 6 2018, 10:16 AM
Herald added subscribers: Restricted Project, llvm-commits, delcypher and 2 others. · View Herald TranscriptNov 6 2018, 10:16 AM
bkramer accepted this revision.Nov 6 2018, 10:25 AM

Thanks! This looks good to me, but I'd like someone from sanitizer team review it too.

This revision is now accepted and ready to land.Nov 6 2018, 10:25 AM
vitalybuka requested changes to this revision.Nov 6 2018, 11:09 AM

I think we should move ReExec into libcdep file D54163

This revision now requires changes to proceed.Nov 6 2018, 11:09 AM
MaskRay abandoned this revision.Nov 6 2018, 11:12 AM