Add DefaultSharedLibraries to Toolchain
Move the default value for system_shared_libs out of linker.go and into
a new DefaultSharedLibraries method in Toolchain. This will simplify
adding system_shared_libs to cc_object, and adding new toolchains with
different default system_shared_libs.
Test: m checkbuild
Test: go test ./cc/...
Change-Id: I422315f090be20719c08a4d33bd39b0b26a93d6c
diff --git a/cc/config/toolchain.go b/cc/config/toolchain.go
index 496277b..dfb2439 100644
--- a/cc/config/toolchain.go
+++ b/cc/config/toolchain.go
@@ -106,6 +106,10 @@
AvailableLibraries() []string
+ // DefaultSharedLibraries returns the list of shared libraries that will be added to all
+ // targets unless they explicitly specify system_shared_libs.
+ DefaultSharedLibraries() []string
+
Bionic() bool
}
@@ -165,7 +169,11 @@
}
func (toolchainBase) AvailableLibraries() []string {
- return []string{}
+ return nil
+}
+
+func (toolchainBase) DefaultSharedLibraries() []string {
+ return nil
}
func (toolchainBase) Bionic() bool {