diff options
Diffstat (limited to 'cc')
-rw-r--r-- | cc/cc.go | 10 | ||||
-rw-r--r-- | cc/linkable.go | 6 | ||||
-rw-r--r-- | cc/snapshot_utils.go | 4 | ||||
-rw-r--r-- | cc/vendor_snapshot.go | 10 |
4 files changed, 28 insertions, 2 deletions
@@ -337,6 +337,7 @@ type BaseProperties struct { // Used by vendor snapshot to record dependencies from snapshot modules. SnapshotSharedLibs []string `blueprint:"mutated"` + SnapshotStaticLibs []string `blueprint:"mutated"` SnapshotRuntimeLibs []string `blueprint:"mutated"` Installable *bool @@ -2856,6 +2857,8 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps { c.Properties.AndroidMkStaticLibs = append( c.Properties.AndroidMkStaticLibs, makeLibName) } + // Record BaseLibName for snapshots. + c.Properties.SnapshotStaticLibs = append(c.Properties.SnapshotStaticLibs, BaseLibName(depName)) } } else if !c.IsStubs() { // Stubs lib doesn't link to the runtime lib, object, crt, etc. dependencies. @@ -3179,6 +3182,13 @@ func (c *Module) Binary() bool { return false } +func (c *Module) StaticExecutable() bool { + if b, ok := c.linker.(*binaryDecorator); ok { + return b.static() + } + return false +} + func (c *Module) Object() bool { if o, ok := c.linker.(interface { object() bool diff --git a/cc/linkable.go b/cc/linkable.go index 231626ecc..dd87334a3 100644 --- a/cc/linkable.go +++ b/cc/linkable.go @@ -94,6 +94,9 @@ type Snapshottable interface { // SnapshotSharedLibs returns the list of shared library dependencies for this module. SnapshotSharedLibs() []string + // SnapshotStaticLibs returns the list of static library dependencies for this module. + SnapshotStaticLibs() []string + // IsSnapshotPrebuilt returns true if this module is a snapshot prebuilt. IsSnapshotPrebuilt() bool } @@ -226,6 +229,9 @@ type LinkableInterface interface { // Header returns true if this is a library headers module. Header() bool + // StaticExecutable returns true if this is a binary module with "static_executable: true". + StaticExecutable() bool + // EverInstallable returns true if the module is ever installable EverInstallable() bool diff --git a/cc/snapshot_utils.go b/cc/snapshot_utils.go index a6c8ed522..b0538bea0 100644 --- a/cc/snapshot_utils.go +++ b/cc/snapshot_utils.go @@ -53,6 +53,10 @@ func (m *Module) SnapshotSharedLibs() []string { return m.Properties.SnapshotSharedLibs } +func (m *Module) SnapshotStaticLibs() []string { + return m.Properties.SnapshotStaticLibs +} + // snapshotLibraryInterface is an interface for libraries captured to VNDK / vendor snapshots. type snapshotLibraryInterface interface { libraryInterface diff --git a/cc/vendor_snapshot.go b/cc/vendor_snapshot.go index 5a303c806..7ba2363fc 100644 --- a/cc/vendor_snapshot.go +++ b/cc/vendor_snapshot.go @@ -242,10 +242,12 @@ type snapshotJsonFlags struct { SanitizeUbsanDep bool `json:",omitempty"` // binary flags - Symlinks []string `json:",omitempty"` + Symlinks []string `json:",omitempty"` + StaticExecutable bool `json:",omitempty"` // dependencies SharedLibs []string `json:",omitempty"` + StaticLibs []string `json:",omitempty"` RuntimeLibs []string `json:",omitempty"` Required []string `json:",omitempty"` @@ -381,6 +383,8 @@ func (c *snapshotSingleton) GenerateBuildActions(ctx android.SingletonContext) { if m.Shared() { prop.SharedLibs = m.SnapshotSharedLibs() } + // static libs dependencies are required to collect the NOTICE files. + prop.StaticLibs = m.SnapshotStaticLibs() if sanitizable, ok := m.(PlatformSanitizeable); ok { if sanitizable.Static() && sanitizable.SanitizePropDefined() { prop.SanitizeMinimalDep = sanitizable.MinimalRuntimeDep() || sanitizable.MinimalRuntimeNeeded() @@ -426,8 +430,10 @@ func (c *snapshotSingleton) GenerateBuildActions(ctx android.SingletonContext) { } else if m.Binary() { // binary flags prop.Symlinks = m.Symlinks() + prop.StaticExecutable = m.StaticExecutable() prop.SharedLibs = m.SnapshotSharedLibs() - + // static libs dependencies are required to collect the NOTICE files. + prop.StaticLibs = m.SnapshotStaticLibs() // install bin binPath := m.OutputFile().Path() snapshotBinOut := filepath.Join(snapshotArchDir, targetArch, "binary", binPath.Base()) |