Revert "Block CFI on static libraries"
This reverts commit f9abec0987feb81132201179217ad0ea66ae4074.
Reason for revert:
https://b.corp.google.com/issues/301444094
https://b.corp.google.com/issues/301443813
https://b.corp.google.com/issues/301437374
Change-Id: I6fd03e4d3c0930005178ad347f53156be8f15efc
diff --git a/cc/Android.bp b/cc/Android.bp
index 8f6709f..c32d854 100644
--- a/cc/Android.bp
+++ b/cc/Android.bp
@@ -30,7 +30,6 @@
"cc.go",
"ccdeps.go",
"check.go",
- "constants.go",
"coverage.go",
"gen.go",
"generated_cc_library.go",
diff --git a/cc/bp2build.go b/cc/bp2build.go
index bbdf672..7f78e28 100644
--- a/cc/bp2build.go
+++ b/cc/bp2build.go
@@ -1953,9 +1953,9 @@
sanitizerCompilerInputs.SetSelectValue(bazel.SanitizersEnabledAxis, bazel.SanitizersEnabled, bazel.MakeLabelListFromTargetNames([]string{*blocklist}))
}
if sanitizerProps.Sanitize.Cfi != nil && !proptools.Bool(sanitizerProps.Sanitize.Cfi) {
- features = append(features, "-"+cfiFeatureName)
+ features = append(features, "-android_cfi")
} else if proptools.Bool(sanitizerProps.Sanitize.Cfi) {
- features = append(features, cfiFeatureName)
+ features = append(features, "android_cfi")
if proptools.Bool(sanitizerProps.Sanitize.Config.Cfi_assembly_support) {
features = append(features, "android_cfi_assembly_support")
}
diff --git a/cc/constants.go b/cc/constants.go
deleted file mode 100644
index f188d4e..0000000
--- a/cc/constants.go
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2016 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package cc
-
-var (
- cfiFeatureName = "android_cfi"
-)
diff --git a/cc/library.go b/cc/library.go
index c5a9222..2d4d604 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -331,7 +331,6 @@
sharedFeatures.DeduplicateAxesFromBase()
staticFeatures := baseAttributes.features.Clone().Append(staticAttrs.Features)
staticFeatures.DeduplicateAxesFromBase()
- staticFeatures.RemoveFromAllConfigs(cfiFeatureName)
staticCommonAttrs := staticOrSharedAttributes{
Srcs: *srcs.Clone().Append(staticAttrs.Srcs),
@@ -2947,9 +2946,6 @@
features := baseAttributes.features.Clone().Append(libSharedOrStaticAttrs.Features)
features.DeduplicateAxesFromBase()
- if isStatic {
- features.RemoveFromAllConfigs(cfiFeatureName)
- }
commonAttrs := staticOrSharedAttributes{
Srcs: compilerAttrs.srcs,