Remove ConvertWithBp2build implementations

Remove the ConvertWithBp2build implementations from all the module
types, along with the related code.

Bug: 315353489
Test: m blueprint_tests
Change-Id: I212672286686a318893bc7348ddd5a5ec51e77a7
diff --git a/cc/Android.bp b/cc/Android.bp
index 351f3f6..9e4b763 100644
--- a/cc/Android.bp
+++ b/cc/Android.bp
@@ -12,14 +12,12 @@
         "soong-aconfig",
         "soong-aidl-library",
         "soong-android",
-        "soong-bazel",
         "soong-cc-config",
         "soong-etc",
         "soong-fuzz",
         "soong-genrule",
         "soong-multitree",
         "soong-snapshot",
-        "soong-sysprop-bp2build",
         "soong-testing",
         "soong-tradefed",
     ],
@@ -28,7 +26,6 @@
         "fdo_profile.go",
         "androidmk.go",
         "api_level.go",
-        "bp2build.go",
         "builder.go",
         "cc.go",
         "ccdeps.go",
diff --git a/cc/afdo.go b/cc/afdo.go
index e7dea0e..bad16a1 100644
--- a/cc/afdo.go
+++ b/cc/afdo.go
@@ -24,16 +24,6 @@
 	"github.com/google/blueprint/proptools"
 )
 
-// TODO(b/267229066): Remove globalAfdoProfileProjects after implementing bp2build converter for fdo_profile
-var (
-	globalAfdoProfileProjects = []string{
-		"vendor/google_data/pgo_profile/sampling/",
-		"toolchain/pgo-profiles/sampling/",
-	}
-)
-
-var afdoProfileProjectsConfigKey = android.NewOnceKey("AfdoProfileProjects")
-
 // This flag needs to be in both CFlags and LdFlags to ensure correct symbol ordering
 const afdoFlagsFormat = "-fprofile-sample-use=%s -fprofile-sample-accurate"
 
