2019-10-18 23:18:45 +02:00
|
|
|
package cc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/google/blueprint"
|
|
|
|
|
|
|
|
"android/soong/android"
|
|
|
|
)
|
|
|
|
|
|
|
|
type LinkableInterface interface {
|
|
|
|
Module() android.Module
|
|
|
|
CcLibrary() bool
|
|
|
|
CcLibraryInterface() bool
|
|
|
|
|
|
|
|
OutputFile() android.OptionalPath
|
|
|
|
|
2019-11-07 04:15:49 +01:00
|
|
|
IncludeDirs() android.Paths
|
2019-10-18 23:18:45 +02:00
|
|
|
SetDepsInLinkOrder([]android.Path)
|
|
|
|
GetDepsInLinkOrder() []android.Path
|
|
|
|
|
|
|
|
HasStaticVariant() bool
|
|
|
|
GetStaticVariant() LinkableInterface
|
|
|
|
|
2019-11-21 21:30:50 +01:00
|
|
|
NonCcVariants() bool
|
|
|
|
|
2019-10-18 23:18:45 +02:00
|
|
|
StubsVersions() []string
|
2019-10-18 23:49:46 +02:00
|
|
|
BuildStubs() bool
|
2019-10-18 23:18:45 +02:00
|
|
|
SetBuildStubs()
|
|
|
|
SetStubsVersions(string)
|
2020-02-26 14:45:42 +01:00
|
|
|
StubsVersion() string
|
2019-10-18 23:49:46 +02:00
|
|
|
HasStubsVariants() bool
|
|
|
|
SelectedStl() string
|
|
|
|
ApiLevel() string
|
2019-10-18 23:18:45 +02:00
|
|
|
|
|
|
|
BuildStaticVariant() bool
|
|
|
|
BuildSharedVariant() bool
|
|
|
|
SetStatic()
|
|
|
|
SetShared()
|
2019-10-18 23:49:46 +02:00
|
|
|
Static() bool
|
|
|
|
Shared() bool
|
|
|
|
Toc() android.OptionalPath
|
|
|
|
|
2020-01-22 00:53:22 +01:00
|
|
|
InRamdisk() bool
|
|
|
|
OnlyInRamdisk() bool
|
|
|
|
|
2019-10-18 23:49:46 +02:00
|
|
|
InRecovery() bool
|
|
|
|
OnlyInRecovery() bool
|
|
|
|
|
|
|
|
UseVndk() bool
|
|
|
|
MustUseVendorVariant() bool
|
|
|
|
IsVndk() bool
|
|
|
|
HasVendorVariant() bool
|
|
|
|
|
|
|
|
SdkVersion() string
|
|
|
|
|
|
|
|
ToolchainLibrary() bool
|
|
|
|
NdkPrebuiltStl() bool
|
|
|
|
StubDecorator() bool
|
2019-10-18 23:18:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type DependencyTag struct {
|
|
|
|
blueprint.BaseDependencyTag
|
|
|
|
Name string
|
|
|
|
Library bool
|
|
|
|
Shared bool
|
|
|
|
|
|
|
|
ReexportFlags bool
|
|
|
|
|
|
|
|
ExplicitlyVersioned bool
|
shared_lib dependency from a static lib crosses the APEX boundary
cc_library_static {
name: "libfoo",
shared_libs: ["libbar"],
}
cc_library {
name: "libbar",
}
If libfoo is part of an APEX, then libbar is no longer considered as a
member of the APEX, because it isn't actually linked to libfoo.
To distinguish such a shared lib dependency from a static library from a
shared lib dependency from a shared library, a new dep type
SharedFromStaticDepTag is introduced. It is treated exactly the same as
SharedDepTag, except when we determine whether a dependency is crossing
the APEX boundary or not.
This allows us to check the apex_available property more correctly.
Previously, modules were incorrectly considered as being used for an
APEX due to the shared lib dependency from a static lib.
As a good side effect, this also reduces the number of APEX variants.
Specifically, on aosp_arm64, the number of the generated modules were
reduced from 44745 to 44180.
Exempt-From-Owner-Approval: cherry-pick from internal
Bug: 147671264
Test: m
Merged-In: I899ccb9eae1574effef77ca1bc3a0df145983861
(cherry picked from commit 931b676a69c092451ed25a5dda67accf90ce6457)
Change-Id: I899ccb9eae1574effef77ca1bc3a0df145983861
2020-01-16 09:14:23 +01:00
|
|
|
|
|
|
|
FromStatic bool
|
2019-10-18 23:18:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var (
|
|
|
|
SharedDepTag = DependencyTag{Name: "shared", Library: true, Shared: true}
|
|
|
|
StaticDepTag = DependencyTag{Name: "static", Library: true}
|
|
|
|
|
shared_lib dependency from a static lib crosses the APEX boundary
cc_library_static {
name: "libfoo",
shared_libs: ["libbar"],
}
cc_library {
name: "libbar",
}
If libfoo is part of an APEX, then libbar is no longer considered as a
member of the APEX, because it isn't actually linked to libfoo.
To distinguish such a shared lib dependency from a static library from a
shared lib dependency from a shared library, a new dep type
SharedFromStaticDepTag is introduced. It is treated exactly the same as
SharedDepTag, except when we determine whether a dependency is crossing
the APEX boundary or not.
This allows us to check the apex_available property more correctly.
Previously, modules were incorrectly considered as being used for an
APEX due to the shared lib dependency from a static lib.
As a good side effect, this also reduces the number of APEX variants.
Specifically, on aosp_arm64, the number of the generated modules were
reduced from 44745 to 44180.
Exempt-From-Owner-Approval: cherry-pick from internal
Bug: 147671264
Test: m
Merged-In: I899ccb9eae1574effef77ca1bc3a0df145983861
(cherry picked from commit 931b676a69c092451ed25a5dda67accf90ce6457)
Change-Id: I899ccb9eae1574effef77ca1bc3a0df145983861
2020-01-16 09:14:23 +01:00
|
|
|
// Same as SharedDepTag, but from a static lib
|
|
|
|
SharedFromStaticDepTag = DependencyTag{Name: "shared from static", Library: true, Shared: true, FromStatic: true}
|
|
|
|
|
2019-10-18 23:18:45 +02:00
|
|
|
CrtBeginDepTag = DependencyTag{Name: "crtbegin"}
|
|
|
|
CrtEndDepTag = DependencyTag{Name: "crtend"}
|
|
|
|
)
|