Adds dylib support for vendor and recovery images.
This changes the default linkage for vendor and recovery images to
dylib, which matches the platform default linkage. This also means that
by default, dylib-std variants are used for rlib dependencies.
Bug: 204303985
Test: Soong tests.
Test: m dist vendor-snapshot
Test: RECOVERY_SNAPSHOT_VERSION=current m dist recovery-snapshot
Change-Id: If84074b8615a70c45e7e162abeb853dc8c34d49a
Current snapshot definition is located in the CC module, so it is
difficult to capture non-CC module (such as prebuilt_etc) to the
snapshot. Separate general snapshot definition from cc so other modules
can also define its own snapshot.
Bug: 192430376
Test: m nothing passed
Change-Id: Ifb69fb3d2ec555b629aa31ec03e7ce5831fd3063
snapshot modules require the list of static libs to find the NOTICE
files for the snapshot modules.
snapshot binaries must include static_executable property to check if
non static binaries have libc as a static lib.
Bug: 190690041
Test: Check NOTICE for libaudiopreprocessing.so built from snapshots.
Change-Id: I53f7549a158ab27ada87833a3f4d58620aa7c3cf
Export additional fuctions, structs, and interfaces from cc for use in
the rust package to allow for rlib snapshotting.
Bug: 184042776
Test: m nothing
Change-Id: I4c53b9378d5d5b5973dbd23ab692cdfb2ede60b9
This CL exports and refactors some cc vendor-snapshot related functions
so they can be reused by rust modules to support vendor snapshotting.
Bug: 184042776
Test: m nothing
Change-Id: I12706e62ce0ac3b2b4298085fafc1d77b8e0a0c4
Refactors the vendor snapshot support to use the LinkableInterface
so that support can be extended to Rust. This CL does not add
vendor snapshot support for Rust; that is left for a follow-on CL.
Bug: 184042776
Test: m nothing
Change-Id: Id0c4970ca00053484a52677d182153cbc454c301
Vendors can now generate only needed modules by setting the following
Makefile variables:
- DIRECTED_VENDOR_SNAPSHOT: set to true
- VENDOR_SNAPSHOT_MODULES: list of snapshot candidates
e.g.
DIRECTED_VENDOR_SNAPSHOT := true
VENDOR_SNAPSHOT_MODULES := toybox_vendor sh_vendor libbase libcutils ...
Bug: 157967325
Test: m dist vendor-snapshot after setting those in BoardConfig.mk
Change-Id: I6515a43d9358d94483d7c7fa2b066f9dd457f6aa
Also some files are refactored:
- snapshot_prebuilt.go is separated from vendor_snapshot.go. Now
vendor_snapshot.go contains snapshot generation codes, while
snapshot_prebuilt.go contains module definition codes.
- Some helper functions are moved from snapshot_utils.go to util.go.
- Some ambiguous names of types and functions are renamed.
We still can add more detailed comments about the snapshots. They are to
be uploaded in follow-up changes, to avoid making this change too big.
Bug: 173474311
Test: generate vndk and vendor snapshot
Change-Id: I18fa837ccdf44a042b7a78e5c3df25fd2de96d95
The android.WriteFile rule takes careful escaping to produce the
right contents. Wrap it in an android.WriteFileRule that handles
the escaping.
Test: compare all android.WriteFile outputs
Change-Id: If71a5843af47a37ca61714e1a1ebb32d08536c31
Export information about static libraries, shared libraries and
exported flags through Providers instead of accessing the module
directly. Much more is left to be converted, but this significantly
simplifies the dependencies on libraries with stubs by making it easy
for a module to masquerade as another by simply exporting the
providers from the other module. Instead of depending on all the
versions of a library and then picking which one to use later, it
can depend only on the implementation variant and then select the
right SharedLibraryInfo from the variant.
Test: m checkbuild
Test: only expected changes to build.ninja
Change-Id: I1fd9eb4d251cf96ed8398d586efc3e0817663c76
A global variant was used to store the global mapping between
modules and APEXes. Replace it with storing pointers to APEX
contents inside each module so that they can query the contents
of any APEXes they belong to.
Bug: 146393795
Test: all Soong tests
Test: single line change to build.ninja host install dependency ordering
Test: no Android-${TARGET_PRODUCT}.mk, make_vars-${TARGET_PRODUCT}.mk or late-${TARGET_PRODUCT}.mk
Change-Id: Id2d7b73ea27f8c3b41d30820bdd86b65c539bfa4
When building a vendor snapshot, the general rule the
build system uses to select a module for inclusion into
the vendor snapshot is if it's a framework module.
However, there are cases where a partner may modify the
framework module, thereby assuming control of that
module.
This change adds the exclude_from_vendor_snapshot
property allowing the partner to mark a module that
would normally be included in the vendor snapshot for
exclusion. This module is then built from source when
building the vendor image against the vendor snapshot.
Bug: 165705527
Test: m nothing
Test: build partner code against vendor snapshot
Change-Id: I6c5c15f13eeeb8f29717a4abd84b65fa72096889
VNDK and vendor snapshot singleton work in a single thread, so globbing
in singleton results in ridiculus running time. Moving codes to
GenerateAndroidBuildActions to reduce running time.
Bug: 150406226
Test: VNDK_SNAPSHOT_BUILD_ARTIFACTS=true m dist vndk vendor-snapshot
Test: vendorSnapshotSingleton build time became 0.56s (from 10s)
Test: build.ninja building time became 1m11s (from 1m21s)
Change-Id: I4a081eef5847c62ca00280ca426f5b4e10f87b59
As a second step to removing the go/android3p instructions to copy or
to link NOTICE to LICENSE, include LICENSE files in the notices, which
will allow deleting all of the copied/linked NOTICE files.
The change causes a few additions to the system image notice files.
Test: manually built and compared before and after notices
Change-Id: Ia7bc58e2eba7bed5e63934881b5298201a93bc3e
This implements four modules (static/shared/header libraries, and
binaries) for vendor snapshot. These modules will override source
modules if BOARD_VNDK_VERSION != current.
Bug: 65377115
Test: 1) VNDK_SNAPSHOT_BUILD_ARTIFACTS=true m dist vndk vendor-snapshot
Test: 2) install snapshot under source tree
Test: 3) set BOARD_VNDK_VERSION and boot cuttlefish
Change-Id: I24ddb4c3aa6abeab60bbfd31bcbd8753e2592dc5
Vendor snapshot can be captured with "m dist vendor-snapshot". With
vendor snapshot and vndk snapshot, older version of /vendor and newer
version of /system will be able to be built together by setting
BOARD_VNDK_VERSION to past vendor's version.
Only vendor modules under AOSP are to be captured. In detail, modules
under following directories are ignored:
- device/
- vendor/
- hardware/, except for interfaces/, libhardware/, libhardware_legacy/,
and ril/
Test modules (cc_test, etc.) and sanitized modules are also ignored.
Bug: 65377115
Test: m dist vendor-snapshot
Change-Id: If7a2f6de7f36deee936930c0ccf7c47c4a0cebf6