diff --git a/cc/binary.go b/cc/binary.go
index 0f05605..ebe672b 100644
--- a/cc/binary.go
+++ b/cc/binary.go
@@ -17,13 +17,8 @@
 import (
 	"path/filepath"
 
-	"android/soong/bazel/cquery"
-
-	"github.com/google/blueprint"
-	"github.com/google/blueprint/proptools"
-
 	"android/soong/android"
-	"android/soong/bazel"
+	"github.com/google/blueprint"
 )
 
 type BinaryLinkerProperties struct {
@@ -71,14 +66,13 @@
 
 // cc_binary produces a binary that is runnable on a device.
 func BinaryFactory() android.Module {
-	module, _ := newBinary(android.HostAndDeviceSupported, true)
-	module.bazelHandler = &ccBinaryBazelHandler{module: module}
+	module, _ := newBinary(android.HostAndDeviceSupported)
 	return module.Init()
 }
 
 // cc_binary_host produces a binary that is runnable on a host.
 func BinaryHostFactory() android.Module {
-	module, _ := newBinary(android.HostSupported, true)
+	module, _ := newBinary(android.HostSupported)
 	return module.Init()
 }
 
@@ -196,10 +190,10 @@
 // Individual module implementations which comprise a C++ binary should call this function,
 // set some fields on the result, and then call the Init function.
 func NewBinary(hod android.HostOrDeviceSupported) (*Module, *binaryDecorator) {
-	return newBinary(hod, true)
+	return newBinary(hod)
 }
 
-func newBinary(hod android.HostOrDeviceSupported, bazelable bool) (*Module, *binaryDecorator) {
+func newBinary(hod android.HostOrDeviceSupported) (*Module, *binaryDecorator) {
 	module := newModule(hod, android.MultilibFirst)
 	binary := &binaryDecorator{
 		baseLinker:    NewBaseLinker(module.sanitize),
@@ -208,7 +202,6 @@
 	module.compiler = NewBaseCompiler()
 	module.linker = binary
 	module.installer = binary
-	module.bazelable = bazelable
 
 	// Allow module to be added as member of an sdk/module_exports.
 	module.sdkMemberTypes = []android.SdkMemberType{
@@ -568,149 +561,3 @@
 		},
 	})
 }
-
-type ccBinaryBazelHandler struct {
-	module *Module
-}
-
-var _ BazelHandler = (*ccBinaryBazelHandler)(nil)
-
-func (handler *ccBinaryBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(label, cquery.GetCcUnstrippedInfo, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-}
-
-func (handler *ccBinaryBazelHandler) ProcessBazelQueryResponse(ctx android.ModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	info, err := bazelCtx.GetCcUnstrippedInfo(label, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-
-	var outputFilePath android.Path = android.PathForBazelOut(ctx, info.OutputFile)
-	if len(info.TidyFiles) > 0 {
-		handler.module.tidyFiles = android.PathsForBazelOut(ctx, info.TidyFiles)
-		outputFilePath = android.AttachValidationActions(ctx, outputFilePath, handler.module.tidyFiles)
-	}
-	handler.module.outputFile = android.OptionalPathForPath(outputFilePath)
-	handler.module.linker.(*binaryDecorator).unstrippedOutputFile = android.PathForBazelOut(ctx, info.UnstrippedOutput)
-
-	handler.module.setAndroidMkVariablesFromCquery(info.CcAndroidMkInfo)
-}
-
-func binaryBp2buildAttrs(ctx android.Bp2buildMutatorContext, m *Module) binaryAttributes {
-	baseAttrs := bp2BuildParseBaseProps(ctx, m)
-	binaryLinkerAttrs := bp2buildBinaryLinkerProps(ctx, m)
-
-	if proptools.BoolDefault(binaryLinkerAttrs.Linkshared, true) {
-		baseAttrs.implementationDynamicDeps.Add(baseAttrs.protoDependency)
-	} else {
-		baseAttrs.implementationDeps.Add(baseAttrs.protoDependency)
-	}
-
-	// binaries don't have implementation_whole_archive_deps
-	baseAttrs.wholeArchiveDeps.Append(baseAttrs.implementationWholeArchiveDeps)
-
-	attrs := binaryAttributes{
-		binaryLinkerAttrs: binaryLinkerAttrs,
-
-		Srcs:    baseAttrs.srcs,
-		Srcs_c:  baseAttrs.cSrcs,
-		Srcs_as: baseAttrs.asSrcs,
-
-		Copts:      baseAttrs.copts,
-		Cppflags:   baseAttrs.cppFlags,
-		Conlyflags: baseAttrs.conlyFlags,
-		Asflags:    baseAttrs.asFlags,
-
-		Deps:               baseAttrs.implementationDeps,
-		Dynamic_deps:       baseAttrs.implementationDynamicDeps,
-		Whole_archive_deps: baseAttrs.wholeArchiveDeps,
-		System_deps:        baseAttrs.systemDynamicDeps,
-		Runtime_deps:       baseAttrs.runtimeDeps,
-
-		Local_includes:    baseAttrs.localIncludes,
-		Absolute_includes: baseAttrs.absoluteIncludes,
-		Linkopts:          baseAttrs.linkopts,
-		Use_version_lib:   baseAttrs.useVersionLib,
-		Rtti:              baseAttrs.rtti,
-		Stl:               baseAttrs.stl,
-		Cpp_std:           baseAttrs.cppStd,
-
-		Additional_linker_inputs:   baseAttrs.additionalLinkerInputs,
-		Additional_compiler_inputs: baseAttrs.additionalCompilerInputs,
-
-		Strip: stripAttributes{
-			Keep_symbols:                 baseAttrs.stripKeepSymbols,
-			Keep_symbols_and_debug_frame: baseAttrs.stripKeepSymbolsAndDebugFrame,
-			Keep_symbols_list:            baseAttrs.stripKeepSymbolsList,
-			All:                          baseAttrs.stripAll,
-			None:                         baseAttrs.stripNone,
-		},
-
-		Features: baseAttrs.features,
-
-		SdkAttributes: Bp2BuildParseSdkAttributes(m),
-
-		Native_coverage: baseAttrs.Native_coverage,
-	}
-
-	m.convertTidyAttributes(ctx, &attrs.tidyAttributes)
-
-	return attrs
-}
-
-func binaryBp2build(ctx android.Bp2buildMutatorContext, m *Module) {
-	// shared with cc_test
-	binaryAttrs := binaryBp2buildAttrs(ctx, m)
-
-	tags := android.ApexAvailableTagsWithoutTestApexes(ctx, m)
-	ctx.CreateBazelTargetModule(bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_binary",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_binary.bzl",
-	},
-		android.CommonAttributes{Name: m.Name(), Tags: tags},
-		&binaryAttrs)
-}
-
-// binaryAttributes contains Bazel attributes corresponding to a cc binary
-type binaryAttributes struct {
-	binaryLinkerAttrs
-	Srcs    bazel.LabelListAttribute
-	Srcs_c  bazel.LabelListAttribute
-	Srcs_as bazel.LabelListAttribute
-
-	Copts                      bazel.StringListAttribute
-	Cppflags                   bazel.StringListAttribute
-	Conlyflags                 bazel.StringListAttribute
-	Asflags                    bazel.StringListAttribute
-	Additional_compiler_inputs bazel.LabelListAttribute
-
-	Deps               bazel.LabelListAttribute
-	Dynamic_deps       bazel.LabelListAttribute
-	Whole_archive_deps bazel.LabelListAttribute
-	System_deps        bazel.LabelListAttribute
-	Runtime_deps       bazel.LabelListAttribute
-
-	Local_includes    bazel.StringListAttribute
-	Absolute_includes bazel.StringListAttribute
-
-	Linkopts                 bazel.StringListAttribute
-	Additional_linker_inputs bazel.LabelListAttribute
-	Use_version_lib          bazel.BoolAttribute
-
-	Rtti    bazel.BoolAttribute
-	Stl     *string
-	Cpp_std *string
-
-	Strip stripAttributes
-
-	Features bazel.StringListAttribute
-
-	SdkAttributes
-
-	tidyAttributes
-
-	Native_coverage *bool
-}
diff --git a/cc/binary_test.go b/cc/binary_test.go
index 2fac002..3e18940 100644
--- a/cc/binary_test.go
+++ b/cc/binary_test.go
@@ -17,89 +17,9 @@
 import (
 	"testing"
 
-	"android/soong/bazel/cquery"
-
 	"android/soong/android"
 )
 
-func TestCcBinaryWithBazel(t *testing.T) {
-	t.Parallel()
-	bp := `
-cc_binary {
-	name: "foo",
-	srcs: ["foo.cc"],
-	bazel_module: { label: "//foo/bar:bar" },
-}`
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir: "outputbase",
-		LabelToCcBinary: map[string]cquery.CcUnstrippedInfo{
-			"//foo/bar:bar": cquery.CcUnstrippedInfo{
-				OutputFile:       "foo",
-				UnstrippedOutput: "foo.unstripped",
-			},
-		},
-	}
-	ctx := testCcWithConfig(t, config)
-
-	binMod := ctx.ModuleForTests("foo", "android_arm64_armv8-a").Module()
-	producer := binMod.(android.OutputFileProducer)
-	outputFiles, err := producer.OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_binary outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{"outputbase/execroot/__main__/foo"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
-
-	unStrippedFilePath := binMod.(*Module).UnstrippedOutputFile()
-	expectedUnStrippedFile := "outputbase/execroot/__main__/foo.unstripped"
-	android.AssertStringEquals(t, "Unstripped output file", expectedUnStrippedFile, unStrippedFilePath.String())
-
-	entries := android.AndroidMkEntriesForTest(t, ctx, binMod)[0]
-	android.AssertStringEquals(t, "unexpected LOCAL_SOONG_MODULE_TYPE", "cc_binary", entries.EntryMap["LOCAL_SOONG_MODULE_TYPE"][0])
-}
-
-func TestCcBinaryWithBazelValidations(t *testing.T) {
-	t.Parallel()
-	bp := `
-cc_binary {
-	name: "foo",
-	srcs: ["foo.cc"],
-	bazel_module: { label: "//foo/bar:bar" },
-	tidy: true,
-}`
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir: "outputbase",
-		LabelToCcBinary: map[string]cquery.CcUnstrippedInfo{
-			"//foo/bar:bar": cquery.CcUnstrippedInfo{
-				OutputFile:       "foo",
-				UnstrippedOutput: "foo.unstripped",
-				TidyFiles:        []string{"foo.c.tidy"},
-			},
-		},
-	}
-	ctx := android.GroupFixturePreparers(
-		prepareForCcTest,
-		android.FixtureMergeEnv(map[string]string{
-			"ALLOW_LOCAL_TIDY_TRUE": "1",
-		}),
-	).RunTestWithConfig(t, config).TestContext
-
-	binMod := ctx.ModuleForTests("foo", "android_arm64_armv8-a").Module()
-	producer := binMod.(android.OutputFileProducer)
-	outputFiles, err := producer.OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_binary outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{"out/soong/.intermediates/foo/android_arm64_armv8-a/validated/foo"}
-	android.AssertPathsRelativeToTopEquals(t, "output files", expectedOutputFiles, outputFiles)
-
-	unStrippedFilePath := binMod.(*Module).UnstrippedOutputFile()
-	expectedUnStrippedFile := "outputbase/execroot/__main__/foo.unstripped"
-	android.AssertStringEquals(t, "Unstripped output file", expectedUnStrippedFile, unStrippedFilePath.String())
-}
-
 func TestBinaryLinkerScripts(t *testing.T) {
 	t.Parallel()
 	result := PrepareForIntegrationTestWithCc.RunTestWithBp(t, `
diff --git a/cc/bp2build.go b/cc/bp2build.go
deleted file mode 100644
index 919b4d4..0000000
--- a/cc/bp2build.go
+++ /dev/null
@@ -1,2127 +0,0 @@
-// Copyright 2021 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
-
-import (
-	"fmt"
-	"path/filepath"
-	"strings"
-	"sync"
-
-	"android/soong/android"
-	"android/soong/bazel"
-	"android/soong/cc/config"
-	"android/soong/genrule"
-
-	"github.com/google/blueprint"
-
-	"github.com/google/blueprint/proptools"
-)
-
-const (
-	cSrcPartition       = "c"
-	asSrcPartition      = "as"
-	asmSrcPartition     = "asm"
-	lSrcPartition       = "l"
-	llSrcPartition      = "ll"
-	cppSrcPartition     = "cpp"
-	protoSrcPartition   = "proto"
-	aidlSrcPartition    = "aidl"
-	syspropSrcPartition = "sysprop"
-
-	yaccSrcPartition = "yacc"
-
-	rScriptSrcPartition = "renderScript"
-
-	xsdSrcPartition = "xsd"
-
-	genrulePartition = "genrule"
-
-	protoFromGenPartition = "proto_gen"
-
-	hdrPartition = "hdr"
-
-	stubsSuffix = "_stub_libs_current"
-)
-
-// staticOrSharedAttributes are the Bazel-ified versions of StaticOrSharedProperties --
-// properties which apply to either the shared or static version of a cc_library module.
-type staticOrSharedAttributes struct {
-	Srcs      bazel.LabelListAttribute
-	Srcs_c    bazel.LabelListAttribute
-	Srcs_as   bazel.LabelListAttribute
-	Srcs_aidl bazel.LabelListAttribute
-	Hdrs      bazel.LabelListAttribute
-	Copts     bazel.StringListAttribute
-
-	Additional_compiler_inputs bazel.LabelListAttribute
-
-	Deps                              bazel.LabelListAttribute
-	Implementation_deps               bazel.LabelListAttribute
-	Dynamic_deps                      bazel.LabelListAttribute
-	Implementation_dynamic_deps       bazel.LabelListAttribute
-	Whole_archive_deps                bazel.LabelListAttribute
-	Implementation_whole_archive_deps bazel.LabelListAttribute
-	Runtime_deps                      bazel.LabelListAttribute
-
-	System_dynamic_deps bazel.LabelListAttribute
-
-	Enabled bazel.BoolAttribute
-
-	Native_coverage *bool
-
-	Apex_available []string
-
-	Features bazel.StringListAttribute
-
-	SdkAttributes
-
-	tidyAttributes
-}
-
-type tidyAttributes struct {
-	Tidy                  *string
-	Tidy_flags            []string
-	Tidy_checks           []string
-	Tidy_checks_as_errors []string
-	Tidy_disabled_srcs    bazel.LabelListAttribute
-	Tidy_timeout_srcs     bazel.LabelListAttribute
-}
-
-func (m *Module) convertTidyAttributes(ctx android.Bp2buildMutatorContext, moduleAttrs *tidyAttributes) {
-	for _, f := range m.features {
-		if tidy, ok := f.(*tidyFeature); ok {
-			var tidyAttr *string
-			if tidy.Properties.Tidy != nil {
-				if *tidy.Properties.Tidy {
-					tidyAttr = proptools.StringPtr("local")
-				} else {
-					tidyAttr = proptools.StringPtr("never")
-				}
-			}
-			moduleAttrs.Tidy = tidyAttr
-			moduleAttrs.Tidy_flags = tidy.Properties.Tidy_flags
-			moduleAttrs.Tidy_checks = tidy.Properties.Tidy_checks
-			moduleAttrs.Tidy_checks_as_errors = tidy.Properties.Tidy_checks_as_errors
-		}
-
-	}
-	archVariantProps := m.GetArchVariantProperties(ctx, &BaseCompilerProperties{})
-	for axis, configToProps := range archVariantProps {
-		for cfg, _props := range configToProps {
-			if archProps, ok := _props.(*BaseCompilerProperties); ok {
-				archDisabledSrcs := android.BazelLabelForModuleSrc(ctx, archProps.Tidy_disabled_srcs)
-				moduleAttrs.Tidy_disabled_srcs.SetSelectValue(axis, cfg, archDisabledSrcs)
-				archTimeoutSrcs := android.BazelLabelForModuleSrc(ctx, archProps.Tidy_timeout_srcs)
-				moduleAttrs.Tidy_timeout_srcs.SetSelectValue(axis, cfg, archTimeoutSrcs)
-			}
-		}
-	}
-}
-
-// Returns an unchanged label and a bool indicating whether the dep is a genrule that produces .proto files
-func protoFromGenPartitionMapper(pathCtx android.BazelConversionContext) bazel.LabelMapper {
-	return func(ctx bazel.OtherModuleContext, label bazel.Label) (string, bool) {
-		mod, exists := ctx.ModuleFromName(label.OriginalModuleName)
-		if !exists {
-			return label.Label, false
-		}
-		gen, isGen := mod.(*genrule.Module)
-		if !isGen {
-			return label.Label, false
-		}
-		if containsProto(ctx, gen.RawOutputFiles(pathCtx)) {
-			// Return unmodified label + true
-			// True will ensure that this module gets dropped from `srcs` of the generated cc_* target. `srcs` is reserved for .cpp files
-			return label.Label, true
-		}
-		return label.Label, false
-	}
-}
-
-// Returns true if srcs contains only .proto files
-// Raises an exception if there is a combination of .proto and non .proto srcs
-func containsProto(ctx bazel.OtherModuleContext, srcs []string) bool {
-	onlyProtos := false
-	for _, src := range srcs {
-		if strings.HasSuffix(src, ".proto") {
-			onlyProtos = true
-		} else if onlyProtos {
-			// This is not a proto file, and we have encountered a .proto file previously
-			ctx.ModuleErrorf("TOOD: Add bp2build support combination of .proto and non .proto files in outs of genrule")
-		}
-	}
-	return onlyProtos
-}
-
-// groupSrcsByExtension partitions `srcs` into groups based on file extension.
-func groupSrcsByExtension(ctx android.BazelConversionPathContext, srcs bazel.LabelListAttribute) bazel.PartitionToLabelListAttribute {
-	// Convert filegroup dependencies into extension-specific filegroups filtered in the filegroup.bzl
-	// macro.
-	addSuffixForFilegroup := func(suffix string) bazel.LabelMapper {
-		return func(otherModuleCtx bazel.OtherModuleContext, label bazel.Label) (string, bool) {
-
-			m, exists := otherModuleCtx.ModuleFromName(label.OriginalModuleName)
-			labelStr := label.Label
-			if !exists || !android.IsFilegroup(otherModuleCtx, m) {
-				return labelStr, false
-			}
-			// If the filegroup is already converted to aidl_library or proto_library,
-			// skip creating _c_srcs, _as_srcs, _cpp_srcs filegroups
-			fg, _ := m.(android.FileGroupAsLibrary)
-			if fg.ShouldConvertToAidlLibrary(ctx) || fg.ShouldConvertToProtoLibrary(ctx) {
-				return labelStr, false
-			}
-			return labelStr + suffix, true
-		}
-	}
-
-	// TODO(b/190006308): Handle language detection of sources in a Bazel rule.
-	labels := bazel.LabelPartitions{
-		protoSrcPartition: android.ProtoSrcLabelPartition,
-		cSrcPartition:     bazel.LabelPartition{Extensions: []string{".c"}, LabelMapper: addSuffixForFilegroup("_c_srcs")},
-		asSrcPartition:    bazel.LabelPartition{Extensions: []string{".s", ".S"}, LabelMapper: addSuffixForFilegroup("_as_srcs")},
-		asmSrcPartition:   bazel.LabelPartition{Extensions: []string{".asm"}},
-		aidlSrcPartition:  android.AidlSrcLabelPartition,
-		// TODO(http://b/231968910): If there is ever a filegroup target that
-		// 		contains .l or .ll files we will need to find a way to add a
-		// 		LabelMapper for these that identifies these filegroups and
-		//		converts them appropriately
-		lSrcPartition:         bazel.LabelPartition{Extensions: []string{".l"}},
-		llSrcPartition:        bazel.LabelPartition{Extensions: []string{".ll"}},
-		rScriptSrcPartition:   bazel.LabelPartition{Extensions: []string{".fs", ".rscript"}},
-		xsdSrcPartition:       bazel.LabelPartition{LabelMapper: android.XsdLabelMapper(xsdConfigCppTarget)},
-		protoFromGenPartition: bazel.LabelPartition{LabelMapper: protoFromGenPartitionMapper(ctx)},
-		// C++ is the "catch-all" group, and comprises generated sources because we don't
-		// know the language of these sources until the genrule is executed.
-		cppSrcPartition:     bazel.LabelPartition{Extensions: []string{".cpp", ".cc", ".cxx", ".mm"}, LabelMapper: addSuffixForFilegroup("_cpp_srcs"), Keep_remainder: true},
-		syspropSrcPartition: bazel.LabelPartition{Extensions: []string{".sysprop"}},
-		yaccSrcPartition:    bazel.LabelPartition{Extensions: []string{".y", "yy"}},
-	}
-
-	return bazel.PartitionLabelListAttribute(ctx, &srcs, labels)
-}
-
-func partitionHeaders(ctx android.BazelConversionPathContext, hdrs bazel.LabelListAttribute) bazel.PartitionToLabelListAttribute {
-	labels := bazel.LabelPartitions{
-		xsdSrcPartition:  bazel.LabelPartition{LabelMapper: android.XsdLabelMapper(xsdConfigCppTarget)},
-		genrulePartition: bazel.LabelPartition{LabelMapper: genrule.GenruleCcHeaderLabelMapper},
-		hdrPartition:     bazel.LabelPartition{Keep_remainder: true},
-	}
-	return bazel.PartitionLabelListAttribute(ctx, &hdrs, labels)
-}
-
-// bp2BuildParseLibProps returns the attributes for a variant of a cc_library.
-func bp2BuildParseLibProps(ctx android.Bp2buildMutatorContext, module *Module, isStatic bool) staticOrSharedAttributes {
-	lib, ok := module.compiler.(*libraryDecorator)
-	if !ok {
-		return staticOrSharedAttributes{}
-	}
-	return bp2buildParseStaticOrSharedProps(ctx, module, lib, isStatic)
-}
-
-// bp2buildParseSharedProps returns the attributes for the shared variant of a cc_library.
-func bp2BuildParseSharedProps(ctx android.Bp2buildMutatorContext, module *Module) staticOrSharedAttributes {
-	return bp2BuildParseLibProps(ctx, module, false)
-}
-
-// bp2buildParseStaticProps returns the attributes for the static variant of a cc_library.
-func bp2BuildParseStaticProps(ctx android.Bp2buildMutatorContext, module *Module) staticOrSharedAttributes {
-	return bp2BuildParseLibProps(ctx, module, true)
-}
-
-type depsPartition struct {
-	export         bazel.LabelList
-	implementation bazel.LabelList
-}
-
-type bazelLabelForDepsFn func(android.Bp2buildMutatorContext, []string) bazel.LabelList
-
-func maybePartitionExportedAndImplementationsDeps(ctx android.Bp2buildMutatorContext, exportsDeps bool, allDeps, exportedDeps []string, fn bazelLabelForDepsFn) depsPartition {
-	if !exportsDeps {
-		return depsPartition{
-			implementation: fn(ctx, allDeps),
-		}
-	}
-
-	implementation, export := android.FilterList(allDeps, exportedDeps)
-
-	return depsPartition{
-		export:         fn(ctx, export),
-		implementation: fn(ctx, implementation),
-	}
-}
-
-type bazelLabelForDepsExcludesFn func(android.Bp2buildMutatorContext, []string, []string) bazel.LabelList
-
-func maybePartitionExportedAndImplementationsDepsExcludes(ctx android.Bp2buildMutatorContext, exportsDeps bool, allDeps, excludes, exportedDeps []string, fn bazelLabelForDepsExcludesFn) depsPartition {
-	if !exportsDeps {
-		return depsPartition{
-			implementation: fn(ctx, allDeps, excludes),
-		}
-	}
-	implementation, export := android.FilterList(allDeps, exportedDeps)
-
-	return depsPartition{
-		export:         fn(ctx, export, excludes),
-		implementation: fn(ctx, implementation, excludes),
-	}
-}
-
-func bp2BuildPropParseHelper(ctx android.ArchVariantContext, module *Module, propsType interface{}, parseFunc func(axis bazel.ConfigurationAxis, config string, props interface{})) {
-	for axis, configToProps := range module.GetArchVariantProperties(ctx, propsType) {
-		for cfg, props := range configToProps {
-			parseFunc(axis, cfg, props)
-		}
-	}
-}
-
-// Parses properties common to static and shared libraries. Also used for prebuilt libraries.
-func bp2buildParseStaticOrSharedProps(ctx android.Bp2buildMutatorContext, module *Module, lib *libraryDecorator, isStatic bool) staticOrSharedAttributes {
-	attrs := staticOrSharedAttributes{}
-
-	setAttrs := func(axis bazel.ConfigurationAxis, config string, props StaticOrSharedProperties) {
-		attrs.Copts.SetSelectValue(axis, config, parseCommandLineFlags(props.Cflags, filterOutStdFlag, filterOutHiddenVisibility))
-		attrs.Srcs.SetSelectValue(axis, config, android.BazelLabelForModuleSrc(ctx, props.Srcs))
-		attrs.System_dynamic_deps.SetSelectValue(axis, config, bazelLabelForSharedDeps(ctx, props.System_shared_libs))
-
-		staticDeps := maybePartitionExportedAndImplementationsDeps(ctx, true, props.Static_libs, props.Export_static_lib_headers, bazelLabelForStaticDeps)
-		attrs.Deps.SetSelectValue(axis, config, staticDeps.export)
-		attrs.Implementation_deps.SetSelectValue(axis, config, staticDeps.implementation)
-
-		sharedDeps := maybePartitionExportedAndImplementationsDeps(ctx, true, props.Shared_libs, props.Export_shared_lib_headers, bazelLabelForSharedDeps)
-		attrs.Dynamic_deps.SetSelectValue(axis, config, sharedDeps.export)
-		attrs.Implementation_dynamic_deps.SetSelectValue(axis, config, sharedDeps.implementation)
-
-		attrs.Whole_archive_deps.SetSelectValue(axis, config, bazelLabelForWholeDeps(ctx, props.Whole_static_libs))
-		attrs.Enabled.SetSelectValue(axis, config, props.Enabled)
-	}
-	// system_dynamic_deps distinguishes between nil/empty list behavior:
-	//    nil -> use default values
-	//    empty list -> no values specified
-	attrs.System_dynamic_deps.ForceSpecifyEmptyList = true
-
-	var apexAvailable []string
-	if isStatic {
-		apexAvailable = lib.StaticProperties.Static.Apex_available
-		bp2BuildPropParseHelper(ctx, module, &StaticProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-			if staticOrSharedProps, ok := props.(*StaticProperties); ok {
-				setAttrs(axis, config, staticOrSharedProps.Static)
-			}
-		})
-	} else {
-		apexAvailable = lib.SharedProperties.Shared.Apex_available
-		bp2BuildPropParseHelper(ctx, module, &SharedProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-			if staticOrSharedProps, ok := props.(*SharedProperties); ok {
-				setAttrs(axis, config, staticOrSharedProps.Shared)
-			}
-		})
-	}
-
-	partitionedSrcs := groupSrcsByExtension(ctx, attrs.Srcs)
-	attrs.Srcs = partitionedSrcs[cppSrcPartition]
-	attrs.Srcs_c = partitionedSrcs[cSrcPartition]
-	attrs.Srcs_as = partitionedSrcs[asSrcPartition]
-
-	attrs.Apex_available = android.ConvertApexAvailableToTagsWithoutTestApexes(ctx, apexAvailable)
-
-	attrs.Features.Append(convertHiddenVisibilityToFeatureStaticOrShared(ctx, module, isStatic))
-
-	if !partitionedSrcs[protoSrcPartition].IsEmpty() {
-		// TODO(b/208815215): determine whether this is used and add support if necessary
-		ctx.ModuleErrorf("Migrating static/shared only proto srcs is not currently supported")
-	}
-
-	return attrs
-}
-
-// Convenience struct to hold all attributes parsed from prebuilt properties.
-type prebuiltAttributes struct {
-	Src     bazel.LabelAttribute
-	Enabled bazel.BoolAttribute
-}
-
-func parseSrc(ctx android.Bp2buildMutatorContext, srcLabelAttribute *bazel.LabelAttribute, axis bazel.ConfigurationAxis, config string, srcs []string) {
-	srcFileError := func() {
-		ctx.ModuleErrorf("parseSrc: Expected at most one source file for %s %s\n", axis, config)
-	}
-	if len(srcs) > 1 {
-		srcFileError()
-		return
-	} else if len(srcs) == 0 {
-		return
-	}
-	if srcLabelAttribute.SelectValue(axis, config) != nil {
-		srcFileError()
-		return
-	}
-	srcLabelAttribute.SetSelectValue(axis, config, android.BazelLabelForModuleSrcSingle(ctx, srcs[0]))
-}
-
-// NOTE: Used outside of Soong repo project, in the clangprebuilts.go bootstrap_go_package
-func Bp2BuildParsePrebuiltLibraryProps(ctx android.Bp2buildMutatorContext, module *Module, isStatic bool) prebuiltAttributes {
-
-	var srcLabelAttribute bazel.LabelAttribute
-	bp2BuildPropParseHelper(ctx, module, &prebuiltLinkerProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		if prebuiltLinkerProperties, ok := props.(*prebuiltLinkerProperties); ok {
-			parseSrc(ctx, &srcLabelAttribute, axis, config, prebuiltLinkerProperties.Srcs)
-		}
-	})
-
-	var enabledLabelAttribute bazel.BoolAttribute
-	parseAttrs := func(axis bazel.ConfigurationAxis, config string, props StaticOrSharedProperties) {
-		if props.Enabled != nil {
-			enabledLabelAttribute.SetSelectValue(axis, config, props.Enabled)
-		}
-		parseSrc(ctx, &srcLabelAttribute, axis, config, props.Srcs)
-	}
-
-	if isStatic {
-		bp2BuildPropParseHelper(ctx, module, &StaticProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-			if staticProperties, ok := props.(*StaticProperties); ok {
-				parseAttrs(axis, config, staticProperties.Static)
-			}
-		})
-	} else {
-		bp2BuildPropParseHelper(ctx, module, &SharedProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-			if sharedProperties, ok := props.(*SharedProperties); ok {
-				parseAttrs(axis, config, sharedProperties.Shared)
-			}
-		})
-	}
-
-	return prebuiltAttributes{
-		Src:     srcLabelAttribute,
-		Enabled: enabledLabelAttribute,
-	}
-}
-
-func bp2BuildParsePrebuiltBinaryProps(ctx android.Bp2buildMutatorContext, module *Module) prebuiltAttributes {
-	var srcLabelAttribute bazel.LabelAttribute
-	bp2BuildPropParseHelper(ctx, module, &prebuiltLinkerProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		if props, ok := props.(*prebuiltLinkerProperties); ok {
-			parseSrc(ctx, &srcLabelAttribute, axis, config, props.Srcs)
-		}
-	})
-
-	return prebuiltAttributes{
-		Src: srcLabelAttribute,
-	}
-}
-
-func bp2BuildParsePrebuiltObjectProps(ctx android.Bp2buildMutatorContext, module *Module) prebuiltAttributes {
-	var srcLabelAttribute bazel.LabelAttribute
-	bp2BuildPropParseHelper(ctx, module, &prebuiltObjectProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		if props, ok := props.(*prebuiltObjectProperties); ok {
-			parseSrc(ctx, &srcLabelAttribute, axis, config, props.Srcs)
-		}
-	})
-
-	return prebuiltAttributes{
-		Src: srcLabelAttribute,
-	}
-}
-
-type baseAttributes struct {
-	compilerAttributes
-	linkerAttributes
-
-	// A combination of compilerAttributes.features and linkerAttributes.features, as well as sanitizer features
-	features        bazel.StringListAttribute
-	protoDependency *bazel.LabelAttribute
-	aidlDependency  *bazel.LabelAttribute
-	Native_coverage *bool
-}
-
-// Convenience struct to hold all attributes parsed from compiler properties.
-type compilerAttributes struct {
-	// Options for all languages
-	copts bazel.StringListAttribute
-	// Assembly options and sources
-	asFlags bazel.StringListAttribute
-	asSrcs  bazel.LabelListAttribute
-	asmSrcs bazel.LabelListAttribute
-	// C options and sources
-	conlyFlags bazel.StringListAttribute
-	cSrcs      bazel.LabelListAttribute
-	// C++ options and sources
-	cppFlags bazel.StringListAttribute
-	srcs     bazel.LabelListAttribute
-
-	// xsd config sources
-	xsdSrcs       bazel.LabelListAttribute
-	exportXsdSrcs bazel.LabelListAttribute
-
-	// genrule headers
-	genruleHeaders       bazel.LabelListAttribute
-	exportGenruleHeaders bazel.LabelListAttribute
-
-	// Lex sources and options
-	lSrcs   bazel.LabelListAttribute
-	llSrcs  bazel.LabelListAttribute
-	lexopts bazel.StringListAttribute
-
-	// Sysprop sources
-	syspropSrcs bazel.LabelListAttribute
-
-	// Yacc sources
-	yaccSrc               *bazel.LabelAttribute
-	yaccFlags             bazel.StringListAttribute
-	yaccGenLocationHeader bazel.BoolAttribute
-	yaccGenPositionHeader bazel.BoolAttribute
-
-	rsSrcs bazel.LabelListAttribute
-
-	hdrs bazel.LabelListAttribute
-
-	rtti bazel.BoolAttribute
-
-	// Not affected by arch variants
-	stl    *string
-	cStd   *string
-	cppStd *string
-
-	localIncludes    bazel.StringListAttribute
-	absoluteIncludes bazel.StringListAttribute
-
-	includes BazelIncludes
-
-	protoSrcs   bazel.LabelListAttribute
-	aidlSrcs    bazel.LabelListAttribute
-	rscriptSrcs bazel.LabelListAttribute
-
-	stubsSymbolFile *string
-	stubsVersions   bazel.StringListAttribute
-
-	features bazel.StringListAttribute
-
-	stem   bazel.StringAttribute
-	suffix bazel.StringAttribute
-
-	fdoProfile bazel.LabelAttribute
-
-	additionalCompilerInputs bazel.LabelListAttribute
-}
-
-type filterOutFn func(string) bool
-
-// filterOutHiddenVisibility removes the flag specifying hidden visibility as
-// this flag is converted to a toolchain feature
-func filterOutHiddenVisibility(flag string) bool {
-	return flag == config.VisibilityHiddenFlag
-}
-
-func filterOutStdFlag(flag string) bool {
-	return strings.HasPrefix(flag, "-std=")
-}
-
-func filterOutClangUnknownCflags(flag string) bool {
-	for _, f := range config.ClangUnknownCflags {
-		if f == flag {
-			return true
-		}
-	}
-	return false
-}
-
-func parseCommandLineFlags(soongFlags []string, filterOut ...filterOutFn) []string {
-	var result []string
-	for _, flag := range soongFlags {
-		skipFlag := false
-		for _, filter := range filterOut {
-			if filter != nil && filter(flag) {
-				skipFlag = true
-			}
-		}
-		if skipFlag {
-			continue
-		}
-		// Soong's cflags can contain spaces, like `-include header.h`. For
-		// Bazel's copts, split them up to be compatible with the
-		// no_copts_tokenization feature.
-		result = append(result, strings.Split(flag, " ")...)
-	}
-	return result
-}
-
-func (ca *compilerAttributes) bp2buildForAxisAndConfig(ctx android.Bp2buildMutatorContext, axis bazel.ConfigurationAxis, config string, props *BaseCompilerProperties) {
-	// If there's arch specific srcs or exclude_srcs, generate a select entry for it.
-	// TODO(b/186153868): do this for OS specific srcs and exclude_srcs too.
-	srcsList, ok := parseSrcs(ctx, props)
-
-	if ok {
-		ca.srcs.SetSelectValue(axis, config, srcsList)
-	}
-
-	localIncludeDirs := props.Local_include_dirs
-	if axis == bazel.NoConfigAxis {
-		ca.cStd, ca.cppStd = bp2buildResolveCppStdValue(props.C_std, props.Cpp_std, props.Gnu_extensions)
-		if includeBuildDirectory(props.Include_build_directory) {
-			localIncludeDirs = append(localIncludeDirs, ".")
-		}
-	}
-
-	ca.absoluteIncludes.SetSelectValue(axis, config, props.Include_dirs)
-	ca.localIncludes.SetSelectValue(axis, config, localIncludeDirs)
-
-	instructionSet := proptools.StringDefault(props.Instruction_set, "")
-	if instructionSet == "arm" {
-		ca.features.SetSelectValue(axis, config, []string{"arm_isa_arm"})
-	} else if instructionSet != "" && instructionSet != "thumb" {
-		ctx.ModuleErrorf("Unknown value for instruction_set: %s", instructionSet)
-	}
-
-	// In Soong, cflags occur on the command line before -std=<val> flag, resulting in the value being
-	// overridden. In Bazel we always allow overriding, via flags; however, this can cause
-	// incompatibilities, so we remove "-std=" flags from Cflag properties while leaving it in other
-	// cases.
-	ca.copts.SetSelectValue(axis, config, parseCommandLineFlags(props.Cflags, filterOutStdFlag, filterOutClangUnknownCflags, filterOutHiddenVisibility))
-	ca.asFlags.SetSelectValue(axis, config, parseCommandLineFlags(props.Asflags, nil))
-	ca.conlyFlags.SetSelectValue(axis, config, parseCommandLineFlags(props.Conlyflags, filterOutClangUnknownCflags))
-	ca.cppFlags.SetSelectValue(axis, config, parseCommandLineFlags(props.Cppflags, filterOutClangUnknownCflags))
-	ca.rtti.SetSelectValue(axis, config, props.Rtti)
-}
-
-func (ca *compilerAttributes) convertStlProps(ctx android.ArchVariantContext, module *Module) {
-	bp2BuildPropParseHelper(ctx, module, &StlProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		if stlProps, ok := props.(*StlProperties); ok {
-			if stlProps.Stl == nil {
-				return
-			}
-			if ca.stl == nil {
-				stl := deduplicateStlInput(*stlProps.Stl)
-				ca.stl = &stl
-			} else if ca.stl != stlProps.Stl {
-				ctx.ModuleErrorf("Unsupported conversion: module with different stl for different variants: %s and %s", *ca.stl, stlProps.Stl)
-			}
-		}
-	})
-}
-
-func (ca *compilerAttributes) convertProductVariables(ctx android.BazelConversionPathContext, productVariableProps android.ProductConfigProperties) {
-	productVarPropNameToAttribute := map[string]*bazel.StringListAttribute{
-		"Cflags":   &ca.copts,
-		"Asflags":  &ca.asFlags,
-		"Cppflags": &ca.cppFlags,
-	}
-	for propName, attr := range productVarPropNameToAttribute {
-		if productConfigProps, exists := productVariableProps[propName]; exists {
-			for productConfigProp, prop := range productConfigProps {
-				flags, ok := prop.([]string)
-				if !ok {
-					ctx.ModuleErrorf("Could not convert product variable %s property", proptools.PropertyNameForField(propName))
-				}
-				newFlags, _ := bazel.TryVariableSubstitutions(flags, productConfigProp.Name())
-				attr.SetSelectValue(productConfigProp.ConfigurationAxis(), productConfigProp.SelectKey(), newFlags)
-			}
-		}
-	}
-}
-
-func (ca *compilerAttributes) finalize(ctx android.BazelConversionPathContext, implementationHdrs, exportHdrs bazel.LabelListAttribute) {
-	ca.srcs.ResolveExcludes()
-	partitionedSrcs := groupSrcsByExtension(ctx, ca.srcs)
-	partitionedImplHdrs := partitionHeaders(ctx, implementationHdrs)
-	partitionedHdrs := partitionHeaders(ctx, exportHdrs)
-
-	ca.protoSrcs = partitionedSrcs[protoSrcPartition]
-	ca.protoSrcs.Append(partitionedSrcs[protoFromGenPartition])
-	ca.aidlSrcs = partitionedSrcs[aidlSrcPartition]
-
-	for p, lla := range partitionedSrcs {
-		// if there are no sources, there is no need for headers
-		if lla.IsEmpty() {
-			continue
-		}
-		lla.Append(partitionedImplHdrs[hdrPartition])
-		partitionedSrcs[p] = lla
-	}
-
-	ca.hdrs = partitionedHdrs[hdrPartition]
-
-	ca.includesFromHeaders(ctx, partitionedImplHdrs[hdrPartition], partitionedHdrs[hdrPartition])
-
-	xsdSrcs := bazel.SubtractBazelLabelListAttribute(partitionedSrcs[xsdSrcPartition], partitionedHdrs[xsdSrcPartition])
-	xsdSrcs.Append(partitionedImplHdrs[xsdSrcPartition])
-	ca.exportXsdSrcs = partitionedHdrs[xsdSrcPartition]
-	ca.xsdSrcs = bazel.FirstUniqueBazelLabelListAttribute(xsdSrcs)
-
-	ca.genruleHeaders = partitionedImplHdrs[genrulePartition]
-	ca.exportGenruleHeaders = partitionedHdrs[genrulePartition]
-
-	ca.srcs = partitionedSrcs[cppSrcPartition]
-	ca.cSrcs = partitionedSrcs[cSrcPartition]
-	ca.asSrcs = partitionedSrcs[asSrcPartition]
-	ca.asmSrcs = partitionedSrcs[asmSrcPartition]
-	ca.lSrcs = partitionedSrcs[lSrcPartition]
-	ca.llSrcs = partitionedSrcs[llSrcPartition]
-	if yacc := partitionedSrcs[yaccSrcPartition]; !yacc.IsEmpty() {
-		if len(yacc.Value.Includes) > 1 {
-			ctx.PropertyErrorf("srcs", "Found multiple yacc (.y/.yy) files in library")
-		}
-		ca.yaccSrc = bazel.MakeLabelAttribute(yacc.Value.Includes[0].Label)
-	}
-	ca.syspropSrcs = partitionedSrcs[syspropSrcPartition]
-	ca.rscriptSrcs = partitionedSrcs[rScriptSrcPartition]
-
-	ca.absoluteIncludes.DeduplicateAxesFromBase()
-	ca.localIncludes.DeduplicateAxesFromBase()
-}
-
-// Parse srcs from an arch or OS's props value.
-func parseSrcs(ctx android.Bp2buildMutatorContext, props *BaseCompilerProperties) (bazel.LabelList, bool) {
-	anySrcs := false
-	// Add srcs-like dependencies such as generated files.
-	// First create a LabelList containing these dependencies, then merge the values with srcs.
-	genSrcs := props.Generated_sources
-	generatedSrcsLabelList := android.BazelLabelForModuleDepsExcludes(ctx, genSrcs, props.Exclude_generated_sources)
-	if len(props.Generated_sources) > 0 || len(props.Exclude_generated_sources) > 0 {
-		anySrcs = true
-	}
-
-	allSrcsLabelList := android.BazelLabelForModuleSrcExcludes(ctx, props.Srcs, props.Exclude_srcs)
-
-	if len(props.Srcs) > 0 || len(props.Exclude_srcs) > 0 {
-		anySrcs = true
-	}
-
-	return bazel.AppendBazelLabelLists(allSrcsLabelList, generatedSrcsLabelList), anySrcs
-}
-
-func bp2buildStdVal(std *string, prefix string, useGnu bool) *string {
-	defaultVal := prefix + "_std_default"
-	// If c{,pp}std properties are not specified, don't generate them in the BUILD file.
-	// Defaults are handled by the toolchain definition.
-	// However, if gnu_extensions is false, then the default gnu-to-c version must be specified.
-	stdVal := proptools.StringDefault(std, defaultVal)
-	if stdVal == "experimental" || stdVal == defaultVal {
-		if stdVal == "experimental" {
-			stdVal = prefix + "_std_experimental"
-		}
-		if !useGnu {
-			stdVal += "_no_gnu"
-		}
-	} else if !useGnu {
-		stdVal = gnuToCReplacer.Replace(stdVal)
-	}
-
-	if stdVal == defaultVal {
-		return nil
-	}
-	return &stdVal
-}
-
-func bp2buildResolveCppStdValue(c_std *string, cpp_std *string, gnu_extensions *bool) (*string, *string) {
-	useGnu := useGnuExtensions(gnu_extensions)
-
-	return bp2buildStdVal(c_std, "c", useGnu), bp2buildStdVal(cpp_std, "cpp", useGnu)
-}
-
-// packageFromLabel extracts package from a fully-qualified or relative Label and whether the label
-// is fully-qualified.
-// e.g. fully-qualified "//a/b:foo" -> "a/b", true, relative: ":bar" -> ".", false
-func packageFromLabel(label string) (string, bool) {
-	split := strings.Split(label, ":")
-	if len(split) != 2 {
-		return "", false
-	}
-	if split[0] == "" {
-		return ".", false
-	}
-	// remove leading "//"
-	return split[0][2:], true
-}
-
-// includesFromHeaders gets the include directories needed from generated headers
-func (ca *compilerAttributes) includesFromHeaders(ctx android.BazelConversionPathContext, implHdrs, hdrs bazel.LabelListAttribute) {
-	local, absolute := includesFromLabelListAttribute(implHdrs, ca.localIncludes, ca.absoluteIncludes)
-	localExport, absoluteExport := includesFromLabelListAttribute(hdrs, ca.includes.Includes, ca.includes.AbsoluteIncludes)
-
-	ca.localIncludes = local
-	ca.absoluteIncludes = absolute
-
-	ca.includes.Includes = localExport
-	ca.includes.AbsoluteIncludes = absoluteExport
-}
-
-// includesFromLabelList extracts the packages from a LabelListAttribute that should be includes and
-// combines them with existing local/absolute includes.
-func includesFromLabelListAttribute(attr bazel.LabelListAttribute, existingLocal, existingAbsolute bazel.StringListAttribute) (bazel.StringListAttribute, bazel.StringListAttribute) {
-	localAttr := existingLocal.Clone()
-	absoluteAttr := existingAbsolute.Clone()
-	if !attr.Value.IsEmpty() {
-		l, a := includesFromLabelList(attr.Value, existingLocal.Value, existingAbsolute.Value)
-		localAttr.SetSelectValue(bazel.NoConfigAxis, "", l)
-		absoluteAttr.SetSelectValue(bazel.NoConfigAxis, "", a)
-	}
-	for axis, configToLabels := range attr.ConfigurableValues {
-		for c, labels := range configToLabels {
-			local := existingLocal.SelectValue(axis, c)
-			absolute := existingAbsolute.SelectValue(axis, c)
-			l, a := includesFromLabelList(labels, local, absolute)
-			localAttr.SetSelectValue(axis, c, l)
-			absoluteAttr.SetSelectValue(axis, c, a)
-		}
-	}
-	return *localAttr, *absoluteAttr
-}
-
-// includesFromLabelList extracts relative/absolute includes from a bazel.LabelList.
-func includesFromLabelList(labelList bazel.LabelList, existingRel, existingAbs []string) ([]string, []string) {
-	var relative, absolute []string
-	for _, hdr := range labelList.Includes {
-		if pkg, hasPkg := packageFromLabel(hdr.Label); hasPkg {
-			absolute = append(absolute, pkg)
-		} else if pkg != "" {
-			relative = append(relative, pkg)
-		}
-	}
-	if len(relative)+len(existingRel) != 0 {
-		relative = android.FirstUniqueStrings(append(append([]string{}, existingRel...), relative...))
-	}
-	if len(absolute)+len(existingAbs) != 0 {
-		absolute = android.FirstUniqueStrings(append(append([]string{}, existingAbs...), absolute...))
-	}
-	return relative, absolute
-}
-
-type YasmAttributes struct {
-	Srcs         bazel.LabelListAttribute
-	Flags        bazel.StringListAttribute
-	Include_dirs bazel.StringListAttribute
-}
-
-func bp2BuildYasm(ctx android.Bp2buildMutatorContext, m *Module, ca compilerAttributes) *bazel.LabelAttribute {
-	if ca.asmSrcs.IsEmpty() {
-		return nil
-	}
-
-	// Yasm needs the include directories from both local_includes and
-	// export_include_dirs. We don't care about actually exporting them from the
-	// yasm rule though, because they will also be present on the cc_ rule that
-	// wraps this yasm rule.
-	includes := ca.localIncludes.Clone()
-	bp2BuildPropParseHelper(ctx, m, &FlagExporterProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		if flagExporterProperties, ok := props.(*FlagExporterProperties); ok {
-			if len(flagExporterProperties.Export_include_dirs) > 0 {
-				x := bazel.StringListAttribute{}
-				x.SetSelectValue(axis, config, flagExporterProperties.Export_include_dirs)
-				includes.Append(x)
-			}
-		}
-	})
-
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "yasm",
-			Bzl_load_location: "//build/bazel/rules/cc:yasm.bzl",
-		},
-		android.CommonAttributes{Name: m.Name() + "_yasm"},
-		&YasmAttributes{
-			Srcs:         ca.asmSrcs,
-			Flags:        ca.asFlags,
-			Include_dirs: *includes,
-		})
-
-	// We only want to add a dependency on the _yasm target if there are asm
-	// sources in the current configuration. If there are unconfigured asm
-	// sources, always add the dependency. Otherwise, add the dependency only
-	// on the configuration axes and values that had asm sources.
-	if len(ca.asmSrcs.Value.Includes) > 0 {
-		return bazel.MakeLabelAttribute(":" + m.Name() + "_yasm")
-	}
-
-	ret := &bazel.LabelAttribute{}
-	for _, axis := range ca.asmSrcs.SortedConfigurationAxes() {
-		for cfg := range ca.asmSrcs.ConfigurableValues[axis] {
-			ret.SetSelectValue(axis, cfg, bazel.Label{Label: ":" + m.Name() + "_yasm"})
-		}
-	}
-	return ret
-}
-
-// bp2BuildParseBaseProps returns all compiler, linker, library attributes of a cc module.
-func bp2BuildParseBaseProps(ctx android.Bp2buildMutatorContext, module *Module) baseAttributes {
-	archVariantCompilerProps := module.GetArchVariantProperties(ctx, &BaseCompilerProperties{})
-	archVariantLinkerProps := module.GetArchVariantProperties(ctx, &BaseLinkerProperties{})
-	archVariantLibraryProperties := module.GetArchVariantProperties(ctx, &LibraryProperties{})
-
-	axisToConfigs := map[bazel.ConfigurationAxis]map[string]bool{}
-	allAxesAndConfigs := func(cp android.ConfigurationAxisToArchVariantProperties) {
-		for axis, configMap := range cp {
-			if _, ok := axisToConfigs[axis]; !ok {
-				axisToConfigs[axis] = map[string]bool{}
-			}
-			for cfg := range configMap {
-				axisToConfigs[axis][cfg] = true
-			}
-		}
-	}
-	allAxesAndConfigs(archVariantCompilerProps)
-	allAxesAndConfigs(archVariantLinkerProps)
-	allAxesAndConfigs(archVariantLibraryProperties)
-
-	compilerAttrs := compilerAttributes{}
-	linkerAttrs := linkerAttributes{}
-
-	var aidlLibs bazel.LabelList
-	var implementationHdrs, exportHdrs bazel.LabelListAttribute
-
-	// Iterate through these axes in a deterministic order. This is required
-	// because processing certain dependencies may result in concatenating
-	// elements along other axes. (For example, processing NoConfig may result
-	// in elements being added to InApex). This is thus the only way to ensure
-	// that the order of entries in each list is in a predictable order.
-	for _, axis := range bazel.SortedConfigurationAxes(axisToConfigs) {
-		configs := axisToConfigs[axis]
-		for cfg := range configs {
-			var allHdrs []string
-			if baseCompilerProps, ok := archVariantCompilerProps[axis][cfg].(*BaseCompilerProperties); ok {
-				allHdrs = baseCompilerProps.Generated_headers
-
-				if baseCompilerProps.Lex != nil {
-					compilerAttrs.lexopts.SetSelectValue(axis, cfg, baseCompilerProps.Lex.Flags)
-				}
-				if baseCompilerProps.Yacc != nil {
-					compilerAttrs.yaccFlags.SetSelectValue(axis, cfg, baseCompilerProps.Yacc.Flags)
-					compilerAttrs.yaccGenLocationHeader.SetSelectValue(axis, cfg, baseCompilerProps.Yacc.Gen_location_hh)
-					compilerAttrs.yaccGenPositionHeader.SetSelectValue(axis, cfg, baseCompilerProps.Yacc.Gen_position_hh)
-				}
-				(&compilerAttrs).bp2buildForAxisAndConfig(ctx, axis, cfg, baseCompilerProps)
-				aidlLibs.Append(android.BazelLabelForModuleDeps(ctx, baseCompilerProps.Aidl.Libs))
-			}
-
-			var exportedHdrs []string
-
-			if baseLinkerProps, ok := archVariantLinkerProps[axis][cfg].(*BaseLinkerProperties); ok {
-				exportedHdrs = baseLinkerProps.Export_generated_headers
-				(&linkerAttrs).bp2buildForAxisAndConfig(ctx, module, axis, cfg, baseLinkerProps)
-			}
-
-			headers := maybePartitionExportedAndImplementationsDeps(ctx, !module.Binary(), allHdrs, exportedHdrs, android.BazelLabelForModuleDeps)
-
-			implementationHdrs.SetSelectValue(axis, cfg, headers.implementation)
-			exportHdrs.SetSelectValue(axis, cfg, headers.export)
-
-			if libraryProps, ok := archVariantLibraryProperties[axis][cfg].(*LibraryProperties); ok {
-				if axis == bazel.NoConfigAxis {
-					if libraryProps.Stubs.Symbol_file != nil {
-						compilerAttrs.stubsSymbolFile = libraryProps.Stubs.Symbol_file
-						versions := android.CopyOf(libraryProps.Stubs.Versions)
-						normalizeVersions(ctx, versions)
-						versions = addCurrentVersionIfNotPresent(versions)
-						compilerAttrs.stubsVersions.SetSelectValue(axis, cfg, versions)
-					}
-				}
-				if stem := libraryProps.Stem; stem != nil {
-					compilerAttrs.stem.SetSelectValue(axis, cfg, stem)
-				}
-				if suffix := libraryProps.Suffix; suffix != nil {
-					compilerAttrs.suffix.SetSelectValue(axis, cfg, suffix)
-				}
-			}
-
-		}
-	}
-
-	compilerAttrs.convertStlProps(ctx, module)
-	(&linkerAttrs).convertStripProps(ctx, module)
-
-	var nativeCoverage *bool
-	if module.coverage != nil && module.coverage.Properties.Native_coverage != nil &&
-		!Bool(module.coverage.Properties.Native_coverage) {
-		nativeCoverage = BoolPtr(false)
-	}
-
-	productVariableProps, errs := android.ProductVariableProperties(ctx, ctx.Module())
-	for _, err := range errs {
-		ctx.ModuleErrorf("ProductVariableProperties error: %s", err)
-	}
-
-	(&compilerAttrs).convertProductVariables(ctx, productVariableProps)
-	(&linkerAttrs).convertProductVariables(ctx, productVariableProps)
-
-	(&compilerAttrs).finalize(ctx, implementationHdrs, exportHdrs)
-	(&linkerAttrs).finalize(ctx)
-
-	(&compilerAttrs.srcs).Add(bp2BuildYasm(ctx, module, compilerAttrs))
-
-	(&linkerAttrs).deps.Append(compilerAttrs.exportGenruleHeaders)
-	(&linkerAttrs).implementationDeps.Append(compilerAttrs.genruleHeaders)
-
-	(&linkerAttrs).wholeArchiveDeps.Append(compilerAttrs.exportXsdSrcs)
-	(&linkerAttrs).implementationWholeArchiveDeps.Append(compilerAttrs.xsdSrcs)
-
-	protoDep := bp2buildProto(ctx, module, compilerAttrs.protoSrcs, linkerAttrs)
-
-	// bp2buildProto will only set wholeStaticLib or implementationWholeStaticLib, but we don't know
-	// which. This will add the newly generated proto library to the appropriate attribute and nothing
-	// to the other
-	(&linkerAttrs).wholeArchiveDeps.Add(protoDep.wholeStaticLib)
-	(&linkerAttrs).implementationWholeArchiveDeps.Add(protoDep.implementationWholeStaticLib)
-
-	aidlDep := bp2buildCcAidlLibrary(
-		ctx, module,
-		compilerAttrs.aidlSrcs,
-		bazel.LabelListAttribute{
-			Value: aidlLibs,
-		},
-		linkerAttrs,
-		compilerAttrs,
-	)
-	if aidlDep != nil {
-		if lib, ok := module.linker.(*libraryDecorator); ok {
-			if proptools.Bool(lib.Properties.Aidl.Export_aidl_headers) {
-				(&linkerAttrs).wholeArchiveDeps.Add(aidlDep)
-			} else {
-				(&linkerAttrs).implementationWholeArchiveDeps.Add(aidlDep)
-			}
-		}
-	}
-
-	// Create a cc_yacc_static_library if srcs contains .y/.yy files
-	// This internal target will produce an .a file that will be statically linked to the parent library
-	if yaccDep := bp2buildCcYaccLibrary(ctx, compilerAttrs, linkerAttrs); yaccDep != nil {
-		(&linkerAttrs).implementationWholeArchiveDeps.Add(yaccDep)
-	}
-
-	convertedLSrcs := bp2BuildLex(ctx, module.Name(), compilerAttrs)
-	(&compilerAttrs).srcs.Add(&convertedLSrcs.srcName)
-	(&compilerAttrs).cSrcs.Add(&convertedLSrcs.cSrcName)
-
-	if module.afdo != nil && module.afdo.Properties.Afdo {
-		fdoProfileDep := bp2buildFdoProfile(ctx, module)
-		if fdoProfileDep != nil {
-			// TODO(b/276287371): Only set fdo_profile for android platform
-			// https://cs.android.com/android/platform/superproject/main/+/main:build/soong/cc/afdo.go;l=105;drc=2dbe160d1af445de32725098570ec594e3944fc5
-			(&compilerAttrs).fdoProfile.SetValue(*fdoProfileDep)
-		}
-	}
-
-	if !compilerAttrs.syspropSrcs.IsEmpty() {
-		(&linkerAttrs).wholeArchiveDeps.Add(bp2buildCcSysprop(ctx, module.Name(), module.Properties.Min_sdk_version, compilerAttrs.syspropSrcs))
-	}
-
-	linkerAttrs.wholeArchiveDeps.Prepend = true
-	linkerAttrs.deps.Prepend = true
-	compilerAttrs.localIncludes.Prepend = true
-	compilerAttrs.absoluteIncludes.Prepend = true
-	compilerAttrs.hdrs.Prepend = true
-
-	convertedRsSrcs, rsAbsIncludes, rsLocalIncludes := bp2buildRScript(ctx, module, compilerAttrs)
-	(&compilerAttrs).srcs.Add(&convertedRsSrcs)
-	(&compilerAttrs).absoluteIncludes.Append(rsAbsIncludes)
-	(&compilerAttrs).localIncludes.Append(rsLocalIncludes)
-	(&compilerAttrs).localIncludes.Value = android.FirstUniqueStrings(compilerAttrs.localIncludes.Value)
-
-	sanitizerValues := bp2buildSanitizerFeatures(ctx, module)
-
-	features := compilerAttrs.features.Clone().Append(linkerAttrs.features).Append(sanitizerValues.features)
-	features = features.Append(bp2buildLtoFeatures(ctx, module))
-	features = features.Append(convertHiddenVisibilityToFeatureBase(ctx, module))
-	features.DeduplicateAxesFromBase()
-
-	compilerAttrs.copts = *compilerAttrs.copts.Append(sanitizerValues.copts)
-	compilerAttrs.additionalCompilerInputs = *compilerAttrs.additionalCompilerInputs.Append(sanitizerValues.additionalCompilerInputs)
-
-	addMuslSystemDynamicDeps(ctx, linkerAttrs)
-
-	// Dedupe all deps.
-	(&linkerAttrs).deps.Value = bazel.FirstUniqueBazelLabelList((&linkerAttrs).deps.Value)
-	(&linkerAttrs).implementationDeps.Value = bazel.FirstUniqueBazelLabelList((&linkerAttrs).implementationDeps.Value)
-	(&linkerAttrs).implementationDynamicDeps.Value = bazel.FirstUniqueBazelLabelList((&linkerAttrs).implementationDynamicDeps.Value)
-	(&linkerAttrs).wholeArchiveDeps.Value = bazel.FirstUniqueBazelLabelList((&linkerAttrs).wholeArchiveDeps.Value)
-	(&linkerAttrs).implementationWholeArchiveDeps.Value = bazel.FirstUniqueBazelLabelList((&linkerAttrs).implementationWholeArchiveDeps.Value)
-
-	return baseAttributes{
-		compilerAttrs,
-		linkerAttrs,
-		*features,
-		protoDep.protoDep,
-		aidlDep,
-		nativeCoverage,
-	}
-}
-
-type ccYaccLibraryAttributes struct {
-	Src                         bazel.LabelAttribute
-	Flags                       bazel.StringListAttribute
-	Gen_location_hh             bazel.BoolAttribute
-	Gen_position_hh             bazel.BoolAttribute
-	Local_includes              bazel.StringListAttribute
-	Implementation_deps         bazel.LabelListAttribute
-	Implementation_dynamic_deps bazel.LabelListAttribute
-}
-
-func bp2buildCcYaccLibrary(ctx android.Bp2buildMutatorContext, ca compilerAttributes, la linkerAttributes) *bazel.LabelAttribute {
-	if ca.yaccSrc == nil {
-		return nil
-	}
-	yaccLibraryLabel := ctx.Module().Name() + "_yacc"
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "cc_yacc_static_library",
-			Bzl_load_location: "//build/bazel/rules/cc:cc_yacc_library.bzl",
-		},
-		android.CommonAttributes{
-			Name: yaccLibraryLabel,
-		},
-		&ccYaccLibraryAttributes{
-			Src:                         *ca.yaccSrc,
-			Flags:                       ca.yaccFlags,
-			Gen_location_hh:             ca.yaccGenLocationHeader,
-			Gen_position_hh:             ca.yaccGenPositionHeader,
-			Local_includes:              ca.localIncludes,
-			Implementation_deps:         la.implementationDeps,
-			Implementation_dynamic_deps: la.implementationDynamicDeps,
-		},
-	)
-
-	yaccLibrary := &bazel.LabelAttribute{
-		Value: &bazel.Label{
-			Label: ":" + yaccLibraryLabel,
-		},
-	}
-	return yaccLibrary
-}
-
-// As a workaround for b/261657184, we are manually adding the default value
-// of system_dynamic_deps for the linux_musl os.
-// TODO: Solve this properly
-func addMuslSystemDynamicDeps(ctx android.Bp2buildMutatorContext, attrs linkerAttributes) {
-	systemDynamicDeps := attrs.systemDynamicDeps.SelectValue(bazel.OsConfigurationAxis, "linux_musl")
-	if attrs.systemDynamicDeps.HasAxisSpecificValues(bazel.OsConfigurationAxis) && systemDynamicDeps.IsNil() {
-		attrs.systemDynamicDeps.SetSelectValue(bazel.OsConfigurationAxis, "linux_musl", android.BazelLabelForModuleDeps(ctx, config.MuslDefaultSharedLibraries))
-	}
-}
-
-type fdoProfileAttributes struct {
-	Absolute_path_profile string
-}
-
-func bp2buildFdoProfile(
-	ctx android.Bp2buildMutatorContext,
-	m *Module,
-) *bazel.Label {
-	// TODO(b/267229066): Convert to afdo boolean attribute and let Bazel handles finding
-	// fdo_profile target from AfdoProfiles product var
-	for _, project := range globalAfdoProfileProjects {
-		// Ensure it's a Soong package
-		bpPath := android.ExistentPathForSource(ctx, project, "Android.bp")
-		if bpPath.Valid() {
-			// TODO(b/260714900): Handle arch-specific afdo profiles (e.g. `<module-name>-arm<64>.afdo`)
-			path := android.ExistentPathForSource(ctx, project, m.Name()+".afdo")
-			if path.Valid() {
-				fdoProfileLabel := "//" + strings.TrimSuffix(project, "/") + ":" + m.Name()
-				return &bazel.Label{
-					Label: fdoProfileLabel,
-				}
-			}
-		}
-	}
-
-	return nil
-}
-
-func bp2buildCcAidlLibrary(
-	ctx android.Bp2buildMutatorContext,
-	m *Module,
-	aidlSrcs bazel.LabelListAttribute,
-	aidlLibs bazel.LabelListAttribute,
-	linkerAttrs linkerAttributes,
-	compilerAttrs compilerAttributes,
-) *bazel.LabelAttribute {
-	var aidlLibsFromSrcs, aidlFiles bazel.LabelListAttribute
-	apexAvailableTags := android.ApexAvailableTagsWithoutTestApexes(ctx, ctx.Module())
-
-	if !aidlSrcs.IsEmpty() {
-		aidlLibsFromSrcs, aidlFiles = aidlSrcs.Partition(func(src bazel.Label) bool {
-			if fg, ok := android.ToFileGroupAsLibrary(ctx, src.OriginalModuleName); ok &&
-				fg.ShouldConvertToAidlLibrary(ctx) {
-				return true
-			}
-			return false
-		})
-
-		if !aidlFiles.IsEmpty() {
-			aidlLibName := m.Name() + "_aidl_library"
-			ctx.CreateBazelTargetModule(
-				bazel.BazelTargetModuleProperties{
-					Rule_class:        "aidl_library",
-					Bzl_load_location: "//build/bazel/rules/aidl:aidl_library.bzl",
-				},
-				android.CommonAttributes{
-					Name: aidlLibName,
-					Tags: apexAvailableTags,
-				},
-				&aidlLibraryAttributes{
-					Srcs: aidlFiles,
-				},
-			)
-			aidlLibsFromSrcs.Add(&bazel.LabelAttribute{Value: &bazel.Label{Label: ":" + aidlLibName}})
-		}
-	}
-
-	allAidlLibs := aidlLibs.Clone()
-	allAidlLibs.Append(aidlLibsFromSrcs)
-
-	if !allAidlLibs.IsEmpty() {
-		ccAidlLibrarylabel := m.Name() + "_cc_aidl_library"
-		// Since parent cc_library already has these dependencies, we can add them as implementation
-		// deps so that they don't re-export
-		implementationDeps := linkerAttrs.deps.Clone()
-		implementationDeps.Append(linkerAttrs.implementationDeps)
-		implementationDynamicDeps := linkerAttrs.dynamicDeps.Clone()
-		implementationDynamicDeps.Append(linkerAttrs.implementationDynamicDeps)
-
-		sdkAttrs := Bp2BuildParseSdkAttributes(m)
-
-		exportedIncludes := bp2BuildParseExportedIncludes(ctx, m, &compilerAttrs.includes)
-		includeAttrs := includesAttributes{
-			Export_includes:          exportedIncludes.Includes,
-			Export_absolute_includes: exportedIncludes.AbsoluteIncludes,
-			Export_system_includes:   exportedIncludes.SystemIncludes,
-			Local_includes:           compilerAttrs.localIncludes,
-			Absolute_includes:        compilerAttrs.absoluteIncludes,
-		}
-
-		ctx.CreateBazelTargetModule(
-			bazel.BazelTargetModuleProperties{
-				Rule_class:        "cc_aidl_library",
-				Bzl_load_location: "//build/bazel/rules/cc:cc_aidl_library.bzl",
-			},
-			android.CommonAttributes{Name: ccAidlLibrarylabel},
-			&ccAidlLibraryAttributes{
-				Deps:                        *allAidlLibs,
-				Implementation_deps:         *implementationDeps,
-				Implementation_dynamic_deps: *implementationDynamicDeps,
-				Tags:                        apexAvailableTags,
-				SdkAttributes:               sdkAttrs,
-				includesAttributes:          includeAttrs,
-			},
-		)
-		label := &bazel.LabelAttribute{
-			Value: &bazel.Label{
-				Label: ":" + ccAidlLibrarylabel,
-			},
-		}
-		return label
-	}
-
-	return nil
-}
-
-func Bp2BuildParseSdkAttributes(module *Module) SdkAttributes {
-	return SdkAttributes{
-		Sdk_version:     module.Properties.Sdk_version,
-		Min_sdk_version: module.Properties.Min_sdk_version,
-	}
-}
-
-type SdkAttributes struct {
-	Sdk_version     *string
-	Min_sdk_version *string
-}
-
-// Convenience struct to hold all attributes parsed from linker properties.
-type linkerAttributes struct {
-	deps                             bazel.LabelListAttribute
-	implementationDeps               bazel.LabelListAttribute
-	dynamicDeps                      bazel.LabelListAttribute
-	implementationDynamicDeps        bazel.LabelListAttribute
-	runtimeDeps                      bazel.LabelListAttribute
-	wholeArchiveDeps                 bazel.LabelListAttribute
-	implementationWholeArchiveDeps   bazel.LabelListAttribute
-	systemDynamicDeps                bazel.LabelListAttribute
-	usedSystemDynamicDepAsStaticDep  map[string]bool
-	usedSystemDynamicDepAsDynamicDep map[string]bool
-
-	useVersionLib                 bazel.BoolAttribute
-	linkopts                      bazel.StringListAttribute
-	additionalLinkerInputs        bazel.LabelListAttribute
-	stripKeepSymbols              bazel.BoolAttribute
-	stripKeepSymbolsAndDebugFrame bazel.BoolAttribute
-	stripKeepSymbolsList          bazel.StringListAttribute
-	stripAll                      bazel.BoolAttribute
-	stripNone                     bazel.BoolAttribute
-	features                      bazel.StringListAttribute
-}
-
-var (
-	soongSystemSharedLibs = []string{"libc", "libm", "libdl"}
-	versionLib            = "libbuildversion"
-)
-
-// resolveTargetApex re-adds the shared and static libs in target.apex.exclude_shared|static_libs props to non-apex variant
-// since all libs are already excluded by default
-func (la *linkerAttributes) resolveTargetApexProp(ctx android.Bp2buildMutatorContext, props *BaseLinkerProperties) {
-	excludeSharedLibs := bazelLabelForSharedDeps(ctx, props.Target.Apex.Exclude_shared_libs)
-	sharedExcludes := bazel.LabelList{Excludes: excludeSharedLibs.Includes}
-	sharedExcludesLabelList := bazel.LabelListAttribute{}
-	sharedExcludesLabelList.SetSelectValue(bazel.InApexAxis, bazel.InApex, sharedExcludes)
-
-	la.dynamicDeps.Append(sharedExcludesLabelList)
-	la.implementationDynamicDeps.Append(sharedExcludesLabelList)
-
-	excludeStaticLibs := bazelLabelForStaticDeps(ctx, props.Target.Apex.Exclude_static_libs)
-	staticExcludes := bazel.LabelList{Excludes: excludeStaticLibs.Includes}
-	staticExcludesLabelList := bazel.LabelListAttribute{}
-	staticExcludesLabelList.SetSelectValue(bazel.InApexAxis, bazel.InApex, staticExcludes)
-
-	la.deps.Append(staticExcludesLabelList)
-	la.implementationDeps.Append(staticExcludesLabelList)
-}
-
-func (la *linkerAttributes) bp2buildForAxisAndConfig(ctx android.Bp2buildMutatorContext, module *Module, axis bazel.ConfigurationAxis, config string, props *BaseLinkerProperties) {
-	isBinary := module.Binary()
-	// Use a single variable to capture usage of nocrt in arch variants, so there's only 1 error message for this module
-	var axisFeatures []string
-
-	wholeStaticLibs := android.FirstUniqueStrings(props.Whole_static_libs)
-	staticLibs := android.FirstUniqueStrings(android.RemoveListFromList(props.Static_libs, wholeStaticLibs))
-	if axis == bazel.NoConfigAxis {
-		la.useVersionLib.SetSelectValue(axis, config, props.Use_version_lib)
-		if proptools.Bool(props.Use_version_lib) {
-			versionLibAlreadyInDeps := android.InList(versionLib, wholeStaticLibs)
-			// remove from static libs so there is no duplicate dependency
-			_, staticLibs = android.RemoveFromList(versionLib, staticLibs)
-			// only add the dep if it is not in progress
-			if !versionLibAlreadyInDeps {
-				wholeStaticLibs = append(wholeStaticLibs, versionLib)
-			}
-		}
-	}
-
-	// Excludes to parallel Soong:
-	// https://cs.android.com/android/platform/superproject/+/master:build/soong/cc/linker.go;l=247-249;drc=088b53577dde6e40085ffd737a1ae96ad82fc4b0
-	la.wholeArchiveDeps.SetSelectValue(axis, config, bazelLabelForWholeDepsExcludes(ctx, wholeStaticLibs, props.Exclude_static_libs))
-
-	if isBinary && module.StaticExecutable() {
-		usedSystemStatic := android.FilterListPred(staticLibs, func(s string) bool {
-			return android.InList(s, soongSystemSharedLibs) && !android.InList(s, props.Exclude_static_libs)
-		})
-
-		for _, el := range usedSystemStatic {
-			if la.usedSystemDynamicDepAsStaticDep == nil {
-				la.usedSystemDynamicDepAsStaticDep = map[string]bool{}
-			}
-			la.usedSystemDynamicDepAsStaticDep[el] = true
-		}
-	}
-	staticDeps := maybePartitionExportedAndImplementationsDepsExcludes(
-		ctx,
-		!isBinary,
-		staticLibs,
-		props.Exclude_static_libs,
-		props.Export_static_lib_headers,
-		bazelLabelForStaticDepsExcludes,
-	)
-
-	headerLibs := android.FirstUniqueStrings(props.Header_libs)
-	hDeps := maybePartitionExportedAndImplementationsDeps(ctx, !isBinary, headerLibs, props.Export_header_lib_headers, bazelLabelForHeaderDeps)
-
-	(&hDeps.export).Append(staticDeps.export)
-	la.deps.SetSelectValue(axis, config, hDeps.export)
-
-	(&hDeps.implementation).Append(staticDeps.implementation)
-	la.implementationDeps.SetSelectValue(axis, config, hDeps.implementation)
-
-	systemSharedLibs := props.System_shared_libs
-	// systemSharedLibs distinguishes between nil/empty list behavior:
-	//    nil -> use default values
-	//    empty list -> no values specified
-	if len(systemSharedLibs) > 0 {
-		systemSharedLibs = android.FirstUniqueStrings(systemSharedLibs)
-	}
-	la.systemDynamicDeps.SetSelectValue(axis, config, bazelLabelForSharedDeps(ctx, systemSharedLibs))
-
-	sharedLibs := android.FirstUniqueStrings(props.Shared_libs)
-	excludeSharedLibs := props.Exclude_shared_libs
-	usedSystem := android.FilterListPred(sharedLibs, func(s string) bool {
-		return android.InList(s, soongSystemSharedLibs) && !android.InList(s, excludeSharedLibs)
-	})
-
-	for _, el := range usedSystem {
-		if la.usedSystemDynamicDepAsDynamicDep == nil {
-			la.usedSystemDynamicDepAsDynamicDep = map[string]bool{}
-		}
-		la.usedSystemDynamicDepAsDynamicDep[el] = true
-	}
-
-	sharedDeps := maybePartitionExportedAndImplementationsDepsExcludes(
-		ctx,
-		!isBinary,
-		sharedLibs,
-		props.Exclude_shared_libs,
-		props.Export_shared_lib_headers,
-		bazelLabelForSharedDepsExcludes,
-	)
-	la.dynamicDeps.SetSelectValue(axis, config, sharedDeps.export)
-	la.implementationDynamicDeps.SetSelectValue(axis, config, sharedDeps.implementation)
-	la.resolveTargetApexProp(ctx, props)
-
-	if axis == bazel.NoConfigAxis || (axis == bazel.OsConfigurationAxis && config == bazel.OsAndroid) {
-		// If a dependency in la.implementationDynamicDeps or la.dynamicDeps has stubs, its
-		// stub variant should be used when the dependency is linked in a APEX. The
-		// dependencies in NoConfigAxis and OsConfigurationAxis/OsAndroid are grouped by
-		// having stubs or not, so Bazel select() statement can be used to choose
-		// source/stub variants of them.
-		apexAvailable := module.ApexAvailable()
-		SetStubsForDynamicDeps(ctx, axis, config, apexAvailable, sharedDeps.export, &la.dynamicDeps, &la.deps, 0, false)
-		SetStubsForDynamicDeps(ctx, axis, config, apexAvailable, sharedDeps.implementation, &la.implementationDynamicDeps, &la.deps, 1, false)
-		if len(systemSharedLibs) > 0 {
-			SetStubsForDynamicDeps(ctx, axis, config, apexAvailable, bazelLabelForSharedDeps(ctx, systemSharedLibs), &la.systemDynamicDeps, &la.deps, 2, true)
-		}
-	}
-
-	if !BoolDefault(props.Pack_relocations, packRelocationsDefault) {
-		axisFeatures = append(axisFeatures, "disable_pack_relocations")
-	}
-
-	if Bool(props.Allow_undefined_symbols) {
-		axisFeatures = append(axisFeatures, "-no_undefined_symbols")
-	}
-
-	var linkerFlags []string
-	if len(props.Ldflags) > 0 {
-		linkerFlags = append(linkerFlags, proptools.NinjaEscapeList(props.Ldflags)...)
-		// binaries remove static flag if -shared is in the linker flags
-		if isBinary && android.InList("-shared", linkerFlags) {
-			axisFeatures = append(axisFeatures, "-static_flag")
-		}
-	}
-
-	if !props.libCrt() {
-		axisFeatures = append(axisFeatures, "-use_libcrt")
-	}
-	if !props.crt() {
-		axisFeatures = append(axisFeatures, "-link_crt")
-	}
-
-	// This must happen before the addition of flags for Version Script and
-	// Dynamic List, as these flags must be split on spaces and those must not
-	linkerFlags = parseCommandLineFlags(linkerFlags, filterOutClangUnknownCflags)
-
-	additionalLinkerInputs := bazel.LabelList{}
-	if props.Version_script != nil {
-		label := android.BazelLabelForModuleSrcSingle(ctx, *props.Version_script)
-		additionalLinkerInputs.Add(&label)
-		linkerFlags = append(linkerFlags, fmt.Sprintf("-Wl,--version-script,$(location %s)", label.Label))
-		axisFeatures = append(axisFeatures, "android_cfi_exports_map")
-	}
-
-	if props.Dynamic_list != nil {
-		label := android.BazelLabelForModuleSrcSingle(ctx, *props.Dynamic_list)
-		additionalLinkerInputs.Add(&label)
-		linkerFlags = append(linkerFlags, fmt.Sprintf("-Wl,--dynamic-list,$(location %s)", label.Label))
-	}
-
-	la.additionalLinkerInputs.SetSelectValue(axis, config, additionalLinkerInputs)
-	if axis == bazel.OsConfigurationAxis && (config == bazel.OsDarwin || config == bazel.OsLinux || config == bazel.OsWindows) {
-		linkerFlags = append(linkerFlags, props.Host_ldlibs...)
-	}
-	la.linkopts.SetSelectValue(axis, config, linkerFlags)
-
-	if axisFeatures != nil {
-		la.features.SetSelectValue(axis, config, axisFeatures)
-	}
-
-	runtimeDeps := android.BazelLabelForModuleDepsExcludes(ctx, props.Runtime_libs, props.Exclude_runtime_libs)
-	if !runtimeDeps.IsEmpty() {
-		la.runtimeDeps.SetSelectValue(axis, config, runtimeDeps)
-	}
-}
-
-var (
-	apiSurfaceModuleLibCurrentPackage = "@api_surfaces//" + android.ModuleLibApi.String() + "/current:"
-)
-
-func availableToSameApexes(a, b []string) bool {
-	if len(a) == 0 && len(b) == 0 {
-		return true
-	}
-	differ, _, _ := android.ListSetDifference(a, b)
-	return !differ
-}
-
-var (
-	apiDomainConfigSettingKey  = android.NewOnceKey("apiDomainConfigSettingKey")
-	apiDomainConfigSettingLock sync.Mutex
-)
-
-func getApiDomainConfigSettingMap(config android.Config) *map[string]bool {
-	return config.Once(apiDomainConfigSettingKey, func() interface{} {
-		return &map[string]bool{}
-	}).(*map[string]bool)
-}
-
-var (
-	testApexNameToApiDomain = map[string]string{
-		"test_broken_com.android.art": "com.android.art",
-	}
-)
-
-// GetApiDomain returns the canonical name of the apex. This is synonymous to the apex_name definition.
-// https://cs.android.com/android/_/android/platform/build/soong/+/e3f0281b8897da1fe23b2f4f3a05f1dc87bcc902:apex/prebuilt.go;l=81-83;drc=2dc7244af985a6ad701b22f1271e606cabba527f;bpv=1;bpt=0
-// For test apexes, it uses a naming convention heuristic to determine the api domain.
-// TODO (b/281548611): Move this build/soong/android
-func GetApiDomain(apexName string) string {
-	if apiDomain, exists := testApexNameToApiDomain[apexName]; exists {
-		return apiDomain
-	}
-	// Remove `test_` prefix
-	return strings.TrimPrefix(apexName, "test_")
-}
-
-// Create a config setting for this apex in build/bazel/rules/apex
-// The use case for this is stub/impl selection in cc libraries
-// Long term, these config_setting(s) should be colocated with the respective apex definitions.
-// Note that this is an anti-pattern: The config_setting should be created from the apex definition
-// and not from a cc_library.
-// This anti-pattern is needed today since not all apexes have been allowlisted.
-func createInApexConfigSetting(ctx android.Bp2buildMutatorContext, apexName string) {
-	if apexName == android.AvailableToPlatform || apexName == android.AvailableToAnyApex {
-		// These correspond to android-non_apex and android-in_apex
-		return
-	}
-	apiDomainConfigSettingLock.Lock()
-	defer apiDomainConfigSettingLock.Unlock()
-
-	// Return if a config_setting has already been created
-	apiDomain := GetApiDomain(apexName)
-	acsm := getApiDomainConfigSettingMap(ctx.Config())
-	if _, exists := (*acsm)[apiDomain]; exists {
-		return
-	}
-	(*acsm)[apiDomain] = true
-
-	csa := bazel.ConfigSettingAttributes{
-		Flag_values: bazel.StringMapAttribute{
-			"//build/bazel/rules/apex:api_domain": apiDomain,
-		},
-		// Constraint this to android
-		Constraint_values: bazel.MakeLabelListAttribute(
-			bazel.MakeLabelList(
-				[]bazel.Label{
-					bazel.Label{Label: "//build/bazel_common_rules/platforms/os:android"},
-				},
-			),
-		),
-	}
-	ca := android.CommonAttributes{
-		Name: apiDomain,
-	}
-	ctx.CreateBazelConfigSetting(
-		csa,
-		ca,
-		"build/bazel/rules/apex",
-	)
-}
-
-func inApexConfigSetting(apexAvailable string) string {
-	if apexAvailable == android.AvailableToPlatform {
-		return bazel.AndroidPlatform
-	}
-	if apexAvailable == android.AvailableToAnyApex {
-		return bazel.AndroidAndInApex
-	}
-	apiDomain := GetApiDomain(apexAvailable)
-	return "//build/bazel/rules/apex:" + apiDomain
-}
-
-// Inputs to stub vs impl selection.
-type stubSelectionInfo struct {
-	// Label of the implementation library (e.g. //bionic/libc:libc)
-	impl bazel.Label
-	// Axis containing the implementation library
-	axis bazel.ConfigurationAxis
-	// Axis key containing the implementation library
-	config string
-	// API domain of the apex
-	// For test apexes (test_com.android.foo), this will be the source apex (com.android.foo)
-	apiDomain string
-	// List of dep labels
-	dynamicDeps *bazel.LabelListAttribute
-	// Boolean value for determining if the dep is in the same api domain
-	// If false, the label will be rewritten to to the stub label
-	sameApiDomain bool
-}
-
-func useStubOrImplInApexWithName(ssi stubSelectionInfo) {
-	lib := ssi.impl
-	if !ssi.sameApiDomain {
-		lib = bazel.Label{
-			Label: apiSurfaceModuleLibCurrentPackage + strings.TrimPrefix(lib.OriginalModuleName, ":"),
-		}
-	}
-	// Create a select statement specific to this apex
-	inApexSelectValue := ssi.dynamicDeps.SelectValue(bazel.OsAndInApexAxis, inApexConfigSetting(ssi.apiDomain))
-	(&inApexSelectValue).Append(bazel.MakeLabelList([]bazel.Label{lib}))
-	ssi.dynamicDeps.SetSelectValue(bazel.OsAndInApexAxis, inApexConfigSetting(ssi.apiDomain), bazel.FirstUniqueBazelLabelList(inApexSelectValue))
-	// Delete the library from the common config for this apex
-	implDynamicDeps := ssi.dynamicDeps.SelectValue(ssi.axis, ssi.config)
-	implDynamicDeps = bazel.SubtractBazelLabelList(implDynamicDeps, bazel.MakeLabelList([]bazel.Label{ssi.impl}))
-	ssi.dynamicDeps.SetSelectValue(ssi.axis, ssi.config, implDynamicDeps)
-	if ssi.axis == bazel.NoConfigAxis {
-		// Set defaults. Defaults (i.e. host) should use impl and not stubs.
-		defaultSelectValue := ssi.dynamicDeps.SelectValue(bazel.OsAndInApexAxis, bazel.ConditionsDefaultConfigKey)
-		(&defaultSelectValue).Append(bazel.MakeLabelList([]bazel.Label{ssi.impl}))
-		ssi.dynamicDeps.SetSelectValue(bazel.OsAndInApexAxis, bazel.ConditionsDefaultConfigKey, bazel.FirstUniqueBazelLabelList(defaultSelectValue))
-	}
-}
-
-// hasNdkStubs returns true for libfoo if there exists a libfoo.ndk of type ndk_library
-func hasNdkStubs(ctx android.BazelConversionPathContext, c *Module) bool {
-	mod, exists := ctx.ModuleFromName(c.Name() + ndkLibrarySuffix)
-	return exists && ctx.OtherModuleType(mod) == "ndk_library"
-}
-
-func SetStubsForDynamicDeps(ctx android.Bp2buildMutatorContext, axis bazel.ConfigurationAxis,
-	config string, apexAvailable []string, dynamicLibs bazel.LabelList, dynamicDeps *bazel.LabelListAttribute, deps *bazel.LabelListAttribute, ind int, buildNonApexWithStubs bool) {
-
-	// Create a config_setting for each apex_available.
-	// This will be used to select impl of a dep if dep is available to the same apex.
-	for _, aa := range apexAvailable {
-		createInApexConfigSetting(ctx, aa)
-	}
-
-	apiDomainForSelects := []string{}
-	for _, apex := range apexAvailable {
-		apiDomainForSelects = append(apiDomainForSelects, GetApiDomain(apex))
-	}
-	// Always emit a select statement for the platform variant.
-	// This ensures that b build //foo --config=android works
-	// Soong always creates a platform variant even when the library might not be available to platform.
-	if !android.InList(android.AvailableToPlatform, apiDomainForSelects) {
-		apiDomainForSelects = append(apiDomainForSelects, android.AvailableToPlatform)
-	}
-	apiDomainForSelects = android.SortedUniqueStrings(apiDomainForSelects)
-
-	// Create a select for each apex this library could be included in.
-	for _, l := range dynamicLibs.Includes {
-		dep, _ := ctx.ModuleFromName(l.OriginalModuleName)
-		if c, ok := dep.(*Module); !ok || !c.HasStubsVariants() {
-			continue
-		}
-		// TODO (b/280339069): Decrease the verbosity of the generated BUILD files
-		for _, apiDomain := range apiDomainForSelects {
-			var sameApiDomain bool
-			if apiDomain == android.AvailableToPlatform {
-				// Platform variants in Soong use equality of apex_available for stub/impl selection.
-				// https://cs.android.com/android/_/android/platform/build/soong/+/316b0158fe57ee7764235923e7c6f3d530da39c6:cc/cc.go;l=3393-3404;drc=176271a426496fa2688efe2b40d5c74340c63375;bpv=1;bpt=0
-				// One of the factors behind this design choice is cc_test
-				// Tests only have a platform variant, and using equality of apex_available ensures
-				// that tests of an apex library gets its implementation and not stubs.
-				// TODO (b/280343104): Discuss if we can drop this special handling for platform variants.
-				sameApiDomain = availableToSameApexes(apexAvailable, dep.(*Module).ApexAvailable())
-				if linkable, ok := ctx.Module().(LinkableInterface); ok && linkable.Bootstrap() {
-					sameApiDomain = true
-				}
-				// If dependency has `apex_available: ["//apex_available:platform]`, then the platform variant of rdep should link against its impl.
-				// https://cs.android.com/android/_/android/platform/build/soong/+/main:cc/cc.go;l=3617;bpv=1;bpt=0;drc=c6a93d853b37ec90786e745b8d282145e6d3b589
-				if depApexAvailable := dep.(*Module).ApexAvailable(); len(depApexAvailable) == 1 && depApexAvailable[0] == android.AvailableToPlatform {
-					sameApiDomain = true
-				}
-			} else {
-				sameApiDomain = android.InList(apiDomain, dep.(*Module).ApexAvailable())
-			}
-			ssi := stubSelectionInfo{
-				impl:          l,
-				axis:          axis,
-				config:        config,
-				apiDomain:     apiDomain,
-				dynamicDeps:   dynamicDeps,
-				sameApiDomain: sameApiDomain,
-			}
-			useStubOrImplInApexWithName(ssi)
-		}
-	}
-
-	// If the library has an sdk variant, create additional selects to build this variant against the ndk
-	// The config setting for this variant will be //build/bazel/rules/apex:unbundled_app
-	if c, ok := ctx.Module().(*Module); ok && c.Properties.Sdk_version != nil {
-		for _, l := range dynamicLibs.Includes {
-			dep, _ := ctx.ModuleFromName(l.OriginalModuleName)
-			label := l // use the implementation by default
-			if depC, ok := dep.(*Module); ok && hasNdkStubs(ctx, depC) {
-				// If the dependency has ndk stubs, build against the ndk stubs
-				// https://cs.android.com/android/_/android/platform/build/soong/+/main:cc/cc.go;l=2642-2643;drc=e12d252e22dd8afa654325790d3298a0d67bd9d6;bpv=1;bpt=0
-				ver := proptools.String(c.Properties.Sdk_version)
-				// TODO - b/298085502: Add bp2build support for sdk_version: "minimum"
-				ndkLibModule, _ := ctx.ModuleFromName(dep.Name() + ndkLibrarySuffix)
-				label = bazel.Label{
-					Label: "//" + ctx.OtherModuleDir(ndkLibModule) + ":" + ndkLibModule.Name() + "_stub_libs-" + ver,
-				}
-			}
-			// add the ndk lib label to this axis
-			existingValue := dynamicDeps.SelectValue(bazel.OsAndInApexAxis, "unbundled_app")
-			existingValue.Append(bazel.MakeLabelList([]bazel.Label{label}))
-			dynamicDeps.SetSelectValue(bazel.OsAndInApexAxis, "unbundled_app", bazel.FirstUniqueBazelLabelList(existingValue))
-		}
-
-		// Add ndk_sysroot to deps.
-		// ndk_sysroot has a dependency edge on all ndk_headers, and will provide the .h files of _every_ ndk library
-		existingValue := deps.SelectValue(bazel.OsAndInApexAxis, "unbundled_app")
-		existingValue.Append(bazel.MakeLabelList([]bazel.Label{ndkSysrootLabel}))
-		deps.SetSelectValue(bazel.OsAndInApexAxis, "unbundled_app", bazel.FirstUniqueBazelLabelList(existingValue))
-	}
-}
-
-var (
-	ndkSysrootLabel = bazel.Label{
-		Label: "//build/bazel/rules/cc:ndk_sysroot",
-	}
-)
-
-func (la *linkerAttributes) convertStripProps(ctx android.BazelConversionPathContext, module *Module) {
-	bp2BuildPropParseHelper(ctx, module, &StripProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		if stripProperties, ok := props.(*StripProperties); ok {
-			la.stripKeepSymbols.SetSelectValue(axis, config, stripProperties.Strip.Keep_symbols)
-			la.stripKeepSymbolsList.SetSelectValue(axis, config, stripProperties.Strip.Keep_symbols_list)
-			la.stripKeepSymbolsAndDebugFrame.SetSelectValue(axis, config, stripProperties.Strip.Keep_symbols_and_debug_frame)
-			la.stripAll.SetSelectValue(axis, config, stripProperties.Strip.All)
-			la.stripNone.SetSelectValue(axis, config, stripProperties.Strip.None)
-		}
-	})
-}
-
-func (la *linkerAttributes) convertProductVariables(ctx android.Bp2buildMutatorContext, productVariableProps android.ProductConfigProperties) {
-
-	type productVarDep struct {
-		// the name of the corresponding excludes field, if one exists
-		excludesField string
-		// reference to the bazel attribute that should be set for the given product variable config
-		attribute *bazel.LabelListAttribute
-
-		depResolutionFunc func(ctx android.Bp2buildMutatorContext, modules, excludes []string) bazel.LabelList
-	}
-
-	// an intermediate attribute that holds Header_libs info, and will be appended to
-	// implementationDeps at the end, to solve the confliction that both header_libs
-	// and static_libs use implementationDeps.
-	var headerDeps bazel.LabelListAttribute
-
-	productVarToDepFields := map[string]productVarDep{
-		// product variables do not support exclude_shared_libs
-		"Shared_libs":       {attribute: &la.implementationDynamicDeps, depResolutionFunc: bazelLabelForSharedDepsExcludes},
-		"Static_libs":       {"Exclude_static_libs", &la.implementationDeps, bazelLabelForStaticDepsExcludes},
-		"Whole_static_libs": {"Exclude_static_libs", &la.wholeArchiveDeps, bazelLabelForWholeDepsExcludes},
-		"Header_libs":       {attribute: &headerDeps, depResolutionFunc: bazelLabelForHeaderDepsExcludes},
-	}
-
-	for name, dep := range productVarToDepFields {
-		props, exists := productVariableProps[name]
-		excludeProps, excludesExists := productVariableProps[dep.excludesField]
-		// if neither an include nor excludes property exists, then skip it
-		if !exists && !excludesExists {
-			continue
-		}
-		// Collect all the configurations that an include or exclude property exists for.
-		// We want to iterate all configurations rather than either the include or exclude because, for a
-		// particular configuration, we may have either only an include or an exclude to handle.
-		productConfigProps := make(map[android.ProductConfigOrSoongConfigProperty]bool, len(props)+len(excludeProps))
-		for p := range props {
-			productConfigProps[p] = true
-		}
-		for p := range excludeProps {
-			productConfigProps[p] = true
-		}
-
-		for productConfigProp := range productConfigProps {
-			prop, includesExists := props[productConfigProp]
-			excludesProp, excludesExists := excludeProps[productConfigProp]
-			var includes, excludes []string
-			var ok bool
-			// if there was no includes/excludes property, casting fails and that's expected
-			if includes, ok = prop.([]string); includesExists && !ok {
-				ctx.ModuleErrorf("Could not convert product variable %s property", name)
-			}
-			if excludes, ok = excludesProp.([]string); excludesExists && !ok {
-				ctx.ModuleErrorf("Could not convert product variable %s property", dep.excludesField)
-			}
-
-			dep.attribute.EmitEmptyList = productConfigProp.AlwaysEmit()
-			dep.attribute.SetSelectValue(
-				productConfigProp.ConfigurationAxis(),
-				productConfigProp.SelectKey(),
-				dep.depResolutionFunc(ctx, android.FirstUniqueStrings(includes), excludes),
-			)
-		}
-	}
-	la.implementationDeps.Append(headerDeps)
-}
-
-func (la *linkerAttributes) finalize(ctx android.Bp2buildMutatorContext) {
-	// if system dynamic deps have the default value, any use of a system dynamic library used will
-	// result in duplicate library errors for bionic OSes. Here, we explicitly exclude those libraries
-	// from bionic OSes and the no config case as these libraries only build for bionic OSes.
-	if la.systemDynamicDeps.IsNil() && len(la.usedSystemDynamicDepAsDynamicDep) > 0 {
-		toRemove := bazelLabelForSharedDeps(ctx, android.SortedKeys(la.usedSystemDynamicDepAsDynamicDep))
-		la.dynamicDeps.Exclude(bazel.NoConfigAxis, "", toRemove)
-		la.dynamicDeps.Exclude(bazel.OsConfigurationAxis, "android", toRemove)
-		la.dynamicDeps.Exclude(bazel.OsConfigurationAxis, "linux_bionic", toRemove)
-		la.implementationDynamicDeps.Exclude(bazel.NoConfigAxis, "", toRemove)
-		la.implementationDynamicDeps.Exclude(bazel.OsConfigurationAxis, "android", toRemove)
-		la.implementationDynamicDeps.Exclude(bazel.OsConfigurationAxis, "linux_bionic", toRemove)
-
-		la.implementationDynamicDeps.Exclude(bazel.OsAndInApexAxis, bazel.ConditionsDefaultConfigKey, toRemove)
-		stubsToRemove := make([]bazel.Label, 0, len(la.usedSystemDynamicDepAsDynamicDep))
-		for _, lib := range toRemove.Includes {
-			stubLabelInApiSurfaces := bazel.Label{
-				Label: apiSurfaceModuleLibCurrentPackage + lib.OriginalModuleName,
-			}
-			stubsToRemove = append(stubsToRemove, stubLabelInApiSurfaces)
-		}
-		// system libraries (e.g. libc, libm, libdl) belong the com.android.runtime api domain
-		// dedupe the stubs of these libraries from the other api domains (platform, other_apexes...)
-		for _, aa := range ctx.Module().(*Module).ApexAvailable() {
-			la.implementationDynamicDeps.Exclude(bazel.OsAndInApexAxis, inApexConfigSetting(aa), bazel.MakeLabelList(stubsToRemove))
-		}
-		la.implementationDynamicDeps.Exclude(bazel.OsAndInApexAxis, bazel.AndroidPlatform, bazel.MakeLabelList(stubsToRemove))
-	}
-	if la.systemDynamicDeps.IsNil() && len(la.usedSystemDynamicDepAsStaticDep) > 0 {
-		toRemove := bazelLabelForStaticDeps(ctx, android.SortedKeys(la.usedSystemDynamicDepAsStaticDep))
-		la.deps.Exclude(bazel.NoConfigAxis, "", toRemove)
-		la.deps.Exclude(bazel.OsConfigurationAxis, "android", toRemove)
-		la.deps.Exclude(bazel.OsConfigurationAxis, "linux_bionic", toRemove)
-		la.implementationDeps.Exclude(bazel.NoConfigAxis, "", toRemove)
-		la.implementationDeps.Exclude(bazel.OsConfigurationAxis, "android", toRemove)
-		la.implementationDeps.Exclude(bazel.OsConfigurationAxis, "linux_bionic", toRemove)
-	}
-
-	la.deps.ResolveExcludes()
-	la.implementationDeps.ResolveExcludes()
-	la.dynamicDeps.ResolveExcludes()
-	la.implementationDynamicDeps.ResolveExcludes()
-	la.wholeArchiveDeps.ResolveExcludes()
-	la.systemDynamicDeps.ForceSpecifyEmptyList = true
-
-}
-
-// Relativize a list of root-relative paths with respect to the module's
-// directory.
-//
-// include_dirs Soong prop are root-relative (b/183742505), but
-// local_include_dirs, export_include_dirs and export_system_include_dirs are
-// module dir relative. This function makes a list of paths entirely module dir
-// relative.
-//
-// For the `include` attribute, Bazel wants the paths to be relative to the
-// module.
-func bp2BuildMakePathsRelativeToModule(ctx android.BazelConversionPathContext, paths []string) []string {
-	var relativePaths []string
-	for _, path := range paths {
-		// Semantics of filepath.Rel: join(ModuleDir, rel(ModuleDir, path)) == path
-		relativePath, err := filepath.Rel(ctx.ModuleDir(), path)
-		if err != nil {
-			panic(err)
-		}
-		relativePaths = append(relativePaths, relativePath)
-	}
-	return relativePaths
-}
-
-// BazelIncludes contains information about -I and -isystem paths from a module converted to Bazel
-// attributes.
-type BazelIncludes struct {
-	AbsoluteIncludes bazel.StringListAttribute
-	Includes         bazel.StringListAttribute
-	SystemIncludes   bazel.StringListAttribute
-}
-
-func bp2BuildParseExportedIncludes(ctx android.BazelConversionPathContext, module *Module, includes *BazelIncludes) BazelIncludes {
-	var exported BazelIncludes
-	if includes != nil {
-		exported = *includes
-	} else {
-		exported = BazelIncludes{}
-	}
-
-	// cc library Export_include_dirs and Export_system_include_dirs are marked
-	// "variant_prepend" in struct tag, set their prepend property to true to make
-	// sure bp2build generates correct result.
-	exported.Includes.Prepend = true
-	exported.SystemIncludes.Prepend = true
-
-	bp2BuildPropParseHelper(ctx, module, &FlagExporterProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		if flagExporterProperties, ok := props.(*FlagExporterProperties); ok {
-			if len(flagExporterProperties.Export_include_dirs) > 0 {
-				exported.Includes.SetSelectValue(axis, config, android.FirstUniqueStrings(append(exported.Includes.SelectValue(axis, config), flagExporterProperties.Export_include_dirs...)))
-			}
-			if len(flagExporterProperties.Export_system_include_dirs) > 0 {
-				exported.SystemIncludes.SetSelectValue(axis, config, android.FirstUniqueStrings(append(exported.SystemIncludes.SelectValue(axis, config), flagExporterProperties.Export_system_include_dirs...)))
-			}
-		}
-	})
-	exported.AbsoluteIncludes.DeduplicateAxesFromBase()
-	exported.Includes.DeduplicateAxesFromBase()
-	exported.SystemIncludes.DeduplicateAxesFromBase()
-
-	return exported
-}
-
-func BazelLabelNameForStaticModule(baseLabel string) string {
-	return baseLabel + "_bp2build_cc_library_static"
-}
-
-func bazelLabelForStaticModule(ctx android.BazelConversionPathContext, m blueprint.Module) string {
-	label := android.BazelModuleLabel(ctx, m)
-	if ccModule, ok := m.(*Module); ok && ccModule.typ() == fullLibrary {
-		return BazelLabelNameForStaticModule(label)
-	}
-	return label
-}
-
-func bazelLabelForSharedModule(ctx android.BazelConversionPathContext, m blueprint.Module) string {
-	// cc_library, at it's root name, propagates the shared library, which depends on the static
-	// library.
-	return android.BazelModuleLabel(ctx, m)
-}
-
-func bazelLabelForStaticWholeModuleDeps(ctx android.BazelConversionPathContext, m blueprint.Module) string {
-	label := bazelLabelForStaticModule(ctx, m)
-	if aModule, ok := m.(android.Module); ok {
-		if android.IsModulePrebuilt(aModule) {
-			label += "_alwayslink"
-		}
-	}
-	return label
-}
-
-func xsdConfigCppTarget(xsd android.XsdConfigBp2buildTargets) string {
-	return xsd.CppBp2buildTargetName()
-}
-
-func bazelLabelForWholeDeps(ctx android.Bp2buildMutatorContext, modules []string) bazel.LabelList {
-	return android.BazelLabelForModuleDepsWithFn(ctx, modules, bazelLabelForStaticWholeModuleDeps, true)
-}
-
-func bazelLabelForWholeDepsExcludes(ctx android.Bp2buildMutatorContext, modules, excludes []string) bazel.LabelList {
-	return android.BazelLabelForModuleDepsExcludesWithFn(ctx, modules, excludes, bazelLabelForStaticWholeModuleDeps)
-}
-
-func bazelLabelForStaticDepsExcludes(ctx android.Bp2buildMutatorContext, modules, excludes []string) bazel.LabelList {
-	return android.BazelLabelForModuleDepsExcludesWithFn(ctx, modules, excludes, bazelLabelForStaticModule)
-}
-
-func bazelLabelForStaticDeps(ctx android.Bp2buildMutatorContext, modules []string) bazel.LabelList {
-	return android.BazelLabelForModuleDepsWithFn(ctx, modules, bazelLabelForStaticModule, true)
-}
-
-func bazelLabelForSharedDeps(ctx android.Bp2buildMutatorContext, modules []string) bazel.LabelList {
-	return android.BazelLabelForModuleDepsWithFn(ctx, modules, bazelLabelForSharedModule, true)
-}
-
-func bazelLabelForHeaderDeps(ctx android.Bp2buildMutatorContext, modules []string) bazel.LabelList {
-	// This is not elegant, but bp2build's shared library targets only propagate
-	// their header information as part of the normal C++ provider.
-	return bazelLabelForSharedDeps(ctx, modules)
-}
-
-func bazelLabelForHeaderDepsExcludes(ctx android.Bp2buildMutatorContext, modules, excludes []string) bazel.LabelList {
-	// This is only used when product_variable header_libs is processed, to follow
-	// the pattern of depResolutionFunc
-	return android.BazelLabelForModuleDepsExcludesWithFn(ctx, modules, excludes, bazelLabelForSharedModule)
-}
-
-func bazelLabelForSharedDepsExcludes(ctx android.Bp2buildMutatorContext, modules, excludes []string) bazel.LabelList {
-	return android.BazelLabelForModuleDepsExcludesWithFn(ctx, modules, excludes, bazelLabelForSharedModule)
-}
-
-type binaryLinkerAttrs struct {
-	Linkshared *bool
-	Stem       bazel.StringAttribute
-	Suffix     bazel.StringAttribute
-}
-
-func bp2buildBinaryLinkerProps(ctx android.BazelConversionPathContext, m *Module) binaryLinkerAttrs {
-	attrs := binaryLinkerAttrs{}
-	bp2BuildPropParseHelper(ctx, m, &BinaryLinkerProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		linkerProps := props.(*BinaryLinkerProperties)
-		staticExecutable := linkerProps.Static_executable
-		if axis == bazel.NoConfigAxis {
-			if linkBinaryShared := !proptools.Bool(staticExecutable); !linkBinaryShared {
-				attrs.Linkshared = &linkBinaryShared
-			}
-		} else if staticExecutable != nil {
-			// TODO(b/202876379): Static_executable is arch-variant; however, linkshared is a
-			// nonconfigurable attribute. Only 4 AOSP modules use this feature, defer handling
-			ctx.ModuleErrorf("bp2build cannot migrate a module with arch/target-specific static_executable values")
-		}
-		if stem := linkerProps.Stem; stem != nil {
-			attrs.Stem.SetSelectValue(axis, config, stem)
-		}
-		if suffix := linkerProps.Suffix; suffix != nil {
-			attrs.Suffix.SetSelectValue(axis, config, suffix)
-		}
-	})
-
-	return attrs
-}
-
-type sanitizerValues struct {
-	features                 bazel.StringListAttribute
-	copts                    bazel.StringListAttribute
-	additionalCompilerInputs bazel.LabelListAttribute
-}
-
-func bp2buildSanitizerFeatures(ctx android.BazelConversionPathContext, m *Module) sanitizerValues {
-	sanitizerFeatures := bazel.StringListAttribute{}
-	sanitizerCopts := bazel.StringListAttribute{}
-	sanitizerCompilerInputs := bazel.LabelListAttribute{}
-	memtagFeatures := bazel.StringListAttribute{}
-	memtagFeature := ""
-	bp2BuildPropParseHelper(ctx, m, &SanitizeProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		var features []string
-		if sanitizerProps, ok := props.(*SanitizeProperties); ok {
-			if sanitizerProps.Sanitize.Integer_overflow != nil && *sanitizerProps.Sanitize.Integer_overflow {
-				features = append(features, "ubsan_integer_overflow")
-			}
-			for _, sanitizer := range sanitizerProps.Sanitize.Misc_undefined {
-				features = append(features, "ubsan_"+sanitizer)
-			}
-			blocklist := sanitizerProps.Sanitize.Blocklist
-			if blocklist != nil {
-				// TODO: b/294868620 - Change this not to use the special axis when completing the bug
-				coptValue := fmt.Sprintf("-fsanitize-ignorelist=$(location %s)", *blocklist)
-				sanitizerCopts.SetSelectValue(bazel.SanitizersEnabledAxis, bazel.SanitizersEnabled, []string{coptValue})
-				sanitizerCompilerInputs.SetSelectValue(bazel.SanitizersEnabledAxis, bazel.SanitizersEnabled, bazel.MakeLabelListFromTargetNames([]string{*blocklist}))
-			}
-			if sanitizerProps.Sanitize.Cfi != nil && !proptools.Bool(sanitizerProps.Sanitize.Cfi) {
-				features = append(features, "-android_cfi")
-			} else if proptools.Bool(sanitizerProps.Sanitize.Cfi) {
-				features = append(features, "android_cfi")
-				if proptools.Bool(sanitizerProps.Sanitize.Config.Cfi_assembly_support) {
-					features = append(features, "android_cfi_assembly_support")
-				}
-			}
-
-			if sanitizerProps.Sanitize.Memtag_heap != nil {
-				if (axis == bazel.NoConfigAxis && memtagFeature == "") ||
-					(axis == bazel.OsArchConfigurationAxis && config == bazel.OsArchAndroidArm64) {
-					memtagFeature = setMemtagValue(sanitizerProps, &memtagFeatures)
-				}
-			}
-			sanitizerFeatures.SetSelectValue(axis, config, features)
-		}
-	})
-	sanitizerFeatures.Append(memtagFeatures)
-
-	return sanitizerValues{
-		features:                 sanitizerFeatures,
-		copts:                    sanitizerCopts,
-		additionalCompilerInputs: sanitizerCompilerInputs,
-	}
-}
-
-func setMemtagValue(sanitizerProps *SanitizeProperties, memtagFeatures *bazel.StringListAttribute) string {
-	var features []string
-	if proptools.Bool(sanitizerProps.Sanitize.Memtag_heap) {
-		features = append(features, "memtag_heap")
-	} else {
-		features = append(features, "-memtag_heap")
-	}
-	// Logic comes from: https://cs.android.com/android/platform/superproject/main/+/32ea1afbd1148b0b78553f24fa61116c999eb968:build/soong/cc/sanitize.go;l=910
-	if sanitizerProps.Sanitize.Diag.Memtag_heap != nil {
-		if proptools.Bool(sanitizerProps.Sanitize.Diag.Memtag_heap) {
-			features = append(features, "diag_memtag_heap")
-		} else {
-			features = append(features, "-diag_memtag_heap")
-		}
-	}
-	memtagFeatures.SetSelectValue(bazel.OsArchConfigurationAxis, bazel.OsArchAndroidArm64, features)
-
-	return features[0]
-}
-
-func bp2buildLtoFeatures(ctx android.BazelConversionPathContext, m *Module) bazel.StringListAttribute {
-	lto_feature_name := "android_thin_lto"
-	ltoBoolFeatures := bazel.BoolAttribute{}
-	bp2BuildPropParseHelper(ctx, m, &LTOProperties{}, func(axis bazel.ConfigurationAxis, config string, props interface{}) {
-		if ltoProps, ok := props.(*LTOProperties); ok {
-			thinProp := ltoProps.Lto.Thin != nil && *ltoProps.Lto.Thin
-			thinPropSetToFalse := ltoProps.Lto.Thin != nil && !*ltoProps.Lto.Thin
-			neverProp := ltoProps.Lto.Never != nil && *ltoProps.Lto.Never
-			if thinProp {
-				ltoBoolFeatures.SetSelectValue(axis, config, BoolPtr(true))
-				return
-			}
-			if neverProp || thinPropSetToFalse {
-				if thinProp {
-					ctx.ModuleErrorf("lto.thin and lto.never are mutually exclusive but were specified together")
-				} else {
-					ltoBoolFeatures.SetSelectValue(axis, config, BoolPtr(false))
-				}
-				return
-			}
-		}
-		ltoBoolFeatures.SetSelectValue(axis, config, nil)
-	})
-
-	props := m.GetArchVariantProperties(ctx, &LTOProperties{})
-	ltoStringFeatures, err := ltoBoolFeatures.ToStringListAttribute(func(boolPtr *bool, axis bazel.ConfigurationAxis, config string) []string {
-		if boolPtr == nil {
-			return []string{}
-		}
-		if !*boolPtr {
-			return []string{"-" + lto_feature_name}
-		}
-		features := []string{lto_feature_name}
-		if ltoProps, ok := props[axis][config].(*LTOProperties); ok {
-			if ltoProps.Whole_program_vtables != nil && *ltoProps.Whole_program_vtables {
-				features = append(features, "android_thin_lto_whole_program_vtables")
-			}
-		}
-		return features
-	})
-	if err != nil {
-		ctx.ModuleErrorf("Error processing LTO attributes: %s", err)
-	}
-	return ltoStringFeatures
-}
-
-func convertHiddenVisibilityToFeatureBase(ctx android.BazelConversionPathContext, m *Module) bazel.StringListAttribute {
-	visibilityHiddenFeature := bazel.StringListAttribute{}
-	bp2BuildPropParseHelper(ctx, m, &BaseCompilerProperties{}, func(axis bazel.ConfigurationAxis, configString string, props interface{}) {
-		if baseCompilerProps, ok := props.(*BaseCompilerProperties); ok {
-			convertHiddenVisibilityToFeatureHelper(&visibilityHiddenFeature, axis, configString, baseCompilerProps.Cflags)
-		}
-	})
-	return visibilityHiddenFeature
-}
-
-func convertHiddenVisibilityToFeatureStaticOrShared(ctx android.BazelConversionPathContext, m *Module, isStatic bool) bazel.StringListAttribute {
-	visibilityHiddenFeature := bazel.StringListAttribute{}
-	if isStatic {
-		bp2BuildPropParseHelper(ctx, m, &StaticProperties{}, func(axis bazel.ConfigurationAxis, configString string, props interface{}) {
-			if staticProps, ok := props.(*StaticProperties); ok {
-				convertHiddenVisibilityToFeatureHelper(&visibilityHiddenFeature, axis, configString, staticProps.Static.Cflags)
-			}
-		})
-	} else {
-		bp2BuildPropParseHelper(ctx, m, &SharedProperties{}, func(axis bazel.ConfigurationAxis, configString string, props interface{}) {
-			if sharedProps, ok := props.(*SharedProperties); ok {
-				convertHiddenVisibilityToFeatureHelper(&visibilityHiddenFeature, axis, configString, sharedProps.Shared.Cflags)
-			}
-		})
-	}
-
-	return visibilityHiddenFeature
-}
-
-func convertHiddenVisibilityToFeatureHelper(feature *bazel.StringListAttribute, axis bazel.ConfigurationAxis, configString string, cflags []string) {
-	if inList(config.VisibilityHiddenFlag, cflags) {
-		feature.SetSelectValue(axis, configString, []string{"visibility_hidden"})
-	}
-}
diff --git a/cc/cc.go b/cc/cc.go
index f800dc0..12db797 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -25,15 +25,12 @@
 	"strings"
 
 	"android/soong/testing"
