platform_build_soong/cc
Colin Cross d6b2525b00 Deduplicate APEX variants that would build identically
APEX variants that share the same SDK version and updatability
almost always use identical command line arguments to build but
with different intermediates directories.  This causes unnecessary
build time and disk space for duplicated work.

Deduplicate APEX variants that would build identically.  Create
aliases from the per-APEX variations to the new shared variations
so that the APEX modules can continue to depend on them via the
APEX name as the variation.

This has one significant change in behavior.  Before this change,
if an APEX had two libraries in its direct dependencies and one
of those libraries depended on the other, and the second library
had stubs, then the first library would depend on the implementation
of the second library and not the stubs.  After this change, if
the first library is also present in a second APEX but the second
library is not, then the common variant shared between the two
APEXes would use the stubs, not the implementation.

In a correctly configured set of build rules this change will
be irrelevant, because if the compilation worked for the second
APEX using stubs then it will work for the common variant using
stubs.  However, if an incorrect change to the build rules is
made this could lead to confusing errors, as a previously-working
common variant could suddenly stop building when a module is added
to a new APEX without its dependencies that require implementation
APIs to compile.

This change reduces the number of modules in an AOSP arm64-userdebug
build by 3% (52242 to 50586), reduces the number of variants of the
libcutils module from 74 to 53, and reduces the number of variants
of the massive libart[d] modules from 44 to 32.

