2019-10-19 05:18:45 +08: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 11:15:49 +08:00
|
|
|
IncludeDirs() android.Paths
|
2019-10-19 05:18:45 +08:00
|
|
|
SetDepsInLinkOrder([]android.Path)
|
|
|
|
GetDepsInLinkOrder() []android.Path
|
|
|
|
|
|
|
|
HasStaticVariant() bool
|
|
|
|
GetStaticVariant() LinkableInterface
|
|
|
|
|
2019-11-22 04:30:50 +08:00
|
|
|
NonCcVariants() bool
|
|
|
|
|
2019-10-19 05:18:45 +08:00
|
|
|
StubsVersions() []string
|
2019-10-19 05:49:46 +08:00
|
|
|
BuildStubs() bool
|
2019-10-19 05:18:45 +08:00
|
|
|
SetBuildStubs()
|
|
|
|
SetStubsVersions(string)
|
2020-02-26 21:45:42 +08:00
|
|
|
StubsVersion() string
|
2019-10-19 05:49:46 +08:00
|
|
|
HasStubsVariants() bool
|
|
|
|
SelectedStl() string
|
|
|
|
ApiLevel() string
|
2019-10-19 05:18:45 +08:00
|
|
|
|
|
|
|
BuildStaticVariant() bool
|
|
|
|
BuildSharedVariant() bool
|
|
|
|
SetStatic()
|
|
|
|
SetShared()
|
2019-10-19 05:49:46 +08:00
|
|
|
Static() bool
|
|
|
|
Shared() bool
|
|
|
|
Toc() android.OptionalPath
|
|
|
|
|
2020-01-22 07:53:22 +08:00
|
|
|
InRamdisk() bool
|
|
|
|
OnlyInRamdisk() bool
|
|
|
|
|
2019-10-19 05:49:46 +08:00
|
|
|
InRecovery() bool
|
|
|
|
OnlyInRecovery() bool
|
|
|
|
|
2020-04-08 00:50:32 +08:00
|
|
|
UseSdk() bool
|
2019-10-19 05:49:46 +08:00
|
|
|
UseVndk() bool
|
|
|
|
MustUseVendorVariant() bool
|
|
|
|
IsVndk() bool
|
|
|
|
HasVendorVariant() bool
|
|
|
|
|
|
|
|
SdkVersion() string
|
2020-04-08 00:50:32 +08:00
|
|
|
AlwaysSdk() bool
|
2019-10-19 05:49:46 +08:00
|
|
|
|
|
|
|
ToolchainLibrary() bool
|
|
|
|
NdkPrebuiltStl() bool
|
|
|
|
StubDecorator() bool
|
2019-10-19 05:18:45 +08: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 16:14:23 +08:00
|
|
|
|
|
|
|
FromStatic bool
|
2019-10-19 05:18:45 +08: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 16:14:23 +08:00
|
|
|
// Same as SharedDepTag, but from a static lib
|
|
|
|
SharedFromStaticDepTag = DependencyTag{Name: "shared from static", Library: true, Shared: true, FromStatic: true}
|
|
|
|
|
2019-10-19 05:18:45 +08:00
|
|
|
CrtBeginDepTag = DependencyTag{Name: "crtbegin"}
|
|
|
|
CrtEndDepTag = DependencyTag{Name: "crtend"}
|
|
|
|
)
|