-	"android/soong/ui/metrics/bp2build_metrics_proto"
-
 	"github.com/google/blueprint"
 	"github.com/google/blueprint/proptools"
 
 	"android/soong/aconfig"
 	"android/soong/aidl_library"
 	"android/soong/android"
-	"android/soong/bazel/cquery"
 	"android/soong/cc/config"
 	"android/soong/fuzz"
 	"android/soong/genrule"
@@ -592,7 +589,6 @@
 	GeneratorFlags(ctx ModuleContext, flags Flags, deps PathDeps) Flags
 	GeneratorSources(ctx ModuleContext) GeneratedSource
 	GeneratorBuildActions(ctx ModuleContext, flags Flags, deps PathDeps)
-	GeneratorBp2build(ctx android.Bp2buildMutatorContext, module *Module) bool
 }
 
 // compiler is the interface for a compiler helper object. Different module decorators may implement
@@ -831,19 +827,6 @@
 	return ok && ccDepTag == testPerSrcDepTag
 }
 
-// bazelHandler is the interface for a helper object related to deferring to Bazel for
-// processing a cc module (during Bazel mixed builds). Individual module types should define
-// their own bazel handler if they support being handled by Bazel.
-type BazelHandler interface {
-	// QueueBazelCall invokes request-queueing functions on the BazelContext
-	//so that these requests are handled when Bazel's cquery is invoked.
-	QueueBazelCall(ctx android.BaseModuleContext, label string)
-
-	// ProcessBazelQueryResponse uses information retrieved from Bazel to set properties
-	// on the current module with given label.
-	ProcessBazelQueryResponse(ctx android.ModuleContext, label string)
-}
-
 // Module contains the properties and members used by all C/C++ module types, and implements
 // the blueprint.Module interface.  It delegates to compiler, linker, and installer interfaces
 // to construct the output file.  Behavior can be customized with a Customizer, or "decorator",