Bug: 164216768
Test: go test ./build/soong/apex/...
Change-Id: I0529837476a253c32b3dfb98dcccf107427c742c
2020-08-17 15:18:31 -07:00
..
config Merge "Add remote execution support for clang-tidy actions" 2020-08-12 13:46:10 +00:00
libbuildversion Set apex_available property 2020-04-22 23:12:42 +09:00
ndk_api_coverage_parser Fix non-determinism in tests. 2020-07-16 13:23:33 -07:00
ndkstubgen Get NDK python script tests running. 2020-07-16 13:23:29 -07:00
symbolfile Get NDK python script tests running. 2020-07-16 13:23:29 -07:00
Android.bp Move image mutator things to image.go 2020-08-05 04:47:28 +00:00
androidmk.go Merge "Improve abidump generating logic for non-REL build" 2020-08-13 11:53:05 +00:00
binary.go Rename ApexName to ApexVariationName 2020-08-13 17:50:29 -07:00
binary_sdk_member.go Disable all host OS variants except those explicitly included. 2020-08-03 21:06:50 +01:00
builder.go Add remote execution support for clang-tidy actions 2020-06-18 09:34:19 -07:00
cc.go Deduplicate APEX variants that would build identically 2020-08-17 15:18:31 -07:00
cc_test.go Add cfi static libraries to vendor snapshot 2020-08-06 19:47:57 +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 Simple refactoring of prefix related functions. 2020-02-14 14:33:49 -08:00
check.go Forbid -Weverything 2019-11-12 15:55:03 -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 Deduplicate APEX variants that would build identically 2020-08-17 15:18:31 -07:00
compiler_test.go Expand ClangExtraExternalCflags to non-Google vendor projects 2019-11-11 13:24:39 -08:00
coverage.go Merge "Add libraryDependencyTag to track dependencies on static and shared libraries" 2020-08-06 00:06:28 +00:00
fuzz.go add researcher_submitted field to cc_fuzz 2020-05-06 03:25:54 +00:00
gen.go Revert "Switch cc's use of bison and flex to prebuilt_build_tool" 2020-07-24 21:25:00 +00:00
gen_test.go Use empty string for core image variant 2019-12-13 20:44:36 -08:00
genrule.go Create only one vendor variant depending on path 2020-06-05 04:26:24 +00:00
genrule_test.go Add alias variations to linkageMutator 2020-08-06 18:46:06 -07:00
image.go Separate lists of soong sanitize modules 2020-08-05 04:47:41 +00: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 Change exportedDirs and exportedSystemDirs from []string to android.Paths 2019-10-25 09:52:08 +09:00
library.go Stop using prebuilt NDK CRT objects. 2020-08-11 15:06:55 -07: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 Add cc_prebuilt_library_headers 2020-02-24 14:49:22 +00:00
library_sdk_member.go Disable all host OS variants except those explicitly included. 2020-08-03 21:06:50 +01:00
library_test.go Apex: support codenames for min_sdk_version 2020-04-09 16:04:17 +09:00
linkable.go Add libraryDependencyTag to track dependencies on static and shared libraries 2020-07-29 13:22:30 -07:00
linker.go Remove libc_scudo references. 2020-06-22 15:27:56 -07:00
llndk_library.go Nullify stl and sanitize of llndk_headers 2020-07-08 07:56:02 +09:00
lto.go Handle static unwinder in ltoDepsMutator 2020-07-29 13:22:33 -07:00
makevars.go Remove M4 export to Make 2020-08-07 13:45:45 -07:00
ndk_headers.go Remove unused mips workarounds. 2020-03-06 18:15:44 -08:00
ndk_library.go Stop using prebuilt NDK CRT objects. 2020-08-11 15:06:55 -07:00
ndk_prebuilt.go apex/apk: enforce min_sdk_version of all deps 2020-06-24 02:00:33 +09:00
ndk_sysroot.go Expose some factories for aidl_test.go 2019-12-09 18:21:48 +09:00
object.go Stop using prebuilt NDK CRT objects. 2020-08-11 15:06:55 -07:00
object_test.go Allow linker scripts when building objects. 2019-08-22 13:21:37 -07:00
pgo.go [pgo] Allow profile gather and use flags to coexist for sampling PGO 2020-07-22 02:01:49 +08:00
prebuilt.go Only output make targets for uninstallable static libs in the APEX 2020-08-06 22:52:58 +01:00
prebuilt_test.go cc_prebuilt_library respect module name and stem 2020-04-13 17:02:27 +08:00
proto.go Split local and global cflags 2019-11-07 15:27:58 -08:00
proto_test.go Use empty string for core image variant 2019-12-13 20:44:36 -08: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 Merge "[cc/sanitize] Deprecate blacklist sub-property of sanitize" 2020-08-11 21:24:16 +00:00
sdk.go Build against SDKs for native libs only for unbundled apps. 2020-06-17 04:28:27 +01:00
sdk_test.go Revert^2 "Add sdk mutator for native modules" 2020-04-07 16:50:32 +00:00
snapshot_utils.go Capture snapshot headers in parallel 2020-03-04 23:39:42 +09:00
stl.go Revert^2 "Add sdk mutator for native modules" 2020-04-07 16:50:32 +00:00
strip.go Remove use_gnu_strip option 2019-09-13 12:18:47 -07:00
sysprop.go Implement sysprop_library API stability check 2019-08-23 06:28:34 +00:00
test.go Install data_libs using relative_install_path property 2020-07-20 13:59:24 -04:00
test_data_test.go Move filesystem into Config 2019-12-18 08:19:10 -08:00
testing.go Stop using prebuilt NDK CRT objects. 2020-08-11 15:06:55 -07:00
tidy.go Switch to clang-r383902 (11.0.1). 2020-04-27 01:17:12 -07:00
toolchain_library.go Revert^2 "Add sdk mutator for native modules" 2020-04-07 16:50:32 +00:00
util.go Only package gcno files for gcov coverage builds. 2020-04-22 13:30:07 -07:00
vendor_public_library.go Split local and global cflags 2019-11-07 15:27:58 -08:00
vendor_snapshot.go Add cfi static libraries to vendor snapshot 2020-08-06 19:47:57 +00:00
vndk.go Add libraryDependencyTag to track dependencies on static and shared libraries 2020-07-29 13:22:30 -07:00
vndk_prebuilt.go Implement cc_object vendor snapshot 2020-06-05 04:26:17 +00:00