Add Toolchain.Bionic()
Move some cc ctx.Host() / ctx.Device() checks over to using ctx.toolchain().Bionic(). There will be more changes, these are just the obvious ones dealing with host_ldlibs / crt / system libraries. Bug: 31559095 Test: out/soong/build.ninja is identical Change-Id: Ibba60483b4ab0e01f6996eb7d883120e4acc1830
This commit is contained in:
@@ -91,7 +91,7 @@ func (binary *binaryDecorator) getStem(ctx BaseModuleContext) string {
|
||||
|
||||
func (binary *binaryDecorator) linkerDeps(ctx BaseModuleContext, deps Deps) Deps {
|
||||
deps = binary.baseLinker.linkerDeps(ctx, deps)
|
||||
if ctx.Device() {
|
||||
if ctx.toolchain().Bionic() {
|
||||
if !Bool(binary.baseLinker.Properties.Nocrt) {
|
||||
if !ctx.sdk() {
|
||||
if binary.static() {
|
||||
@@ -163,7 +163,7 @@ func NewBinary(hod android.HostOrDeviceSupported) (*Module, *binaryDecorator) {
|
||||
func (binary *binaryDecorator) linkerInit(ctx BaseModuleContext) {
|
||||
binary.baseLinker.linkerInit(ctx)
|
||||
|
||||
if ctx.Host() {
|
||||
if !ctx.toolchain().Bionic() {
|
||||
if ctx.Os() == android.Linux {
|
||||
if binary.Properties.Static_executable == nil && Bool(ctx.AConfig().ProductVariables.HostStaticBinaries) {
|
||||
binary.Properties.Static_executable = proptools.BoolPtr(true)
|
||||
@@ -210,7 +210,7 @@ func (binary *binaryDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags
|
||||
flags.CFlags = append(flags.CFlags, "-fpie")
|
||||
}
|
||||
|
||||
if ctx.Device() {
|
||||
if ctx.toolchain().Bionic() {
|
||||
if binary.static() {
|
||||
// Clang driver needs -static to create static executable.
|
||||
// However, bionic/linker uses -shared to overwrite.
|
||||
|
Reference in New Issue
Block a user