Compare commits

...

8 commits

Author SHA1 Message Date
dianlujitao
c38f67a21e Add Init_rc to Product_variables.Eng
Change-Id: If490b64f3631ec0825ffa28964a3e65572a9bcb8
2024-09-08 13:24:54 +02:00
Chirayu Desai
fa05ec8e2f Replace {device,qti}_kernel_headers only when building inline
Change-Id: Ibbae77a92f5f96da92213d0a0078867ddeeeaf04
2024-09-07 20:42:22 +00:00
Nolen Johnson
73e6bfc947 Replace qti_kernel_headers with generated_kernel_headers
* Further avoids edits in CAF repos.

Change-Id: I99f9773e3132de7816c921c9d6b09e3e62b68265
2024-09-07 20:42:16 +00:00
Chirayu Desai
e8a02794af Replace device_kernel_headers with generated_kernel_headers
* For inline kernel building
* Avoids having to make edits to multiple repos, even
  if it's a quick replacement

Change-Id: I01d4a9b3e24315731efbc8d16882818d20e38e89
2024-09-07 20:42:10 +00:00
Alessandro Astone
f563943c6b soong: Add equivalent for LOCAL_EXPORT_CFLAGS
Change-Id: Ieb3e5739b50789bdbaf41a7d5adb04b08f7b9ea2
2024-09-07 20:41:58 +00:00
Scott Lobdell
8c89318cd2 Add qcom.fmradio and org.codeaurora.internal to allowlist
B58: Add org.codeaurora.ims to the list.

Bug: 192690464
Change-Id: I0837873f5bf4e3a8402d70e720d2b55ee4e0a991
(cherry picked from commit ef25c8777180f88650dad8bd2499e8c8c9d174b7)
2024-09-07 20:41:48 +00:00
LuK1337
7afb23c3c9 Add exported-to-kati namespaces to root namespace
This lets us use boot jar modules that are hidden behind
soong_namespace.

Change-Id: If0068387efdeca5458b5b97ce6b993b10a268bd2
2024-09-07 20:41:42 +00:00
Sam Mortimer
639cd2ce78 soong: Add PathForSourceRelaxed
Used by vendor/lineage generated kernel header module.

Partial pick from:
Author: Sam Mortimer <sam@mortimer.me.uk>
Date:   Fri Aug 17 11:25:08 2018 -0700
    soong: Add java sources overlay support
    Change-Id: I94143febb0a8afa6a165364d36a40d5120a4e7bc

Change-Id: I415af71458f2a7be8e256cb3c548994f09c5bebf
2024-09-07 20:41:21 +00:00
7 changed files with 95 additions and 0 deletions

View file

@ -156,6 +156,9 @@ func (r *NameResolver) addNamespace(namespace *Namespace) (err error) {
return fmt.Errorf("a namespace must be the first module in the file")
}
}
if (namespace.exportToKati) {
r.rootNamespace.visibleNamespaces = append(r.rootNamespace.visibleNamespaces, namespace)
}
r.sortedNamespaces.add(namespace)
r.namespacesByDir.Store(namespace.Path, namespace)

View file

