Loading cc/cc.go +6 −0 Original line number Diff line number Diff line Loading @@ -3085,6 +3085,12 @@ func squashRecoverySrcs(m *Module) { } } func squashVendorRamdiskSrcs(m *Module) { if lib, ok := m.compiler.(*libraryDecorator); ok { lib.baseCompiler.Properties.Exclude_srcs = append(lib.baseCompiler.Properties.Exclude_srcs, lib.baseCompiler.Properties.Target.Vendor_ramdisk.Exclude_srcs...) } } func (c *Module) IsSdkVariant() bool { return c.Properties.IsSdkVariant || c.AlwaysSdk() } Loading cc/compiler.go +14 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,15 @@ type BaseCompilerProperties struct { // build the recovery variant of the C/C++ module. Exclude_generated_sources []string } Vendor_ramdisk struct { // list of source files that should not be used to // build the vendor ramdisk variant of the C/C++ module. Exclude_srcs []string `android:"path"` // List of additional cflags that should be used to build the vendor ramdisk // variant of the C/C++ module. Cflags []string } } Proto struct { Loading Loading @@ -290,6 +299,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps CheckBadCompilerFlags(ctx, "asflags", compiler.Properties.Asflags) CheckBadCompilerFlags(ctx, "vendor.cflags", compiler.Properties.Target.Vendor.Cflags) CheckBadCompilerFlags(ctx, "recovery.cflags", compiler.Properties.Target.Recovery.Cflags) CheckBadCompilerFlags(ctx, "vendor_ramdisk.cflags", compiler.Properties.Target.Vendor_ramdisk.Cflags) esc := proptools.NinjaAndShellEscapeList Loading Loading @@ -471,6 +481,10 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps flags.Local.CFlags = append(flags.Local.CFlags, esc(compiler.Properties.Target.Recovery.Cflags)...) } if ctx.inVendorRamdisk() { flags.Local.CFlags = append(flags.Local.CFlags, esc(compiler.Properties.Target.Vendor_ramdisk.Cflags)...) } // We can enforce some rules more strictly in the code we own. strict // indicates if this is code that we can be stricter with. If we have // rules that we want to apply to *our* code (but maybe can't for Loading cc/image.go +4 −1 Original line number Diff line number Diff line Loading @@ -353,8 +353,11 @@ func (c *Module) ExtraImageVariations(ctx android.BaseModuleContext) []string { func (c *Module) SetImageVariation(ctx android.BaseModuleContext, variant string, module android.Module) { m := module.(*Module) if variant == android.RamdiskVariation || variant == android.VendorRamdiskVariation { if variant == android.RamdiskVariation { m.MakeAsPlatform() } else if variant == android.VendorRamdiskVariation { m.MakeAsPlatform() squashVendorRamdiskSrcs(m) } else if variant == android.RecoveryVariation { m.MakeAsPlatform() squashRecoverySrcs(m) Loading cc/library.go +7 −0 Original line number Diff line number Diff line Loading @@ -833,6 +833,13 @@ func (library *libraryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps { deps.ReexportSharedLibHeaders = removeListFromList(deps.ReexportSharedLibHeaders, library.baseLinker.Properties.Target.Ramdisk.Exclude_shared_libs) deps.ReexportStaticLibHeaders = removeListFromList(deps.ReexportStaticLibHeaders, library.baseLinker.Properties.Target.Ramdisk.Exclude_static_libs) } if ctx.inVendorRamdisk() { deps.WholeStaticLibs = removeListFromList(deps.WholeStaticLibs, library.baseLinker.Properties.Target.Vendor_ramdisk.Exclude_static_libs) deps.SharedLibs = removeListFromList(deps.SharedLibs, library.baseLinker.Properties.Target.Vendor_ramdisk.Exclude_shared_libs) deps.StaticLibs = removeListFromList(deps.StaticLibs, library.baseLinker.Properties.Target.Vendor_ramdisk.Exclude_static_libs) deps.ReexportSharedLibHeaders = removeListFromList(deps.ReexportSharedLibHeaders, library.baseLinker.Properties.Target.Vendor_ramdisk.Exclude_shared_libs) deps.ReexportStaticLibHeaders = removeListFromList(deps.ReexportStaticLibHeaders, library.baseLinker.Properties.Target.Vendor_ramdisk.Exclude_static_libs) } return deps } Loading cc/linker.go +17 −0 Original line number Diff line number Diff line Loading @@ -158,6 +158,15 @@ type BaseLinkerProperties struct { // the ramdisk variant of the C/C++ module. Exclude_static_libs []string } Vendor_ramdisk struct { // list of shared libs that should not be used to build // the recovery variant of the C/C++ module. Exclude_shared_libs []string // list of static libs that should not be used to build // the vendor ramdisk variant of the C/C++ module. Exclude_static_libs []string } Platform struct { // list of shared libs that should be use to build the platform variant // of a module that sets sdk_version. This should rarely be necessary, Loading Loading @@ -267,6 +276,14 @@ func (linker *baseLinker) linkerDeps(ctx DepsContext, deps Deps) Deps { deps.WholeStaticLibs = removeListFromList(deps.WholeStaticLibs, linker.Properties.Target.Ramdisk.Exclude_static_libs) } if ctx.inVendorRamdisk() { deps.SharedLibs = removeListFromList(deps.SharedLibs, linker.Properties.Target.Vendor_ramdisk.Exclude_shared_libs) deps.ReexportSharedLibHeaders = removeListFromList(deps.ReexportSharedLibHeaders, linker.Properties.Target.Vendor_ramdisk.Exclude_shared_libs) deps.StaticLibs = removeListFromList(deps.StaticLibs, linker.Properties.Target.Vendor_ramdisk.Exclude_static_libs) deps.ReexportStaticLibHeaders = removeListFromList(deps.ReexportStaticLibHeaders, linker.Properties.Target.Vendor_ramdisk.Exclude_static_libs) deps.WholeStaticLibs = removeListFromList(deps.WholeStaticLibs, linker.Properties.Target.Vendor_ramdisk.Exclude_static_libs) } if !ctx.useSdk() { deps.SharedLibs = append(deps.SharedLibs, linker.Properties.Target.Platform.Shared_libs...) } Loading Loading
cc/cc.go +6 −0 Original line number Diff line number Diff line Loading @@ -3085,6 +3085,12 @@ func squashRecoverySrcs(m *Module) { } } func squashVendorRamdiskSrcs(m *Module) { if lib, ok := m.compiler.(*libraryDecorator); ok { lib.baseCompiler.Properties.Exclude_srcs = append(lib.baseCompiler.Properties.Exclude_srcs, lib.baseCompiler.Properties.Target.Vendor_ramdisk.Exclude_srcs...) } } func (c *Module) IsSdkVariant() bool { return c.Properties.IsSdkVariant || c.AlwaysSdk() } Loading
cc/compiler.go +14 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,15 @@ type BaseCompilerProperties struct { // build the recovery variant of the C/C++ module. Exclude_generated_sources []string } Vendor_ramdisk struct { // list of source files that should not be used to // build the vendor ramdisk variant of the C/C++ module. Exclude_srcs []string `android:"path"` // List of additional cflags that should be used to build the vendor ramdisk // variant of the C/C++ module. Cflags []string } } Proto struct { Loading Loading @@ -290,6 +299,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps CheckBadCompilerFlags(ctx, "asflags", compiler.Properties.Asflags) CheckBadCompilerFlags(ctx, "vendor.cflags", compiler.Properties.Target.Vendor.Cflags) CheckBadCompilerFlags(ctx, "recovery.cflags", compiler.Properties.Target.Recovery.Cflags) CheckBadCompilerFlags(ctx, "vendor_ramdisk.cflags", compiler.Properties.Target.Vendor_ramdisk.Cflags) esc := proptools.NinjaAndShellEscapeList Loading Loading @@ -471,6 +481,10 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps flags.Local.CFlags = append(flags.Local.CFlags, esc(compiler.Properties.Target.Recovery.Cflags)...) } if ctx.inVendorRamdisk() { flags.Local.CFlags = append(flags.Local.CFlags, esc(compiler.Properties.Target.Vendor_ramdisk.Cflags)...) } // We can enforce some rules more strictly in the code we own. strict // indicates if this is code that we can be stricter with. If we have // rules that we want to apply to *our* code (but maybe can't for Loading
cc/image.go +4 −1 Original line number Diff line number Diff line Loading @@ -353,8 +353,11 @@ func (c *Module) ExtraImageVariations(ctx android.BaseModuleContext) []string { func (c *Module) SetImageVariation(ctx android.BaseModuleContext, variant string, module android.Module) { m := module.(*Module) if variant == android.RamdiskVariation || variant == android.VendorRamdiskVariation { if variant == android.RamdiskVariation { m.MakeAsPlatform() } else if variant == android.VendorRamdiskVariation { m.MakeAsPlatform() squashVendorRamdiskSrcs(m) } else if variant == android.RecoveryVariation { m.MakeAsPlatform() squashRecoverySrcs(m) Loading
cc/library.go +7 −0 Original line number Diff line number Diff line Loading @@ -833,6 +833,13 @@ func (library *libraryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps { deps.ReexportSharedLibHeaders = removeListFromList(deps.ReexportSharedLibHeaders, library.baseLinker.Properties.Target.Ramdisk.Exclude_shared_libs) deps.ReexportStaticLibHeaders = removeListFromList(deps.ReexportStaticLibHeaders, library.baseLinker.Properties.Target.Ramdisk.Exclude_static_libs) } if ctx.inVendorRamdisk() { deps.WholeStaticLibs = removeListFromList(deps.WholeStaticLibs, library.baseLinker.Properties.Target.Vendor_ramdisk.Exclude_static_libs) deps.SharedLibs = removeListFromList(deps.SharedLibs, library.baseLinker.Properties.Target.Vendor_ramdisk.Exclude_shared_libs) deps.StaticLibs = removeListFromList(deps.StaticLibs, library.baseLinker.Properties.Target.Vendor_ramdisk.Exclude_static_libs) deps.ReexportSharedLibHeaders = removeListFromList(deps.ReexportSharedLibHeaders, library.baseLinker.Properties.Target.Vendor_ramdisk.Exclude_shared_libs) deps.ReexportStaticLibHeaders = removeListFromList(deps.ReexportStaticLibHeaders, library.baseLinker.Properties.Target.Vendor_ramdisk.Exclude_static_libs) } return deps } Loading
cc/linker.go +17 −0 Original line number Diff line number Diff line Loading @@ -158,6 +158,15 @@ type BaseLinkerProperties struct { // the ramdisk variant of the C/C++ module. Exclude_static_libs []string } Vendor_ramdisk struct { // list of shared libs that should not be used to build // the recovery variant of the C/C++ module. Exclude_shared_libs []string // list of static libs that should not be used to build // the vendor ramdisk variant of the C/C++ module. Exclude_static_libs []string } Platform struct { // list of shared libs that should be use to build the platform variant // of a module that sets sdk_version. This should rarely be necessary, Loading Loading @@ -267,6 +276,14 @@ func (linker *baseLinker) linkerDeps(ctx DepsContext, deps Deps) Deps { deps.WholeStaticLibs = removeListFromList(deps.WholeStaticLibs, linker.Properties.Target.Ramdisk.Exclude_static_libs) } if ctx.inVendorRamdisk() { deps.SharedLibs = removeListFromList(deps.SharedLibs, linker.Properties.Target.Vendor_ramdisk.Exclude_shared_libs) deps.ReexportSharedLibHeaders = removeListFromList(deps.ReexportSharedLibHeaders, linker.Properties.Target.Vendor_ramdisk.Exclude_shared_libs) deps.StaticLibs = removeListFromList(deps.StaticLibs, linker.Properties.Target.Vendor_ramdisk.Exclude_static_libs) deps.ReexportStaticLibHeaders = removeListFromList(deps.ReexportStaticLibHeaders, linker.Properties.Target.Vendor_ramdisk.Exclude_static_libs) deps.WholeStaticLibs = removeListFromList(deps.WholeStaticLibs, linker.Properties.Target.Vendor_ramdisk.Exclude_static_libs) } if !ctx.useSdk() { deps.SharedLibs = append(deps.SharedLibs, linker.Properties.Target.Platform.Shared_libs...) } Loading