@@ -861,15 +844,12 @@
 type Module struct {
 	fuzz.FuzzModule
 
-	android.BazelModuleBase
-
 	VendorProperties VendorProperties
 	Properties       BaseProperties
 
 	// initialize before calling Init
 	hod        android.HostOrDeviceSupported
 	multilib   android.Multilib
-	bazelable  bool
 	testModule bool
 
 	// Allowable SdkMemberTypes of this module type.
@@ -880,11 +860,10 @@
 	// type-specific logic. These members may reference different objects or the same object.
 	// Functions of these decorators will be invoked to initialize and register type-specific
 	// build statements.
-	generators   []Generator
-	compiler     compiler
-	linker       linker
-	installer    installer
-	bazelHandler BazelHandler
+	generators []Generator
+	compiler   compiler
+	linker     linker
+	installer  installer
 
 	features  []feature
 	stl       *stl
@@ -1288,9 +1267,6 @@
 	}
 
 	android.InitAndroidArchModule(c, c.hod, c.multilib)
-	if c.bazelable {
-		android.InitBazelModule(c)
-	}
 	android.InitApexModule(c)
 	android.InitDefaultableModule(c)
 
@@ -1546,8 +1522,6 @@
 }
 
 func InstallToBootstrap(name string, config android.Config) bool {
-	// NOTE: also update //build/bazel/rules/apex/cc.bzl#_installed_to_bootstrap
-	// if this list is updated.
 	if name == "libclang_rt.hwasan" || name == "libc_hwasan" {
 		return true
 	}
@@ -1943,170 +1917,6 @@
 	return subName
 }
 
-var _ android.MixedBuildBuildable = (*Module)(nil)
-
-func (c *Module) getBazelModuleLabel(ctx android.BaseModuleContext) string {
-	var bazelModuleLabel string
-	if c.typ() == fullLibrary && c.static() {
-		// cc_library is a special case in bp2build; two targets are generated -- one for each
-		// of the shared and static variants. The shared variant keeps the module name, but the
-		// static variant uses a different suffixed name.
-		bazelModuleLabel = bazelLabelForStaticModule(ctx, c)
-	} else {
-		bazelModuleLabel = c.GetBazelLabel(ctx, c)
-	}
-	labelNoPrebuilt := bazelModuleLabel
-	if c.IsPrebuilt() {
-		labelNoPrebuilt = android.RemoveOptionalPrebuiltPrefixFromBazelLabel(bazelModuleLabel)
-	}
-	return labelNoPrebuilt
-}
-
-func (c *Module) QueueBazelCall(ctx android.BaseModuleContext) {
-	c.bazelHandler.QueueBazelCall(ctx, c.getBazelModuleLabel(ctx))
-}
-
-// IsMixedBuildSupported returns true if the module should be analyzed by Bazel
-// in any of the --bazel-mode(s).
-func (c *Module) IsMixedBuildSupported(ctx android.BaseModuleContext) bool {
-	if !allEnabledSanitizersSupportedByBazel(ctx, c) {
-		//TODO(b/278772861) support sanitizers in Bazel rules
-		return false
-	}
-	if !imageVariantSupportedByBazel(c) {
-		return false
-	}
-	if c.IsSdkVariant() {
-		return false
-	}
-	return c.bazelHandler != nil
-}
-
-func imageVariantSupportedByBazel(c *Module) bool {
-	if c.IsLlndk() {
-		return false
-	}
-	if c.InVendor() {
-		return false
-	}
-	if c.InProduct() {
-		return false
-	}
-	if c.InRamdisk() {
-		return false
-	}
-	if c.InVendorRamdisk() {
-		return false
-	}
-	if c.InRecovery() {
-		return false
-	}
-	return true
-}
-
-func allEnabledSanitizersSupportedByBazel(ctx android.BaseModuleContext, c *Module) bool {
-	if c.sanitize == nil {
-		return true
-	}
-	sanitizeProps := &c.sanitize.Properties.SanitizeMutated
-
-	unsupportedSanitizers := []*bool{
-		sanitizeProps.Safestack,
-		sanitizeProps.Scudo,
-		BoolPtr(len(c.sanitize.Properties.Sanitize.Recover) > 0),
-	}
-	for _, san := range unsupportedSanitizers {
-		if Bool(san) {
-			return false
-		}
-	}
-
-	for _, san := range Sanitizers {
-		if san == intOverflow {
-			// TODO(b/261058727): enable mixed builds for all modules with UBSan
-			// Currently we can only support ubsan when minimum runtime is used.
-			ubsanEnabled := Bool(sanitizeProps.Integer_overflow) || len(sanitizeProps.Misc_undefined) > 0
-			if !ubsanEnabled || c.MinimalRuntimeNeeded() {
-				continue
-			}
-		} else if san == cfi {
-			apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
-			// Only allow cfi if this is an apex variant
-			if !apexInfo.IsForPlatform() {
-				continue
-			}
-		}
-		if c.sanitize.isSanitizerEnabled(san) {
-			return false
-		}
-	}
-
-	return true
-}
-
-func GetApexConfigKey(ctx android.BaseModuleContext) *android.ApexConfigKey {
-	apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
-	if !apexInfo.IsForPlatform() {
-		apexKey := android.ApexConfigKey{
-			WithinApex:     true,
-			ApexSdkVersion: findApexSdkVersion(ctx, apexInfo).String(),
-			ApiDomain:      findApiDomain(apexInfo),
-		}
-		return &apexKey
-	}
-
-	return nil
-}
-
-// Returns the api domain of a module for an apexInfo group
-// Input:
-// ai.InApexModules: [com.android.foo, test_com.android.foo, com.google.android.foo]
-// Return:
-// com.android.foo
-
-// If a module is included in multiple api domains (collated by min_sdk_version), it will return
-// the first match. The other matches have the same build actions since they share a min_sdk_version, so returning
-// the first match is fine.
-func findApiDomain(ai android.ApexInfo) string {
-	// Remove any test apexes
-	matches, _ := android.FilterList(ai.InApexModules, ai.TestApexes)
-	// Remove any google apexes. Rely on naming convention.
-	pred := func(s string) bool { return !strings.HasPrefix(s, "com.google") }
-	matches = android.FilterListPred(matches, pred)
-	if len(matches) > 0 {
-		// Return the first match
-		return android.SortedUniqueStrings(matches)[0]
-	} else {
-		// No apex in the tree has a dependency on this module
-		return ""
-	}
-}
-
-func (c *Module) ProcessBazelQueryResponse(ctx android.ModuleContext) {
-	bazelModuleLabel := c.getBazelModuleLabel(ctx)
-	c.bazelHandler.ProcessBazelQueryResponse(ctx, bazelModuleLabel)
-
-	c.Properties.SubName = GetSubnameProperty(ctx, c)
-	apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
-	if !apexInfo.IsForPlatform() {
-		c.hideApexVariantFromMake = true
-	}
-
-	c.makeLinkType = GetMakeLinkType(ctx, c)
-
-	mctx := &moduleContext{
-		ModuleContext: ctx,
-		moduleContextImpl: moduleContextImpl{
-			mod: c,
-		},
-	}
-	mctx.ctx = mctx
-
-	// TODO(b/244432500): Get the tradefed config from the bazel target instead
-	// of generating it with Soong.
-	c.maybeInstall(mctx, apexInfo)
-}
-
 func moduleContextFromAndroidModuleContext(actx android.ModuleContext, c *Module) ModuleContext {
 	ctx := &moduleContext{
 		ModuleContext: actx,
@@ -2345,9 +2155,8 @@
 	}
 }
 
-// maybeInstall is called at the end of both GenerateAndroidBuildActions and
-// ProcessBazelQueryResponse to run the install hooks for installable modules,
-// like binaries and tests.
+// maybeInstall is called at the end of both GenerateAndroidBuildActions to run the
+// install hooks for installable modules, like binaries and tests.
 func (c *Module) maybeInstall(ctx ModuleContext, apexInfo android.ApexInfo) {
 	if !proptools.BoolDefault(c.Installable(), true) {
 		// If the module has been specifically configure to not be installed then
@@ -2370,12 +2179,6 @@
 	}
 }
 
-func (c *Module) setAndroidMkVariablesFromCquery(info cquery.CcAndroidMkInfo) {
-	c.Properties.AndroidMkSharedLibs = info.LocalSharedLibs
-	c.Properties.AndroidMkStaticLibs = info.LocalStaticLibs
-	c.Properties.AndroidMkWholeStaticLibs = info.LocalWholeStaticLibs
-}
-
 func (c *Module) toolchain(ctx android.BaseModuleContext) config.Toolchain {
 	if c.cachedToolchain == nil {
 		c.cachedToolchain = config.FindToolchainWithContext(ctx)
@@ -4215,65 +4018,6 @@
 	return unknownType
 }
 
-// ConvertWithBp2build converts Module to Bazel for bp2build.
-func (c *Module) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	if len(c.generators) > 0 {
-		allConverted := true
-		for _, generator := range c.generators {
-			allConverted = allConverted && generator.GeneratorBp2build(ctx, c)
-		}
-		if allConverted {
-			return
-		}
-	}
-
-	prebuilt := c.IsPrebuilt()
-	switch c.typ() {
-	case binary:
-		if prebuilt {
-			prebuiltBinaryBp2Build(ctx, c)
-		} else {
-			binaryBp2build(ctx, c)
-		}
-	case testBin:
-		if !prebuilt {
-			testBinaryBp2build(ctx, c)
-		}
-	case object:
-		if prebuilt {
-			prebuiltObjectBp2Build(ctx, c)
-		} else {
-			objectBp2Build(ctx, c)
-		}
-	case fullLibrary:
-		if !prebuilt {
-			libraryBp2Build(ctx, c)
-		} else {
-			prebuiltLibraryBp2Build(ctx, c)
-		}
-	case headerLibrary:
-		libraryHeadersBp2Build(ctx, c)
-	case staticLibrary:
-		if prebuilt {
-			prebuiltLibraryStaticBp2Build(ctx, c, false)
-		} else {
-			sharedOrStaticLibraryBp2Build(ctx, c, true)
-		}
-	case sharedLibrary:
-		if prebuilt {
-			prebuiltLibrarySharedBp2Build(ctx, c)
-		} else {
-			sharedOrStaticLibraryBp2Build(ctx, c, false)
-		}
-	case ndkPrebuiltStl:
-		ndkPrebuiltStlBp2build(ctx, c)
-	case ndkLibrary:
-		ndkLibraryBp2build(ctx, c)
-	default:
-		ctx.MarkBp2buildUnconvertible(bp2build_metrics_proto.UnconvertedReasonType_TYPE_UNSUPPORTED, "")
-	}
-}
-
 // Defaults
 type Defaults struct {
 	android.ModuleBase
diff --git a/cc/cc_test.go b/cc/cc_test.go
index 710b72b..a1842d7 100644
--- a/cc/cc_test.go
+++ b/cc/cc_test.go
@@ -26,7 +26,6 @@
 
 	"android/soong/aidl_library"
 	"android/soong/android"
-	"android/soong/bazel/cquery"
 )
 
 func init() {
@@ -46,27 +45,15 @@
 	}),
 )
 
-var ccLibInApex = "cc_lib_in_apex"
 var apexVariationName = "apex28"
 var apexVersion = "28"
 
 func registerTestMutators(ctx android.RegistrationContext) {
 	ctx.PostDepsMutators(func(ctx android.RegisterMutatorsContext) {
 		ctx.BottomUp("apex", testApexMutator).Parallel()
-		ctx.BottomUp("mixed_builds_prep", mixedBuildsPrepareMutator).Parallel()
 	})
 }
 
-func mixedBuildsPrepareMutator(ctx android.BottomUpMutatorContext) {
-	if m := ctx.Module(); m.Enabled() {
-		if mixedBuildMod, ok := m.(android.MixedBuildBuildable); ok {
-			if mixedBuildMod.IsMixedBuildSupported(ctx) && android.MixedBuildsEnabled(ctx) == android.MixedBuildEnabled {
-				mixedBuildMod.QueueBazelCall(ctx)
-			}
-		}
-	}
-}
-
 func testApexMutator(mctx android.BottomUpMutatorContext) {
 	modules := mctx.CreateVariations(apexVariationName)
 	apexInfo := android.ApexInfo{
@@ -2929,258 +2916,6 @@
 	checkStaticLibs(t, []string{"lib1", "libc++_static", "libc++demangle", "libclang_rt.builtins"}, module)
 }
 
-func TestLibDepAndroidMkExportInMixedBuilds(t *testing.T) {
-	bp := `
-		cc_library {
-			name: "static_dep",
-		}
-		cc_library {
-			name: "whole_static_dep",
-		}
-		cc_library {
-			name: "shared_dep",
-		}
-		cc_library {
-			name: "lib",
-			bazel_module: { label: "//:lib" },
-			static_libs: ["static_dep"],
-			whole_static_libs: ["whole_static_dep"],
-			shared_libs: ["shared_dep"],
-		}
-		cc_test {
-			name: "test",
-			bazel_module: { label: "//:test" },
-			static_libs: ["static_dep"],
-			whole_static_libs: ["whole_static_dep"],
-			shared_libs: ["shared_dep"],
-			gtest: false,
-			sanitize: {
-				// cc_test modules default to memtag_heap: true,
-				// but this adds extra dependencies that we don't care about
-				never: true,
-			}
-		}
-		cc_binary {
-			name: "binary",
-			bazel_module: { label: "//:binary" },
-			static_libs: ["static_dep"],
-			whole_static_libs: ["whole_static_dep"],
-			shared_libs: ["shared_dep"],
-		}
-		cc_library_headers {
-			name: "lib_headers",
-			bazel_module: { label: "//:lib_headers" },
-			static_libs: ["static_dep"],
-			whole_static_libs: ["whole_static_dep"],
-			shared_libs: ["shared_dep"],
-		}
-		cc_prebuilt_library {
-			name: "lib_prebuilt",
-			bazel_module: { label: "//:lib_prebuilt" },
-			static_libs: ["static_dep"],
-			whole_static_libs: ["whole_static_dep"],
-			shared_libs: ["shared_dep"],
-		}
-	`
-
-	testCases := []struct {
-		name          string
-		moduleName    string
-		variant       string
-		androidMkInfo cquery.CcAndroidMkInfo
-	}{
-		{
-			name:       "shared lib",
-			moduleName: "lib",
-			variant:    "android_arm64_armv8-a_shared",
-			androidMkInfo: cquery.CcAndroidMkInfo{
-				LocalStaticLibs:      []string{"static_dep"},
-				LocalWholeStaticLibs: []string{"whole_static_dep"},
-				LocalSharedLibs:      []string{"shared_dep"},
-			},
-		},
-		{
-			name:       "static lib",
-			moduleName: "lib",
-			variant:    "android_arm64_armv8-a_static",
-			androidMkInfo: cquery.CcAndroidMkInfo{
-				LocalStaticLibs:      []string{"static_dep"},
-				LocalWholeStaticLibs: []string{"whole_static_dep"},
-				LocalSharedLibs:      []string{"shared_dep"},
-			},
-		},
-		{
-			name:       "cc_test arm64",
-			moduleName: "test",
-			variant:    "android_arm64_armv8-a",
-			androidMkInfo: cquery.CcAndroidMkInfo{
-				LocalStaticLibs:      []string{"static_dep"},
-				LocalWholeStaticLibs: []string{"whole_static_dep"},
-				LocalSharedLibs:      []string{"shared_dep"},
-			},
-		},
-		{
-			name:       "cc_test arm",
-			moduleName: "test",
-			variant:    "android_arm_armv7-a-neon",
-			androidMkInfo: cquery.CcAndroidMkInfo{
-				LocalStaticLibs:      []string{"static_dep"},
-				LocalWholeStaticLibs: []string{"whole_static_dep"},
-				LocalSharedLibs:      []string{"shared_dep"},
-			},
-		},
-		{
-			name:       "cc_binary",
-			moduleName: "binary",
-			variant:    "android_arm64_armv8-a",
-			androidMkInfo: cquery.CcAndroidMkInfo{
-				LocalStaticLibs:      []string{"static_dep"},
-				LocalWholeStaticLibs: []string{"whole_static_dep"},
-				LocalSharedLibs:      []string{"shared_dep"},
-			},
-		},
-		{
-			name:       "cc_library_headers",
-			moduleName: "lib_headers",
-			variant:    "android_arm64_armv8-a",
-			androidMkInfo: cquery.CcAndroidMkInfo{
-				LocalStaticLibs:      []string{"static_dep"},
-				LocalWholeStaticLibs: []string{"whole_static_dep"},
-				LocalSharedLibs:      []string{"shared_dep"},
-			},
-		},
-		{
-			name:       "prebuilt lib static",
-			moduleName: "lib_prebuilt",
-			variant:    "android_arm64_armv8-a_static",
-			androidMkInfo: cquery.CcAndroidMkInfo{
-				LocalStaticLibs:      []string{"static_dep"},
-				LocalWholeStaticLibs: []string{"whole_static_dep"},
-				LocalSharedLibs:      []string{"shared_dep"},
-			},
-		},
-		{
-			name:       "prebuilt lib shared",
-			moduleName: "lib_prebuilt",
-			variant:    "android_arm64_armv8-a_shared",
-			androidMkInfo: cquery.CcAndroidMkInfo{
-				LocalStaticLibs:      []string{"static_dep"},
-				LocalWholeStaticLibs: []string{"whole_static_dep"},
-				LocalSharedLibs:      []string{"shared_dep"},
-			},
-		},
-	}
-
-	outputBaseDir := "out/bazel"
-	for _, tc := range testCases {
-		t.Run(tc.name, func(t *testing.T) {
-			result := android.GroupFixturePreparers(
-				prepareForCcTest,
-				android.FixtureModifyConfig(func(config android.Config) {
-					config.BazelContext = android.MockBazelContext{
-						OutputBaseDir: outputBaseDir,
-						LabelToCcInfo: map[string]cquery.CcInfo{
-							"//:lib": cquery.CcInfo{
-								CcAndroidMkInfo:      tc.androidMkInfo,
-								RootDynamicLibraries: []string{""},
-							},
-							"//:lib_bp2build_cc_library_static": cquery.CcInfo{
-								CcAndroidMkInfo:    tc.androidMkInfo,
-								RootStaticArchives: []string{""},
-							},
-							"//:lib_headers": cquery.CcInfo{
-								CcAndroidMkInfo: tc.androidMkInfo,
-								OutputFiles:     []string{""},
-							},
-							"//:lib_prebuilt": cquery.CcInfo{
-								CcAndroidMkInfo: tc.androidMkInfo,
-							},
-							"//:lib_prebuilt_bp2build_cc_library_static": cquery.CcInfo{
-								CcAndroidMkInfo: tc.androidMkInfo,
-							},
-						},
-						LabelToCcBinary: map[string]cquery.CcUnstrippedInfo{
-							"//:test__tf_internal": cquery.CcUnstrippedInfo{
-								CcAndroidMkInfo: tc.androidMkInfo,
-							},
-							"//:binary": cquery.CcUnstrippedInfo{
-								CcAndroidMkInfo: tc.androidMkInfo,
-							},
-						},
-					}
-				}),
-			).RunTestWithBp(t, bp)
-			ctx := result.TestContext
-
-			module := ctx.ModuleForTests(tc.moduleName, tc.variant).Module().(*Module)
-			entries := android.AndroidMkEntriesForTest(t, ctx, module)[0]
-			if !reflect.DeepEqual(module.Properties.AndroidMkStaticLibs, tc.androidMkInfo.LocalStaticLibs) {
-				t.Errorf("incorrect static_libs"+
-					"\nactual:   %v"+
-					"\nexpected: %v",
-					module.Properties.AndroidMkStaticLibs,
-					tc.androidMkInfo.LocalStaticLibs,
-				)
-			}
-			staticDepsDiffer, missingStaticDeps, additionalStaticDeps := android.ListSetDifference(
-				entries.EntryMap["LOCAL_STATIC_LIBRARIES"],
-				tc.androidMkInfo.LocalStaticLibs,
-			)
-			if staticDepsDiffer {
-				t.Errorf(
-					"expected LOCAL_STATIC_LIBRARIES to be %q but was %q; missing: %q; extra %q",
-					tc.androidMkInfo.LocalStaticLibs,
-					entries.EntryMap["LOCAL_STATIC_LIBRARIES"],
-					missingStaticDeps,
-					additionalStaticDeps,
-				)
-			}
-
-			if !reflect.DeepEqual(module.Properties.AndroidMkWholeStaticLibs, tc.androidMkInfo.LocalWholeStaticLibs) {
-				t.Errorf("expected module.Properties.AndroidMkWholeStaticLibs to be %q, but was %q",
-					tc.androidMkInfo.LocalWholeStaticLibs,
-					module.Properties.AndroidMkWholeStaticLibs,
-				)
-			}
-			wholeStaticDepsDiffer, missingWholeStaticDeps, additionalWholeStaticDeps := android.ListSetDifference(
-				entries.EntryMap["LOCAL_WHOLE_STATIC_LIBRARIES"],
-				tc.androidMkInfo.LocalWholeStaticLibs,
-			)
-			if wholeStaticDepsDiffer {
-				t.Errorf(
-					"expected LOCAL_WHOLE_STATIC_LIBRARIES to be %q but was %q; missing: %q; extra %q",
-					tc.androidMkInfo.LocalWholeStaticLibs,
-					entries.EntryMap["LOCAL_WHOLE_STATIC_LIBRARIES"],
-					missingWholeStaticDeps,
-					additionalWholeStaticDeps,
-				)
-			}
-
-			if !reflect.DeepEqual(module.Properties.AndroidMkSharedLibs, tc.androidMkInfo.LocalSharedLibs) {
-				t.Errorf("incorrect shared_libs"+
-					"\nactual:   %v"+
-					"\nexpected: %v",
-					module.Properties.AndroidMkSharedLibs,
-					tc.androidMkInfo.LocalSharedLibs,
-				)
-			}
-			sharedDepsDiffer, missingSharedDeps, additionalSharedDeps := android.ListSetDifference(
-				entries.EntryMap["LOCAL_SHARED_LIBRARIES"],
-				tc.androidMkInfo.LocalSharedLibs,
-			)
-			if sharedDepsDiffer {
-				t.Errorf(
-					"expected LOCAL_SHARED_LIBRARIES to be %q but was %q; missing %q; extra %q",
-					tc.androidMkInfo.LocalSharedLibs,
-					entries.EntryMap["LOCAL_SHARED_LIBRARIES"],
-					missingSharedDeps,
-					additionalSharedDeps,
-				)
-			}
-		})
-	}
-}
-
 var compilerFlagsTestCases = []struct {
 	in  string
 	out bool
@@ -3522,130 +3257,6 @@
 	}
 }
 
-func TestMixedBuildUsesStubs(t *testing.T) {
-	t.Parallel()
-	bp := `
-		cc_library_shared {
-			name: "libFoo",
-			bazel_module: { label: "//:libFoo" },
-			srcs: ["foo.c"],
-			stubs: {
-				symbol_file: "foo.map.txt",
-				versions: ["current"],
-			},
-			apex_available: ["bar", "a1"],
-		}
-
-		cc_library_shared {
-			name: "libBar",
-			srcs: ["bar.c"],
-			shared_libs: ["libFoo"],
-			apex_available: ["a1"],
-		}
-
-		cc_library_shared {
-			name: "libA1",
-			srcs: ["a1.c"],
-			shared_libs: ["libFoo"],
-			apex_available: ["a1"],
-		}
-
-		cc_library_shared {
-			name: "libBarA1",
-			srcs: ["bara1.c"],
-			shared_libs: ["libFoo"],
-			apex_available: ["bar", "a1"],
-		}
-
-		cc_library_shared {
-			name: "libAnyApex",
-			srcs: ["anyApex.c"],
-			shared_libs: ["libFoo"],
-			apex_available: ["//apex_available:anyapex"],
-		}
-
-		cc_library_shared {
-			name: "libBaz",
-			srcs: ["baz.c"],
-			shared_libs: ["libFoo"],
-			apex_available: ["baz"],
-		}
-
-		cc_library_shared {
-			name: "libQux",
-			srcs: ["qux.c"],
-			shared_libs: ["libFoo"],
-			apex_available: ["qux", "bar"],
-		}`
-
-	result := android.GroupFixturePreparers(
-		prepareForCcTest,
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: "out/bazel",
-				LabelToCcInfo: map[string]cquery.CcInfo{
-					"//:libFoo": {
-						RootDynamicLibraries: []string{"libFoo.so"},
-					},
-					"//:libFoo_stub_libs-current": {
-						RootDynamicLibraries: []string{"libFoo_stub_libs-current.so"},
-					},
-				},
-			}
-		}),
-	).RunTestWithBp(t, bp)
-	ctx := result.TestContext
-
-	variants := ctx.ModuleVariantsForTests("libFoo")
-	expectedVariants := []string{
-		"android_arm64_armv8-a_shared",
-		"android_arm64_armv8-a_shared_current",
-		"android_arm_armv7-a-neon_shared",
-		"android_arm_armv7-a-neon_shared_current",
-	}
-	variantsMismatch := false
-	if len(variants) != len(expectedVariants) {
-		variantsMismatch = true
-	} else {
-		for _, v := range expectedVariants {
-			if !inList(v, variants) {
-				variantsMismatch = false
-			}
-		}
-	}
-	if variantsMismatch {
-		t.Errorf("variants of libFoo expected:\n")
-		for _, v := range expectedVariants {
-			t.Errorf("%q\n", v)
-		}
-		t.Errorf(", but got:\n")
-		for _, v := range variants {
-			t.Errorf("%q\n", v)
-		}
-	}
-
-	linkAgainstFoo := []string{"libBarA1"}
-	linkAgainstFooStubs := []string{"libBar", "libA1", "libBaz", "libQux", "libAnyApex"}
-
-	libFooPath := "out/bazel/execroot/__main__/libFoo.so"
-	for _, lib := range linkAgainstFoo {
-		libLinkRule := ctx.ModuleForTests(lib, "android_arm64_armv8-a_shared").Rule("ld")
-		libFlags := libLinkRule.Args["libFlags"]
-		if !strings.Contains(libFlags, libFooPath) {
-			t.Errorf("%q: %q is not found in %q", lib, libFooPath, libFlags)
-		}
-	}
-
-	libFooStubPath := "out/bazel/execroot/__main__/libFoo_stub_libs-current.so"
-	for _, lib := range linkAgainstFooStubs {
-		libLinkRule := ctx.ModuleForTests(lib, "android_arm64_armv8-a_shared").Rule("ld")
-		libFlags := libLinkRule.Args["libFlags"]
-		if !strings.Contains(libFlags, libFooStubPath) {
-			t.Errorf("%q: %q is not found in %q", lib, libFooStubPath, libFlags)
-		}
-	}
-}
-
 func TestVersioningMacro(t *testing.T) {
 	t.Parallel()
 	for _, tc := range []struct{ moduleName, expected string }{
@@ -4019,9 +3630,6 @@
 			shared: {
 				srcs: ["baz.c"],
 			},
-			bazel_module: {
-				bp2build_available: true,
-			},
 		}
 
 		cc_library_static {
@@ -5150,309 +4758,3 @@
 		})
 	}
 }
