Merge "Make toolchain more compose-y"

This commit is contained in:
Colin Cross 2022-09-02 15:33:17 +00:00 committed by Gerrit Code Review
commit 6d89152f33
5 changed files with 32 additions and 19 deletions

View file

@ -15,6 +15,7 @@
package config
type toolchainBionic struct {
toolchainBase
}
var (
@ -29,6 +30,12 @@ func (toolchainBionic) Bionic() bool { return true }
func (toolchainBionic) DefaultSharedLibraries() []string { return bionicDefaultSharedLibraries }
func (toolchainBionic) ShlibSuffix() string { return ".so" }
func (toolchainBionic) ExecutableSuffix() string { return "" }
func (toolchainBionic) AvailableLibraries() []string { return nil }
func (toolchainBionic) CrtBeginStaticBinary() []string { return bionicCrtBeginStaticBinary }
func (toolchainBionic) CrtBeginSharedBinary() []string { return bionicCrtBeginSharedBinary }
func (toolchainBionic) CrtBeginSharedLibrary() []string { return bionicCrtBeginSharedLibrary }

View file

@ -176,6 +176,8 @@ func getMacTools(ctx android.PathContext) *macPlatformTools {
type toolchainDarwin struct {
cFlags, ldFlags string
toolchain64Bit
toolchainNoCrt
toolchainBase
}
type toolchainDarwinX86 struct {
@ -254,6 +256,10 @@ func (t *toolchainDarwin) ShlibSuffix() string {
return ".dylib"
}
func (t *toolchainDarwin) ExecutableSuffix() string {
return ""
}
func (t *toolchainDarwin) AvailableLibraries() []string {
return darwinAvailableLibraries
}

View file

@ -140,14 +140,6 @@ func (toolchainBase) ToolchainLdflags() string {
return ""
}
func (toolchainBase) ShlibSuffix() string {
return ".so"
}
func (toolchainBase) ExecutableSuffix() string {
return ""
}
func (toolchainBase) Asflags() string {
return ""
}
@ -160,16 +152,14 @@ func (toolchainBase) LibclangRuntimeLibraryArch() string {
return ""
}
func (toolchainBase) AvailableLibraries() []string {
return nil
}
type toolchainNoCrt struct{}
func (toolchainBase) CrtBeginStaticBinary() []string { return nil }
func (toolchainBase) CrtBeginSharedBinary() []string { return nil }
func (toolchainBase) CrtBeginSharedLibrary() []string { return nil }
func (toolchainBase) CrtEndStaticBinary() []string { return nil }
func (toolchainBase) CrtEndSharedBinary() []string { return nil }
func (toolchainBase) CrtEndSharedLibrary() []string { return nil }
func (toolchainNoCrt) CrtBeginStaticBinary() []string { return nil }
func (toolchainNoCrt) CrtBeginSharedBinary() []string { return nil }
func (toolchainNoCrt) CrtBeginSharedLibrary() []string { return nil }
func (toolchainNoCrt) CrtEndStaticBinary() []string { return nil }
func (toolchainNoCrt) CrtEndSharedBinary() []string { return nil }
func (toolchainNoCrt) CrtEndSharedLibrary() []string { return nil }
func (toolchainBase) DefaultSharedLibraries() []string {
return nil
@ -188,7 +178,6 @@ func (toolchainBase) Musl() bool {
}
type toolchain64Bit struct {
toolchainBase
}
func (toolchain64Bit) Is64Bit() bool {
@ -196,7 +185,6 @@ func (toolchain64Bit) Is64Bit() bool {
}
type toolchain32Bit struct {
toolchainBase
}
func (toolchain32Bit) Is64Bit() bool {

View file

@ -158,6 +158,7 @@ func init() {
}
type toolchainLinux struct {
toolchainBase
cFlags, ldFlags string
}
@ -247,9 +248,18 @@ func (t *toolchainLinux) AvailableLibraries() []string {
return linuxAvailableLibraries
}
func (toolchainLinux) ShlibSuffix() string {
return ".so"
}
func (toolchainLinux) ExecutableSuffix() string {
return ""
}
// glibc specialization of the linux toolchain
type toolchainGlibc struct {
toolchainNoCrt
}
func (toolchainGlibc) Glibc() bool { return true }

View file

@ -153,6 +153,8 @@ func init() {
type toolchainWindows struct {
cFlags, ldFlags string
toolchainBase
toolchainNoCrt
}
type toolchainWindowsX86 struct {