Skip default dependencies for header libraries

Header libraries don't compile anything, so they don't need the
default stl and libclang_rt dependencies.  Trimming the dependencies
simplifies using header libraries for LLNDK libraries, which need
extra variants that don't exist for the default dependencies.

Test: m checkbuild
Change-Id: Ib9864c3cc7048b2cc52acf304830777b65a51877
This commit is contained in:
Colin Cross 2021-04-26 17:07:17 -07:00
parent b719c0194e
commit be763f7b16
2 changed files with 3 additions and 1 deletions

View File

@ -322,7 +322,7 @@ func (linker *baseLinker) linkerDeps(ctx DepsContext, deps Deps) Deps {
if ctx.toolchain().Bionic() { if ctx.toolchain().Bionic() {
// libclang_rt.builtins has to be last on the command line // libclang_rt.builtins has to be last on the command line
if !Bool(linker.Properties.No_libcrt) { if !Bool(linker.Properties.No_libcrt) && !ctx.header() {
deps.LateStaticLibs = append(deps.LateStaticLibs, config.BuiltinsRuntimeLibrary(ctx.toolchain())) deps.LateStaticLibs = append(deps.LateStaticLibs, config.BuiltinsRuntimeLibrary(ctx.toolchain()))
} }

View File

@ -62,6 +62,8 @@ func (stl *stl) begin(ctx BaseModuleContext) {
s := "" s := ""
if stl.Properties.Stl != nil { if stl.Properties.Stl != nil {
s = *stl.Properties.Stl s = *stl.Properties.Stl
} else if ctx.header() {
s = "none"
} }
if ctx.useSdk() && ctx.Device() { if ctx.useSdk() && ctx.Device() {
switch s { switch s {