diff --git a/cc/cc.go b/cc/cc.go index df0aa6d68..2d9c184e9 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -2468,6 +2468,21 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) { variantNdkLibs := []string{} variantLateNdkLibs := []string{} if ctx.Os() == android.Android { + rewriteHeaderLibs := func(list []string) (newHeaderLibs []string) { + newHeaderLibs = []string{} + for _, entry := range list { + // Replace device_kernel_headers with generated_kernel_headers + // for inline kernel building + if entry == "device_kernel_headers" { + newHeaderLibs = append(newHeaderLibs, "generated_kernel_headers") + continue + } + newHeaderLibs = append(newHeaderLibs, entry) + } + return newHeaderLibs + } + deps.HeaderLibs = rewriteHeaderLibs(deps.HeaderLibs) + deps.SharedLibs, variantNdkLibs = FilterNdkLibs(c, ctx.Config(), deps.SharedLibs) deps.LateSharedLibs, variantLateNdkLibs = FilterNdkLibs(c, ctx.Config(), deps.LateSharedLibs) deps.ReexportSharedLibHeaders, _ = FilterNdkLibs(c, ctx.Config(), deps.ReexportSharedLibHeaders)