diff options
author | Vishwath Mohan <vishwath@google.com> | 2017-01-19 13:54:55 -0800 |
---|---|---|
committer | Vishwath Mohan <vishwath@google.com> | 2017-01-19 14:40:34 -0800 |
commit | 1b017a76e1d84626c0bd881625149dcd66174fe0 (patch) | |
tree | ef7a4a201e5f782d2415bf7394288e2a7db61c85 /cc | |
parent | 1a01e83725cabcef13941d3cc2216a32bd9ce851 (diff) | |
download | build_soong-1b017a76e1d84626c0bd881625149dcd66174fe0.tar.gz build_soong-1b017a76e1d84626c0bd881625149dcd66174fe0.tar.bz2 build_soong-1b017a76e1d84626c0bd881625149dcd66174fe0.zip |
Hide CFI behind a global flag.
This CL ensures that locally enabling CFI in a .bp file is not honored
unless it is enabled globally using ENABLE_CFI=true first, effectively
hiding it behind a flag.
Bug: 30227045
Bug: 22033465
Test: m -j40 works and device boots
Test: cfi is correctly honored only when the global flag is set.
Change-Id: Iccc6e4bf5e7828ab8ce6056f3e40922712faa0d8
Diffstat (limited to 'cc')
-rw-r--r-- | cc/sanitize.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cc/sanitize.go b/cc/sanitize.go index 447c5b42..6ab66997 100644 --- a/cc/sanitize.go +++ b/cc/sanitize.go @@ -161,6 +161,11 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) { } } + if !ctx.AConfig().EnableCFI() { + s.Cfi = nil + s.Diag.Cfi = nil + } + if ctx.staticBinary() { s.Address = nil s.Coverage = nil |