-
-func TestDclaLibraryInApex(t *testing.T) {
-	t.Parallel()
-	bp := `
-	cc_library_shared {
-		name: "cc_lib_in_apex",
-		srcs: ["foo.cc"],
-    apex_available: ["myapex"],
-		bazel_module: { label: "//foo/bar:bar" },
-	}`
-	label := "//foo/bar:bar"
-	arch64 := "arm64_armv8-a"
-	arch32 := "arm_armv7-a-neon"
-	apexCfgKey := android.ApexConfigKey{
-		WithinApex:     true,
-		ApexSdkVersion: "28",
-	}
-
-	result := android.GroupFixturePreparers(
-		prepareForCcTest,
-		android.FixtureRegisterWithContext(registerTestMutators),
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: "outputbase",
-				LabelToCcInfo: map[string]cquery.CcInfo{
-					android.BuildMockBazelContextResultKey(label, arch32, android.Android, apexCfgKey): cquery.CcInfo{
-						RootDynamicLibraries: []string{"foo.so"},
-					},
-					android.BuildMockBazelContextResultKey(label, arch64, android.Android, apexCfgKey): cquery.CcInfo{
-						RootDynamicLibraries: []string{"foo.so"},
-					},
-				},
-				BazelRequests: make(map[string]bool),
-			}
-		}),
-	).RunTestWithBp(t, bp)
-	ctx := result.TestContext
-
-	// Test if the bazel request is queued correctly
-	key := android.BuildMockBazelContextRequestKey(label, cquery.GetCcInfo, arch32, android.Android, apexCfgKey)
-	if !ctx.Config().BazelContext.(android.MockBazelContext).BazelRequests[key] {
-		t.Errorf("Bazel request was not queued: %s", key)
-	}
-
-	sharedFoo := ctx.ModuleForTests(ccLibInApex, "android_arm_armv7-a-neon_shared_"+apexVariationName).Module()
-	producer := sharedFoo.(android.OutputFileProducer)
-	outputFiles, err := producer.OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{"outputbase/execroot/__main__/foo.so"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
-}
-
-func TestDisableSanitizerVariantsInMixedBuilds(t *testing.T) {
-	t.Parallel()
-	bp := `
-		cc_library_static {
-			name: "foo_ubsan_minimal",
-			srcs: ["foo.cc"],
-			bazel_module: { label: "//foo_ubsan_minimal" },
-			sanitize: {
-				all_undefined: true,
-				integer_overflow: true,
-			},
-		}
-		cc_library_static {
-			name: "foo",
-			srcs: ["foo.cc"],
-			bazel_module: { label: "//foo" },
-			sanitize: {
-				address: true,
-				hwaddress: true,
-				fuzzer: true,
-				integer_overflow: true,
-				scs: true,
-			},
-		}
-		cc_library_static {
-			name: "foo_tsan",
-			srcs: ["foo.cc"],
-			bazel_module: { label: "//foo_tsan" },
-			sanitize: {
-				thread: true,
-			},
-		}
-		cc_library_static {
-			name: "foo_cfi",
-			srcs: ["foo.cc"],
-			bazel_module: { label: "//foo_cfi" },
-			sanitize: {
-				cfi: true,
-			},
-		}
-		cc_library_static {
-			name: "foo_memtag_stack",
-			srcs: ["foo.cc"],
-			bazel_module: { label: "//foo_memtag_stack" },
-			sanitize: {
-				memtag_stack: true,
-			},
-		}
-		cc_library_static {
-			name: "foo_memtag_heap",
-			srcs: ["foo.cc"],
-			bazel_module: { label: "//foo_memtag_heap" },
-			sanitize: {
-				memtag_heap: true,
-			},
-		}
-		cc_library_static {
-			name: "foo_safestack",
-			srcs: ["foo.cc"],
-			bazel_module: { label: "//foo_safestack" },
-			sanitize: {
-				safestack: true,
-			},
-		}
-		cc_library_static {
-			name: "foo_scudo",
-			srcs: ["foo.cc"],
-			bazel_module: { label: "//foo_scudo" },
-			sanitize: {
-				scudo: true,
-			},
-		}
-	`
-	testcases := []struct {
-		name                string
-		variant             string
-		expectedOutputPaths []string
-	}{
-		{
-			name:    "foo_ubsan_minimal",
-			variant: "android_arm64_armv8-a_static_apex28",
-			expectedOutputPaths: []string{
-				"outputbase/execroot/__main__/foo_ubsan_minimal.a",
-			},
-		},
-		{
-			name:    "foo",
-			variant: "android_arm64_armv8-a_static_apex28",
-			expectedOutputPaths: []string{
-				"outputbase/execroot/__main__/foo.a",
-			},
-		},
-		{
-			name:    "foo",
-			variant: "android_arm_armv7-a-neon_static_asan_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo/android_arm_armv7-a-neon_static_asan_apex28/foo.a",
-			},
-		},
-		{
-			name:    "foo",
-			variant: "android_arm64_armv8-a_static_hwasan_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo/android_arm64_armv8-a_static_hwasan_apex28/foo.a",
-			},
-		},
-		{
-			name:    "foo",
-			variant: "android_arm64_armv8-a_static_fuzzer_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo/android_arm64_armv8-a_static_fuzzer_apex28/foo.a",
-			},
-		},
-		{
-			name:    "foo",
-			variant: "android_arm_armv7-a-neon_static_asan_fuzzer_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo/android_arm_armv7-a-neon_static_asan_fuzzer_apex28/foo.a",
-			},
-		},
-		{
-			name:    "foo",
-			variant: "android_arm64_armv8-a_static_hwasan_fuzzer_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo/android_arm64_armv8-a_static_hwasan_fuzzer_apex28/foo.a",
-			},
-		},
-		{
-			name:    "foo",
-			variant: "android_arm64_armv8-a_static_scs_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo/android_arm64_armv8-a_static_scs_apex28/foo.a",
-			},
-		},
-		{
-			name:    "foo",
-			variant: "android_arm64_armv8-a_static_hwasan_scs_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo/android_arm64_armv8-a_static_hwasan_scs_apex28/foo.a",
-			},
-		},
-		{
-			name:    "foo",
-			variant: "android_arm64_armv8-a_static_hwasan_scs_fuzzer_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo/android_arm64_armv8-a_static_hwasan_scs_fuzzer_apex28/foo.a",
-			},
-		},
-		{
-			name:    "foo_tsan",
-			variant: "android_arm64_armv8-a_static_apex28",
-			expectedOutputPaths: []string{
-				"outputbase/execroot/__main__/foo_tsan.a",
-			},
-		},
-		{
-			name:    "foo_tsan",
-			variant: "android_arm64_armv8-a_static_tsan_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo_tsan/android_arm64_armv8-a_static_tsan_apex28/foo_tsan.a",
-			},
-		},
-		{
-			name:    "foo_cfi",
-			variant: "android_arm64_armv8-a_static_apex28",
-			expectedOutputPaths: []string{
-				"outputbase/execroot/__main__/foo_cfi.a",
-			},
-		},
-		{
-			name:    "foo_cfi",
-			variant: "android_arm64_armv8-a_static_cfi_apex28",
-			expectedOutputPaths: []string{
-				"outputbase/execroot/__main__/foo_cfi.a",
-			},
-		},
-		{
-			name:    "foo_memtag_stack",
-			variant: "android_arm64_armv8-a_static_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo_memtag_stack/android_arm64_armv8-a_static_apex28/foo_memtag_stack.a",
-			},
-		},
-		{
-			name:    "foo_memtag_heap",
-			variant: "android_arm64_armv8-a_static_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo_memtag_heap/android_arm64_armv8-a_static_apex28/foo_memtag_heap.a",
-			},
-		},
-		{
-			name:    "foo_safestack",
-			variant: "android_arm64_armv8-a_static_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo_safestack/android_arm64_armv8-a_static_apex28/foo_safestack.a",
-			},
-		},
-		{
-			name:    "foo_scudo",
-			variant: "android_arm64_armv8-a_static_apex28",
-			expectedOutputPaths: []string{
-				"out/soong/.intermediates/foo_scudo/android_arm64_armv8-a_static_apex28/foo_scudo.a",
-			},
-		},
-	}
-
-	ctx := android.GroupFixturePreparers(
-		prepareForCcTest,
-		prepareForAsanTest,
-		android.FixtureRegisterWithContext(registerTestMutators),
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: "outputbase",
-				LabelToCcInfo: map[string]cquery.CcInfo{
-					"//foo_ubsan_minimal": {
-						RootStaticArchives: []string{"foo_ubsan_minimal.a"},
-					},
-					"//foo": {
-						RootStaticArchives: []string{"foo.a"},
-					},
-					"//foo_tsan": {
-						RootStaticArchives: []string{"foo_tsan.a"},
-					},
-					"//foo_cfi": {
-						RootStaticArchives: []string{"foo_cfi.a"},
-					},
-					"//foo_memtag_stack": {
-						RootStaticArchives: []string{"INVALID_ARCHIVE.a"},
-					},
-					"//foo_memtag_heap": {
-						RootStaticArchives: []string{"INVALID_ARCHIVE.a"},
-					},
-					"//foo_safestack": {
-						RootStaticArchives: []string{"INVALID_ARCHIVE.a"},
-					},
-					"//foo_scudo": {
-						RootStaticArchives: []string{"INVALID_ARCHIVE.a"},
-					},
-				},
-			}
-		}),
-	).RunTestWithBp(t, bp).TestContext
-
-	for _, tc := range testcases {
-		fooMod := ctx.ModuleForTests(tc.name, tc.variant).Module()
-		outputFiles, err := fooMod.(android.OutputFileProducer).OutputFiles("")
-		if err != nil {
-			t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-		}
-		android.AssertPathsRelativeToTopEquals(t, "output files", tc.expectedOutputPaths, outputFiles)
-	}
-}
diff --git a/cc/config/global.go b/cc/config/global.go
index 8b6df30..85ebd60 100644
--- a/cc/config/global.go
+++ b/cc/config/global.go
@@ -378,12 +378,6 @@
 	VisibilityDefaultFlag = "-fvisibility=default"
 )
 
-// BazelCcToolchainVars generates bzl file content containing variables for
-// Bazel's cc_toolchain configuration.
-func BazelCcToolchainVars(config android.Config) string {
-	return android.BazelToolchainVars(config, exportedVars)
-}
-
 func ExportStringList(name string, value []string) {
 	exportedVars.ExportStringList(name, value)
 }
diff --git a/cc/fdo_profile.go b/cc/fdo_profile.go
index cd3eb1e..02f68b5 100644
--- a/cc/fdo_profile.go
+++ b/cc/fdo_profile.go
@@ -16,10 +16,7 @@
 
 import (
 	"android/soong/android"
-	"android/soong/bazel"
-
 	"github.com/google/blueprint"
-	"github.com/google/blueprint/proptools"
 )
 
 func init() {
@@ -32,7 +29,6 @@
 
 type fdoProfile struct {
 	android.ModuleBase
-	android.BazelModuleBase
 
 	properties fdoProfileProperties
 }
@@ -41,50 +37,6 @@
 	Profile *string `android:"arch_variant"`
 }
 
-type bazelFdoProfileAttributes struct {
-	Profile bazel.StringAttribute
-}
-
-func (fp *fdoProfile) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	var profileAttr bazel.StringAttribute
-
-	archVariantProps := fp.GetArchVariantProperties(ctx, &fdoProfileProperties{})
-	for axis, configToProps := range archVariantProps {
-		for config, _props := range configToProps {
-			if archProps, ok := _props.(*fdoProfileProperties); ok {
-				if axis.String() == "arch" || axis.String() == "no_config" {
-					if archProps.Profile != nil {
-						profileAttr.SetSelectValue(axis, config, archProps.Profile)
-					}
-				}
-			}
-		}
-	}
-
-	// Ideally, cc_library_shared's fdo_profile attr can be a select statement so that we
-	// don't lift the restriction here. However, in cc_library_shared macro, fdo_profile
-	// is used as a string, we need to temporarily lift the host restriction until we can
-	// pass use fdo_profile attr with select statement
-	// https://cs.android.com/android/platform/superproject/+/master:build/bazel/rules/cc/cc_library_shared.bzl;l=127;drc=cc01bdfd39857eddbab04ef69ab6db22dcb1858a
-	// TODO(b/276287371): Drop the restriction override after fdo_profile path is handled properly
-	var noRestriction bazel.BoolAttribute
-	noRestriction.SetSelectValue(bazel.NoConfigAxis, "", proptools.BoolPtr(true))
-
-	ctx.CreateBazelTargetModuleWithRestrictions(
-		bazel.BazelTargetModuleProperties{
-			Bzl_load_location: "//build/bazel/rules/fdo:fdo_profile.bzl",
-			Rule_class:        "fdo_profile",
-		},
-		android.CommonAttributes{
-			Name: fp.Name(),
-		},
-		&bazelFdoProfileAttributes{
-			Profile: profileAttr,
-		},
-		noRestriction,
-	)
-}
-
 // FdoProfileInfo is provided by FdoProfileProvider
 type FdoProfileInfo struct {
 	Path android.Path
@@ -128,6 +80,5 @@
 	m := &fdoProfile{}
 	m.AddProperties(&m.properties)
 	android.InitAndroidMultiTargetsArchModule(m, android.DeviceSupported, android.MultilibBoth)
-	android.InitBazelModule(m)
 	return m
 }
diff --git a/cc/fuzz.go b/cc/fuzz.go
index ef2e68c..6b3a739 100644
--- a/cc/fuzz.go
+++ b/cc/fuzz.go
@@ -299,7 +299,7 @@
 }
 
 func NewFuzzer(hod android.HostOrDeviceSupported) *Module {
-	module, binary := newBinary(hod, false)
+	module, binary := newBinary(hod)
 	baseInstallerPath := "fuzz"
 
 	binary.baseInstaller = NewBaseInstaller(baseInstallerPath, baseInstallerPath, InstallInData)
diff --git a/cc/gen.go b/cc/gen.go
index 151f23d..2e72e30 100644
--- a/cc/gen.go
+++ b/cc/gen.go
@@ -19,9 +19,6 @@
 	"strings"
 
 	"android/soong/aidl_library"
-	"android/soong/bazel"
-	"android/soong/sysprop/bp2build"
-
 	"github.com/google/blueprint"
 
 	"android/soong/android"
@@ -181,41 +178,6 @@
 	})
 }
 
-type LexAttrs struct {
-	Srcs    bazel.LabelListAttribute
-	Lexopts bazel.StringListAttribute
-}
-
-type LexNames struct {
-	cSrcName bazel.LabelAttribute
-	srcName  bazel.LabelAttribute
-}
-
-func bp2BuildLex(ctx android.Bp2buildMutatorContext, moduleName string, ca compilerAttributes) LexNames {
-	names := LexNames{}
-	if !ca.lSrcs.IsEmpty() {
-		names.cSrcName = createLexTargetModule(ctx, moduleName+"_genlex_l", ca.lSrcs, ca.lexopts)
-	}
-	if !ca.llSrcs.IsEmpty() {
-		names.srcName = createLexTargetModule(ctx, moduleName+"_genlex_ll", ca.llSrcs, ca.lexopts)
-	}
-	return names
-}
-
-func createLexTargetModule(ctx android.Bp2buildMutatorContext, name string, srcs bazel.LabelListAttribute, opts bazel.StringListAttribute) bazel.LabelAttribute {
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "genlex",
-			Bzl_load_location: "//build/bazel/rules/cc:flex.bzl",
-		},
-		android.CommonAttributes{Name: name},
-		&LexAttrs{
-			Srcs:    srcs,
-			Lexopts: opts,
-		})
-	return bazel.LabelAttribute{Value: &bazel.Label{Label: ":" + name}}
-}
-
 func genSysprop(ctx android.ModuleContext, syspropFile android.Path) (android.Path, android.Paths) {
 	headerFile := android.PathForModuleGen(ctx, "sysprop", "include", syspropFile.Rel()+".h")
 	publicHeaderFile := android.PathForModuleGen(ctx, "sysprop/public", "include", syspropFile.Rel()+".h")
@@ -240,35 +202,6 @@
 	return cppFile, headers.Paths()
 }
 
-func bp2buildCcSysprop(ctx android.Bp2buildMutatorContext, moduleName string, minSdkVersion *string, srcs bazel.LabelListAttribute) *bazel.LabelAttribute {
-	labels := bp2build.SyspropLibraryLabels{
-		SyspropLibraryLabel:  moduleName + "_sysprop_library",
-		CcStaticLibraryLabel: moduleName + "_cc_sysprop_library_static",
-	}
-	bp2build.Bp2buildBaseSyspropLibrary(ctx, labels.SyspropLibraryLabel, srcs)
-	bp2build.Bp2buildSyspropCc(ctx, labels, minSdkVersion)
-	return createLabelAttributeCorrespondingToSrcs(":"+labels.CcStaticLibraryLabel, srcs)
-}
-
-// Creates a LabelAttribute for a given label where the value is only set for
-// the same config values that have values in a given LabelListAttribute
-func createLabelAttributeCorrespondingToSrcs(baseLabelName string, srcs bazel.LabelListAttribute) *bazel.LabelAttribute {
-	baseLabel := bazel.Label{Label: baseLabelName}
-	label := bazel.LabelAttribute{}
-	if !srcs.Value.IsNil() && !srcs.Value.IsEmpty() {
-		label.Value = &baseLabel
-		return &label
-	}
-	for axis, configToSrcs := range srcs.ConfigurableValues {
-		for config, val := range configToSrcs {
-			if !val.IsNil() && !val.IsEmpty() {
-				label.SetSelectValue(axis, config, baseLabel)
-			}
-		}
-	}
-	return &label
-}
-
 // Used to communicate information from the genSources method back to the library code that uses
 // it.
 type generatedSourceInfo struct {
diff --git a/cc/generated_cc_library.go b/cc/generated_cc_library.go
index 8428e94..b1084e4 100644
--- a/cc/generated_cc_library.go
+++ b/cc/generated_cc_library.go
@@ -28,9 +28,6 @@
 		staticAndSharedLibrarySdkMemberType,
 	}
 
-	module.bazelable = true
-	module.bazelHandler = &ccLibraryBazelHandler{module: module}
-
 	module.generators = append(module.generators, callbacks)
 
 	return module.Init()
diff --git a/cc/genrule.go b/cc/genrule.go
index 63c728c..0c06ae6 100644
--- a/cc/genrule.go
+++ b/cc/genrule.go
@@ -62,7 +62,6 @@
 	android.InitAndroidArchModule(module, android.HostAndDeviceSupported, android.MultilibBoth)
 
 	android.InitApexModule(module)
-	android.InitBazelModule(module)
 
 	return module
 }
diff --git a/cc/library.go b/cc/library.go
index 719455c..2aa0b1b 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -24,28 +24,11 @@
 	"sync"
 
 	"android/soong/android"
-	"android/soong/bazel"
-	"android/soong/bazel/cquery"
-
 	"github.com/google/blueprint"
 	"github.com/google/blueprint/pathtools"
 	"github.com/google/blueprint/proptools"
 )
 
-var (
-	alwaysLinkLibraries = map[string]bool{
-		// Coverage libraries are _always_ added as a whole_static_dep. By converting as these as
-		// alwayslink = True, we can add these as to deps (e.g. as a regular static dep) in Bazel
-		// without any extra complications in cc_shared_library roots to prevent linking the same
-		// library repeatedly.
-		"libprofile-extras_ndk":               true,
-		"libprofile-extras":                   true,
-		"libprofile-clang-extras_ndk":         true,
-		"libprofile-clang-extras_cfi_support": true,
-		"libprofile-clang-extras":             true,
-	}
-)
-
 // LibraryProperties is a collection of properties shared by cc library rules/cc.
 type LibraryProperties struct {
 	// local file name to pass to the linker as -unexported_symbols_list
@@ -235,336 +218,6 @@
 	ctx.RegisterModuleType("cc_library_host_shared", LibraryHostSharedFactory)
 }
 
-// TODO(b/199902614): Can this be factored to share with the other Attributes?
-// For bp2build conversion.
-type bazelCcLibraryAttributes struct {
-	// Attributes pertaining to both static and shared variants.
-	Srcs    bazel.LabelListAttribute
-	Srcs_c  bazel.LabelListAttribute
-	Srcs_as bazel.LabelListAttribute
-
-	Copts      bazel.StringListAttribute
-	Cppflags   bazel.StringListAttribute
-	Conlyflags bazel.StringListAttribute
-	Asflags    bazel.StringListAttribute
-
-	Hdrs bazel.LabelListAttribute
-
-	Deps                              bazel.LabelListAttribute
-	Implementation_deps               bazel.LabelListAttribute
-	Dynamic_deps                      bazel.LabelListAttribute
-	Implementation_dynamic_deps       bazel.LabelListAttribute
-	Whole_archive_deps                bazel.LabelListAttribute
-	Implementation_whole_archive_deps bazel.LabelListAttribute
-	System_dynamic_deps               bazel.LabelListAttribute
-
-	Export_includes        bazel.StringListAttribute
-	Export_system_includes bazel.StringListAttribute
-	Local_includes         bazel.StringListAttribute
-	Absolute_includes      bazel.StringListAttribute
-	Linkopts               bazel.StringListAttribute
-	Rtti                   bazel.BoolAttribute
-
-	Stl     *string
-	Cpp_std *string
-	C_std   *string
-
-	// This is shared only.
-	Additional_linker_inputs bazel.LabelListAttribute
-
-	// Common properties shared between both shared and static variants.
-	Shared staticOrSharedAttributes
-	Static staticOrSharedAttributes
-
-	Strip stripAttributes
-
-	Features bazel.StringListAttribute
-}
-
-type aidlLibraryAttributes struct {
-	Srcs        bazel.LabelListAttribute
-	Include_dir *string
-	Tags        bazel.StringListAttribute
-}
-
-type ccAidlLibraryAttributes struct {
-	Deps                        bazel.LabelListAttribute
-	Implementation_deps         bazel.LabelListAttribute
-	Implementation_dynamic_deps bazel.LabelListAttribute
-	Tags                        bazel.StringListAttribute
-
-	SdkAttributes
-	includesAttributes
-}
-
-type stripAttributes struct {
-	Keep_symbols                 bazel.BoolAttribute
-	Keep_symbols_and_debug_frame bazel.BoolAttribute
-	Keep_symbols_list            bazel.StringListAttribute
-	All                          bazel.BoolAttribute
-	None                         bazel.BoolAttribute
-}
-
-func stripAttrsFromLinkerAttrs(la *linkerAttributes) stripAttributes {
-	return stripAttributes{
-		Keep_symbols:                 la.stripKeepSymbols,
-		Keep_symbols_and_debug_frame: la.stripKeepSymbolsAndDebugFrame,
-		Keep_symbols_list:            la.stripKeepSymbolsList,
-		All:                          la.stripAll,
-		None:                         la.stripNone,
-	}
-}
-
-func libraryBp2Build(ctx android.Bp2buildMutatorContext, m *Module) {
-	sharedAttrs := bp2BuildParseSharedProps(ctx, m)
-	staticAttrs := bp2BuildParseStaticProps(ctx, m)
-	baseAttributes := bp2BuildParseBaseProps(ctx, m)
-	compilerAttrs := baseAttributes.compilerAttributes
-	linkerAttrs := baseAttributes.linkerAttributes
-	exportedIncludes := bp2BuildParseExportedIncludes(ctx, m, &compilerAttrs.includes)
-
-	srcs := compilerAttrs.srcs
-
-	sharedAttrs.Dynamic_deps.Add(baseAttributes.protoDependency)
-	staticAttrs.Deps.Add(baseAttributes.protoDependency)
-
-	asFlags := compilerAttrs.asFlags
-	if compilerAttrs.asSrcs.IsEmpty() && sharedAttrs.Srcs_as.IsEmpty() && staticAttrs.Srcs_as.IsEmpty() {
-		// Skip asflags for BUILD file simplicity if there are no assembly sources.
-		asFlags = bazel.MakeStringListAttribute(nil)
-	}
-
-	sharedFeatures := baseAttributes.features.Clone().Append(sharedAttrs.Features)
-	sharedFeatures.DeduplicateAxesFromBase()
-	staticFeatures := baseAttributes.features.Clone().Append(staticAttrs.Features)
-	staticFeatures.DeduplicateAxesFromBase()
-
-	staticCommonAttrs := staticOrSharedAttributes{
-		Srcs:    *srcs.Clone().Append(staticAttrs.Srcs),
-		Srcs_c:  *compilerAttrs.cSrcs.Clone().Append(staticAttrs.Srcs_c),
-		Srcs_as: *compilerAttrs.asSrcs.Clone().Append(staticAttrs.Srcs_as),
-		Copts:   *compilerAttrs.copts.Clone().Append(staticAttrs.Copts),
-		Hdrs:    *compilerAttrs.hdrs.Clone().Append(staticAttrs.Hdrs),
-
-		Deps:                              *linkerAttrs.deps.Clone().Append(staticAttrs.Deps),
-		Implementation_deps:               *linkerAttrs.implementationDeps.Clone().Append(staticAttrs.Implementation_deps),
-		Dynamic_deps:                      *linkerAttrs.dynamicDeps.Clone().Append(staticAttrs.Dynamic_deps),
-		Implementation_dynamic_deps:       *linkerAttrs.implementationDynamicDeps.Clone().Append(staticAttrs.Implementation_dynamic_deps),
-		Implementation_whole_archive_deps: linkerAttrs.implementationWholeArchiveDeps,
-		Whole_archive_deps:                *linkerAttrs.wholeArchiveDeps.Clone().Append(staticAttrs.Whole_archive_deps),
-		System_dynamic_deps:               *linkerAttrs.systemDynamicDeps.Clone().Append(staticAttrs.System_dynamic_deps),
-		Runtime_deps:                      linkerAttrs.runtimeDeps,
-		SdkAttributes:                     Bp2BuildParseSdkAttributes(m),
-		Native_coverage:                   baseAttributes.Native_coverage,
-		Additional_compiler_inputs:        compilerAttrs.additionalCompilerInputs,
-	}
-
-	includeAttrs := includesAttributes{
-		Export_includes:          exportedIncludes.Includes,
-		Export_absolute_includes: exportedIncludes.AbsoluteIncludes,
-		Export_system_includes:   exportedIncludes.SystemIncludes,
-		Local_includes:           compilerAttrs.localIncludes,
-		Absolute_includes:        compilerAttrs.absoluteIncludes,
-	}
-
-	sharedCommonAttrs := staticOrSharedAttributes{
-		Srcs:    *srcs.Clone().Append(sharedAttrs.Srcs),
-		Srcs_c:  *compilerAttrs.cSrcs.Clone().Append(sharedAttrs.Srcs_c),
-		Srcs_as: *compilerAttrs.asSrcs.Clone().Append(sharedAttrs.Srcs_as),
-		Copts:   *compilerAttrs.copts.Clone().Append(sharedAttrs.Copts),
-		Hdrs:    *compilerAttrs.hdrs.Clone().Append(sharedAttrs.Hdrs),
-
-		Deps:                              *linkerAttrs.deps.Clone().Append(sharedAttrs.Deps),
-		Implementation_deps:               *linkerAttrs.implementationDeps.Clone().Append(sharedAttrs.Implementation_deps),
-		Dynamic_deps:                      *linkerAttrs.dynamicDeps.Clone().Append(sharedAttrs.Dynamic_deps),
-		Implementation_dynamic_deps:       *linkerAttrs.implementationDynamicDeps.Clone().Append(sharedAttrs.Implementation_dynamic_deps),
-		Whole_archive_deps:                *linkerAttrs.wholeArchiveDeps.Clone().Append(sharedAttrs.Whole_archive_deps),
-		Implementation_whole_archive_deps: linkerAttrs.implementationWholeArchiveDeps,
-		System_dynamic_deps:               *linkerAttrs.systemDynamicDeps.Clone().Append(sharedAttrs.System_dynamic_deps),
-		Runtime_deps:                      linkerAttrs.runtimeDeps,
-		SdkAttributes:                     Bp2BuildParseSdkAttributes(m),
-		Native_coverage:                   baseAttributes.Native_coverage,
-		Additional_compiler_inputs:        compilerAttrs.additionalCompilerInputs,
-	}
-
-	staticTargetAttrs := &bazelCcLibraryStaticAttributes{
-		staticOrSharedAttributes: staticCommonAttrs,
-		includesAttributes:       includeAttrs,
-
-		Cppflags:   compilerAttrs.cppFlags,
-		Conlyflags: compilerAttrs.conlyFlags,
-		Asflags:    asFlags,
-
-		Rtti:    compilerAttrs.rtti,
-		Stl:     compilerAttrs.stl,
-		Cpp_std: compilerAttrs.cppStd,
-		C_std:   compilerAttrs.cStd,
-
-		Features: *staticFeatures,
-	}
-
-	sharedTargetAttrs := &bazelCcLibrarySharedAttributes{
-		staticOrSharedAttributes: sharedCommonAttrs,
-		includesAttributes:       includeAttrs,
-
-		Cppflags:   compilerAttrs.cppFlags,
-		Conlyflags: compilerAttrs.conlyFlags,
-		Asflags:    asFlags,
-
-		Linkopts:        linkerAttrs.linkopts,
-		Rtti:            compilerAttrs.rtti,
-		Stl:             compilerAttrs.stl,
-		Cpp_std:         compilerAttrs.cppStd,
-		C_std:           compilerAttrs.cStd,
-		Use_version_lib: linkerAttrs.useVersionLib,
-
-		Additional_linker_inputs: linkerAttrs.additionalLinkerInputs,
-
-		Strip:                             stripAttrsFromLinkerAttrs(&linkerAttrs),
-		Features:                          *sharedFeatures,
-		bazelCcHeaderAbiCheckerAttributes: bp2buildParseAbiCheckerProps(ctx, m),
-
-		Fdo_profile: compilerAttrs.fdoProfile,
-	}
-
-	if compilerAttrs.stubsSymbolFile != nil && len(compilerAttrs.stubsVersions.Value) > 0 {
-		sharedTargetAttrs.Stubs_symbol_file = compilerAttrs.stubsSymbolFile
-	}
-
-	sharedTargetAttrs.Stem = compilerAttrs.stem
-	sharedTargetAttrs.Suffix = compilerAttrs.suffix
-
-	for axis, configToProps := range m.GetArchVariantProperties(ctx, &LibraryProperties{}) {
-		for cfg, props := range configToProps {
-			if props, ok := props.(*LibraryProperties); ok {
-				if props.Inject_bssl_hash != nil {
-					// This is an edge case applies only to libcrypto
-					if m.Name() == "libcrypto" || m.Name() == "libcrypto_for_testing" {
-						sharedTargetAttrs.Inject_bssl_hash.SetSelectValue(axis, cfg, props.Inject_bssl_hash)
-					} else {
-						ctx.PropertyErrorf("inject_bssl_hash", "only applies to libcrypto")
-					}
-				}
-			}
-		}
-	}
-
-	staticProps := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_library_static",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_library_static.bzl",
-	}
-	sharedProps := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_library_shared",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_library_shared.bzl",
-	}
-
-	if _, ok := alwaysLinkLibraries[m.Name()]; ok {
-		staticTargetAttrs.Alwayslink = proptools.BoolPtr(true)
-	}
-
-	var tagsForStaticVariant bazel.StringListAttribute
-	if compilerAttrs.stubsSymbolFile == nil && len(compilerAttrs.stubsVersions.Value) == 0 {
-		tagsForStaticVariant = android.ApexAvailableTagsWithoutTestApexes(ctx, m)
-	}
-	tagsForStaticVariant.Append(bazel.StringListAttribute{Value: staticAttrs.Apex_available})
-
-	tagsForSharedVariant := android.ApexAvailableTagsWithoutTestApexes(ctx, m)
-	tagsForSharedVariant.Append(bazel.StringListAttribute{Value: sharedAttrs.Apex_available})
-
-	ctx.CreateBazelTargetModuleWithRestrictions(staticProps,
-		android.CommonAttributes{
-			Name: m.Name() + "_bp2build_cc_library_static",
-			Tags: tagsForStaticVariant,
-			// TODO: b/303307456 - Remove this when data is properly supported in cc rules.
-			SkipData: proptools.BoolPtr(true),
-		},
-		staticTargetAttrs, staticAttrs.Enabled)
-	ctx.CreateBazelTargetModuleWithRestrictions(sharedProps,
-		android.CommonAttributes{
-			Name: m.Name(),
-			Tags: tagsForSharedVariant,
-			// TODO: b/303307456 - Remove this when data is properly supported in cc rules.
-			SkipData: proptools.BoolPtr(true),
-		},
-		sharedTargetAttrs, sharedAttrs.Enabled)
-
-	createStubsBazelTargetIfNeeded(ctx, m, compilerAttrs, exportedIncludes, baseAttributes)
-}
-
-func createStubsBazelTargetIfNeeded(ctx android.Bp2buildMutatorContext, m *Module, compilerAttrs compilerAttributes, exportedIncludes BazelIncludes, baseAttributes baseAttributes) {
-	if compilerAttrs.stubsSymbolFile != nil && len(compilerAttrs.stubsVersions.Value) > 0 {
-		stubSuitesProps := bazel.BazelTargetModuleProperties{
-			Rule_class:        "cc_stub_suite",
-			Bzl_load_location: "//build/bazel/rules/cc:cc_stub_library.bzl",
-		}
-		soname := m.Name() + ".so"
-		stubSuitesAttrs := &bazelCcStubSuiteAttributes{
-			Symbol_file:          compilerAttrs.stubsSymbolFile,
-			Versions:             compilerAttrs.stubsVersions,
-			Export_includes:      exportedIncludes.Includes,
-			Soname:               &soname,
-			Source_library_label: proptools.StringPtr(m.GetBazelLabel(ctx, m)),
-			Deps:                 baseAttributes.deps,
-			Api_surface:          proptools.StringPtr("module-libapi"),
-		}
-		if _, isNdk := ctx.ModuleFromName(m.Name() + ".ndk"); isNdk {
-			stubSuitesAttrs.Included_in_ndk = proptools.BoolPtr(true)
-		}
-
-		ctx.CreateBazelTargetModule(stubSuitesProps, android.CommonAttributes{
-			Name: m.Name() + "_stub_libs",
-			// TODO: b/303307456 - Remove this when data is properly supported in cc rules.
-			SkipData: proptools.BoolPtr(true),
-		},
-			stubSuitesAttrs)
-
-		// Add alias for the stub shared_library in @api_surfaces repository
-		currentModuleLibApiDir := ctx.Config().ApiSurfacesDir(android.ModuleLibApi, "current")
-		actualLabelInMainWorkspace := bazel.Label{
-			Label: fmt.Sprintf("@//%s:%s%s", ctx.ModuleDir(), m.Name(), stubsSuffix),
-		}
-		ctx.CreateBazelTargetAliasInDir(currentModuleLibApiDir, m.Name(), actualLabelInMainWorkspace)
-
-		// Add alias for headers exported by the stub library
-		headerLabelInMainWorkspace := bazel.Label{
-			// This label is generated from cc_stub_suite macro
-			Label: fmt.Sprintf("@//%s:%s_stub_libs_%s_headers", ctx.ModuleDir(), m.Name(), android.ModuleLibApi.String()),
-		}
-		headerAlias := m.Name() + "_headers"
-		ctx.CreateBazelTargetAliasInDir(currentModuleLibApiDir, headerAlias, headerLabelInMainWorkspace)
-	}
-}
-
-// wrapper struct to flatten the arch and os specific export_include_dirs
-// flattening is necessary since we want to export apis of all arches even when we build for x86 (e.g.)
-type bazelCcApiLibraryHeadersAttributes struct {
-	bazelCcLibraryHeadersAttributes
-
-	Arch *string
-}
-
-func (a *bazelCcApiLibraryHeadersAttributes) isEmpty() bool {
-	return a.Export_includes.IsEmpty() &&
-		a.Export_system_includes.IsEmpty() &&
-		a.Deps.IsEmpty()
-}
-
-type apiIncludes struct {
-	name  string // name of the Bazel target in the generated bp2build workspace
-	attrs bazelCcApiLibraryHeadersAttributes
-}
-
-func (includes *apiIncludes) isEmpty() bool {
-	return includes.attrs.isEmpty()
-}
-
-func (includes *apiIncludes) addDep(name string) {
-	l := bazel.Label{Label: ":" + name}
-	ll := bazel.MakeLabelList([]bazel.Label{l})
-	lla := bazel.MakeLabelListAttribute(ll)
-	includes.attrs.Deps.Append(lla)
-}
-
 // cc_library creates both static and/or shared libraries for a device and/or
 // host. By default, a cc_library has a single variant that targets the device.
 // Specifying `host_supported: true` also creates a library that targets the
