summaryrefslogtreecommitdiff
path: root/cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc')
-rw-r--r--cc/cc.go26
-rw-r--r--cc/config/vndk.go66
-rw-r--r--cc/linkable.go5
3 files changed, 25 insertions, 72 deletions
diff --git a/cc/cc.go b/cc/cc.go
index ce3a2ed06..2e55841ee 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -1266,8 +1266,11 @@ func orderStaticModuleDeps(module LinkableInterface, staticDeps []LinkableInterf
allTransitiveDeps := make(map[android.Path][]android.Path, len(staticDeps))
staticDepFiles := []android.Path{}
for _, dep := range staticDeps {
- allTransitiveDeps[dep.OutputFile().Path()] = dep.GetDepsInLinkOrder()
- staticDepFiles = append(staticDepFiles, dep.OutputFile().Path())
+ // The OutputFile may not be valid for a variant not present, and the AllowMissingDependencies flag is set.
+ if dep.OutputFile().Valid() {
+ allTransitiveDeps[dep.OutputFile().Path()] = dep.GetDepsInLinkOrder()
+ staticDepFiles = append(staticDepFiles, dep.OutputFile().Path())
+ }
}
sharedDepFiles := []android.Path{}
for _, sharedDep := range sharedDeps {
@@ -1777,6 +1780,9 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) {
for _, lib := range deps.SharedLibs {
depTag := SharedDepTag
+ if c.static() {
+ depTag = SharedFromStaticDepTag
+ }
if inList(lib, deps.ReexportSharedLibHeaders) {
depTag = sharedExportDepTag
}
@@ -2194,7 +2200,7 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
depFile := android.OptionalPath{}
switch depTag {
- case ndkStubDepTag, SharedDepTag, sharedExportDepTag:
+ case ndkStubDepTag, SharedDepTag, SharedFromStaticDepTag, sharedExportDepTag:
ptr = &depPaths.SharedLibs
depPtr = &depPaths.SharedLibsDeps
depFile = ccDep.Toc()
@@ -2547,9 +2553,17 @@ func (c *Module) AndroidMkWriteAdditionalDependenciesForSourceAbiDiff(w io.Write
func (c *Module) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool {
if depTag, ok := ctx.OtherModuleDependencyTag(dep).(DependencyTag); ok {
- if cc, ok := dep.(*Module); ok && cc.IsStubs() && depTag.Shared {
- // dynamic dep to a stubs lib crosses APEX boundary
- return false
+ if cc, ok := dep.(*Module); ok {
+ if cc.HasStubsVariants() && depTag.Shared && depTag.Library {
+ // dynamic dep to a stubs lib crosses APEX boundary
+ return false
+ }
+ if depTag.FromStatic {
+ // shared_lib dependency from a static lib is considered as crossing
+ // the APEX boundary because the dependency doesn't actually is
+ // linked; the dependency is used only during the compilation phase.
+ return false
+ }
}
}
return true
diff --git a/cc/config/vndk.go b/cc/config/vndk.go
index 52bd9f0d0..7b8c3350f 100644
--- a/cc/config/vndk.go
+++ b/cc/config/vndk.go
@@ -18,48 +18,10 @@ package config
// For these libraries, the vendor variants must be installed even if the device
// has VndkUseCoreVariant set.
var VndkMustUseVendorVariantList = []string{
- "android.hardware.automotive.evs@1.0",
- "android.hardware.automotive.vehicle@2.0",
- "android.hardware.broadcastradio@2.0",
- "android.hardware.camera.device@1.0",
- "android.hardware.camera.device@3.2",
- "android.hardware.camera.device@3.3",
- "android.hardware.camera.device@3.4",
- "android.hardware.camera.provider@2.4",
- "android.hardware.fastboot@1.0",
- "android.hardware.media.bufferpool@1.0",
- "android.hardware.neuralnetworks@1.0",
- "android.hardware.neuralnetworks@1.1",
- "android.hardware.neuralnetworks@1.2",
- "android.hardware.neuralnetworks@1.3",
"android.hardware.nfc@1.2",
- "android.hardware.oemlock@1.0",
- "android.hardware.power.stats@1.0",
"android.hardware.power-ndk_platform",
- "android.hardware.power@1.0",
- "android.hardware.power@1.1",
- "android.hardware.radio@1.4",
- "android.hardware.secure_element@1.0",
- "android.hardware.sensors@1.0",
- "android.hardware.soundtrigger@2.0",
- "android.hardware.soundtrigger@2.0-core",
- "android.hardware.soundtrigger@2.1",
- "android.hardware.tetheroffload.config@1.0",
- "android.hardware.tetheroffload.control@1.0",
"android.hardware.vibrator-ndk_platform",
- "android.hardware.weaver@1.0",
- "android.hardware.wifi.hostapd@1.0",
- "android.hardware.wifi.offload@1.0",
- "android.hardware.wifi.supplicant@1.0",
- "android.hardware.wifi.supplicant@1.1",
- "android.hardware.wifi@1.1",
- "android.hardware.wifi@1.2",
- "android.hardwareundtrigger@2.0",
- "android.hardwareundtrigger@2.0-core",
- "android.hardwareundtrigger@2.1",
- "libaudioroute",
"libbinder",
- "libcamera_metadata",
"libcrypto",
"libexpat",
"libgatekeeper",
@@ -68,45 +30,17 @@ var VndkMustUseVendorVariantList = []string{
"libkeymaster_messages",
"libkeymaster_portable",
"libmedia_omx",
- "libprotobuf-cpp-full",
- "libprotobuf-cpp-lite",
"libpuresoftkeymasterdevice",
"libselinux",
"libsoftkeymasterdevice",
"libsqlite",
"libssl",
- "libstagefright_amrnb_common",
"libstagefright_bufferpool@2.0",
"libstagefright_bufferqueue_helper",
- "libstagefright_enc_common",
- "libstagefright_flacdec",
"libstagefright_foundation",
"libstagefright_omx",
"libstagefright_omx_utils",
- "libstagefright_soft_aacdec",
- "libstagefright_soft_aacenc",
- "libstagefright_soft_amrdec",
- "libstagefright_soft_amrnbenc",
- "libstagefright_soft_amrwbenc",
- "libstagefright_soft_avcdec",
- "libstagefright_soft_avcenc",
- "libstagefright_soft_flacdec",
- "libstagefright_soft_flacenc",
- "libstagefright_soft_g711dec",
- "libstagefright_soft_gsmdec",
- "libstagefright_soft_hevcdec",
- "libstagefright_soft_mp3dec",
- "libstagefright_soft_mpeg2dec",
- "libstagefright_soft_mpeg4dec",
- "libstagefright_soft_mpeg4enc",
- "libstagefright_soft_opusdec",
- "libstagefright_soft_rawdec",
- "libstagefright_soft_vorbisdec",
- "libstagefright_soft_vpxdec",
- "libstagefright_soft_vpxenc",
"libstagefright_xmlparser",
"libui",
- "libvorbisidec",
"libxml2",
- "libyuv",
}
diff --git a/cc/linkable.go b/cc/linkable.go
index 3c46d9dd9..2abb11264 100644
--- a/cc/linkable.go
+++ b/cc/linkable.go
@@ -67,12 +67,17 @@ type DependencyTag struct {
ReexportFlags bool
ExplicitlyVersioned bool
+
+ FromStatic bool
}
var (
SharedDepTag = DependencyTag{Name: "shared", Library: true, Shared: true}
StaticDepTag = DependencyTag{Name: "static", Library: true}
+ // Same as SharedDepTag, but from a static lib
+ SharedFromStaticDepTag = DependencyTag{Name: "shared from static", Library: true, Shared: true, FromStatic: true}
+
CrtBeginDepTag = DependencyTag{Name: "crtbegin"}
CrtEndDepTag = DependencyTag{Name: "crtend"}
)