This is an archive of the discontinued LLVM Phabricator instance.

[SanitizerBinaryMetadata] Support ignore list
ClosedPublic

Authored by melver on Feb 9 2023, 10:03 AM.

Details

Summary

For large projects it will be required to opt out entire subdirectories.
In the absence of fine-grained control over the flags passed via the
build system, introduce -fexperimental-sanitize-metadata-ignorelist=.

The format is identical to other sanitizer ignore lists, and its effect
will be to simply not instrument either functions or entire modules
based on the rules in the ignore list file.

Diff Detail

Event Timeline

melver created this revision.Feb 9 2023, 10:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 9 2023, 10:03 AM
melver requested review of this revision.Feb 9 2023, 10:03 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 9 2023, 10:03 AM
dvyukov accepted this revision.Feb 9 2023, 10:22 PM
dvyukov added inline comments.
clang/test/Driver/fsanitize-metadata-ignorelist.c
7

What is this test doing?

This revision is now accepted and ready to land.Feb 9 2023, 10:22 PM
melver marked an inline comment as done.Feb 10 2023, 12:04 AM
melver added inline comments.
clang/test/Driver/fsanitize-metadata-ignorelist.c
7

Driver test that frontend passes all the options to cc1. Every option should have such a test in Driver/.

melver updated this revision to Diff 496353.Feb 10 2023, 12:33 AM
melver marked an inline comment as done.

Make Driver test check that cc1 doesn't receive flag if not required.

This revision was landed with ongoing or failed builds.Feb 10 2023, 1:26 AM
This revision was automatically updated to reflect the committed changes.

The test sanitize-metadata-ignorelist.c fails in -Asserts.

clang/test/CodeGen/sanitize-metadata-ignorelist.c
11

It should match if it is unnamed.

melver marked an inline comment as done.Feb 10 2023, 3:40 PM
melver added inline comments.
clang/test/CodeGen/sanitize-metadata-ignorelist.c
11

Thanks for the report. %clang and %clang_cc1 behave differently with +Assert and -Assert. I switched to %clang_cc1 which is consistent.

https://reviews.llvm.org/rGdac423bd5718