aboutsummaryrefslogtreecommitdiffstats
path: root/cc/sanitize.go
diff options
context:
space:
mode:
authorVishwath Mohan <vishwath@google.com>2017-04-20 07:42:52 -0700
committerVishwath Mohan <vishwath@google.com>2017-04-20 08:06:09 -0700
commit8f4fdd8f7636d4ee51afec7273f7734b0a32b25a (patch)
tree455954b17dac89b8ff3856821e09f80e2a0f1c8f /cc/sanitize.go
parent9ce45296145df6b17f94cabe497aa9928b6b3c87 (diff)
downloadbuild_soong-8f4fdd8f7636d4ee51afec7273f7734b0a32b25a.tar.gz
build_soong-8f4fdd8f7636d4ee51afec7273f7734b0a32b25a.tar.bz2
build_soong-8f4fdd8f7636d4ee51afec7273f7734b0a32b25a.zip
Disable CFI for ASAN targets. (Soong)
This CL disables CFI if both CFI and ASAN flags are enabled. This allows ASAN to take precedence where needed, preventing build errors that would otherwise arise. Bug: 30227045 Test: SANITIZE_TARGET="address" m -j40 Change-Id: Id336bf2bf5498d4c3ea6492e36b366c76c06376e
Diffstat (limited to 'cc/sanitize.go')
-rw-r--r--cc/sanitize.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/cc/sanitize.go b/cc/sanitize.go
index 18d6c16e..7d7bd090 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -186,6 +186,12 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) {
s.Diag.Cfi = nil
}
+ // Also disable CFI if ASAN is enabled.
+ if Bool(s.Address) {
+ s.Cfi = nil
+ s.Diag.Cfi = nil
+ }
+
if ctx.staticBinary() {
s.Address = nil
s.Coverage = nil