From 95497dc89bc428594b5ca626de1c25f089f84056 Mon Sep 17 00:00:00 2001 From: Yu Liu Date: Thu, 25 May 2023 11:15:07 -0700 Subject: [PATCH] Allow cfi enabled modules in mixed build. Bug: None Test: Locally tested Change-Id: I53c4ad8428cf05ceee3d73b4f97c2b9db2285c38 --- cc/cc.go | 3 ++- cc/cc_test.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cc/cc.go b/cc/cc.go index c9f00e248..bafd6251f 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -1916,7 +1916,6 @@ func allEnabledSanitizersSupportedByBazel(c *Module) bool { unsupportedSanitizers := []*bool{ sanitizeProps.Safestack, - sanitizeProps.Cfi, sanitizeProps.Scudo, BoolPtr(len(c.sanitize.Properties.Sanitize.Recover) > 0), BoolPtr(c.sanitize.Properties.Sanitize.Blocklist != nil), @@ -1935,6 +1934,8 @@ func allEnabledSanitizersSupportedByBazel(c *Module) bool { if ubsanEnabled && !c.MinimalRuntimeNeeded() { return false } + } else if san == cfi { + continue } else if c.sanitize.isSanitizerEnabled(san) { return false } diff --git a/cc/cc_test.go b/cc/cc_test.go index 173911bc4..701c3bb74 100644 --- a/cc/cc_test.go +++ b/cc/cc_test.go @@ -5538,7 +5538,7 @@ func TestDisableSanitizerVariantsInMixedBuilds(t *testing.T) { name: "foo_cfi", variant: "android_arm64_armv8-a_static_cfi_apex28", expectedOutputPaths: []string{ - "out/soong/.intermediates/foo_cfi/android_arm64_armv8-a_static_cfi_apex28/foo_cfi.a", + "outputbase/execroot/__main__/foo_cfi.a", }, }, {