diff --git a/cc/object.go b/cc/object.go index f619c7923..1f1ac8e1c 100644 --- a/cc/object.go +++ b/cc/object.go @@ -52,8 +52,9 @@ type ObjectLinkerProperties struct { // input to a cc_genrule module. func ObjectFactory() android.Module { module := newBaseModule(android.HostAndDeviceSupported, android.MultilibBoth) + module.sanitize = &sanitize{} module.linker = &objectLinker{ - baseLinker: NewBaseLinker(nil), + baseLinker: NewBaseLinker(module.sanitize), } module.compiler = NewBaseCompiler() diff --git a/cc/sanitize.go b/cc/sanitize.go index 415518c10..c0a7c63e0 100644 --- a/cc/sanitize.go +++ b/cc/sanitize.go @@ -674,7 +674,7 @@ func (sanitize *sanitize) isSanitizerEnabled(t sanitizerType) bool { func isSanitizableDependencyTag(tag blueprint.DependencyTag) bool { t, ok := tag.(dependencyTag) - return ok && t.library || t == reuseObjTag + return ok && t.library || t == reuseObjTag || t == objDepTag } // Propagate sanitizer requirements down from binaries