diff options
| author | 2019-11-26 10:32:50 -0800 | |
|---|---|---|
| committer | 2019-12-04 09:10:21 -0800 | |
| commit | d094d4006fc2352af55fc1e16fbcdbbd2a721c7f (patch) | |
| tree | f9a8b0c051c353a88566711ff75896287cdd79bb | |
| parent | 46fc58ee8d151200b12e595f9edf1d8b57f40b42 (diff) | |
Exclude dirs from binder interface whitelisting
Exclude vendor/ and hardware/ from the manually written binder interface
whitelist.
Bug: 136279235
Test: interfaces in excluded directories are not checked against whitelist.
Change-Id: I0d640e23489b37d0c0787d5fca6bcdab10034109
| -rw-r--r-- | cc/compiler.go | 10 | ||||
| -rw-r--r-- | cc/makevars.go | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/cc/compiler.go b/cc/compiler.go index 671861b0b..2bc6ae26e 100644 --- a/cc/compiler.go +++ b/cc/compiler.go @@ -27,6 +27,10 @@ import ( "android/soong/cc/config" ) +var ( + allowedManualInterfacePaths = []string{"vendor/", "hardware/"} +) + // This file contains the basic C/C++/assembly to .o compliation steps type BaseCompilerProperties struct { @@ -509,6 +513,12 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps flags.Local.CFlags = append(flags.Local.CFlags, "-fopenmp") } + // Exclude directories from manual binder interface whitelisting. + //TODO(b/145621474): Move this check into IInterface.h when clang-tidy no longer uses absolute paths. + if android.PrefixInList(ctx.ModuleDir(), allowedManualInterfacePaths) { + flags.Local.CFlags = append(flags.Local.CFlags, "-DDO_NOT_CHECK_MANUAL_BINDER_INTERFACES") + } + return flags } diff --git a/cc/makevars.go b/cc/makevars.go index e8cedf0f6..0f9f4c1e1 100644 --- a/cc/makevars.go +++ b/cc/makevars.go @@ -147,6 +147,7 @@ func makeVarsProvider(ctx android.MakeVarsContext) { ctx.Strict("WITH_TIDY_FLAGS", "${config.TidyWithTidyFlags}") ctx.Strict("AIDL_CPP", "${aidlCmd}") + ctx.Strict("ALLOWED_MANUAL_INTERFACE_PATHS", strings.Join(allowedManualInterfacePaths, " ")) ctx.Strict("M4", "${m4Cmd}") |