This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt | interceptors] Provide an intercept override knob.
ClosedPublic

Authored by sivachandra on Mar 1 2021, 3:46 PM.

Details

Summary

This knob is useful for downstream users who want that some of their
libc functions to not be intercepted.

Diff Detail

Event Timeline

sivachandra created this revision.Mar 1 2021, 3:46 PM
sivachandra requested review of this revision.Mar 1 2021, 3:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 1 2021, 3:46 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
eugenis accepted this revision.Mar 2 2021, 9:32 AM
eugenis added subscribers: vitalybuka, kcc.
compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
605

SANITIZER_OVERRIDE_INTERCEPTORS?
The current name sounds like an interceptor for a function named override.

This revision is now accepted and ready to land.Mar 2 2021, 9:32 AM
eugenis requested changes to this revision.Mar 2 2021, 9:33 AM
This revision now requires changes to proceed.Mar 2 2021, 9:33 AM

Change the macro name as suggested.

sivachandra marked an inline comment as done.Mar 2 2021, 10:11 AM

Changed the macro name as suggested.

eugenis accepted this revision.Mar 3 2021, 10:04 AM

LGTM

This revision is now accepted and ready to land.Mar 3 2021, 10:04 AM
This revision was landed with ongoing or failed builds.Mar 3 2021, 9:04 PM
This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Jun 1 2022, 5:37 AM

Out of interest, how do you run tests after disabling interception of a function with this? Won't the test for that function fail then?

Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2022, 5:37 AM
Herald added a subscriber: Enna1. · View Herald Transcript
thakis added a comment.Jun 8 2022, 8:16 AM

Out of interest, how do you run tests after disabling interception of a function with this? Won't the test for that function fail then?

To answer my own question: One option is to use something like e.g. LIT_FILTER_OUT='^SanitizerCommon-(a|l|m|ub|t)san-x86_64-Linux :: (Linux/crypt_r.cpp|Posix/crypt.cpp)$' ninja check-sanitizer.