@@ -577,8 +230,6 @@
 		staticLibrarySdkMemberType,
 		staticAndSharedLibrarySdkMemberType,
 	}
-	module.bazelable = true
-	module.bazelHandler = &ccLibraryBazelHandler{module: module}
 	return module.Init()
 }
 
@@ -587,8 +238,6 @@
 	module, library := NewLibrary(android.HostAndDeviceSupported)
 	library.BuildOnlyStatic()
 	module.sdkMemberTypes = []android.SdkMemberType{staticLibrarySdkMemberType}
-	module.bazelable = true
-	module.bazelHandler = &ccLibraryBazelHandler{module: module}
 	return module.Init()
 }
 
@@ -597,8 +246,6 @@
 	module, library := NewLibrary(android.HostAndDeviceSupported)
 	library.BuildOnlyShared()
 	module.sdkMemberTypes = []android.SdkMemberType{sharedLibrarySdkMemberType}
-	module.bazelable = true
-	module.bazelHandler = &ccLibraryBazelHandler{module: module}
 	return module.Init()
 }
 
@@ -608,8 +255,6 @@
 	module, library := NewLibrary(android.HostSupported)
 	library.BuildOnlyStatic()
 	module.sdkMemberTypes = []android.SdkMemberType{staticLibrarySdkMemberType}
-	module.bazelable = true
-	module.bazelHandler = &ccLibraryBazelHandler{module: module}
 	return module.Init()
 }
 
@@ -618,8 +263,6 @@
 	module, library := NewLibrary(android.HostSupported)
 	library.BuildOnlyShared()
 	module.sdkMemberTypes = []android.SdkMemberType{sharedLibrarySdkMemberType}
-	module.bazelable = true
-	module.bazelHandler = &ccLibraryBazelHandler{module: module}
 	return module.Init()
 }
 
@@ -782,145 +425,6 @@
 	apiListCoverageXmlPath android.ModuleOutPath
 }
 
-type ccLibraryBazelHandler struct {
-	module *Module
-}
-
-var _ BazelHandler = (*ccLibraryBazelHandler)(nil)
-
-// generateStaticBazelBuildActions constructs the StaticLibraryInfo Soong
-// provider from a Bazel shared library's CcInfo provider.
-func (handler *ccLibraryBazelHandler) generateStaticBazelBuildActions(ctx android.ModuleContext, label string, ccInfo cquery.CcInfo) {
-	rootStaticArchives := ccInfo.RootStaticArchives
-	if len(rootStaticArchives) != 1 {
-		ctx.ModuleErrorf("expected exactly one root archive file for '%s', but got %s", label, rootStaticArchives)
-		return
-	}
-	var outputFilePath android.Path = android.PathForBazelOut(ctx, rootStaticArchives[0])
-	if len(ccInfo.TidyFiles) > 0 {
-		handler.module.tidyFiles = android.PathsForBazelOut(ctx, ccInfo.TidyFiles)
-		outputFilePath = android.AttachValidationActions(ctx, outputFilePath, handler.module.tidyFiles)
-	}
-	handler.module.outputFile = android.OptionalPathForPath(outputFilePath)
-
-	objPaths := ccInfo.CcObjectFiles
-	objFiles := make(android.Paths, len(objPaths))
-	for i, objPath := range objPaths {
-		objFiles[i] = android.PathForBazelOut(ctx, objPath)
-	}
-	objects := Objects{
-		objFiles: objFiles,
-	}
-
-	ctx.SetProvider(StaticLibraryInfoProvider, StaticLibraryInfo{
-		StaticLibrary: outputFilePath,
-		ReuseObjects:  objects,
-		Objects:       objects,
-
-		// TODO(b/190524881): Include transitive static libraries in this provider to support
-		// static libraries with deps.
-		TransitiveStaticLibrariesForOrdering: android.NewDepSetBuilder[android.Path](android.TOPOLOGICAL).
-			Direct(outputFilePath).
-			Build(),
-	})
-
-	return
-}
-
-// generateSharedBazelBuildActions constructs the SharedLibraryInfo Soong
-// provider from a Bazel shared library's CcInfo provider.
-func (handler *ccLibraryBazelHandler) generateSharedBazelBuildActions(ctx android.ModuleContext, label string, ccInfo cquery.CcInfo) {
-	rootDynamicLibraries := ccInfo.RootDynamicLibraries
-
-	if len(rootDynamicLibraries) != 1 {
-		ctx.ModuleErrorf("expected exactly one root dynamic library file for '%s', but got %s", label, rootDynamicLibraries)
-		return
-	}
-	var outputFilePath android.Path = android.PathForBazelOut(ctx, rootDynamicLibraries[0])
-	if len(ccInfo.TidyFiles) > 0 {
-		handler.module.tidyFiles = android.PathsForBazelOut(ctx, ccInfo.TidyFiles)
-		outputFilePath = android.AttachValidationActions(ctx, outputFilePath, handler.module.tidyFiles)
-	}
-
-	handler.module.outputFile = android.OptionalPathForPath(outputFilePath)
-	handler.module.linker.(*libraryDecorator).unstrippedOutputFile = android.PathForBazelOut(ctx, ccInfo.UnstrippedOutput)
-
-	var tocFile android.OptionalPath
-	if len(ccInfo.TocFile) > 0 {
-		tocFile = android.OptionalPathForPath(android.PathForBazelOut(ctx, ccInfo.TocFile))
-	}
-	handler.module.linker.(*libraryDecorator).tocFile = tocFile
-
-	if len(ccInfo.AbiDiffFiles) > 0 {
-		handler.module.linker.(*libraryDecorator).sAbiDiff = android.PathsForBazelOut(ctx, ccInfo.AbiDiffFiles)
-	}
-
-	ctx.SetProvider(SharedLibraryInfoProvider, SharedLibraryInfo{
-		TableOfContents: tocFile,
-		SharedLibrary:   outputFilePath,
-		Target:          ctx.Target(),
-		// TODO(b/190524881): Include transitive static libraries in this provider to support
-		// static libraries with deps. The provider key for this is TransitiveStaticLibrariesForOrdering.
-	})
-}
-
-func (handler *ccLibraryBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(label, cquery.GetCcInfo, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-	if v := handler.module.library.stubsVersion(); v != "" {
-		stubsLabel := label + "_stub_libs-" + v
-		bazelCtx.QueueBazelRequest(stubsLabel, cquery.GetCcInfo, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-	}
-}
-
-func (handler *ccLibraryBazelHandler) ProcessBazelQueryResponse(ctx android.ModuleContext, label string) {
-	if v := handler.module.library.stubsVersion(); v != "" {
-		// if we are a stubs variant, just use the Bazel stubs target
-		label = label + "_stub_libs-" + v
-	}
-	bazelCtx := ctx.Config().BazelContext
-	ccInfo, err := bazelCtx.GetCcInfo(label, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-	if err != nil {
-		ctx.ModuleErrorf("Error getting Bazel CcInfo: %s", err)
-		return
-	}
-
-	if handler.module.static() {
-		handler.generateStaticBazelBuildActions(ctx, label, ccInfo)
-	} else if handler.module.Shared() {
-		handler.generateSharedBazelBuildActions(ctx, label, ccInfo)
-	} else {
-		ctx.ModuleErrorf("Unhandled bazel case for %s (neither shared nor static!)", ctx.ModuleName())
-	}
-
-	handler.module.linker.(*libraryDecorator).setFlagExporterInfoFromCcInfo(ctx, ccInfo)
-	handler.module.maybeUnhideFromMake()
-
-	if i, ok := handler.module.linker.(snapshotLibraryInterface); ok {
-		// Dependencies on this library will expect collectedSnapshotHeaders to
-		// be set, otherwise validation will fail. For now, set this to an empty
-		// list.
-		// TODO(b/190533363): More closely mirror the collectHeadersForSnapshot
-		// implementation.
-		i.(*libraryDecorator).collectedSnapshotHeaders = android.Paths{}
-	}
-
-	handler.module.setAndroidMkVariablesFromCquery(ccInfo.CcAndroidMkInfo)
-
-	cctx := moduleContextFromAndroidModuleContext(ctx, handler.module)
-	addStubDependencyProviders(cctx)
-}
-
-func (library *libraryDecorator) setFlagExporterInfoFromCcInfo(ctx android.ModuleContext, ccInfo cquery.CcInfo) {
-	flagExporterInfo := flagExporterInfoFromCcInfo(ctx, ccInfo)
-	// flag exporters consolidates properties like includes, flags, dependencies that should be
-	// exported from this module to other modules
-	ctx.SetProvider(FlagExporterInfoProvider, flagExporterInfo)
-	// Store flag info to be passed along to androidmk
-	// TODO(b/184387147): Androidmk should be done in Bazel, not Soong.
-	library.flagExporterInfo = &flagExporterInfo
-}
-
 func GlobHeadersForSnapshot(ctx android.ModuleContext, paths android.Paths) android.Paths {
 	ret := android.Paths{}
 
@@ -935,11 +439,6 @@
 			continue
 		}
 
-		// Filter out the generated headers from bazel.
-		if strings.HasPrefix(dir, android.PathForBazelOut(ctx, "bazel-out").String()) {
-			continue
-		}
-
 		// libeigen wrongly exports the root directory "external/eigen". But only two
 		// subdirectories "Eigen" and "unsupported" contain exported header files. Even worse
 		// some of them have no extension. So we need special treatment for libeigen in order
@@ -2621,7 +2120,7 @@
 // normalizeVersions modifies `versions` in place, so that each raw version
 // string becomes its normalized canonical form.
 // Validates that the versions in `versions` are specified in least to greatest order.
-func normalizeVersions(ctx android.BazelConversionPathContext, versions []string) {
+func normalizeVersions(ctx android.BaseModuleContext, versions []string) {
 	var previous android.ApiLevel
 	for i, v := range versions {
 		ver, err := android.ApiLevelFromUser(ctx, v)
@@ -2792,263 +2291,3 @@
 
 	return outputFile
 }
-
-func bp2buildParseAbiCheckerProps(ctx android.Bp2buildMutatorContext, module *Module) bazelCcHeaderAbiCheckerAttributes {
-	lib, ok := module.linker.(*libraryDecorator)
-	if !ok {
-		return bazelCcHeaderAbiCheckerAttributes{}
-	}
-
-	abiChecker := lib.getHeaderAbiCheckerProperties(ctx)
-
-	abiCheckerAttrs := bazelCcHeaderAbiCheckerAttributes{
-		Abi_checker_enabled:                 abiChecker.Enabled,
-		Abi_checker_exclude_symbol_versions: abiChecker.Exclude_symbol_versions,
-		Abi_checker_exclude_symbol_tags:     abiChecker.Exclude_symbol_tags,
-		Abi_checker_check_all_apis:          abiChecker.Check_all_apis,
-		Abi_checker_diff_flags:              abiChecker.Diff_flags,
-	}
-	if abiChecker.Symbol_file != nil {
-		symbolFile := android.BazelLabelForModuleSrcSingle(ctx, *abiChecker.Symbol_file)
-		abiCheckerAttrs.Abi_checker_symbol_file = &symbolFile
-	}
-
-	return abiCheckerAttrs
-}
-
-func sharedOrStaticLibraryBp2Build(ctx android.Bp2buildMutatorContext, module *Module, isStatic bool) {
-	baseAttributes := bp2BuildParseBaseProps(ctx, module)
-	compilerAttrs := baseAttributes.compilerAttributes
-	linkerAttrs := baseAttributes.linkerAttributes
-
-	exportedIncludes := bp2BuildParseExportedIncludes(ctx, module, &compilerAttrs.includes)
-	includeAttrs := includesAttributes{
-		Export_includes:          exportedIncludes.Includes,
-		Export_absolute_includes: exportedIncludes.AbsoluteIncludes,
-		Export_system_includes:   exportedIncludes.SystemIncludes,
-		Local_includes:           compilerAttrs.localIncludes,
-		Absolute_includes:        compilerAttrs.absoluteIncludes,
-	}
-
-	// Append shared/static{} stanza properties. These won't be specified on
-	// cc_library_* itself, but may be specified in cc_defaults that this module
-	// depends on.
-	libSharedOrStaticAttrs := bp2BuildParseLibProps(ctx, module, isStatic)
-
-	compilerAttrs.srcs.Append(libSharedOrStaticAttrs.Srcs)
-	compilerAttrs.cSrcs.Append(libSharedOrStaticAttrs.Srcs_c)
-	compilerAttrs.asSrcs.Append(libSharedOrStaticAttrs.Srcs_as)
-	compilerAttrs.copts.Append(libSharedOrStaticAttrs.Copts)
-
-	linkerAttrs.deps.Append(libSharedOrStaticAttrs.Deps)
-	linkerAttrs.implementationDeps.Append(libSharedOrStaticAttrs.Implementation_deps)
-	linkerAttrs.dynamicDeps.Append(libSharedOrStaticAttrs.Dynamic_deps)
-	linkerAttrs.implementationDynamicDeps.Append(libSharedOrStaticAttrs.Implementation_dynamic_deps)
-	linkerAttrs.systemDynamicDeps.Append(libSharedOrStaticAttrs.System_dynamic_deps)
-
-	asFlags := compilerAttrs.asFlags
-	if compilerAttrs.asSrcs.IsEmpty() {
-		// Skip asflags for BUILD file simplicity if there are no assembly sources.
-		asFlags = bazel.MakeStringListAttribute(nil)
-	}
-
-	features := baseAttributes.features.Clone().Append(libSharedOrStaticAttrs.Features)
-	features.DeduplicateAxesFromBase()
-
-	commonAttrs := staticOrSharedAttributes{
-		Srcs:    compilerAttrs.srcs,
-		Srcs_c:  compilerAttrs.cSrcs,
-		Srcs_as: compilerAttrs.asSrcs,
-		Copts:   compilerAttrs.copts,
-		Hdrs:    compilerAttrs.hdrs,
-
-		Deps:                              linkerAttrs.deps,
-		Implementation_deps:               linkerAttrs.implementationDeps,
-		Dynamic_deps:                      linkerAttrs.dynamicDeps,
-		Implementation_dynamic_deps:       linkerAttrs.implementationDynamicDeps,
-		Whole_archive_deps:                linkerAttrs.wholeArchiveDeps,
-		Implementation_whole_archive_deps: linkerAttrs.implementationWholeArchiveDeps,
-		System_dynamic_deps:               linkerAttrs.systemDynamicDeps,
-		SdkAttributes:                     Bp2BuildParseSdkAttributes(module),
-		Runtime_deps:                      linkerAttrs.runtimeDeps,
-		Native_coverage:                   baseAttributes.Native_coverage,
-		Additional_compiler_inputs:        compilerAttrs.additionalCompilerInputs,
-	}
-
-	module.convertTidyAttributes(ctx, &commonAttrs.tidyAttributes)
-
-	var attrs interface{}
-	if isStatic {
-		commonAttrs.Deps.Add(baseAttributes.protoDependency)
-		var alwayslink *bool
-		if _, ok := alwaysLinkLibraries[module.Name()]; ok && isStatic {
-			alwayslink = proptools.BoolPtr(true)
-		}
-		attrs = &bazelCcLibraryStaticAttributes{
-			staticOrSharedAttributes: commonAttrs,
-			Rtti:                     compilerAttrs.rtti,
-			Stl:                      compilerAttrs.stl,
-			Cpp_std:                  compilerAttrs.cppStd,
-			C_std:                    compilerAttrs.cStd,
-
-			includesAttributes: includeAttrs,
-
-			Cppflags:   compilerAttrs.cppFlags,
-			Conlyflags: compilerAttrs.conlyFlags,
-			Asflags:    asFlags,
-
-			Alwayslink: alwayslink,
-			Features:   *features,
-		}
-
-	} else {
-		commonAttrs.Dynamic_deps.Add(baseAttributes.protoDependency)
-
-		sharedLibAttrs := &bazelCcLibrarySharedAttributes{
-			staticOrSharedAttributes: commonAttrs,
-
-			Cppflags:   compilerAttrs.cppFlags,
-			Conlyflags: compilerAttrs.conlyFlags,
-			Asflags:    asFlags,
-
-			Linkopts:        linkerAttrs.linkopts,
-			Use_version_lib: linkerAttrs.useVersionLib,
-
-			Rtti:    compilerAttrs.rtti,
-			Stl:     compilerAttrs.stl,
-			Cpp_std: compilerAttrs.cppStd,
-			C_std:   compilerAttrs.cStd,
-
-			includesAttributes: includeAttrs,
-
-			Additional_linker_inputs: linkerAttrs.additionalLinkerInputs,
-
-			Strip: stripAttrsFromLinkerAttrs(&linkerAttrs),
-
-			Features: *features,
-
-			Stem:   compilerAttrs.stem,
-			Suffix: compilerAttrs.suffix,
-
-			bazelCcHeaderAbiCheckerAttributes: bp2buildParseAbiCheckerProps(ctx, module),
-
-			Fdo_profile: compilerAttrs.fdoProfile,
-		}
-		if compilerAttrs.stubsSymbolFile != nil && len(compilerAttrs.stubsVersions.Value) > 0 {
-			sharedLibAttrs.Stubs_symbol_file = compilerAttrs.stubsSymbolFile
-		}
-		attrs = sharedLibAttrs
-	}
-
-	var modType string
-	if isStatic {
-		modType = "cc_library_static"
-	} else {
-		modType = "cc_library_shared"
-		createStubsBazelTargetIfNeeded(ctx, module, compilerAttrs, exportedIncludes, baseAttributes)
-	}
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        modType,
-		Bzl_load_location: fmt.Sprintf("//build/bazel/rules/cc:%s.bzl", modType),
-	}
-
-	tags := android.ApexAvailableTagsWithoutTestApexes(ctx, module)
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{
-		Name: module.Name(),
-		Tags: tags,
-		// TODO: b/303307456 - Remove this when data is properly supported in cc rules.
-		SkipData: proptools.BoolPtr(true),
-	}, attrs)
-}
-
-type includesAttributes struct {
-	Export_includes          bazel.StringListAttribute
-	Export_absolute_includes bazel.StringListAttribute
-	Export_system_includes   bazel.StringListAttribute
-	Local_includes           bazel.StringListAttribute
-	Absolute_includes        bazel.StringListAttribute
-}
-
-// TODO(b/199902614): Can this be factored to share with the other Attributes?
-type bazelCcLibraryStaticAttributes struct {
-	staticOrSharedAttributes
-	includesAttributes
-
-	Use_version_lib bazel.BoolAttribute
-	Rtti            bazel.BoolAttribute
-	Stl             *string
-	Cpp_std         *string
-	C_std           *string
-
-	Hdrs bazel.LabelListAttribute
-
-	Cppflags   bazel.StringListAttribute
-	Conlyflags bazel.StringListAttribute
-	Asflags    bazel.StringListAttribute
-
-	Alwayslink *bool
-	Features   bazel.StringListAttribute
-}
-
-// TODO(b/199902614): Can this be factored to share with the other Attributes?
-type bazelCcLibrarySharedAttributes struct {
-	staticOrSharedAttributes
-	includesAttributes
-
-	Linkopts        bazel.StringListAttribute
-	Use_version_lib bazel.BoolAttribute
-
-	Rtti    bazel.BoolAttribute
-	Stl     *string
-	Cpp_std *string
-	C_std   *string
-
-	Hdrs bazel.LabelListAttribute
-
-	Strip                    stripAttributes
-	Additional_linker_inputs bazel.LabelListAttribute
-
-	Cppflags   bazel.StringListAttribute
-	Conlyflags bazel.StringListAttribute
-	Asflags    bazel.StringListAttribute
-
-	Features bazel.StringListAttribute
-
-	Stubs_symbol_file *string
-
-	Inject_bssl_hash bazel.BoolAttribute
-
-	Stem   bazel.StringAttribute
-	Suffix bazel.StringAttribute
-
-	bazelCcHeaderAbiCheckerAttributes
-
-	Fdo_profile bazel.LabelAttribute
-}
-
-type bazelCcStubSuiteAttributes struct {
-	Symbol_file          *string
-	Versions             bazel.StringListAttribute
-	Export_includes      bazel.StringListAttribute
-	Source_library_label *string
-	Soname               *string
-	Deps                 bazel.LabelListAttribute
-	Api_surface          *string
-
-	// Unless the library is in the NDK, module-libapi stubs should *not* include the public symbols
-	// Soong uses a global variable to determine if the library is in the NDK
-	// Since Bazel does not have global analysis, create an explicit property
-	// This property is only relevant if `api_surface = module-libapi`
-	// https://cs.android.com/android/_/android/platform/build/soong/+/main:cc/library.go;l=1214-1219;drc=7123cc5370a38983ee6325b5f5f6df19f4e4f10b;bpv=1;bpt=0
-	Included_in_ndk *bool
-}
-
-type bazelCcHeaderAbiCheckerAttributes struct {
-	Abi_checker_enabled                 *bool
-	Abi_checker_symbol_file             *bazel.Label
-	Abi_checker_exclude_symbol_versions []string
-	Abi_checker_exclude_symbol_tags     []string
-	Abi_checker_check_all_apis          *bool
-	Abi_checker_diff_flags              []string
-}
diff --git a/cc/library_headers.go b/cc/library_headers.go
index 2e5a195..98533b2 100644
--- a/cc/library_headers.go
+++ b/cc/library_headers.go
@@ -16,8 +16,6 @@
 
 import (
 	"android/soong/android"
-	"android/soong/bazel"
-	"android/soong/bazel/cquery"
 )
 
 func init() {
@@ -48,52 +46,6 @@
 	ctx.RegisterModuleType("cc_prebuilt_library_headers", prebuiltLibraryHeaderFactory)
 }
 
-type libraryHeaderBazelHandler struct {
-	module  *Module
-	library *libraryDecorator
-}
-
-var _ BazelHandler = (*libraryHeaderBazelHandler)(nil)
-
-func (handler *libraryHeaderBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(label, cquery.GetCcInfo, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-}
-
-func (h *libraryHeaderBazelHandler) ProcessBazelQueryResponse(ctx android.ModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	ccInfo, err := bazelCtx.GetCcInfo(label, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-
-	outputPaths := ccInfo.OutputFiles
-	if len(outputPaths) != 1 {
-		ctx.ModuleErrorf("expected exactly one output file for %q, but got %q", label, outputPaths)
-		return
-	}
-
-	var outputPath android.Path = android.PathForBazelOut(ctx, outputPaths[0])
-	if len(ccInfo.TidyFiles) > 0 {
-		h.module.tidyFiles = android.PathsForBazelOut(ctx, ccInfo.TidyFiles)
-		outputPath = android.AttachValidationActions(ctx, outputPath, h.module.tidyFiles)
-	}
-	h.module.outputFile = android.OptionalPathForPath(outputPath)
-
-	// HeaderLibraryInfo is an empty struct to indicate to dependencies that this is a header library
-	ctx.SetProvider(HeaderLibraryInfoProvider, HeaderLibraryInfo{})
-
-	h.library.setFlagExporterInfoFromCcInfo(ctx, ccInfo)
-
-	// Dependencies on this library will expect collectedSnapshotHeaders to be set, otherwise
-	// validation will fail. For now, set this to an empty list.
-	// TODO(cparsons): More closely mirror the collectHeadersForSnapshot implementation.
-	h.library.collectedSnapshotHeaders = android.Paths{}
-
-	h.module.setAndroidMkVariablesFromCquery(ccInfo.CcAndroidMkInfo)
-}
-
 // cc_library_headers contains a set of c/c++ headers which are imported by
 // other soong cc modules using the header_libs property. For best practices,
 // use export_include_dirs property or LOCAL_EXPORT_C_INCLUDE_DIRS for
@@ -102,8 +54,6 @@
 	module, library := NewLibrary(android.HostAndDeviceSupported)
 	library.HeaderOnly()
 	module.sdkMemberTypes = []android.SdkMemberType{headersLibrarySdkMemberType}
-	module.bazelable = true
-	module.bazelHandler = &libraryHeaderBazelHandler{module: module, library: library}
 	return module.Init()
 }
 
@@ -111,50 +61,5 @@
 func prebuiltLibraryHeaderFactory() android.Module {
 	module, library := NewPrebuiltLibrary(android.HostAndDeviceSupported, "")
 	library.HeaderOnly()
-	module.bazelable = true
-	module.bazelHandler = &ccLibraryBazelHandler{module: module}
 	return module.Init()
 }
-
-type bazelCcLibraryHeadersAttributes struct {
-	Hdrs                     bazel.LabelListAttribute
-	Export_includes          bazel.StringListAttribute
-	Export_absolute_includes bazel.StringListAttribute
-	Export_system_includes   bazel.StringListAttribute
-	Deps                     bazel.LabelListAttribute
-	SdkAttributes
-}
-
-func libraryHeadersBp2Build(ctx android.Bp2buildMutatorContext, module *Module) {
-	baseAttributes := bp2BuildParseBaseProps(ctx, module)
-	exportedIncludes := bp2BuildParseExportedIncludes(ctx, module, &baseAttributes.includes)
-	linkerAttrs := baseAttributes.linkerAttributes
-	(&linkerAttrs.deps).Append(linkerAttrs.dynamicDeps)
-	(&linkerAttrs.deps).Append(linkerAttrs.wholeArchiveDeps)
-
-	attrs := &bazelCcLibraryHeadersAttributes{
-		Export_includes:          exportedIncludes.Includes,
-		Export_absolute_includes: exportedIncludes.AbsoluteIncludes,
-		Export_system_includes:   exportedIncludes.SystemIncludes,
-		Deps:                     linkerAttrs.deps,
-		Hdrs:                     baseAttributes.hdrs,
-		SdkAttributes:            Bp2BuildParseSdkAttributes(module),
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_library_headers",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_library_headers.bzl",
-	}
-
-	tags := android.ApexAvailableTagsWithoutTestApexes(ctx, module)
-
-	name := module.Name()
-	if module.IsPrebuilt() {
-		name = android.RemoveOptionalPrebuiltPrefix(name)
-	}
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{
-		Name: name,
-		Tags: tags,
-	}, attrs)
-}
diff --git a/cc/library_sdk_member.go b/cc/library_sdk_member.go
index e743bb6..52e78d7 100644
--- a/cc/library_sdk_member.go
+++ b/cc/library_sdk_member.go
@@ -251,16 +251,9 @@
 	return &nativeLibInfoProperties{memberType: mt}
 }
 
-func isBazelOutDirectory(p android.Path) bool {
-	_, bazel := p.(android.BazelOutPath)
-	return bazel
-}
-
 func isGeneratedHeaderDirectory(p android.Path) bool {
 	_, gen := p.(android.WritablePath)
-	// TODO(b/183213331): Here we assume that bazel-based headers are not generated; we need
-	// to support generated headers in mixed builds.
-	return gen && !isBazelOutDirectory(p)
+	return gen
 }
 
 type includeDirsProperty struct {
diff --git a/cc/library_test.go b/cc/library_test.go
index dbe2be8..2ed2d76 100644
--- a/cc/library_test.go
+++ b/cc/library_test.go
@@ -19,7 +19,6 @@
 	"testing"
 
 	"android/soong/android"
-	"android/soong/bazel/cquery"
 )
 
 func TestLibraryReuse(t *testing.T) {
@@ -246,137 +245,6 @@
 	testCcError(t, `"libfoo" .*: versions: "X" could not be parsed as an integer and is not a recognized codename`, bp)
 }
 
-func TestCcLibraryWithBazel(t *testing.T) {
-	t.Parallel()
-	bp := `
-cc_library {
-	name: "foo",
-	srcs: ["foo.cc"],
-	bazel_module: { label: "//foo/bar:bar" },
-}`
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir: "outputbase",
-		LabelToCcInfo: map[string]cquery.CcInfo{
-			"//foo/bar:bar": cquery.CcInfo{
-				CcObjectFiles:        []string{"foo.o"},
-				Includes:             []string{"include"},
-				SystemIncludes:       []string{"system_include"},
-				Headers:              []string{"foo.h"},
-				RootDynamicLibraries: []string{"foo.so"},
-				UnstrippedOutput:     "foo_unstripped.so",
-			},
-			"//foo/bar:bar_bp2build_cc_library_static": cquery.CcInfo{
-				CcObjectFiles:      []string{"foo.o"},
-				Includes:           []string{"include"},
-				SystemIncludes:     []string{"system_include"},
-				Headers:            []string{"foo.h"},
-				RootStaticArchives: []string{"foo.a"},
-			},
-		},
-	}
-	ctx := testCcWithConfig(t, config)
-
-	staticFoo := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon_static").Module()
-	outputFiles, err := staticFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-
-	expectedOutputFiles := []string{"outputbase/execroot/__main__/foo.a"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
-
-	flagExporter := ctx.ModuleProvider(staticFoo, FlagExporterInfoProvider).(FlagExporterInfo)
-	android.AssertPathsRelativeToTopEquals(t, "exported include dirs", []string{"outputbase/execroot/__main__/include"}, flagExporter.IncludeDirs)
-	android.AssertPathsRelativeToTopEquals(t, "exported system include dirs", []string{"outputbase/execroot/__main__/system_include"}, flagExporter.SystemIncludeDirs)
-	android.AssertPathsRelativeToTopEquals(t, "exported headers", []string{"outputbase/execroot/__main__/foo.h"}, flagExporter.GeneratedHeaders)
-	android.AssertPathsRelativeToTopEquals(t, "deps", []string{"outputbase/execroot/__main__/foo.h"}, flagExporter.Deps)
-
-	sharedFoo := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
-	outputFiles, err = sharedFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_library outputfiles %s", err)
-	}
-	expectedOutputFiles = []string{"outputbase/execroot/__main__/foo.so"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
-
-	android.AssertStringEquals(t, "unstripped shared library", "outputbase/execroot/__main__/foo_unstripped.so", sharedFoo.(*Module).linker.unstrippedOutputFilePath().String())
-	flagExporter = ctx.ModuleProvider(sharedFoo, FlagExporterInfoProvider).(FlagExporterInfo)
-	android.AssertPathsRelativeToTopEquals(t, "exported include dirs", []string{"outputbase/execroot/__main__/include"}, flagExporter.IncludeDirs)
-	android.AssertPathsRelativeToTopEquals(t, "exported system include dirs", []string{"outputbase/execroot/__main__/system_include"}, flagExporter.SystemIncludeDirs)
-	android.AssertPathsRelativeToTopEquals(t, "exported headers", []string{"outputbase/execroot/__main__/foo.h"}, flagExporter.GeneratedHeaders)
-	android.AssertPathsRelativeToTopEquals(t, "deps", []string{"outputbase/execroot/__main__/foo.h"}, flagExporter.Deps)
-}
-
-func TestCcLibraryWithBazelValidations(t *testing.T) {
-	t.Parallel()
-	bp := `
-cc_library {
-	name: "foo",
-	srcs: ["foo.cc"],
-	bazel_module: { label: "//foo/bar:bar" },
-	tidy: true,
-}`
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir: "outputbase",
-		LabelToCcInfo: map[string]cquery.CcInfo{
-			"//foo/bar:bar": cquery.CcInfo{
-				CcObjectFiles:        []string{"foo.o"},
-				Includes:             []string{"include"},
-				SystemIncludes:       []string{"system_include"},
-				Headers:              []string{"foo.h"},
-				RootDynamicLibraries: []string{"foo.so"},
-				UnstrippedOutput:     "foo_unstripped.so",
-			},
-			"//foo/bar:bar_bp2build_cc_library_static": cquery.CcInfo{
-				CcObjectFiles:      []string{"foo.o"},
-				Includes:           []string{"include"},
-				SystemIncludes:     []string{"system_include"},
-				Headers:            []string{"foo.h"},
-				RootStaticArchives: []string{"foo.a"},
-				TidyFiles:          []string{"foo.c.tidy"},
-			},
-		},
-	}
-	ctx := android.GroupFixturePreparers(
-		prepareForCcTest,
-		android.FixtureMergeEnv(map[string]string{
-			"ALLOW_LOCAL_TIDY_TRUE": "1",
-		}),
-	).RunTestWithConfig(t, config).TestContext
-
-	staticFoo := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon_static").Module()
-	outputFiles, err := staticFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-
-	expectedOutputFiles := []string{"out/soong/.intermediates/foo/android_arm_armv7-a-neon_static/validated/foo.a"}
-	android.AssertPathsRelativeToTopEquals(t, "output files", expectedOutputFiles, outputFiles)
-
-	flagExporter := ctx.ModuleProvider(staticFoo, FlagExporterInfoProvider).(FlagExporterInfo)
-	android.AssertPathsRelativeToTopEquals(t, "exported include dirs", []string{"outputbase/execroot/__main__/include"}, flagExporter.IncludeDirs)
-	android.AssertPathsRelativeToTopEquals(t, "exported system include dirs", []string{"outputbase/execroot/__main__/system_include"}, flagExporter.SystemIncludeDirs)
-	android.AssertPathsRelativeToTopEquals(t, "exported headers", []string{"outputbase/execroot/__main__/foo.h"}, flagExporter.GeneratedHeaders)
-	android.AssertPathsRelativeToTopEquals(t, "deps", []string{"outputbase/execroot/__main__/foo.h"}, flagExporter.Deps)
-
-	sharedFoo := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
-	outputFiles, err = sharedFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_library outputfiles %s", err)
-	}
-	expectedOutputFiles = []string{"outputbase/execroot/__main__/foo.so"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
-
-	android.AssertStringEquals(t, "unstripped shared library", "outputbase/execroot/__main__/foo_unstripped.so", sharedFoo.(*Module).linker.unstrippedOutputFilePath().String())
-	flagExporter = ctx.ModuleProvider(sharedFoo, FlagExporterInfoProvider).(FlagExporterInfo)
-	android.AssertPathsRelativeToTopEquals(t, "exported include dirs", []string{"outputbase/execroot/__main__/include"}, flagExporter.IncludeDirs)
-	android.AssertPathsRelativeToTopEquals(t, "exported system include dirs", []string{"outputbase/execroot/__main__/system_include"}, flagExporter.SystemIncludeDirs)
-	android.AssertPathsRelativeToTopEquals(t, "exported headers", []string{"outputbase/execroot/__main__/foo.h"}, flagExporter.GeneratedHeaders)
-	android.AssertPathsRelativeToTopEquals(t, "deps", []string{"outputbase/execroot/__main__/foo.h"}, flagExporter.Deps)
-}
-
 func TestLibraryVersionScript(t *testing.T) {
 	t.Parallel()
 	result := PrepareForIntegrationTestWithCc.RunTestWithBp(t, `
@@ -413,107 +281,6 @@
 
 }
 
-func TestCcLibrarySharedWithBazelValidations(t *testing.T) {
-	t.Parallel()
-	bp := `
-cc_library_shared {
-	name: "foo",
-	srcs: ["foo.cc"],
-	bazel_module: { label: "//foo/bar:bar" },
-	tidy: true,
-}`
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir: "outputbase",
-		LabelToCcInfo: map[string]cquery.CcInfo{
-			"//foo/bar:bar": cquery.CcInfo{
-				CcObjectFiles:        []string{"foo.o"},
-				Includes:             []string{"include"},
-				SystemIncludes:       []string{"system_include"},
-				RootDynamicLibraries: []string{"foo.so"},
-				TocFile:              "foo.so.toc",
-				TidyFiles:            []string{"foo.c.tidy"},
-			},
-		},
-	}
-	ctx := android.GroupFixturePreparers(
-		prepareForCcTest,
-		android.FixtureMergeEnv(map[string]string{
-			"ALLOW_LOCAL_TIDY_TRUE": "1",
-		}),
-	).RunTestWithConfig(t, config).TestContext
-
-	sharedFoo := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
-	producer := sharedFoo.(android.OutputFileProducer)
-	outputFiles, err := producer.OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{"out/soong/.intermediates/foo/android_arm_armv7-a-neon_shared/validated/foo.so"}
-	android.AssertPathsRelativeToTopEquals(t, "output files", expectedOutputFiles, outputFiles)
-
-	tocFilePath := sharedFoo.(*Module).Toc()
-	if !tocFilePath.Valid() {
-		t.Errorf("Invalid tocFilePath: %s", tocFilePath)
-	}
-	tocFile := tocFilePath.Path()
-	expectedToc := "outputbase/execroot/__main__/foo.so.toc"
-	android.AssertStringEquals(t, "toc file", expectedToc, tocFile.String())
-
-	entries := android.AndroidMkEntriesForTest(t, ctx, sharedFoo)[0]
-	expectedFlags := []string{"-Ioutputbase/execroot/__main__/include", "-isystem outputbase/execroot/__main__/system_include"}
-	gotFlags := entries.EntryMap["LOCAL_EXPORT_CFLAGS"]
-	android.AssertDeepEquals(t, "androidmk exported cflags", expectedFlags, gotFlags)
-	android.AssertStringEquals(t, "unexpected LOCAL_SOONG_MODULE_TYPE", "cc_library_shared", entries.EntryMap["LOCAL_SOONG_MODULE_TYPE"][0])
-}
-
-func TestCcLibrarySharedWithBazel(t *testing.T) {
-	t.Parallel()
-	bp := `
-cc_library_shared {
-	name: "foo",
-	srcs: ["foo.cc"],
-	bazel_module: { label: "//foo/bar:bar" },
-}`
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir: "outputbase",
-		LabelToCcInfo: map[string]cquery.CcInfo{
-			"//foo/bar:bar": cquery.CcInfo{
-				CcObjectFiles:        []string{"foo.o"},
-				Includes:             []string{"include"},
-				SystemIncludes:       []string{"system_include"},
-				RootDynamicLibraries: []string{"foo.so"},
-				TocFile:              "foo.so.toc",
-			},
-		},
-	}
-	ctx := testCcWithConfig(t, config)
-
-	sharedFoo := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
-	producer := sharedFoo.(android.OutputFileProducer)
-	outputFiles, err := producer.OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{"outputbase/execroot/__main__/foo.so"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
-
-	tocFilePath := sharedFoo.(*Module).Toc()
-	if !tocFilePath.Valid() {
-		t.Errorf("Invalid tocFilePath: %s", tocFilePath)
-	}
-	tocFile := tocFilePath.Path()
-	expectedToc := "outputbase/execroot/__main__/foo.so.toc"
-	android.AssertStringEquals(t, "toc file", expectedToc, tocFile.String())
-
-	entries := android.AndroidMkEntriesForTest(t, ctx, sharedFoo)[0]
-	expectedFlags := []string{"-Ioutputbase/execroot/__main__/include", "-isystem outputbase/execroot/__main__/system_include"}
-	gotFlags := entries.EntryMap["LOCAL_EXPORT_CFLAGS"]
-	android.AssertDeepEquals(t, "androidmk exported cflags", expectedFlags, gotFlags)
-	android.AssertStringEquals(t, "unexpected LOCAL_SOONG_MODULE_TYPE", "cc_library_shared", entries.EntryMap["LOCAL_SOONG_MODULE_TYPE"][0])
-}
-
 func TestWholeStaticLibPrebuilts(t *testing.T) {
 	t.Parallel()
 	result := PrepareForIntegrationTestWithCc.RunTestWithBp(t, `
diff --git a/cc/linkable.go b/cc/linkable.go
index 5b5b856..994517c 100644
--- a/cc/linkable.go
+++ b/cc/linkable.go
@@ -2,7 +2,6 @@
 
 import (
 	"android/soong/android"
-	"android/soong/bazel/cquery"
 	"android/soong/fuzz"
 	"android/soong/snapshot"
 
@@ -431,19 +430,3 @@
 }
 
 var FlagExporterInfoProvider = blueprint.NewProvider(FlagExporterInfo{})
-
-// flagExporterInfoFromCcInfo populates FlagExporterInfo provider with information from Bazel.
-func flagExporterInfoFromCcInfo(ctx android.ModuleContext, ccInfo cquery.CcInfo) FlagExporterInfo {
-
-	includes := android.PathsForBazelOut(ctx, ccInfo.Includes)
-	systemIncludes := android.PathsForBazelOut(ctx, ccInfo.SystemIncludes)
-	headers := android.PathsForBazelOut(ctx, ccInfo.Headers)
-
-	return FlagExporterInfo{
-		IncludeDirs:       android.FirstUniquePaths(includes),
-		SystemIncludeDirs: android.FirstUniquePaths(systemIncludes),
-		GeneratedHeaders:  headers,
-		// necessary to ensure generated headers are considered implicit deps of dependent actions
-		Deps: headers,
-	}
-}
diff --git a/cc/ndk_headers.go b/cc/ndk_headers.go
index 461aa96..0fbc8d0 100644
--- a/cc/ndk_headers.go
+++ b/cc/ndk_headers.go
@@ -18,11 +18,8 @@
 	"fmt"
 	"path/filepath"
 
-	"github.com/google/blueprint"
-	"github.com/google/blueprint/proptools"
-
 	"android/soong/android"
-	"android/soong/bazel"
+	"github.com/google/blueprint"
 )
 
 var (
@@ -81,7 +78,6 @@
 
 type headerModule struct {
 	android.ModuleBase
-	android.BazelModuleBase
 
 	properties headerProperties
 
@@ -148,30 +144,6 @@
 	}
 }
 
-type bazelNdkHeadersAttributes struct {
-	Strip_import_prefix *string
-	Import_prefix       *string
-	Hdrs                bazel.LabelListAttribute
-	Run_versioner       *bool
-}
-
-func (h *headerModule) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "ndk_headers",
-		Bzl_load_location: "//build/bazel/rules/cc:ndk_headers.bzl",
-	}
-	attrs := &bazelNdkHeadersAttributes{
-		Strip_import_prefix: h.properties.From,
-		Import_prefix:       h.properties.To,
-		Hdrs:                bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrcExcludes(ctx, h.properties.Srcs, h.properties.Exclude_srcs)),
-	}
-	ctx.CreateBazelTargetModule(
-		props,
-		android.CommonAttributes{Name: h.Name()},
-		attrs,
-	)
-}
-
 // ndk_headers installs the sets of ndk headers defined in the srcs property
 // to the sysroot base + "usr/include" + to directory + directory component.
 // ndk_headers requires the license file to be specified. Example:
