Hide mutated variant in non-make builds.
This CL hides (using Module.Properties.PreventInstall) either the
sanitized or stock variant for non-make embedded builds (based on
whether a sanitizer is enabled or not) so we don't have duplicate
rules for installing the same target.
Bug: 30227045
Test: OUT_DIR=out build/soong/scripts/build-ndk-prebuilts.sh # no
longer generates a duplicate build error.
Change-Id: I0b2dbb0afd5d426b32da67f951e2a4f9fbb3f3b9
diff --git a/cc/sanitize.go b/cc/sanitize.go
index 53de14b..ea6a33e 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -574,22 +574,22 @@
modules[1].(*Module).sanitize.Properties.InSanitizerDir = true
modules[1].(*Module).sanitize.SetSanitizer(cfi, false)
}
- } else {
+ }
+ if mctx.AConfig().EmbeddedInMake() && !mctx.Device() {
+ if isSanitizerEnabled {
+ modules[0].(*Module).Properties.HideFromMake = true
+ } else {
+ modules[1].(*Module).Properties.HideFromMake = true
+ }
+ }
+ if !mctx.AConfig().EmbeddedInMake() || !mctx.Device() {
if isSanitizerEnabled {
modules[0].(*Module).Properties.PreventInstall = true
} else {
modules[1].(*Module).Properties.PreventInstall = true
}
}
- if mctx.AConfig().EmbeddedInMake() {
- if !mctx.Device() {
- if isSanitizerEnabled {
- modules[0].(*Module).Properties.HideFromMake = true
- } else {
- modules[1].(*Module).Properties.HideFromMake = true
- }
- }
- }
+
}
c.sanitize.Properties.SanitizeDep = false
}