diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-15 21:40:24 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-15 21:40:24 +0000 |
commit | 15b099b6621da518a4ffbf3a1b4178902a951036 (patch) | |
tree | 0f4d08540c8e5fa16bcd0c99cd413fe815560e4b | |
parent | b39f643ff0a6e6acc1581a049f70709d06c2dd24 (diff) | |
parent | 0d51dc717edd4d97116b47bc156e83b8fa193d3d (diff) | |
download | libchrome-aml_tz3_314012010.tar.gz |
Snap for 8730993 from 0d51dc717edd4d97116b47bc156e83b8fa193d3d to mainline-tzdata3-releaseaml_tz3_314012070aml_tz3_314012050aml_tz3_314012010aml_tz3_313110000aml_tz3_312511020aml_tz3_312511010aml_tz3_312410020aml_tz3_312410010android12-mainline-tzdata3-releaseaml_tz3_314012010
Change-Id: I7f8c55e991973c0d7464e81992c3e37a7f0d8c1b
-rw-r--r-- | Android.bp | 19 | ||||
-rw-r--r-- | base/threading/thread_local_storage_unittest.cc | 4 | ||||
-rw-r--r-- | soong/bindings_generator.go | 60 |
3 files changed, 52 insertions, 31 deletions
diff --git a/Android.bp b/Android.bp index aada4d99f9..6bd807c029 100644 --- a/Android.bp +++ b/Android.bp @@ -513,6 +513,8 @@ gensrcs { cc_defaults { name: "libchrome-defaults", + // Set clang to "true" to force clang or "false" to force gcc. + // clang: true, cflags: [ "-Wall", @@ -772,13 +774,7 @@ libchromeLinuxSrc = [ "base/threading/platform_thread_linux.cc", ] -libchromeMuslSrc = [ - "base/debug/stack_trace_posix.cc", - "base/memory/platform_shared_memory_region_posix.cc", - "base/memory/shared_memory_handle_posix.cc", -] - -libchromeGlibcSrc = [ +libchromeLinuxGlibcSrc = [ "base/allocator/allocator_shim.cc", "base/allocator/allocator_shim_default_dispatch_to_glibc.cc", "base/debug/stack_trace_posix.cc", @@ -819,7 +815,6 @@ libchromeAndroidSrc = [ cc_library { name: "libchrome", host_supported: true, - ramdisk_available: true, recovery_available: true, vendor_available: true, defaults: ["libchrome-defaults"], @@ -854,11 +849,8 @@ cc_library { "liblog", ], }, - glibc: { - srcs: libchromeGlibcSrc, - }, - musl: { - srcs: libchromeMuslSrc, + linux_glibc: { + srcs: libchromeLinuxGlibcSrc, }, android: { srcs: libchromeAndroidSrc, @@ -868,7 +860,6 @@ cc_library { ], }, }, - min_sdk_version: "30", } // libchrome-crypto shared library for device diff --git a/base/threading/thread_local_storage_unittest.cc b/base/threading/thread_local_storage_unittest.cc index 64bc398cea..9062ff0c7f 100644 --- a/base/threading/thread_local_storage_unittest.cc +++ b/base/threading/thread_local_storage_unittest.cc @@ -84,9 +84,9 @@ class ThreadLocalStorageRunner : public DelegateSimpleThread::Delegate { void ThreadLocalStorageCleanup(void *value) { - int *ptr = static_cast<int*>(value); + int *ptr = reinterpret_cast<int*>(value); // Destructors should never be called with a NULL. - ASSERT_NE(nullptr, ptr); + ASSERT_NE(reinterpret_cast<int*>(NULL), ptr); if (*ptr == kFinalTlsValue) return; // We've been called enough times. ASSERT_LT(kFinalTlsValue, *ptr); diff --git a/soong/bindings_generator.go b/soong/bindings_generator.go index 98a27a2781..7ff98262ed 100644 --- a/soong/bindings_generator.go +++ b/soong/bindings_generator.go @@ -79,7 +79,7 @@ var ( type mojomDowngradedFilesProperties struct { // list of input files - Srcs []string `android:"path"` + Srcs []string } type mojomDowngradedFiles struct { @@ -93,10 +93,14 @@ type mojomDowngradedFiles struct { var _ genrule.SourceFileGenerator = (*mojomDowngradedFiles)(nil) +func (m *mojomDowngradedFiles) DepsMutator(ctx android.BottomUpMutatorContext) { + android.ExtractSourcesDeps(ctx, m.properties.Srcs) +} + func (m *mojomDowngradedFiles) GenerateAndroidBuildActions(ctx android.ModuleContext) { m.outDir = android.PathForModuleGen(ctx, "") - for _, in := range android.PathsForModuleSrc(ctx, m.properties.Srcs) { + for _, in := range ctx.ExpandSources(m.properties.Srcs, nil) { if !strings.HasSuffix(in.Rel(), ".mojom") { ctx.PropertyErrorf("srcs", "Source is not a .mojom file: %s", in.Rel()) continue @@ -141,7 +145,7 @@ func mojomDowngradedFilesFactory() android.Module { type mojomPicklesProperties struct { // list of input files - Srcs []string `android:"path"` + Srcs []string } type mojomPickles struct { @@ -155,10 +159,14 @@ type mojomPickles struct { var _ genrule.SourceFileGenerator = (*mojomPickles)(nil) +func (m *mojomPickles) DepsMutator(ctx android.BottomUpMutatorContext) { + android.ExtractSourcesDeps(ctx, m.properties.Srcs) +} + func (m *mojomPickles) GenerateAndroidBuildActions(ctx android.ModuleContext) { m.outDir = android.PathForModuleGen(ctx, "") - for _, in := range android.PathsForModuleSrc(ctx, m.properties.Srcs) { + for _, in := range ctx.ExpandSources(m.properties.Srcs, nil) { if !strings.HasSuffix(in.Rel(), ".mojom") { ctx.PropertyErrorf("srcs", "Source is not a .mojom file: %s", in.Rel()) continue @@ -210,36 +218,46 @@ func mojomPicklesFactory() android.Module { // source and Java source modules. type mojomGenerationProperties struct { // list of input files - Srcs []string `android:"path"` + Srcs []string // name of the output .srcjar Srcjar string // name of the templates module - Templates string `android:"path"` + Templates string // Additional flags to pass to the bindings generation script Flags string // list of pickles modules that will be imported - Pickles []string `android:"path"` + Pickles []string // list of include paths Includes []string // list of typemaps modules that will be imported - Typemaps []string `android:"path"` + Typemaps []string // If true, set --use_once_callback flag to the generator. // This works only on C++ generation. Use_once_callback bool } +// extractSources adds any necessary dependencies to satisfy filegroup or +// generated sources modules listed in the properties using ":module" syntax, +// if any. +func (p *mojomGenerationProperties) extractSources(ctx android.BottomUpMutatorContext) { + android.ExtractSourcesDeps(ctx, p.Srcs) + android.ExtractSourcesDeps(ctx, p.Typemaps) + android.ExtractSourcesDeps(ctx, p.Pickles) + android.ExtractSourceDeps(ctx, &p.Templates) +} + // flags generates all needed flags for the build rule. func (p *mojomGenerationProperties) flags(ctx android.ModuleContext) string { flags := []string{} - for _, typemap := range android.PathsForModuleSrc(ctx, p.Typemaps) { + for _, typemap := range ctx.ExpandSources(p.Typemaps, nil) { flags = append(flags, fmt.Sprintf("--typemap=%s", typemap.String())) } for _, include := range android.PathsForSource(ctx, p.Includes) { @@ -251,7 +269,7 @@ func (p *mojomGenerationProperties) flags(ctx android.ModuleContext) string { ctx.PropertyErrorf("pickles", "not a module: %q", m) continue } - module := android.GetModuleFromPathDep(ctx, m, "").(*mojomPickles) + module := ctx.GetDirectDepWithTag(m, android.SourceDepTag).(*mojomPickles) flags = append(flags, fmt.Sprintf("--gen_dir=%s", module.outDir.String())) } if p.Flags != "" { @@ -267,15 +285,15 @@ func (p *mojomGenerationProperties) flags(ctx android.ModuleContext) string { // implicitDeps collects all dependencies of the module. func (p *mojomGenerationProperties) implicitDeps(ctx android.ModuleContext) android.Paths { deps := android.Paths{} - deps = append(deps, android.PathsForModuleSrc(ctx, p.Pickles)...) - deps = append(deps, android.PathsForModuleSrc(ctx, p.Typemaps)...) - deps = append(deps, android.PathsForModuleSrc(ctx, []string{p.Templates})...) + deps = append(deps, ctx.ExpandSources(p.Pickles, nil)...) + deps = append(deps, ctx.ExpandSources(p.Typemaps, nil)...) + deps = append(deps, ctx.ExpandSources([]string{p.Templates}, nil)...) return deps } // templateDir returns the path where the template .zips are located. func (p *mojomGenerationProperties) templateDir(ctx android.ModuleContext) string { - srcFiles := android.PathsForModuleSrc(ctx, []string{p.Templates}) + srcFiles := ctx.ExpandSources([]string{p.Templates}, nil) if len(srcFiles) == 0 { ctx.PropertyErrorf("templates", "module %s does not produce any files", p.Templates) return "" @@ -302,7 +320,7 @@ func (p *mojomGenerationProperties) generateBuildActions( templateDir := p.templateDir(ctx) generatedSrcs := android.Paths{} - for _, in := range android.PathsForModuleSrc(ctx, p.Srcs) { + for _, in := range ctx.ExpandSources(p.Srcs, nil) { if !strings.HasSuffix(in.Rel(), ".mojom") { ctx.PropertyErrorf("srcs", "Source is not a .mojom file: %s", in.Rel()) continue @@ -348,6 +366,10 @@ type mojomHeaders struct { var _ genrule.SourceFileGenerator = (*mojomHeaders)(nil) +func (m *mojomHeaders) DepsMutator(ctx android.BottomUpMutatorContext) { + m.properties.extractSources(ctx) +} + func (m *mojomHeaders) GenerateAndroidBuildActions(ctx android.ModuleContext) { m.generatedSrcs = m.properties.generateBuildActions( ctx, @@ -404,6 +426,10 @@ type mojomSrcs struct { var _ genrule.SourceFileGenerator = (*mojomSrcs)(nil) +func (m *mojomSrcs) DepsMutator(ctx android.BottomUpMutatorContext) { + m.properties.extractSources(ctx) +} + func (m *mojomSrcs) GenerateAndroidBuildActions(ctx android.ModuleContext) { m.generatedSrcs = m.properties.generateBuildActions( ctx, @@ -456,6 +482,10 @@ type mojomSrcjar struct { var _ genrule.SourceFileGenerator = (*mojomSrcjar)(nil) +func (m *mojomSrcjar) DepsMutator(ctx android.BottomUpMutatorContext) { + m.properties.extractSources(ctx) +} + func (m *mojomSrcjar) GenerateAndroidBuildActions(ctx android.ModuleContext) { srcjars := m.properties.generateBuildActions( ctx, |