@@ -186,7 +158,6 @@
 	module := &headerModule{}
 	module.AddProperties(&module.properties)
 	android.InitAndroidModule(module)
-	android.InitBazelModule(module)
 	return module
 }
 
@@ -219,7 +190,6 @@
 // Note that this is really only built to handle bionic/libc/include.
 type versionedHeaderModule struct {
 	android.ModuleBase
-	android.BazelModuleBase
 
 	properties versionedHeaderProperties
 
@@ -258,25 +228,6 @@
 	processHeadersWithVersioner(ctx, fromSrcPath, toOutputPath, m.srcPaths, installPaths)
 }
 
-func (h *versionedHeaderModule) ConvertWithBp2build(ctx android.Bp2buildMutatorContext) {
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "ndk_headers",
-		Bzl_load_location: "//build/bazel/rules/cc:ndk_headers.bzl",
-	}
-	globPattern := headerGlobPattern(proptools.String(h.properties.From))
-	attrs := &bazelNdkHeadersAttributes{
-		Strip_import_prefix: h.properties.From,
-		Import_prefix:       h.properties.To,
-		Run_versioner:       proptools.BoolPtr(true),
-		Hdrs:                bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, []string{globPattern})),
-	}
-	ctx.CreateBazelTargetModule(
-		props,
-		android.CommonAttributes{Name: h.Name()},
-		attrs,
-	)
-}
-
 func processHeadersWithVersioner(ctx android.ModuleContext, srcDir, outDir android.Path,
 	srcPaths android.Paths, installPaths []android.WritablePath) android.Path {
 	// The versioner depends on a dependencies directory to simplify determining include paths
@@ -326,7 +277,6 @@
 	module.AddProperties(&module.properties)
 
 	android.InitAndroidModule(module)
-	android.InitBazelModule(module)
 
 	return module
 }
diff --git a/cc/ndk_library.go b/cc/ndk_library.go
index 348c3bc..98fb334 100644
--- a/cc/ndk_library.go
+++ b/cc/ndk_library.go
@@ -25,7 +25,6 @@
 	"github.com/google/blueprint/proptools"
 
 	"android/soong/android"
-	"android/soong/bazel"
 	"android/soong/cc/config"
 )
 
@@ -563,51 +562,5 @@
 func NdkLibraryFactory() android.Module {
 	module := newStubLibrary()
 	android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibBoth)
-	android.InitBazelModule(module)
 	return module
 }
-
-type bazelCcApiContributionAttributes struct {
-	Api          bazel.LabelAttribute
-	Api_surfaces bazel.StringListAttribute
-	Hdrs         bazel.LabelListAttribute
-	Library_name string
-}
-
-func ndkLibraryBp2build(ctx android.Bp2buildMutatorContext, c *Module) {
-	ndk, _ := c.linker.(*stubDecorator)
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_stub_suite",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_stub_library.bzl",
-	}
-	sourceLibraryName := strings.TrimSuffix(c.Name(), ".ndk")
-	fromApiLevel, err := android.ApiLevelFromUser(ctx, proptools.String(ndk.properties.First_version))
-	if err != nil {
-		ctx.PropertyErrorf("first_version", "error converting first_version %v", proptools.String(ndk.properties.First_version))
-	}
-	symbolFileLabel := android.BazelLabelForModuleSrcSingle(ctx, proptools.String(ndk.properties.Symbol_file))
-	attrs := &bazelCcStubSuiteAttributes{
-		// TODO - b/300504837 Add ndk headers
-		Symbol_file:     proptools.StringPtr(symbolFileLabel.Label),
-		Soname:          proptools.StringPtr(sourceLibraryName + ".so"),
-		Api_surface:     proptools.StringPtr(android.PublicApi.String()),
-		Included_in_ndk: proptools.BoolPtr(true),
-	}
-	if sourceLibrary, exists := ctx.ModuleFromName(sourceLibraryName); exists {
-		// the source library might not exist in minimal/unbuildable branches like kernel-build-tools.
-		// check for its existence
-		attrs.Source_library_label = proptools.StringPtr(c.GetBazelLabel(ctx, sourceLibrary))
-	}
-	if ctx.Config().RawPlatformSdkVersion() != nil {
-		// This is a hack to populate `versions` only on branches that set a platform_sdk_version
-		// This prevents errors on branches such as kernel-build-tools
-		// This hack is acceptable since we are not required to support NDK Bazel builds on those branches
-		attrs.Versions = bazel.MakeStringListAttribute(ndkLibraryVersions(ctx, fromApiLevel))
-	}
-
-	ctx.CreateBazelTargetModule(
-		props,
-		android.CommonAttributes{Name: c.Name() + "_stub_libs"},
-		attrs,
-	)
-}
diff --git a/cc/ndk_prebuilt.go b/cc/ndk_prebuilt.go
index c3e6510..842bdf6 100644
--- a/cc/ndk_prebuilt.go
+++ b/cc/ndk_prebuilt.go
@@ -15,11 +15,9 @@
 package cc
 
 import (
-	"path/filepath"
 	"strings"
 
 	"android/soong/android"
-	"android/soong/bazel"
 )
 
 func init() {
@@ -66,7 +64,6 @@
 	module.Properties.Sdk_version = StringPtr("minimum")
 	module.Properties.AlwaysSdk = true
 	module.stl.Properties.Stl = StringPtr("none")
-	module.bazelable = true
 	return module.Init()
 }
 
@@ -87,7 +84,6 @@
 	module.Properties.AlwaysSdk = true
 	module.Properties.Sdk_version = StringPtr("current")
 	module.stl.Properties.Stl = StringPtr("none")
-	module.bazelable = true
 	return module.Init()
 }
 
@@ -135,81 +131,3 @@
 
 	return lib
 }
-
-var (
-	archToAbiDirMap = map[string]string{
-		"android_arm":     "armeabi-v7a",
-		"android_arm64":   "arm64-v8a",
-		"android_riscv64": "riscv64",
-		"android_x86":     "x86",
-		"android_x86_64":  "x86_64",
-	}
-)
-
-// stlSrcBp2build returns a bazel label for the checked-in .so/.a file
-// It contains a select statement for each ABI
-func stlSrcBp2build(ctx android.Bp2buildMutatorContext, c *Module) bazel.LabelAttribute {
-	libName := strings.TrimPrefix(c.Name(), "ndk_")
-	libExt := ".so" // TODO - b/201079053: Support windows
-	if ctx.ModuleType() == "ndk_prebuilt_static_stl" {
-		libExt = ".a"
-	}
-	src := bazel.LabelAttribute{}
-	for arch, abiDir := range archToAbiDirMap {
-		srcPath := filepath.Join(libDir, abiDir, libName+libExt)
-		src.SetSelectValue(
-			bazel.OsArchConfigurationAxis,
-			arch,
-			android.BazelLabelForModuleSrcSingle(ctx, srcPath),
-		)
-	}
-	return src
-}
-
-// stlIncludesBp2build returns the includes exported by the STL
-func stlIncludesBp2build(c *Module) bazel.StringListAttribute {
-	linker, _ := c.linker.(*ndkPrebuiltStlLinker)
-	includeDirs := append(
-		[]string{},
-		linker.libraryDecorator.flagExporter.Properties.Export_include_dirs...,
-	)
-	includeDirs = append(
-		includeDirs,
-		linker.libraryDecorator.flagExporter.Properties.Export_system_include_dirs...,
-	)
-	return bazel.MakeStringListAttribute(android.FirstUniqueStrings(includeDirs))
-}
-
-func ndkPrebuiltStlBp2build(ctx android.Bp2buildMutatorContext, c *Module) {
-	if ctx.ModuleType() == "ndk_prebuilt_static_stl" {
-		ndkPrebuiltStaticStlBp2build(ctx, c)
-	} else {
-		ndkPrebuiltSharedStlBp2build(ctx, c)
-	}
-}
-
-func ndkPrebuiltStaticStlBp2build(ctx android.Bp2buildMutatorContext, c *Module) {
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_prebuilt_library_static",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_prebuilt_library_static.bzl",
-	}
-	attrs := &bazelPrebuiltLibraryStaticAttributes{
-		Static_library:         stlSrcBp2build(ctx, c),
-		Export_system_includes: stlIncludesBp2build(c), // The exports are always as system
-	}
-	// TODO: min_sdk_version
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: c.Name()}, attrs)
-}
-
-func ndkPrebuiltSharedStlBp2build(ctx android.Bp2buildMutatorContext, c *Module) {
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_prebuilt_library_shared",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_prebuilt_library_shared.bzl",
-	}
-	attrs := &bazelPrebuiltLibrarySharedAttributes{
-		Shared_library:         stlSrcBp2build(ctx, c),
-		Export_system_includes: stlIncludesBp2build(c), // The exports are always as system
-	}
-	// TODO: min_sdk_version
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: c.Name()}, attrs)
-}
diff --git a/cc/object.go b/cc/object.go
index d6eb369..b9c40d8 100644
--- a/cc/object.go
+++ b/cc/object.go
@@ -19,8 +19,6 @@
 	"strings"
 
 	"android/soong/android"
-	"android/soong/bazel"
-	"android/soong/bazel/cquery"
 )
 
 //
@@ -50,33 +48,6 @@
 	ndkSysrootPath android.Path
 }
 
-type objectBazelHandler struct {
-	module *Module
-}
-
-var _ BazelHandler = (*objectBazelHandler)(nil)
-
-func (handler *objectBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(label, cquery.GetOutputFiles, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-}
-
-func (handler *objectBazelHandler) ProcessBazelQueryResponse(ctx android.ModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	objPaths, err := bazelCtx.GetOutputFiles(label, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-
-	if len(objPaths) != 1 {
-		ctx.ModuleErrorf("expected exactly one object file for '%s', but got %s", label, objPaths)
-		return
-	}
-
-	handler.module.outputFile = android.OptionalPathForPath(android.PathForBazelOut(ctx, objPaths[0]))
-}
-
 type ObjectLinkerProperties struct {
 	// list of static library modules that should only provide headers for this module.
 	Static_libs []string `android:"arch_variant,variant_prepend"`
@@ -125,115 +96,15 @@
 		baseLinker: NewBaseLinker(module.sanitize),
 	}
 	module.compiler = NewBaseCompiler()
-	module.bazelHandler = &objectBazelHandler{module: module}
 
 	// Clang's address-significance tables are incompatible with ld -r.
 	module.compiler.appendCflags([]string{"-fno-addrsig"})
 
 	module.sdkMemberTypes = []android.SdkMemberType{ccObjectSdkMemberType}
 
-	module.bazelable = true
 	return module.Init()
 }
 
-// For bp2build conversion.
-type bazelObjectAttributes struct {
-	Srcs                bazel.LabelListAttribute
-	Srcs_as             bazel.LabelListAttribute
-	Hdrs                bazel.LabelListAttribute
-	Objs                bazel.LabelListAttribute
-	Deps                bazel.LabelListAttribute
-	System_dynamic_deps bazel.LabelListAttribute
-	Copts               bazel.StringListAttribute
-	Asflags             bazel.StringListAttribute
-	Local_includes      bazel.StringListAttribute
-	Absolute_includes   bazel.StringListAttribute
-	Stl                 *string
-	Linker_script       bazel.LabelAttribute
-	Crt                 *bool
-	SdkAttributes
-}
-
-// objectBp2Build is the bp2build converter from cc_object modules to the
-// Bazel equivalent target, plus any necessary include deps for the cc_object.
-func objectBp2Build(ctx android.Bp2buildMutatorContext, m *Module) {
-	if m.compiler == nil {
-		// a cc_object must have access to the compiler decorator for its props.
-		ctx.ModuleErrorf("compiler must not be nil for a cc_object module")
-	}
-
-	// Set arch-specific configurable attributes
-	baseAttributes := bp2BuildParseBaseProps(ctx, m)
-	compilerAttrs := baseAttributes.compilerAttributes
-	var objs bazel.LabelListAttribute
-	var deps bazel.LabelListAttribute
-	systemDynamicDeps := bazel.LabelListAttribute{ForceSpecifyEmptyList: true}
-
-	var linkerScript bazel.LabelAttribute
-
-	for axis, configToProps := range m.GetArchVariantProperties(ctx, &ObjectLinkerProperties{}) {
-		for config, props := range configToProps {
-			if objectLinkerProps, ok := props.(*ObjectLinkerProperties); ok {
-				if objectLinkerProps.Linker_script != nil {
-					label := android.BazelLabelForModuleSrcSingle(ctx, *objectLinkerProps.Linker_script)
-					linkerScript.SetSelectValue(axis, config, label)
-				}
-				objs.SetSelectValue(axis, config, android.BazelLabelForModuleDeps(ctx, objectLinkerProps.Objs))
-				systemSharedLibs := objectLinkerProps.System_shared_libs
-				if len(systemSharedLibs) > 0 {
-					systemSharedLibs = android.FirstUniqueStrings(systemSharedLibs)
-				}
-				systemDynamicDeps.SetSelectValue(axis, config, bazelLabelForSharedDeps(ctx, systemSharedLibs))
-				deps.SetSelectValue(axis, config, android.BazelLabelForModuleDeps(ctx, objectLinkerProps.Static_libs))
-				deps.SetSelectValue(axis, config, android.BazelLabelForModuleDeps(ctx, objectLinkerProps.Shared_libs))
-				deps.SetSelectValue(axis, config, android.BazelLabelForModuleDeps(ctx, objectLinkerProps.Header_libs))
-				// static_libs, shared_libs, and header_libs have variant_prepend tag
-				deps.Prepend = true
-			}
-		}
-	}
-	objs.ResolveExcludes()
-
-	// Don't split cc_object srcs across languages. Doing so would add complexity,
-	// and this isn't typically done for cc_object.
-	srcs := compilerAttrs.srcs
-	srcs.Append(compilerAttrs.cSrcs)
-
-	asFlags := compilerAttrs.asFlags
-	if compilerAttrs.asSrcs.IsEmpty() {
-		// Skip asflags for BUILD file simplicity if there are no assembly sources.
-		asFlags = bazel.MakeStringListAttribute(nil)
-	}
-
-	attrs := &bazelObjectAttributes{
-		Srcs:                srcs,
-		Srcs_as:             compilerAttrs.asSrcs,
-		Objs:                objs,
-		Deps:                deps,
-		System_dynamic_deps: systemDynamicDeps,
-		Copts:               compilerAttrs.copts,
-		Asflags:             asFlags,
-		Local_includes:      compilerAttrs.localIncludes,
-		Absolute_includes:   compilerAttrs.absoluteIncludes,
-		Stl:                 compilerAttrs.stl,
-		Linker_script:       linkerScript,
-		Crt:                 m.linker.(*objectLinker).Properties.Crt,
-		SdkAttributes:       Bp2BuildParseSdkAttributes(m),
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_object",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_object.bzl",
-	}
-
-	tags := android.ApexAvailableTagsWithoutTestApexes(ctx, m)
-
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{
-		Name: m.Name(),
-		Tags: tags,
-	}, attrs)
-}
-
 func (object *objectLinker) appendLdflags(flags []string) {
 	panic(fmt.Errorf("appendLdflags on objectLinker not supported"))
 }
diff --git a/cc/object_test.go b/cc/object_test.go
index b1e2a0f..e6a3fdd 100644
--- a/cc/object_test.go
+++ b/cc/object_test.go
@@ -85,30 +85,6 @@
 	})
 }
 
