From 6c4ccca7b75e2b2413e98c8b1b0b05b56edc4a44 Mon Sep 17 00:00:00 2001 From: Pirama Arumuga Nainar Date: Mon, 27 Jul 2020 11:49:51 -0700 Subject: [PATCH] [cc/sanitize] Add Blocklist property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will eventually replace the Blacklist property. Update language to comply with Android’s inclusive language guidance See https://source.android.com/setup/contribute/respectful-code for reference Bug: 161896447 Bug: 162245450 Test: build topic Change-Id: I3c2609c791c27b8ba3bcb55f79304b78bce1f518 --- cc/sanitize.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cc/sanitize.go b/cc/sanitize.go index 72ad6d7a0..f9a8b119e 100644 --- a/cc/sanitize.go +++ b/cc/sanitize.go @@ -174,6 +174,8 @@ type SanitizeProperties struct { // value to pass to -fsanitize-blacklist Blacklist *string + // value to pass to -fsanitize-blacklist + Blocklist *string } `android:"arch_variant"` SanitizerEnabled bool `blueprint:"mutated"` @@ -596,6 +598,12 @@ func (sanitize *sanitize) flags(ctx ModuleContext, flags Flags) Flags { flags.CFlagsDeps = append(flags.CFlagsDeps, blacklist.Path()) } + blocklist := android.OptionalPathForModuleSrc(ctx, sanitize.Properties.Sanitize.Blocklist) + if blocklist.Valid() { + flags.Local.CFlags = append(flags.Local.CFlags, "-fsanitize-blacklist="+blocklist.String()) + flags.CFlagsDeps = append(flags.CFlagsDeps, blocklist.Path()) + } + return flags }