@ -1145,6 +1145,31 @@ func pathForSource(ctx PathContext, pathComponents ...string) (SourcePath, error
return ret, nil
}
// pathForSourceRelaxed creates a SourcePath from pathComponents, but does not check that it exists.
// It differs from pathForSource in that the path is allowed to exist outside of the PathContext.
func pathForSourceRelaxed(ctx PathContext, pathComponents ...string) (SourcePath, error) {
p := filepath.Join(pathComponents...)
ret := SourcePath{basePath{p, ""}}
abs, err := filepath.Abs(ret.String())
if err != nil {
return ret, err
}
buildroot, err := filepath.Abs(ctx.Config().soongOutDir)
if err != nil {
return ret, err
}
if strings.HasPrefix(abs, buildroot) {
return ret, fmt.Errorf("source path %s is in output", abs)
}
if pathtools.IsGlob(ret.String()) {
return ret, fmt.Errorf("path may not contain a glob: %s", ret.String())
}
return ret, nil
}
// existsWithDependencies returns true if the path exists, and adds appropriate dependencies to rerun if the
// path does not exist.
func existsWithDependencies(ctx PathGlobContext, path SourcePath) (exists bool, err error) {
@ -1190,6 +1215,31 @@ func PathForSource(ctx PathContext, pathComponents ...string) SourcePath {
return path
}
// PathForSourceRelaxed joins the provided path components. Unlike PathForSource,
// the result is allowed to exist outside of the source dir.
// On error, it will return a usable, but invalid SourcePath, and report a ModuleError.
func PathForSourceRelaxed(ctx PathContext, pathComponents ...string) SourcePath {
path, err := pathForSourceRelaxed(ctx, pathComponents...)
if err != nil {
reportPathError(ctx, err)
}
if modCtx, ok := ctx.(ModuleContext); ok && ctx.Config().AllowMissingDependencies() {
exists, err := existsWithDependencies(modCtx, path)
if err != nil {
reportPathError(ctx, err)
}
if !exists {
modCtx.AddMissingDependencies([]string{path.String()})
}
} else if exists, _, err := ctx.Config().fs.Exists(path.String()); err != nil {
ReportPathErrorf(ctx, "%s: %s", path, err.Error())
} else if !exists {
ReportPathErrorf(ctx, "source path %s does not exist", path)
}
return path
}
// PathForArbitraryOutput creates a path for the given components. Unlike PathForOutput,
// the path is relative to the root of the output folder, not the out/soong folder.
func PathForArbitraryOutput(ctx PathContext, pathComponents ...string) Path {

View file

@ -150,6 +150,7 @@ type variableProperties struct {
Eng struct {
Cflags []string
Cppflags []string
Init_rc []string
Lto struct {
Never *bool
}

View file

@ -762,6 +762,13 @@ func cflags(ctx variableAssignmentContext) error {
return includeVariableNow(bpVariable{"cflags", bpparser.ListType}, ctx)
}
func exportCflags(ctx variableAssignmentContext) error {
// The Soong replacement for EXPORT_CFLAGS doesn't need the same extra escaped quotes that were present in Make
ctx.mkvalue = ctx.mkvalue.Clone()
ctx.mkvalue.ReplaceLiteral(`\"`, `"`)
return includeVariableNow(bpVariable{"export_cflags", bpparser.ListType}, ctx)
}
func protoOutputParams(ctx variableAssignmentContext) error {
// The Soong replacement for LOCAL_PROTO_JAVA_OUTPUT_PARAMS doesn't need ","
ctx.mkvalue = ctx.mkvalue.Clone()

View file

@ -2468,6 +2468,23 @@ 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" || entry == "qti_kernel_headers" {
if (ctx.Config().Getenv("INLINE_KERNEL_BUILDING") == "true") {
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)

View file

@ -196,6 +196,9 @@ type FlagExporterProperties struct {
// using -isystem for this module and any module that links against this module.
Export_system_include_dirs []string `android:"arch_variant,variant_prepend"`
// list of plain cc flags to be used for any module that links against this module.
Export_cflags []string `android:"arch_variant"`
Target struct {
Vendor, Product struct {
// list of exported include directories, like
@ -306,6 +309,10 @@ func (f *flagExporter) exportIncludes(ctx ModuleContext) {
f.systemDirs = append(f.systemDirs, android.PathsForModuleSrc(ctx, f.Properties.Export_system_include_dirs)...)
}
func (f *flagExporter) exportExtraFlags(ctx ModuleContext) {
f.flags = append(f.flags, f.Properties.Export_cflags...)
}
// exportIncludesAsSystem registers the include directories and system include directories to be
// exported transitively both as system include directories to modules depending on this module.
func (f *flagExporter) exportIncludesAsSystem(ctx ModuleContext) {
@ -1630,6 +1637,7 @@ func (library *libraryDecorator) link(ctx ModuleContext,
// Export include paths and flags to be propagated up the tree.
library.exportIncludes(ctx)
library.exportExtraFlags(ctx)
library.reexportDirs(deps.ReexportedDirs...)
library.reexportSystemDirs(deps.ReexportedSystemDirs...)
library.reexportFlags(deps.ReexportedFlags...)

View file

@ -258,3 +258,12 @@ com\.google\.i18n\.phonenumbers
# Packages used for Android in Chrome OS
org\.chromium\.arc
org\.chromium\.arc\..*
# QC adds
com.qualcomm.qti
com.quicinc.tcmiface
com.qualcomm.wfd
com.qualcomm.wfd.service
org.codeaurora.ims
org.codeaurora.internal
qcom.fmradio