-func TestCcObjectWithBazel(t *testing.T) {
-	bp := `
-cc_object {
-	name: "foo",
-	srcs: ["baz.o"],
-	bazel_module: { label: "//foo/bar:bar" },
-}`
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir: "outputbase",
-		LabelToOutputFiles: map[string][]string{
-			"//foo/bar:bar": []string{"bazel_out.o"}}}
-	ctx := testCcWithConfig(t, config)
-
-	module := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon").Module()
-	outputFiles, err := module.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-
-	expectedOutputFiles := []string{"outputbase/execroot/__main__/bazel_out.o"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
-}
-
 func TestCcObjectOutputFile(t *testing.T) {
 	testcases := []struct {
 		name       string
diff --git a/cc/prebuilt.go b/cc/prebuilt.go
index b4819b0..f68fa24 100644
--- a/cc/prebuilt.go
+++ b/cc/prebuilt.go
@@ -18,8 +18,6 @@
 	"path/filepath"
 
 	"android/soong/android"
-	"android/soong/bazel"
-	"android/soong/bazel/cquery"
 )
 
 func init() {
@@ -57,13 +55,6 @@
 	// This is needed only if this library is linked by other modules in build time.
 	// Only makes sense for the Windows target.
 	Windows_import_lib *string `android:"path,arch_variant"`
-
-	// MixedBuildsDisabled is true if and only if building this prebuilt is explicitly disabled in mixed builds for either
-	// its static or shared version on the current build variant. This is to prevent Bazel targets for build variants with
-	// which either the static or shared version is incompatible from participating in mixed buiods. Please note that this
-	// is an override and does not fully determine whether Bazel or Soong will be used. For the full determination, see
-	// cc.ProcessBazelQueryResponse, cc.QueueBazelCall, and cc.MixedBuildsDisabled.
-	MixedBuildsDisabled bool `blueprint:"mutated"`
 }
 
 type prebuiltLinker struct {
@@ -261,7 +252,6 @@
 
 func (p *prebuiltLibraryLinker) disablePrebuilt() {
 	p.properties.Srcs = nil
-	p.properties.MixedBuildsDisabled = true
 }
 
 // Implements versionedInterface
@@ -272,8 +262,6 @@
 func NewPrebuiltLibrary(hod android.HostOrDeviceSupported, srcsProperty string) (*Module, *libraryDecorator) {
 	module, library := NewLibrary(hod)
 	module.compiler = nil
-	module.bazelable = true
-	module.bazelHandler = &prebuiltLibraryBazelHandler{module: module, library: library}
 
 	prebuilt := &prebuiltLibraryLinker{
 		libraryDecorator: library,
@@ -348,82 +336,6 @@
 	return module, library
 }
 
-type bazelPrebuiltLibraryStaticAttributes struct {
-	Static_library         bazel.LabelAttribute
-	Export_includes        bazel.StringListAttribute
-	Export_system_includes bazel.StringListAttribute
-	Alwayslink             bazel.BoolAttribute
-}
-
-// TODO(b/228623543): The below is not entirely true until the bug is fixed. For now, both targets are always generated
-// Implements bp2build for cc_prebuilt_library modules. This will generate:
-//   - Only a cc_prebuilt_library_static if the shared.enabled property is set to false across all variants.
-//   - Only a cc_prebuilt_library_shared if the static.enabled property is set to false across all variants
-//   - Both a cc_prebuilt_library_static and cc_prebuilt_library_shared if the aforementioned properties are not false across
-//     all variants
-//
-// In all cases, cc_prebuilt_library_static target names will be appended with "_bp2build_cc_library_static".
-func prebuiltLibraryBp2Build(ctx android.Bp2buildMutatorContext, module *Module) {
-	prebuiltLibraryStaticBp2Build(ctx, module, true)
-	prebuiltLibrarySharedBp2Build(ctx, module)
-}
-
-func prebuiltLibraryStaticBp2Build(ctx android.Bp2buildMutatorContext, module *Module, fullBuild bool) {
-	prebuiltAttrs := Bp2BuildParsePrebuiltLibraryProps(ctx, module, true)
-	exportedIncludes := bp2BuildParseExportedIncludes(ctx, module, nil)
-
-	attrs := &bazelPrebuiltLibraryStaticAttributes{
-		Static_library:         prebuiltAttrs.Src,
-		Export_includes:        exportedIncludes.Includes,
-		Export_system_includes: exportedIncludes.SystemIncludes,
-		// TODO: ¿Alwayslink?
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_prebuilt_library_static",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_prebuilt_library_static.bzl",
-	}
-
-	name := android.RemoveOptionalPrebuiltPrefix(module.Name())
-	if fullBuild {
-		name += "_bp2build_cc_library_static"
-	}
-
-	tags := android.ApexAvailableTagsWithoutTestApexes(ctx, module)
-	ctx.CreateBazelTargetModuleWithRestrictions(props, android.CommonAttributes{Name: name, Tags: tags}, attrs, prebuiltAttrs.Enabled)
-
-	_true := true
-	alwayslinkAttrs := *attrs
-	alwayslinkAttrs.Alwayslink.SetValue(&_true)
-	ctx.CreateBazelTargetModuleWithRestrictions(props, android.CommonAttributes{Name: name + "_alwayslink", Tags: tags}, &alwayslinkAttrs, prebuiltAttrs.Enabled)
-}
-
-type bazelPrebuiltLibrarySharedAttributes struct {
-	Shared_library         bazel.LabelAttribute
-	Export_includes        bazel.StringListAttribute
-	Export_system_includes bazel.StringListAttribute
-}
-
-func prebuiltLibrarySharedBp2Build(ctx android.Bp2buildMutatorContext, module *Module) {
-	prebuiltAttrs := Bp2BuildParsePrebuiltLibraryProps(ctx, module, false)
-	exportedIncludes := bp2BuildParseExportedIncludes(ctx, module, nil)
-
-	attrs := &bazelPrebuiltLibrarySharedAttributes{
-		Shared_library:         prebuiltAttrs.Src,
-		Export_includes:        exportedIncludes.Includes,
-		Export_system_includes: exportedIncludes.SystemIncludes,
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_prebuilt_library_shared",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_prebuilt_library_shared.bzl",
-	}
-
-	name := android.RemoveOptionalPrebuiltPrefix(module.Name())
-	tags := android.ApexAvailableTagsWithoutTestApexes(ctx, module)
-	ctx.CreateBazelTargetModuleWithRestrictions(props, android.CommonAttributes{Name: name, Tags: tags}, attrs, prebuiltAttrs.Enabled)
-}
-
 type prebuiltObjectProperties struct {
 	Srcs []string `android:"path,arch_variant"`
 }
@@ -435,135 +347,6 @@
 	properties prebuiltObjectProperties
 }
 
-type prebuiltLibraryBazelHandler struct {
-	module  *Module
-	library *libraryDecorator
-}
-
-var _ BazelHandler = (*prebuiltLibraryBazelHandler)(nil)
-
-func (h *prebuiltLibraryBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
-	if h.module.linker.(*prebuiltLibraryLinker).properties.MixedBuildsDisabled {
-		return
-	}
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(label, cquery.GetCcInfo, android.GetConfigKey(ctx))
-}
-
-func (h *prebuiltLibraryBazelHandler) ProcessBazelQueryResponse(ctx android.ModuleContext, label string) {
-	if h.module.linker.(*prebuiltLibraryLinker).properties.MixedBuildsDisabled {
-		return
-	}
-	bazelCtx := ctx.Config().BazelContext
-	ccInfo, err := bazelCtx.GetCcInfo(label, android.GetConfigKey(ctx))
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-
-	if h.module.static() {
-		if ok := h.processStaticBazelQueryResponse(ctx, label, ccInfo); !ok {
-			return
-		}
-	} else if h.module.Shared() {
-		if ok := h.processSharedBazelQueryResponse(ctx, label, ccInfo); !ok {
-			return
-		}
-	} else {
-		return
-	}
-
-	h.module.maybeUnhideFromMake()
-
-	h.module.setAndroidMkVariablesFromCquery(ccInfo.CcAndroidMkInfo)
-}
-
-func (h *prebuiltLibraryBazelHandler) processStaticBazelQueryResponse(ctx android.ModuleContext, label string, ccInfo cquery.CcInfo) bool {
-	staticLibs := ccInfo.CcStaticLibraryFiles
-	if len(staticLibs) > 1 {
-		ctx.ModuleErrorf("expected 1 static library from bazel target %q, got %s", label, staticLibs)
-		return false
-	}
-
-	// TODO(b/184543518): cc_prebuilt_library_static may have properties for re-exporting flags
-
-	// TODO(eakammer):Add stub-related flags if this library is a stub library.
-	// h.library.exportVersioningMacroIfNeeded(ctx)
-
-	// Dependencies on this library will expect collectedSnapshotHeaders to be set, otherwise
-	// validation will fail. For now, set this to an empty list.
-	// TODO(cparsons): More closely mirror the collectHeadersForSnapshot implementation.
-	h.library.collectedSnapshotHeaders = android.Paths{}
-
-	if len(staticLibs) == 0 {
-		h.module.outputFile = android.OptionalPath{}
-		return true
-	}
-
-	var outputPath android.Path = android.PathForBazelOut(ctx, staticLibs[0])
-	if len(ccInfo.TidyFiles) > 0 {
-		h.module.tidyFiles = android.PathsForBazelOut(ctx, ccInfo.TidyFiles)
-		outputPath = android.AttachValidationActions(ctx, outputPath, h.module.tidyFiles)
-	}
-
-	h.module.outputFile = android.OptionalPathForPath(outputPath)
-
-	depSet := android.NewDepSetBuilder[android.Path](android.TOPOLOGICAL).Direct(outputPath).Build()
-	ctx.SetProvider(StaticLibraryInfoProvider, StaticLibraryInfo{
-		StaticLibrary:                        outputPath,
-		TransitiveStaticLibrariesForOrdering: depSet,
-	})
-
-	return true
-}
-
-func (h *prebuiltLibraryBazelHandler) processSharedBazelQueryResponse(ctx android.ModuleContext, label string, ccInfo cquery.CcInfo) bool {
-	sharedLibs := ccInfo.CcSharedLibraryFiles
-	if len(sharedLibs) > 1 {
-		ctx.ModuleErrorf("expected 1 shared library from bazel target %s, got %q", label, sharedLibs)
-		return false
-	}
-
-	// TODO(b/184543518): cc_prebuilt_library_shared may have properties for re-exporting flags
-
-	// TODO(eakammer):Add stub-related flags if this library is a stub library.
-	// h.library.exportVersioningMacroIfNeeded(ctx)
-
-	if len(sharedLibs) == 0 {
-		h.module.outputFile = android.OptionalPath{}
-		return true
-	}
-
-	var outputPath android.Path = android.PathForBazelOut(ctx, sharedLibs[0])
-	if len(ccInfo.TidyFiles) > 0 {
-		h.module.tidyFiles = android.PathsForBazelOut(ctx, ccInfo.TidyFiles)
-		outputPath = android.AttachValidationActions(ctx, outputPath, h.module.tidyFiles)
-	}
-
-	h.module.outputFile = android.OptionalPathForPath(outputPath)
-
-	// FIXME(b/214600441): We don't yet strip prebuilt shared libraries
-	h.library.unstrippedOutputFile = outputPath
-
-	var toc android.Path
-	if len(ccInfo.TocFile) > 0 {
-		toc = android.PathForBazelOut(ctx, ccInfo.TocFile)
-	} else {
-		toc = outputPath // Just reuse `out` so ninja still gets an input but won't matter
-	}
-
-	info := SharedLibraryInfo{
-		SharedLibrary:   outputPath,
-		TableOfContents: android.OptionalPathForPath(toc),
-		Target:          ctx.Target(),
-	}
-	ctx.SetProvider(SharedLibraryInfoProvider, info)
-
-	h.library.setFlagExporterInfoFromCcInfo(ctx, ccInfo)
-	h.module.maybeUnhideFromMake()
-	return true
-}
-
 func (p *prebuiltObjectLinker) prebuilt() *android.Prebuilt {
 	return &p.Prebuilt
 }
@@ -593,8 +376,6 @@
 
 func NewPrebuiltObject(hod android.HostOrDeviceSupported) *Module {
 	module := newObject(hod)
-	module.bazelHandler = &prebuiltObjectBazelHandler{module: module}
-	module.bazelable = true
 	prebuilt := &prebuiltObjectLinker{
 		objectLinker: objectLinker{
 			baseLinker: NewBaseLinker(nil),
@@ -606,54 +387,6 @@
 	return module
 }
 
-type prebuiltObjectBazelHandler struct {
-	module *Module
-}
-
-var _ BazelHandler = (*prebuiltObjectBazelHandler)(nil)
-
-func (h *prebuiltObjectBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(label, cquery.GetOutputFiles, android.GetConfigKey(ctx))
-}
-
-func (h *prebuiltObjectBazelHandler) ProcessBazelQueryResponse(ctx android.ModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	outputs, err := bazelCtx.GetOutputFiles(label, android.GetConfigKey(ctx))
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-	if len(outputs) != 1 {
-		ctx.ModuleErrorf("Expected a single output for `%s`, but got:\n%v", label, outputs)
-		return
-	}
-	out := android.PathForBazelOut(ctx, outputs[0])
-	h.module.outputFile = android.OptionalPathForPath(out)
-	h.module.maybeUnhideFromMake()
-}
-
-type bazelPrebuiltObjectAttributes struct {
-	Src bazel.LabelAttribute
-}
-
-func prebuiltObjectBp2Build(ctx android.Bp2buildMutatorContext, module *Module) {
-	prebuiltAttrs := bp2BuildParsePrebuiltObjectProps(ctx, module)
-
-	attrs := &bazelPrebuiltObjectAttributes{
-		Src: prebuiltAttrs.Src,
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_prebuilt_object",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_prebuilt_object.bzl",
-	}
-
-	name := android.RemoveOptionalPrebuiltPrefix(module.Name())
-	tags := android.ApexAvailableTagsWithoutTestApexes(ctx, module)
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: name, Tags: tags}, attrs)
-}
-
 func PrebuiltObjectFactory() android.Module {
 	module := NewPrebuiltObject(android.HostAndDeviceSupported)
 	return module.Init()
@@ -747,15 +480,9 @@
 	return module.Init()
 }
 
-type prebuiltBinaryBazelHandler struct {
-	module    *Module
-	decorator *binaryDecorator
-}
-
 func NewPrebuiltBinary(hod android.HostOrDeviceSupported) (*Module, *binaryDecorator) {
-	module, binary := newBinary(hod, true)
+	module, binary := newBinary(hod)
 	module.compiler = nil
-	module.bazelHandler = &prebuiltBinaryBazelHandler{module, binary}
 
 	prebuilt := &prebuiltBinaryLinker{
 		binaryDecorator: binary,
@@ -769,54 +496,6 @@
 	return module, binary
 }
 
-var _ BazelHandler = (*prebuiltBinaryBazelHandler)(nil)
-
-func (h *prebuiltBinaryBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(label, cquery.GetOutputFiles, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-}
-
-func (h *prebuiltBinaryBazelHandler) ProcessBazelQueryResponse(ctx android.ModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	outputs, err := bazelCtx.GetOutputFiles(label, android.GetConfigKeyApexVariant(ctx, GetApexConfigKey(ctx)))
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-	if len(outputs) != 1 {
-		ctx.ModuleErrorf("Expected a single output for `%s`, but got:\n%v", label, outputs)
-		return
-	}
-	out := android.PathForBazelOut(ctx, outputs[0])
-	h.module.outputFile = android.OptionalPathForPath(out)
-	h.module.maybeUnhideFromMake()
-}
-
-type bazelPrebuiltBinaryAttributes struct {
-	Src   bazel.LabelAttribute
-	Strip stripAttributes
-}
-
-func prebuiltBinaryBp2Build(ctx android.Bp2buildMutatorContext, module *Module) {
-	prebuiltAttrs := bp2BuildParsePrebuiltBinaryProps(ctx, module)
-
-	var la linkerAttributes
-	la.convertStripProps(ctx, module)
-	attrs := &bazelPrebuiltBinaryAttributes{
-		Src:   prebuiltAttrs.Src,
-		Strip: stripAttrsFromLinkerAttrs(&la),
-	}
-
-	props := bazel.BazelTargetModuleProperties{
-		Rule_class:        "cc_prebuilt_binary",
-		Bzl_load_location: "//build/bazel/rules/cc:cc_prebuilt_binary.bzl",
-	}
-
-	name := android.RemoveOptionalPrebuiltPrefix(module.Name())
-	tags := android.ApexAvailableTagsWithoutTestApexes(ctx, module)
-	ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: name, Tags: tags}, attrs)
-}
-
 type Sanitized struct {
 	None struct {
 		Srcs []string `android:"path,arch_variant"`
diff --git a/cc/prebuilt_test.go b/cc/prebuilt_test.go
index 0c79e55..8b4174b 100644
--- a/cc/prebuilt_test.go
+++ b/cc/prebuilt_test.go
@@ -19,8 +19,6 @@
 	"testing"
 
 	"android/soong/android"
-	"android/soong/bazel/cquery"
-
 	"github.com/google/blueprint"
 )
 
@@ -386,289 +384,6 @@
 	assertString(t, static2.OutputFile().Path().Base(), "libf.hwasan.a")
 }
 
-func TestPrebuiltLibraryWithBazel(t *testing.T) {
-	const bp = `
-cc_prebuilt_library {
-	name: "foo",
-	shared: {
-		srcs: ["foo.so"],
-	},
-	static: {
-		srcs: ["foo.a"],
-	},
-	bazel_module: { label: "//foo/bar:bar" },
-}`
-	outBaseDir := "outputbase"
-	result := android.GroupFixturePreparers(
-		prepareForPrebuiltTest,
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: outBaseDir,
-				LabelToCcInfo: map[string]cquery.CcInfo{
-					"//foo/bar:bar": cquery.CcInfo{
-						CcSharedLibraryFiles: []string{"foo.so"},
-					},
-					"//foo/bar:bar_bp2build_cc_library_static": cquery.CcInfo{
-						CcStaticLibraryFiles: []string{"foo.a"},
-					},
-				},
-			}
-		}),
-	).RunTestWithBp(t, bp)
-	sharedFoo := result.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
-	pathPrefix := outBaseDir + "/execroot/__main__/"
-
-	sharedInfo := result.ModuleProvider(sharedFoo, SharedLibraryInfoProvider).(SharedLibraryInfo)
-	android.AssertPathRelativeToTopEquals(t,
-		"prebuilt library shared target path did not exist or did not match expected. If the base path is what does not match, it is likely that Soong built this module instead of Bazel.",
-		pathPrefix+"foo.so", sharedInfo.SharedLibrary)
-
-	outputFiles, err := sharedFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{pathPrefix + "foo.so"}
-	android.AssertDeepEquals(t,
-		"prebuilt library shared target output files did not match expected.",
-		expectedOutputFiles, outputFiles.Strings())
-
-	staticFoo := result.ModuleForTests("foo", "android_arm_armv7-a-neon_static").Module()
-	staticInfo := result.ModuleProvider(staticFoo, StaticLibraryInfoProvider).(StaticLibraryInfo)
-	android.AssertPathRelativeToTopEquals(t,
-		"prebuilt library static target path did not exist or did not match expected. If the base path is what does not match, it is likely that Soong built this module instead of Bazel.",
-		pathPrefix+"foo.a", staticInfo.StaticLibrary)
-
-	staticOutputFiles, err := staticFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object staticOutputFiles %s", err)
-	}
-	expectedStaticOutputFiles := []string{pathPrefix + "foo.a"}
-	android.AssertDeepEquals(t,
-		"prebuilt library static target output files did not match expected.",
-		expectedStaticOutputFiles, staticOutputFiles.Strings())
-}
-
-func TestPrebuiltLibraryWithBazelValidations(t *testing.T) {
-	const bp = `
-cc_prebuilt_library {
-	name: "foo",
-	shared: {
-		srcs: ["foo.so"],
-	},
-	static: {
-		srcs: ["foo.a"],
-	},
-	bazel_module: { label: "//foo/bar:bar" },
-	tidy: true,
-}`
-	outBaseDir := "outputbase"
-	result := android.GroupFixturePreparers(
-		prepareForPrebuiltTest,
-		android.FixtureMergeEnv(map[string]string{
-			"ALLOW_LOCAL_TIDY_TRUE": "1",
-		}),
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: outBaseDir,
-				LabelToCcInfo: map[string]cquery.CcInfo{
-					"//foo/bar:bar": cquery.CcInfo{
-						CcSharedLibraryFiles: []string{"foo.so"},
-						TidyFiles:            []string{"foo.c.tidy"},
-					},
-					"//foo/bar:bar_bp2build_cc_library_static": cquery.CcInfo{
-						CcStaticLibraryFiles: []string{"foo.a"},
-						TidyFiles:            []string{"foo.c.tidy"},
-					},
-				},
-			}
-		}),
-	).RunTestWithBp(t, bp)
-	sharedFoo := result.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
-
-	expectedOutputFile := "out/soong/.intermediates/foo/android_arm_armv7-a-neon_shared/validated/foo.so"
-	sharedInfo := result.ModuleProvider(sharedFoo, SharedLibraryInfoProvider).(SharedLibraryInfo)
-	android.AssertPathRelativeToTopEquals(t,
-		"prebuilt library shared target path did not exist or did not match expected. If the base path is what does not match, it is likely that Soong built this module instead of Bazel.",
-		expectedOutputFile, sharedInfo.SharedLibrary)
-
-	outputFiles, err := sharedFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{expectedOutputFile}
-	android.AssertPathsRelativeToTopEquals(t,
-		"prebuilt library shared target output files did not match expected.",
-		expectedOutputFiles, outputFiles)
-
-	staticFoo := result.ModuleForTests("foo", "android_arm_armv7-a-neon_static").Module()
-	staticInfo := result.ModuleProvider(staticFoo, StaticLibraryInfoProvider).(StaticLibraryInfo)
-	expectedStaticOutputFile := "out/soong/.intermediates/foo/android_arm_armv7-a-neon_static/validated/foo.a"
-	android.AssertPathRelativeToTopEquals(t,
-		"prebuilt library static target path did not exist or did not match expected. If the base path is what does not match, it is likely that Soong built this module instead of Bazel.",
-		expectedStaticOutputFile, staticInfo.StaticLibrary)
-
-	staticOutputFiles, err := staticFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object staticOutputFiles %s", err)
-	}
-	expectedStaticOutputFiles := []string{expectedStaticOutputFile}
-	android.AssertPathsRelativeToTopEquals(t,
-		"prebuilt library static target output files did not match expected.",
-		expectedStaticOutputFiles, staticOutputFiles)
-}
-
-func TestPrebuiltLibraryWithBazelStaticDisabled(t *testing.T) {
-	const bp = `
-cc_prebuilt_library {
-	name: "foo",
-	shared: {
-		srcs: ["foo.so"],
-	},
-	static: {
-		enabled: false
-	},
-	bazel_module: { label: "//foo/bar:bar" },
-}`
-	outBaseDir := "outputbase"
-	result := android.GroupFixturePreparers(
-		prepareForPrebuiltTest,
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: outBaseDir,
-				LabelToCcInfo: map[string]cquery.CcInfo{
-					"//foo/bar:bar": cquery.CcInfo{
-						CcSharedLibraryFiles: []string{"foo.so"},
-					},
-				},
-			}
-		}),
-	).RunTestWithBp(t, bp)
-	sharedFoo := result.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
-	pathPrefix := outBaseDir + "/execroot/__main__/"
-
-	sharedInfo := result.ModuleProvider(sharedFoo, SharedLibraryInfoProvider).(SharedLibraryInfo)
-	android.AssertPathRelativeToTopEquals(t,
-		"prebuilt library shared target path did not exist or did not match expected. If the base path is what does not match, it is likely that Soong built this module instead of Bazel.",
-		pathPrefix+"foo.so", sharedInfo.SharedLibrary)
-
-	outputFiles, err := sharedFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{pathPrefix + "foo.so"}
-	android.AssertDeepEquals(t,
-		"prebuilt library shared target output files did not match expected.",
-		expectedOutputFiles, outputFiles.Strings())
-}
-
-func TestPrebuiltLibraryStaticWithBazel(t *testing.T) {
-	const bp = `
-cc_prebuilt_library_static {
-	name: "foo",
-	srcs: ["foo.so"],
-	bazel_module: { label: "//foo/bar:bar" },
-}`
-	outBaseDir := "outputbase"
-	result := android.GroupFixturePreparers(
-		prepareForPrebuiltTest,
-		android.FixtureModifyConfig(func(config android.Config) {
-			config.BazelContext = android.MockBazelContext{
-				OutputBaseDir: outBaseDir,
-				LabelToCcInfo: map[string]cquery.CcInfo{
-					"//foo/bar:bar": cquery.CcInfo{
-						CcStaticLibraryFiles: []string{"foo.so"},
-					},
-				},
-			}
-		}),
-	).RunTestWithBp(t, bp)
-	staticFoo := result.ModuleForTests("foo", "android_arm_armv7-a-neon_static").Module()
-	pathPrefix := outBaseDir + "/execroot/__main__/"
-
-	info := result.ModuleProvider(staticFoo, StaticLibraryInfoProvider).(StaticLibraryInfo)
-	android.AssertPathRelativeToTopEquals(t,
-		"prebuilt library static path did not match expected. If the base path is what does not match, it is likely that Soong built this module instead of Bazel.",
-		pathPrefix+"foo.so", info.StaticLibrary)
-
-	outputFiles, err := staticFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{pathPrefix + "foo.so"}
-	android.AssertDeepEquals(t, "prebuilt library static output files did not match expected.", expectedOutputFiles, outputFiles.Strings())
-}
-
-func TestPrebuiltLibrarySharedWithBazelWithoutToc(t *testing.T) {
-	const bp = `
-cc_prebuilt_library_shared {
-	name: "foo",
-	srcs: ["foo.so"],
-	bazel_module: { label: "//foo/bar:bar" },
-}`
-	outBaseDir := "outputbase"
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir: outBaseDir,
-		LabelToCcInfo: map[string]cquery.CcInfo{
-			"//foo/bar:bar": cquery.CcInfo{
-				CcSharedLibraryFiles: []string{"foo.so"},
-			},
-		},
-	}
-	ctx := testCcWithConfig(t, config)
-	sharedFoo := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
-	pathPrefix := outBaseDir + "/execroot/__main__/"
-
-	info := ctx.ModuleProvider(sharedFoo, SharedLibraryInfoProvider).(SharedLibraryInfo)
-	android.AssertPathRelativeToTopEquals(t, "prebuilt shared library",
-		pathPrefix+"foo.so", info.SharedLibrary)
-	android.AssertPathRelativeToTopEquals(t, "prebuilt's 'nullary' ToC",
-		pathPrefix+"foo.so", info.TableOfContents.Path())
-
-	outputFiles, err := sharedFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{pathPrefix + "foo.so"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
-}
-
-func TestPrebuiltLibrarySharedWithBazelWithToc(t *testing.T) {
-	const bp = `
-cc_prebuilt_library_shared {
-	name: "foo",
-	srcs: ["foo.so"],
-	bazel_module: { label: "//foo/bar:bar" },
-}`
-	outBaseDir := "outputbase"
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir: outBaseDir,
-		LabelToCcInfo: map[string]cquery.CcInfo{
-			"//foo/bar:bar": cquery.CcInfo{
-				CcSharedLibraryFiles: []string{"foo.so"},
-				TocFile:              "toc",
-			},
-		},
-	}
-	ctx := testCcWithConfig(t, config)
-	sharedFoo := ctx.ModuleForTests("foo", "android_arm_armv7-a-neon_shared").Module()
-	pathPrefix := outBaseDir + "/execroot/__main__/"
-
-	info := ctx.ModuleProvider(sharedFoo, SharedLibraryInfoProvider).(SharedLibraryInfo)
-	android.AssertPathRelativeToTopEquals(t, "prebuilt shared library's ToC",
-		pathPrefix+"toc", info.TableOfContents.Path())
-	android.AssertPathRelativeToTopEquals(t, "prebuilt shared library",
-		pathPrefix+"foo.so", info.SharedLibrary)
-
-	outputFiles, err := sharedFoo.(android.OutputFileProducer).OutputFiles("")
-	if err != nil {
-		t.Errorf("Unexpected error getting cc_object outputfiles %s", err)
-	}
-	expectedOutputFiles := []string{pathPrefix + "foo.so"}
-	android.AssertDeepEquals(t, "output files", expectedOutputFiles, outputFiles.Strings())
-}
-
 func TestPrebuiltStubNoinstall(t *testing.T) {
 	testFunc := func(t *testing.T, expectLibfooOnSystemLib bool, fs android.MockFS) {
 		result := android.GroupFixturePreparers(
@@ -794,27 +509,3 @@
 }`
 	testCcError(t, `Android.bp:4:6: module "bintest" variant "android_arm64_armv8-a": srcs: multiple prebuilt source files`, bp)
 }
-
-func TestPrebuiltBinaryWithBazel(t *testing.T) {
-	const bp = `
-cc_prebuilt_binary {
-	name: "bintest",
-	srcs: ["bin"],
-	bazel_module: { label: "//bin/foo:foo" },
-}`
-	const outBaseDir = "outputbase"
-	const expectedOut = outBaseDir + "/execroot/__main__/bin"
-	config := TestConfig(t.TempDir(), android.Android, nil, bp, nil)
-	config.BazelContext = android.MockBazelContext{
-		OutputBaseDir:      outBaseDir,
-		LabelToOutputFiles: map[string][]string{"//bin/foo:foo": []string{"bin"}},
-	}
-	ctx := testCcWithConfig(t, config)
-	bin := ctx.ModuleForTests("bintest", "android_arm64_armv8-a").Module().(*Module)
-	out := bin.OutputFile()
-	if !out.Valid() {
-		t.Error("Invalid output file")
-		return
-	}
-	android.AssertStringEquals(t, "output file", expectedOut, out.String())
-}
diff --git a/cc/proto.go b/cc/proto.go
index 4e08a4c..4d72f26 100644
--- a/cc/proto.go
+++ b/cc/proto.go
@@ -19,7 +19,6 @@
 	"github.com/google/blueprint/proptools"
 
 	"android/soong/android"
-	"android/soong/bazel"
 )
 
 const (
@@ -163,109 +162,3 @@
 
 	return flags
 }
-
-type protoAttributes struct {
-	Deps bazel.LabelListAttribute
-
-	// A list of proto_library targets that that the proto_library in `deps` depends on
-	// This list is overestimation.
-	// Overestimation is necessary since Soong includes other protos via proto.include_dirs and not
-	// a specific .proto file module explicitly.
-	Transitive_deps bazel.LabelListAttribute
-
-	// A list of cc_library_* targets that the generated cpp code depends on
-	Cc_deps bazel.LabelListAttribute
-
-	Min_sdk_version *string
-}
-
-type bp2buildProtoDeps struct {
-	wholeStaticLib               *bazel.LabelAttribute
-	implementationWholeStaticLib *bazel.LabelAttribute
-	protoDep                     *bazel.LabelAttribute
-}
-
-func bp2buildProto(ctx android.Bp2buildMutatorContext, m *Module, protoSrcs bazel.LabelListAttribute, la linkerAttributes) bp2buildProtoDeps {
-	var ret bp2buildProtoDeps
-
-	protoInfo, ok := android.Bp2buildProtoProperties(ctx, &m.ModuleBase, protoSrcs)
-	if !ok || protoInfo.Proto_libs.IsEmpty() {
-		return ret
-	}
-
-	var depName string
-	typ := proptools.StringDefault(protoInfo.Type, protoTypeDefault)
-	var rule_class string
-	suffix := "_cc_proto"
-	switch typ {
-	case "lite":
-		suffix += "_lite"
-		rule_class = "cc_lite_proto_library"
-		depName = "libprotobuf-cpp-lite"
-	case "full":
-		rule_class = "cc_proto_library"
-		depName = "libprotobuf-cpp-full"
-	default:
-		ctx.PropertyErrorf("proto.type", "cannot handle conversion at this time: %q", typ)
-	}
-
-	dep := android.BazelLabelForModuleDepSingle(ctx, depName)
-	ret.protoDep = &bazel.LabelAttribute{Value: &dep}
-
-	var protoAttrs protoAttributes
-	protoAttrs.Deps.SetValue(protoInfo.Proto_libs)
-	protoAttrs.Transitive_deps.SetValue(protoInfo.Transitive_proto_libs)
-
-	// Add the implementation deps of the top-level cc_library_static
-	// This is necessary to compile the internal root of cc_proto_library.
-	// Without this, clang might not be able to find .h files that the generated cpp files depends on
-	protoAttrs.Cc_deps = *la.implementationDeps.Clone()
-	protoAttrs.Cc_deps.Append(la.implementationDynamicDeps)
-	protoAttrs.Cc_deps.Append(la.implementationWholeArchiveDeps)
-	protoAttrs.Cc_deps.Append(la.wholeArchiveDeps)
-	// Subtract myself to prevent possible circular dep
-	protoAttrs.Cc_deps = bazel.SubtractBazelLabelListAttribute(
-		protoAttrs.Cc_deps,
-		bazel.MakeLabelListAttribute(
-			bazel.MakeLabelList([]bazel.Label{
-				bazel.Label{Label: ":" + m.Name() + suffix},
-			}),
-		),
-	)
-	// Subtract the protobuf libraries since cc_proto_library implicitly adds them
-	protoAttrs.Cc_deps = bazel.SubtractBazelLabelListAttribute(
-		protoAttrs.Cc_deps,
-		bazel.MakeLabelListAttribute(
-			bazel.MakeLabelList([]bazel.Label{
-				bazel.Label{Label: "//external/protobuf:libprotobuf-cpp-full", OriginalModuleName: "libprotobuf-cpp-full"},
-				bazel.Label{Label: "//external/protobuf:libprotobuf-cpp-lite", OriginalModuleName: "libprotobuf-cpp-lite"},
-			}),
-		),
-	)
-
-	protoAttrs.Min_sdk_version = m.Properties.Min_sdk_version
-
-	name := m.Name() + suffix
-	tags := android.ApexAvailableTagsWithoutTestApexes(ctx, m)
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        rule_class,
-			Bzl_load_location: "//build/bazel/rules/cc:cc_proto.bzl",
-		},
-		android.CommonAttributes{Name: name, Tags: tags},
-		&protoAttrs)
-
-	var privateHdrs bool
-	if lib, ok := m.linker.(*libraryDecorator); ok {
-		privateHdrs = !proptools.Bool(lib.Properties.Proto.Export_proto_headers)
-	}
-
-	labelAttr := &bazel.LabelAttribute{Value: &bazel.Label{Label: ":" + name}}
-	if privateHdrs {
-		ret.implementationWholeStaticLib = labelAttr
-	} else {
-		ret.wholeStaticLib = labelAttr
-	}
-
-	return ret
-}
diff --git a/cc/rs.go b/cc/rs.go
index 93acdc7..b0d759b 100644
--- a/cc/rs.go
+++ b/cc/rs.go
@@ -20,7 +20,6 @@
 	"strings"
 
 	"android/soong/android"
-	"android/soong/bazel"
 	"github.com/google/blueprint"
 )
 
@@ -134,35 +133,3 @@
 
 	return flags
 }
-
-type rscriptAttributes struct {
-	// Renderscript source files
-	Srcs bazel.LabelListAttribute
-}
-
-func bp2buildRScript(ctx android.Bp2buildMutatorContext, m *Module, ca compilerAttributes) (bazel.LabelAttribute, bazel.StringListAttribute, bazel.StringListAttribute) {
-	var rscriptAttrs rscriptAttributes
-	var rsAbsIncludes bazel.StringListAttribute
-	var localIncludes bazel.StringListAttribute
-	var rsModuleName string
-	var convertedRsSrcsLabel bazel.LabelAttribute
-
-	if !ca.rscriptSrcs.IsEmpty() {
-		rscriptAttrs.Srcs = ca.rscriptSrcs
-		rsModuleName = m.Name() + "_renderscript"
-
-		localIncludes.Value = []string{"."}
-		rsAbsIncludes.Value = []string{"frameworks/rs", "frameworks/rs/cpp"}
-		convertedRsSrcsLabel = bazel.LabelAttribute{Value: &bazel.Label{Label: rsModuleName}}
-
-		ctx.CreateBazelTargetModule(
-			bazel.BazelTargetModuleProperties{
-				Rule_class:        "rscript_to_cpp",
-				Bzl_load_location: "//build/bazel/rules/cc:rscript_to_cpp.bzl",
-			},
-			android.CommonAttributes{Name: rsModuleName},
-			&rscriptAttrs)
-	}
-
-	return convertedRsSrcsLabel, rsAbsIncludes, localIncludes
-}
diff --git a/cc/sanitize.go b/cc/sanitize.go
index 6624d4b..31c0500 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -1911,7 +1911,3 @@
 func hwasanMakeVarsProvider(ctx android.MakeVarsContext) {
 	hwasanStaticLibs(ctx.Config()).exportToMake(ctx)
 }
-
-func BazelCcSanitizerToolchainVars(config android.Config) string {
-	return android.BazelToolchainVars(config, exportedVars)
-}
diff --git a/cc/stl.go b/cc/stl.go
index a31a585..63c23d7 100644
--- a/cc/stl.go
+++ b/cc/stl.go
@@ -134,8 +134,6 @@
 	return "libunwind"
 }
 
-// Should be kept up to date with
-// https://cs.android.com/android/platform/superproject/+/master:build/bazel/rules/cc/stl.bzl;l=46;drc=21771b671ae08565033768a6d3d151c54f887fa2
 func (stl *stl) deps(ctx BaseModuleContext, deps Deps) Deps {
 	switch stl.Properties.SelectedStl {
 	case "libstdc++":
@@ -187,8 +185,6 @@
 	return deps
 }
 
-// Should be kept up to date with
-// https://cs.android.com/android/platform/superproject/+/master:build/bazel/rules/cc/stl.bzl;l=94;drc=5bc8e39d2637927dc57dd0850210d43d348a1341
 func (stl *stl) flags(ctx ModuleContext, flags Flags) Flags {
 	switch stl.Properties.SelectedStl {
 	case "libc++", "libc++_static":
diff --git a/cc/strip.go b/cc/strip.go
index c60e135..b1f34bb 100644
--- a/cc/strip.go
+++ b/cc/strip.go
@@ -59,7 +59,6 @@
 	return !forceDisable && (forceEnable || defaultEnable)
 }
 
-// Keep this consistent with //build/bazel/rules/stripped_shared_library.bzl.
 func (stripper *Stripper) strip(actx android.ModuleContext, in android.Path, out android.ModuleOutPath,
 	flags StripFlags, isStaticLib bool) {
 	if actx.Darwin() {
diff --git a/cc/test.go b/cc/test.go
index 78e1646..d02145b 100644
--- a/cc/test.go
+++ b/cc/test.go
@@ -22,8 +22,6 @@
 	"github.com/google/blueprint/proptools"
 
 	"android/soong/android"
-	"android/soong/bazel"
-	"android/soong/bazel/cquery"
 	"android/soong/tradefed"
 )
 
@@ -139,8 +137,7 @@
 // specific functionality on a device. The executable binary gets an implicit
 // static_libs dependency on libgtests unless the gtest flag is set to false.
 func TestFactory() android.Module {
-	module := NewTest(android.HostAndDeviceSupported, true)
-	module.bazelHandler = &ccTestBazelHandler{module: module}
+	module := NewTest(android.HostAndDeviceSupported)
 	return module.Init()
 }
 
@@ -164,7 +161,7 @@
 
 // cc_test_host compiles a test host binary.
 func TestHostFactory() android.Module {
-	module := NewTest(android.HostSupported, true)
+	module := NewTest(android.HostSupported)
 	return module.Init()
 }
 
@@ -488,9 +485,8 @@
 	return configs
 }
 
-func NewTest(hod android.HostOrDeviceSupported, bazelable bool) *Module {
-	module, binary := newBinary(hod, bazelable)
-	module.bazelable = bazelable
+func NewTest(hod android.HostOrDeviceSupported) *Module {
+	module, binary := newBinary(hod)
 	module.multilib = android.MultilibBoth
 	module.testModule = true
 	binary.baseInstaller = NewTestInstaller()
@@ -552,7 +548,6 @@
 	}
 	module.linker = test
 	module.installer = test
-	module.bazelable = true
 	return module
 }
 
@@ -632,7 +627,7 @@
 }
 
 func NewBenchmark(hod android.HostOrDeviceSupported) *Module {
-	module, binary := newBinary(hod, false)
+	module, binary := newBinary(hod)
 	module.multilib = android.MultilibBoth
 	binary.baseInstaller = NewBaseInstaller("benchmarktest", "benchmarktest64", InstallInData)
 
@@ -643,180 +638,3 @@
 	module.installer = benchmark
 	return module
 }
-
-type ccTestBazelHandler struct {
-	module *Module
-}
-
-var _ BazelHandler = (*ccTestBazelHandler)(nil)
-
-// The top level target named $label is a test_suite target,
-// not the internal cc_test executable target.
-//
-// This is to ensure `b test //$label` runs the test_suite target directly,
-// which depends on tradefed_test targets, instead of the internal cc_test
-// target, which doesn't have tradefed integrations.
-//
-// However, for cquery, we want the internal cc_test executable target, which
-// has the suffix "__tf_internal".
-func mixedBuildsTestLabel(label string) string {
-	return label + "__tf_internal"
-}
-
-func (handler *ccTestBazelHandler) QueueBazelCall(ctx android.BaseModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	bazelCtx.QueueBazelRequest(mixedBuildsTestLabel(label), cquery.GetCcUnstrippedInfo, android.GetConfigKey(ctx))
-}
-
-func (handler *ccTestBazelHandler) ProcessBazelQueryResponse(ctx android.ModuleContext, label string) {
-	bazelCtx := ctx.Config().BazelContext
-	info, err := bazelCtx.GetCcUnstrippedInfo(mixedBuildsTestLabel(label), android.GetConfigKey(ctx))
-	if err != nil {
-		ctx.ModuleErrorf(err.Error())
-		return
-	}
-
-	var outputFilePath android.Path = android.PathForBazelOut(ctx, info.OutputFile)
-	if len(info.TidyFiles) > 0 {
-		handler.module.tidyFiles = android.PathsForBazelOut(ctx, info.TidyFiles)
-		outputFilePath = android.AttachValidationActions(ctx, outputFilePath, handler.module.tidyFiles)
-	}
-	handler.module.outputFile = android.OptionalPathForPath(outputFilePath)
-	handler.module.linker.(*testBinary).unstrippedOutputFile = android.PathForBazelOut(ctx, info.UnstrippedOutput)
-
-	handler.module.setAndroidMkVariablesFromCquery(info.CcAndroidMkInfo)
-}
-
-// binaryAttributes contains Bazel attributes corresponding to a cc test
-type testBinaryAttributes struct {
-	binaryAttributes
-
-	Gtest *bool
-
-	tidyAttributes
-	tradefed.TestConfigAttributes
-
-	Runs_on bazel.StringListAttribute
-}
-
-// testBinaryBp2build is the bp2build converter for cc_test modules. A cc_test's
-// dependency graph and compilation/linking steps are functionally similar to a
-// cc_binary, but has additional dependencies on test deps like gtest, and
-// produces additional runfiles like XML plans for Tradefed orchestration
-//
-// TODO(b/244432609): handle `isolated` property.
-// TODO(b/244432134): handle custom runpaths for tests that assume runfile layouts not
-// default to bazel. (see linkerInit function)
-func testBinaryBp2build(ctx android.Bp2buildMutatorContext, m *Module) {
-	var testBinaryAttrs testBinaryAttributes
-	testBinaryAttrs.binaryAttributes = binaryBp2buildAttrs(ctx, m)
-
-	var data bazel.LabelListAttribute
-	var tags bazel.StringListAttribute
-
-	testBinaryProps := m.GetArchVariantProperties(ctx, &TestBinaryProperties{})
-	for axis, configToProps := range testBinaryProps {
-		for config, props := range configToProps {
-			if p, ok := props.(*TestBinaryProperties); ok {
-				// Combine data, data_bins and data_libs into a single 'data' attribute.
-				var combinedData bazel.LabelList
-				combinedData.Append(android.BazelLabelForModuleSrc(ctx, p.Data))
-				combinedData.Append(android.BazelLabelForModuleDeps(ctx, p.Data_bins))
-				combinedData.Append(android.BazelLabelForModuleDeps(ctx, p.Data_libs))
-				data.SetSelectValue(axis, config, combinedData)
-				tags.SetSelectValue(axis, config, p.Test_options.Tags)
-			}
-		}
-	}
-
-	// The logic comes from https://cs.android.com/android/platform/superproject/main/+/0df8153267f96da877febc5332240fa06ceb8533:build/soong/cc/sanitize.go;l=488
-	var features bazel.StringListAttribute
-	curFeatures := testBinaryAttrs.binaryAttributes.Features.SelectValue(bazel.OsArchConfigurationAxis, bazel.OsArchAndroidArm64)
-	var newFeatures []string
-	if !android.InList("memtag_heap", curFeatures) && !android.InList("-memtag_heap", curFeatures) {
-		newFeatures = append(newFeatures, "memtag_heap")
-		if !android.InList("diag_memtag_heap", curFeatures) && !android.InList("-diag_memtag_heap", curFeatures) {
-			newFeatures = append(newFeatures, "diag_memtag_heap")
-		}
-	}
-
-	features.SetSelectValue(bazel.OsArchConfigurationAxis, bazel.OsArchAndroidArm64, newFeatures)
-	testBinaryAttrs.binaryAttributes.Features.Append(features)
-	testBinaryAttrs.binaryAttributes.Features.DeduplicateAxesFromBase()
-
-	m.convertTidyAttributes(ctx, &testBinaryAttrs.tidyAttributes)
-
-	testBinary := m.linker.(*testBinary)
-	gtest := testBinary.gtest()
-	gtestIsolated := testBinary.isolated(ctx)
-	// Use the underling bool pointer for Gtest in attrs
-	// This ensures that if this property is not set in Android.bp file, it will not be set in BUILD file either
-	// cc_test macro will default gtest to True
-	testBinaryAttrs.Gtest = testBinary.LinkerProperties.Gtest
-
-	addImplicitGtestDeps(ctx, &testBinaryAttrs, gtest, gtestIsolated)
-
-	var unitTest *bool
-
-	for _, testProps := range m.GetProperties() {
-		if p, ok := testProps.(*TestBinaryProperties); ok {
-			useVendor := false // TODO Bug: 262914724
-			testInstallBase := getTestInstallBase(useVendor)
-			testConfigAttributes := tradefed.GetTestConfigAttributes(
-				ctx,
-				p.Test_config,
-				p.Test_options.Extra_test_configs,
-				p.Auto_gen_config,
-				p.Test_options.Test_suite_tag,
-				p.Test_config_template,
-				getTradefedConfigOptions(ctx, p, gtestIsolated, true),
-				&testInstallBase,
-			)
-			testBinaryAttrs.TestConfigAttributes = testConfigAttributes
-			unitTest = p.Test_options.Unit_test
-		}
-	}
-
-	testBinaryAttrs.Runs_on = bazel.MakeStringListAttribute(android.RunsOn(
-		m.ModuleBase.HostSupported(),
-		m.ModuleBase.DeviceSupported(),
-		gtest || (unitTest != nil && *unitTest)))
-
-	// TODO (b/262914724): convert to tradefed_cc_test and tradefed_cc_test_host
-	ctx.CreateBazelTargetModule(
-		bazel.BazelTargetModuleProperties{
-			Rule_class:        "cc_test",
-			Bzl_load_location: "//build/bazel/rules/cc:cc_test.bzl",
-		},
-		android.CommonAttributes{
-			Name: m.Name(),
-			Data: data,
-			Tags: tags,
-		},
-		&testBinaryAttrs)
-}
-
-// cc_test that builds using gtest needs some additional deps
-// addImplicitGtestDeps makes these deps explicit in the generated BUILD files
-func addImplicitGtestDeps(ctx android.Bp2buildMutatorContext, attrs *testBinaryAttributes, gtest, gtestIsolated bool) {
-	addDepsAndDedupe := func(lla *bazel.LabelListAttribute, modules []string) {
-		moduleLabels := android.BazelLabelForModuleDeps(ctx, modules)
-		lla.Value.Append(moduleLabels)
-		// Dedupe
-		lla.Value = bazel.FirstUniqueBazelLabelList(lla.Value)
-	}
-	// this must be kept in sync with Soong's implementation in:
-	// https://cs.android.com/android/_/android/platform/build/soong/+/460fb2d6d546b5ab493a7e5479998c4933a80f73:cc/test.go;l=300-313;drc=ec7314336a2b35ea30ce5438b83949c28e3ac429;bpv=1;bpt=0
-	if gtest {
-		// TODO - b/244433197: Handle canUseSdk
-		if gtestIsolated {
-			addDepsAndDedupe(&attrs.Deps, []string{"libgtest_isolated_main"})
-			addDepsAndDedupe(&attrs.Dynamic_deps, []string{"liblog"})
-		} else {
-			addDepsAndDedupe(&attrs.Deps, []string{
-				"libgtest_main",
-				"libgtest",
-			})
-		}
-	}
-}
diff --git a/cc/tidy.go b/cc/tidy.go
index 7b123cb..76ac7d5 100644
--- a/cc/tidy.go
+++ b/cc/tidy.go
@@ -68,7 +68,6 @@
 // Then, that old style usage will be obsolete and an error.
 const NoWarningsAsErrorsInTidyFlags = true
 
-// keep this up to date with https://cs.android.com/android/platform/superproject/+/master:build/bazel/rules/cc/clang_tidy.bzl
 func (tidy *tidyFeature) flags(ctx ModuleContext, flags Flags) Flags {
 	CheckBadTidyFlags(ctx, "tidy_flags", tidy.Properties.Tidy_flags)
 	CheckBadTidyChecks(ctx, "tidy_checks", tidy.Properties.Tidy_checks)