aboutsummaryrefslogtreecommitdiff
path: root/cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc')
-rw-r--r--cc/bp2build.go1
-rw-r--r--cc/cc.go2
-rw-r--r--cc/ccdeps.go2
-rw-r--r--cc/cmakelists.go2
-rw-r--r--cc/compdb.go2
-rw-r--r--cc/config/toolchain.go6
-rw-r--r--cc/fuzz.go6
-rw-r--r--cc/lto.go5
-rw-r--r--cc/ndk_abi.go4
-rw-r--r--cc/ndk_sysroot.go2
-rw-r--r--cc/sanitize.go15
-rw-r--r--cc/stub_library.go2
-rw-r--r--cc/tidy.go2
-rw-r--r--cc/vndk.go14
14 files changed, 42 insertions, 23 deletions
diff --git a/cc/bp2build.go b/cc/bp2build.go
index fa98df4cd..259ba397a 100644
--- a/cc/bp2build.go
+++ b/cc/bp2build.go
@@ -1257,6 +1257,7 @@ func (la *linkerAttributes) bp2buildForAxisAndConfig(ctx android.BazelConversion
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 {
diff --git a/cc/cc.go b/cc/cc.go
index f4b565550..0e7f6c8d5 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -83,7 +83,7 @@ func RegisterCCBuildComponents(ctx android.RegistrationContext) {
ctx.TopDown("sabi_deps", sabiDepsMutator)
})
- ctx.RegisterSingletonType("kythe_extract_all", kytheExtractAllFactory)
+ ctx.RegisterParallelSingletonType("kythe_extract_all", kytheExtractAllFactory)
}
// Deps is a struct containing module names of dependencies, separated by the kind of dependency.
diff --git a/cc/ccdeps.go b/cc/ccdeps.go
index 75e1faf0b..d30abbab7 100644
--- a/cc/ccdeps.go
+++ b/cc/ccdeps.go
@@ -30,7 +30,7 @@ import (
// The info file is generated in $OUT/module_bp_cc_depend.json.
func init() {
- android.RegisterSingletonType("ccdeps_generator", ccDepsGeneratorSingleton)
+ android.RegisterParallelSingletonType("ccdeps_generator", ccDepsGeneratorSingleton)
}
func ccDepsGeneratorSingleton() android.Singleton {
diff --git a/cc/cmakelists.go b/cc/cmakelists.go
index ad130baaa..0f3f02da5 100644
--- a/cc/cmakelists.go
+++ b/cc/cmakelists.go
@@ -29,7 +29,7 @@ import (
// structure (see variable CLionOutputProjectsDirectory for root).
func init() {
- android.RegisterSingletonType("cmakelists_generator", cMakeListsGeneratorSingleton)
+ android.RegisterParallelSingletonType("cmakelists_generator", cMakeListsGeneratorSingleton)
}
func cMakeListsGeneratorSingleton() android.Singleton {
diff --git a/cc/compdb.go b/cc/compdb.go
index ea124438e..617be1a19 100644
--- a/cc/compdb.go
+++ b/cc/compdb.go
@@ -32,7 +32,7 @@ import (
// make SOONG_GEN_COMPDB=1 nothing to get all targets.
func init() {
- android.RegisterSingletonType("compdb_generator", compDBGeneratorSingleton)
+ android.RegisterParallelSingletonType("compdb_generator", compDBGeneratorSingleton)
}
func compDBGeneratorSingleton() android.Singleton {
diff --git a/cc/config/toolchain.go b/cc/config/toolchain.go
index 6a10e1474..a0ef57595 100644
--- a/cc/config/toolchain.go
+++ b/cc/config/toolchain.go
@@ -20,6 +20,12 @@ import (
"android/soong/android"
)
+func init() {
+ exportedVars.ExportStringListStaticVariable("DarwinAvailableLibraries", darwinAvailableLibraries)
+ exportedVars.ExportStringListStaticVariable("LinuxAvailableLibraries", linuxAvailableLibraries)
+ exportedVars.ExportStringListStaticVariable("WindowsAvailableLibraries", windowsAvailableLibraries)
+}
+
type toolchainFactory func(arch android.Arch) Toolchain
var toolchainFactories = make(map[android.OsType]map[android.ArchType]toolchainFactory)
diff --git a/cc/fuzz.go b/cc/fuzz.go
index dfefc11f2..c897501e8 100644
--- a/cc/fuzz.go
+++ b/cc/fuzz.go
@@ -28,7 +28,7 @@ import (
func init() {
android.RegisterModuleType("cc_fuzz", LibFuzzFactory)
- android.RegisterSingletonType("cc_fuzz_packaging", fuzzPackagingFactory)
+ android.RegisterParallelSingletonType("cc_fuzz_packaging", fuzzPackagingFactory)
}
type FuzzProperties struct {
@@ -398,7 +398,9 @@ func (s *ccRustFuzzPackager) GenerateBuildActions(ctx android.SingletonContext)
}
hostOrTargetString := "target"
- if ccModule.Host() {
+ if ccModule.Target().HostCross {
+ hostOrTargetString = "host_cross"
+ } else if ccModule.Host() {
hostOrTargetString = "host"
}
diff --git a/cc/lto.go b/cc/lto.go
index 1afa1ddd9..581856b46 100644
--- a/cc/lto.go
+++ b/cc/lto.go
@@ -91,11 +91,6 @@ func (lto *lto) flags(ctx BaseModuleContext, flags Flags) Flags {
return flags
}
- // TODO(b/254713216): LTO doesn't work on riscv64 yet.
- if ctx.Arch().ArchType == android.Riscv64 {
- return flags
- }
-
if lto.LTO(ctx) {
var ltoCFlag string
var ltoLdFlag string
diff --git a/cc/ndk_abi.go b/cc/ndk_abi.go
index 3456c32bb..86166dcbb 100644
--- a/cc/ndk_abi.go
+++ b/cc/ndk_abi.go
@@ -19,8 +19,8 @@ import (
)
func init() {
- android.RegisterSingletonType("ndk_abi_dump", NdkAbiDumpSingleton)
- android.RegisterSingletonType("ndk_abi_diff", NdkAbiDiffSingleton)
+ android.RegisterParallelSingletonType("ndk_abi_dump", NdkAbiDumpSingleton)
+ android.RegisterParallelSingletonType("ndk_abi_diff", NdkAbiDiffSingleton)
}
func getNdkAbiDumpInstallBase(ctx android.PathContext) android.OutputPath {
diff --git a/cc/ndk_sysroot.go b/cc/ndk_sysroot.go
index dffc6c614..0cf21b65a 100644
--- a/cc/ndk_sysroot.go
+++ b/cc/ndk_sysroot.go
@@ -66,7 +66,7 @@ func RegisterNdkModuleTypes(ctx android.RegistrationContext) {
ctx.RegisterModuleType("ndk_library", NdkLibraryFactory)
ctx.RegisterModuleType("versioned_ndk_headers", versionedNdkHeadersFactory)
ctx.RegisterModuleType("preprocessed_ndk_headers", preprocessedNdkHeadersFactory)
- ctx.RegisterSingletonType("ndk", NdkSingleton)
+ ctx.RegisterParallelSingletonType("ndk", NdkSingleton)
}
func getNdkInstallBase(ctx android.PathContext) android.InstallPath {
diff --git a/cc/sanitize.go b/cc/sanitize.go
index 7fddc1b83..6e732b617 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -665,6 +665,21 @@ func (sanitize *sanitize) begin(ctx BaseModuleContext) {
s.Diag.Cfi = nil
}
+ // TODO(b/280478629): runtimes don't exist for musl arm64 yet.
+ if ctx.toolchain().Musl() && ctx.Arch().ArchType == android.Arm64 {
+ s.Address = nil
+ s.Hwaddress = nil
+ s.Thread = nil
+ s.Scudo = nil
+ s.Fuzzer = nil
+ s.Cfi = nil
+ s.Diag.Cfi = nil
+ s.Misc_undefined = nil
+ s.Undefined = nil
+ s.All_undefined = nil
+ s.Integer_overflow = nil
+ }
+
// Also disable CFI for VNDK variants of components
if ctx.isVndk() && ctx.useVndk() {
s.Cfi = nil
diff --git a/cc/stub_library.go b/cc/stub_library.go
index f324dcc9b..3a6d0aeaa 100644
--- a/cc/stub_library.go
+++ b/cc/stub_library.go
@@ -23,7 +23,7 @@ import (
func init() {
// Use singleton type to gather all generated soong modules.
- android.RegisterSingletonType("stublibraries", stubLibrariesSingleton)
+ android.RegisterParallelSingletonType("stublibraries", stubLibrariesSingleton)
}
type stubLibraries struct {
diff --git a/cc/tidy.go b/cc/tidy.go
index bbcaece24..7b123cb57 100644
--- a/cc/tidy.go
+++ b/cc/tidy.go
@@ -201,7 +201,7 @@ func (tidy *tidyFeature) flags(ctx ModuleContext, flags Flags) Flags {
}
func init() {
- android.RegisterSingletonType("tidy_phony_targets", TidyPhonySingleton)
+ android.RegisterParallelSingletonType("tidy_phony_targets", TidyPhonySingleton)
}
// This TidyPhonySingleton generates both tidy-* and obj-* phony targets for C/C++ files.
diff --git a/cc/vndk.go b/cc/vndk.go
index 9b70004c5..7a2286eb1 100644
--- a/cc/vndk.go
+++ b/cc/vndk.go
@@ -417,16 +417,16 @@ func VndkMutator(mctx android.BottomUpMutatorContext) {
func init() {
RegisterVndkLibraryTxtTypes(android.InitRegistrationContext)
- android.RegisterSingletonType("vndk-snapshot", VndkSnapshotSingleton)
+ android.RegisterParallelSingletonType("vndk-snapshot", VndkSnapshotSingleton)
}
func RegisterVndkLibraryTxtTypes(ctx android.RegistrationContext) {
- ctx.RegisterSingletonModuleType("llndk_libraries_txt", llndkLibrariesTxtFactory)
- ctx.RegisterSingletonModuleType("vndksp_libraries_txt", vndkSPLibrariesTxtFactory)
- ctx.RegisterSingletonModuleType("vndkcore_libraries_txt", vndkCoreLibrariesTxtFactory)
- ctx.RegisterSingletonModuleType("vndkprivate_libraries_txt", vndkPrivateLibrariesTxtFactory)
- ctx.RegisterSingletonModuleType("vndkproduct_libraries_txt", vndkProductLibrariesTxtFactory)
- ctx.RegisterSingletonModuleType("vndkcorevariant_libraries_txt", vndkUsingCoreVariantLibrariesTxtFactory)
+ ctx.RegisterParallelSingletonModuleType("llndk_libraries_txt", llndkLibrariesTxtFactory)
+ ctx.RegisterParallelSingletonModuleType("vndksp_libraries_txt", vndkSPLibrariesTxtFactory)
+ ctx.RegisterParallelSingletonModuleType("vndkcore_libraries_txt", vndkCoreLibrariesTxtFactory)
+ ctx.RegisterParallelSingletonModuleType("vndkprivate_libraries_txt", vndkPrivateLibrariesTxtFactory)
+ ctx.RegisterParallelSingletonModuleType("vndkproduct_libraries_txt", vndkProductLibrariesTxtFactory)
+ ctx.RegisterParallelSingletonModuleType("vndkcorevariant_libraries_txt", vndkUsingCoreVariantLibrariesTxtFactory)
}
type vndkLibrariesTxt struct {