platform_build_soong/cc
Jiyong Park f7c3bbe433 Prebuilt stub not available to platform is handled correctly
When a shared library providing stubs is included in an APEX, only the
stub variant (i.e. version:"1", etc.) gets emitted to Android.mk. This
enforces that everything in the Make world to link to the stub providing
only the public APIs of the library. The non-stub variant (i.e.
version:"") isn't exposed, otherwise, others will be able to access
private part of the lib which isn't guaranteed to be stable.

This has been done by unhiding the stub variant when it is known that
the library is actually included in an APEX. Note that stub variants are
by default hidden.

The above mechanism however doesn't work when the shared library is
replaced by a prebuilt and when the APEX is also replaced by a prebuilt.
Then, the fact that the prebuilt library is actually in the APEX gets
lost.  In that case, AnyVariantDirectlyInAnyApex() returns false for the
prebuilt library. As a result, the stub variant remains hidden and not
emitted to Android.mk.

This change fixes the problem by checking if the lib isn't available for
the platform at all. If not available for the platform (e.g.
apex_available doesn't have "//apex_available:platform"), the lib is
assumed to be included in an APEX even when it actually didn't go
through the apex mutator (... because it's a prebuilt).

Bug: 175166063
Test: m nothing

Change-Id: I41fabd5b368baecf4dc3c5a080b466f8bcd79d77
2020-12-15 09:17:36 +09:00
..
config Move keymint to android.hardware.security. 2020-12-11 20:37:03 +00:00
libbuildversion Set apex_available property 2020-04-28 21:08:58 +09:00
ndk_api_coverage_parser Fix non-determinism in tests. 2020-07-16 13:23:33 -07:00
ndkstubgen Add type information to symbolfile and ndkstubgen. 2020-09-24 14:03:31 -07:00
symbolfile Add type information to symbolfile and ndkstubgen. 2020-09-24 14:03:31 -07:00
Android.bp Add some comments for VNDK / vendor snapshots 2020-12-10 21:12:39 +09:00
OWNERS Refactor OWNERS files in platform/build/soong. 2020-10-08 16:14:32 -07:00
androidmk.go Prebuilt stub not available to platform is handled correctly 2020-12-15 09:17:36 +09:00
api_level.go Replace stringly-typed API levels. 2020-09-18 12:41:28 -07:00
binary.go Improve commenting for cc/builer.go, and kill dead code 2020-12-01 18:28:38 -05:00
binary_sdk_member.go Create fewer empty version variants 2020-10-05 18:57:21 -07:00
builder.go Merge "Soong: add missing header-abi-dumper inputs" 2020-12-09 07:26:36 +00:00
cc.go Prebuilt stub not available to platform is handled correctly 2020-12-15 09:17:36 +09:00
cc_test.go Merge "Refactor for preliminary Rust vendor image support" 2020-12-11 13:40:20 +00:00
ccdeps.go Add soong cc and java deps to general-tests dist 2020-07-06 16:19:56 -07:00
cflag_artifacts.go Pass pctx and ctx to NewRuleBuilder 2020-12-01 16:22:16 -08:00
check.go Forbid -fwhole_program_vtables 2020-09-23 01:39:32 +08:00
cmakelists.go Sandbox soong_build by changing to root directory 2020-01-11 01:11:46 +00:00
compdb.go Sandbox soong_build by changing to root directory 2020-01-11 01:11:46 +00:00
compiler.go Merge "Rename __ANDROID_SDK_VERSION__." 2020-12-03 22:09:56 +00:00
compiler_test.go Revert "Make lots of tests run in parallel" 2020-10-09 18:34:24 -07:00
coverage.go [coverage] Wrap calls to open 2020-12-10 21:45:34 +00:00
fuzz.go Pass pctx and ctx to NewRuleBuilder 2020-12-01 16:22:16 -08:00
gen.go Pass pctx and ctx to NewRuleBuilder 2020-12-01 16:22:16 -08:00
gen_test.go Reland: Rewrite sbox to use a textproto manifest 2020-11-20 15:45:04 -08:00
genrule.go Define product_available property 2020-11-08 23:53:22 +00:00
genrule_test.go Move genrule on top of RuleBuilder 2020-11-17 11:23:45 -08:00
image.go Refactor for preliminary Rust vendor image support 2020-12-10 10:29:48 -05:00
installer.go Only output make targets for uninstallable static libs in the APEX 2020-08-06 22:52:58 +01:00
kernel_headers.go Start using Providers instead of direct module access 2020-10-12 16:55:47 -07:00
library.go Merge "Refactor for preliminary Rust vendor image support" 2020-12-11 13:40:20 +00:00
library_headers.go Disable all host OS variants except those explicitly included. 2020-08-03 21:06:50 +01:00
library_headers_test.go Revert "Make lots of tests run in parallel" 2020-10-09 18:34:24 -07:00
library_sdk_member.go Define product_available property 2020-11-08 23:53:22 +00:00
library_test.go Revert "Make lots of tests run in parallel" 2020-10-09 18:34:24 -07:00
linkable.go Merge "Refactor for preliminary Rust vendor image support" 2020-12-11 13:40:20 +00:00
linker.go target.apex.exclude_[shared|static]_libs to cc_* modules 2020-12-04 18:09:39 +09:00
llndk_library.go Define product_available property 2020-11-08 23:53:22 +00:00
lto.go Global ThinLTO: opt out vndk binaries as a workaround 2020-10-09 22:08:11 +08:00
makevars.go Store ndkKnownLibs in the config 2020-11-17 10:50:19 -08:00
ndk_headers.go Remove unused mips workarounds. 2020-03-06 18:15:44 -08:00
ndk_library.go Store ndkKnownLibs in the config 2020-11-17 10:50:19 -08:00
ndk_prebuilt.go Start using Providers instead of direct module access 2020-10-12 16:55:47 -07:00
ndk_sysroot.go Move stubs related methods out of LinkableInterface 2020-10-29 14:17:54 -07:00
object.go Improve commenting for cc/builer.go, and kill dead code 2020-12-01 18:28:38 -05:00
object_test.go Revert "Make lots of tests run in parallel" 2020-10-09 18:34:24 -07:00
pgo.go Always generate profiling debug info 2020-11-03 18:13:21 +00:00
prebuilt.go Improve commenting for cc/builer.go, and kill dead code 2020-12-01 18:28:38 -05:00
prebuilt_test.go Refactor 'in_make' to mean Kati is not skipped. 2020-11-23 00:29:18 -05:00
proto.go Pass pctx and ctx to NewRuleBuilder 2020-12-01 16:22:16 -08:00
proto_test.go Revert "Make lots of tests run in parallel" 2020-10-09 18:34:24 -07:00
pylintrc Fix pylint issues in gen_stub_libs. 2020-07-16 13:21:43 -07:00
rs.go Remove obsolete PDK build functionality 2020-08-11 01:11:44 +00:00
sabi.go Add libraryDependencyTag to track dependencies on static and shared libraries 2020-07-29 13:22:30 -07:00
sanitize.go Add arch_variant support for diag 2020-12-01 11:26:39 -08:00
sdk.go Don't make SplitPerApiLevel imply UseSdk 2020-10-02 13:00:19 -07:00
sdk_test.go Revert "Make lots of tests run in parallel" 2020-10-09 18:34:24 -07:00
snapshot_prebuilt.go Add some comments for VNDK / vendor snapshots 2020-12-10 21:12:39 +09:00
snapshot_utils.go Add some comments for VNDK / vendor snapshots 2020-12-10 21:12:39 +09:00
stl.go Replace stringly-typed API levels. 2020-09-18 12:41:28 -07:00
strip.go Allow stripping host modules 2020-12-04 09:43:49 -08:00
stub_library.go Generate system stub library list at build time 2020-12-01 14:09:03 +09:00
sysprop.go Add comments about sysprop_library 2020-11-24 14:13:31 +09:00
test.go test_for is available for all cc_* module types 2020-12-09 12:59:19 +09:00
test_data_test.go Pass Config to NewTestContext instead of ctx.Register 2020-11-12 10:07:49 -08:00
testing.go Merge "Add min_sdk_version to Rust modules." 2020-12-10 23:54:34 +00:00
tidy.go Allow globally disabling some clang-tidy checks. 2020-08-18 13:28:03 -07:00
toolchain_library.go Improve commenting for cc/builer.go, and kill dead code 2020-12-01 18:28:38 -05:00
util.go Add some comments for VNDK / vendor snapshots 2020-12-10 21:12:39 +09:00
vendor_public_library.go cc: export Stripper struct 2020-08-27 10:13:42 +02:00
vendor_snapshot.go Merge "Refactor for preliminary Rust vendor image support" 2020-12-11 13:40:20 +00:00
vndk.go Merge "Refactor for preliminary Rust vendor image support" 2020-12-11 13:40:20 +00:00
vndk_prebuilt.go Improve commenting for cc/builer.go, and kill dead code 2020-12-01 18:28:38 -05:00