diff options
author | Dan Willemsen <dwillemsen@google.com> | 2016-11-17 01:02:25 -0800 |
---|---|---|
committer | Dan Willemsen <dwillemsen@google.com> | 2016-11-17 01:50:43 -0800 |
commit | 2e47b34435de8cfe3f1533c553fe546217c98b3c (patch) | |
tree | be009e1af663c782465c0bd9cf2545926eea367d /cc/binary.go | |
parent | 967c6a9b87eb4eca13449498183e3f191843c9cd (diff) | |
download | build_soong-2e47b34435de8cfe3f1533c553fe546217c98b3c.tar.gz build_soong-2e47b34435de8cfe3f1533c553fe546217c98b3c.tar.bz2 build_soong-2e47b34435de8cfe3f1533c553fe546217c98b3c.zip |
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
Diffstat (limited to 'cc/binary.go')
-rw-r--r-- | cc/binary.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cc/binary.go b/cc/binary.go index c16dae60..2b775149 100644 --- a/cc/binary.go +++ b/cc/binary.go @@ -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. |