Add all the boot image files necessary of offline inspection and
compilation in a single zip file (boot.zip).
This replaces the previous boot_profiles_jars.zip which contained only the
jar files.
Bug: 130376456
Test: m dist
Change-Id: I25b0c03ee9e7a2c2ff25db406656ce79baff5a46
Merged-In: Ib71c4fcc0d451570d0bb0584745487c54f884fd9
(cherry picked from commit 3dfae3f149)
We only need to define it once. dex_preopt_libart.mk can be read
multiple times if there are many boot image.
Test: m && no warning
Bug:119800099
(cherry picked from commit 7e8ca9a174)
Change-Id: I16d67b77142fce93c6d4acc15f557ad073b2de44
Merged-In: If5b8fbb0c3310eb42f676d7b5267dcee679f7e19
Some of the inputs to boot_profile_jars.zip have moved outside
of $(PRODUCT_OUT), update the -C argument to soong_zip to point
to the right directory.
Also make the rule to build the zip always present, and only gate
the dist command behind PRODUCT_DIST_BOOT_AND_SYSTEM_JARS.
Test: m out/target/product/blueline/boot_profile_jars.zip
Change-Id: Iaa72be955edda445f3eab041a63f79c9055d6b33
Hiddenapi rules are now in build/soong/java/hiddenapi_singleton.go.
This effectively requires any module in PRODUCT_BOOT_JARS to be
defined in Soong.
Bug: 123645297
Test: m checkbuild
Change-Id: If72bd1c20b2014d0a3d400624d37fdb0a3052245
The core libraries are no longer put in /system/framework. Replace the
system path with the dexpreopt input path.
Test: launch taimen_nopreload-userdebug; m
Bug: 123313750
Change-Id: I6232c36d39fb818a302cb4b6cb61e91b44b28da1
boot_profile_jars.zip is used to process the boot image profile (by
filtering out data that does not belong to the boot classpath).
We only need the jars that are actually preloaded, and not the ones which
are updatable.
Test: launch taimen_nopreload-userdebug; m
Bug: 123313750
Change-Id: I630f78dda3d9b38aac04b0f364b25fbcda4e26a3
The instructions to look up for classes.dex don't work when looking
at different jar versions (aligned, unaligned, etc).
Test: m
Change-Id: I5f178ca0d00497edbab892722a5ee84f0c47d0a0
Pass @CorePlatformApi stubs to the `hiddenapi` singleton rule which
generate a CSV of all public or domain API flags.
Bug: 119068555
Test: m appcompat
Test: dexlayout <core-oj jar> | grep CORE-PLATFORM-API
Change-Id: I597ee330835e564d61cfac44497e762b552b901c
`hiddenapi` is being refactored to work with a single CSV file as
opposued to a multitude of text files (one per flag). This patch
changes the singleton rule for listing public/private APIs from
stubs to expect a CSV as an output.
Bug: 119068555
Test: compiles, hiddenapi-flags.csv unchanged
Change-Id: If56c7ab8a4c3bbd33e447ef0dfd33f2c303a937c
Recent move of hiddenapi rules to soong sets the dependencies of
the hiddenapi_flags.csv rule in dex_preopt.mk but doesn't check
for existence of "frameworks/base" as the hiddenapi-generate-csv
rule in frameworks/base. Solve this by removing the dependency
injection and using the SOONG_HIDDENAPI_FLAGS variable directly
in frameworks/base.
This is necessary because go/art-build creates a fake
hiddenapi_flags.csv and if there is a dependency injection rule,
a phony target is created and all dependencies of flags.csv need
to be satisfied.
Test: master-art compiles
Change-Id: I13ef5e7ec167f9372a5629fe1894c7acd4091d29
Perform hiddenapi CSV generation and dex encoding for Soong modules
in Soong. This fixes an issue where dexpreopting was happening on
a different jar than was being installed.
Bug: 122856783
Test: m checkbuild
Change-Id: I24a235c63ff62fed7e1af9f2fd17e55b0c1598a5
Move the dexpreopting logic into Soong. Make modules will be
dexpreopted by executing the Soong logic in the standalone
dexpreopt_gen binary, which will generate scripts that will
perform dexpreopting for each module. Export global configuration
as JSON to $OUT/dexpreopt.config, which will be used by
dexpreopt_gen and Soong, and per-module JSON configuration that
will be used by dexpreopt_gen.
This relands I59b20c931ee3e5a8d35eb30da4148691c5095502,
I39d580999947ee54cfefe875b57a028be5333bd7,
Ie7daa94e107d53eff075ca58dbe721bd9d7fc8c2 and
Ica006a007d112c232311435aaac0c0e476232b67, with a minor
update to match the changes made to dexpreopt_gen arguments
and a fix to correctly keep dexpreopt disabled on mac builds.
Bug: 119412419
Bug: 120273280
Test: no differences to dexpreopt outputs on aosp_sailfish system/,
only expected changes to dexpreopt outputs on system_other
(.vdex files for privileged Soong modules no longer incorrectly
contain .dex contents).
Change-Id: I25163e91886cea6941afa25cdb529ed053278dcb
Move the dexpreopting logic into Soong. Make modules will be
dexpreopted by executing the Soong logic in the standalone
dexpreopt_gen binary, which will generate scripts that will
perform dexpreopting for each module. Export global configuration
as JSON to $OUT/dexpreopt.config, which will be used by
dexpreopt_gen and Soong, and per-module JSON configuration that
will be used by dexpreopt_gen.
Bug: 119412419
Bug: 120273280
Test: no differences to dexpreopt outputs on aosp_sailfish system/,
only expected changes to dexpreopt outputs on system_other
(.vdex files for privileged Soong modules no longer incorrectly
contain .dex contents).
Change-Id: I59b20c931ee3e5a8d35eb30da4148691c5095502
nostripping causes confusing double negatives, allow nostripping
in LOCAL_DEX_PREOPT and DEFAULT_DEX_PREOPT, but convert to
LOCAL_STRIP_DEX outside of dex_preopt_odex_install.mk.
Test: m checkbuild
Change-Id: I996e9258ce20c394900d9fe937d638bc2ab8589d
soong_zip was previously ignoring trailing command line arguments,
but now they are an error. boot_profile_jars.zip had all its
files as trailing arguments instead of as -f flags, previously
resulting in an empty zip, but now causing an error. Fix the
arguments to use -f before each file.
Test: m PRODUCT_DIST_BOOT_AND_SYSTEM_JARS=true out/target/product/sailfish/boot_profile_jars.zip
Change-Id: I8ac4aa4fbca812b8aa2ff9526e1ed7c769dd8420
Change hidden API public/private list generation build rule so that it
checks if outputs have changed and only commit them when changes have
been made. .KATI_RESTAT instructs ninja to restat the outputs and remove
reverse dependencies when rebuilding dependencies is not needed.
Bug: 113278235
Test: m appcompat
Change-Id: Iad23e302b6c30f9a021200acd4bb20e6062de5a2
This will cause odex/vdex files for apps installed under
/system/product_services/{priv-,}app to be installed in system-other
instead of next to the APKs themselves.
This change is analogous to I63406f91acc3de4b4f142767e28d45308706c7da,
which was for /system/product apps.
Test: diff installed-files{,-system-other}.txt on pixel with a PS app
Bug: 80741439
Change-Id: I79fac41cb665a649028f1f0e30350d42e8b80598
This enables other verticals/products to expand the list of APIs that
apps can call on those devices.
Bug: 112190341
Test: local test with app
Merged-In: I4dc983273a1beb83d0b81ab026945880a10bbd8c
Change-Id: I4dc983273a1beb83d0b81ab026945880a10bbd8c
(cherry picked from commit f9bf755d0a)
The hiddenapi tool needs to build a class hierarchy from API stubs.
These are inconsistent between public, system and test API stubs.
This patch splits stubs into the three corresponding categories
and groups the JARs being passed to hiddenapi.
Test: m appcompat
Bug: 76424618
Change-Id: I3f707070d44f04578bc6148a45f2283bcf060703
Generation of the full list of non-SDK APIs resolves public API
stubs against the boot class path. Remove stubs which do not
correspond to libraries on the boot class path.
This removes "Unresolved" warnings while building the API lists.
Bug: 112002105
Bug: 79409988
Test: m out/target/common/obj/PACKAGING/hiddenapi-private-list.txt
Change-Id: I1a73ed9ee50affed5284692e829a433ec1484f01
The lists of public/private APIs used for non-SDK API restriction
enforcement used to be generated by Doclava. In Q we're switching
to resolving android.jar (and other SDK stub JARs) against the boot
class path directly to avoid lowering Doclava's high-level view of
the framework and issues related to it.
This patch adds a new build rule which invokes `hiddenapi` on all
boot class path dex files simultaneously. The tool generates two
text files - one with public and one with private APIs.
Bug: 79409988
Test: m out/target/common/obj/PACKAGING/hiddenapi-private-list.txt
Change-Id: I826d8ac513a41a1d6d5e29a8300073158cff5acf
Merged-In: I826d8ac513a41a1d6d5e29a8300073158cff5acf
(cherry picked from commit a39db48511)
The lists of public/private APIs used for non-SDK API restriction
enforcement used to be generated by Doclava. In Q we're switching
to resolving android.jar (and other SDK stub JARs) against the boot
class path directly to avoid lowering Doclava's high-level view of
the framework and issues related to it.
This patch adds a new build rule which invokes `hiddenapi` on all
boot class path dex files simultaneously. The tool generates two
text files - one with public and one with private APIs.
Bug: 79409988
Test: m out/target/common/obj/PACKAGING/hiddenapi-private-list.txt
Merged-In: I826d8ac513a41a1d6d5e29a8300073158cff5acf
Change-Id: I826d8ac513a41a1d6d5e29a8300073158cff5acf
(cherry picked from commit a39db48511)
This will cause odex/vdex files for apps installed under
/system/product/{priv-,}app to be installed in system-other image, under
/system/product/{priv-,}app as well.
Test: m on marlin-userdebug target, analyzed
installed-files{,-system-other}.txt
Bug: 110072687
Change-Id: I63406f91acc3de4b4f142767e28d45308706c7da
We need the jars on boot and system server classpath in order to
symbolize profile information. Having the jars packed in a dist zip will
help a lot with the tools.
Test: m
Bug: 73313191
Change-Id: I5b64268d240055282099e9b86a5e6869e6405968
This prevents cases where system_server is running in interpreter
only mode.
Removed unused flag in product.mk
(cherry-picked from commit 27f4287406)
Bug: 74209329
Test: WITH_DEXPREOPT=false make
Merged-In: I4ab3afed95a5baf77d0cd089dafaa18bcc1913e5
Change-Id: I4ab3afed95a5baf77d0cd089dafaa18bcc1913e5
This prevents cases where system_server is running in interpreter
only mode.
Removed unused flag in product.mk
Bug: 74209329
Test: WITH_DEXPREOPT=false make
Change-Id: I4ab3afed95a5baf77d0cd089dafaa18bcc1913e5
Renamed WITH_DEXPREOPT_BOOT_IMG_ONLY to
WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY and changed the
behavior accordingly.
Preopt system server jars since selinux prevents system server from
loading anything from /data. If we don't do this they will need to
be extracted which is not favorable for RAM usage or performance.
Test: make and flash and look at system server maps
Bug: 65122284
Bug: 62356545
(cherry picked from commit 418258cee9)
Merged-In: I2e70c80a86327b455450b95144f21020e7bf0c6f
Change-Id: I316e79c7c6d45e2ccbfff4065137cc3ef9d2738e
Combining $(call dexpreopt-remove-classes.dex) into a
$(call copy-one-file) rule is hacky and error prone. Make a helper
dexpreopt-copy-jar function that takes LOCAL_DEX_PREOPT and copies
the jar, removing the dex files if necessary.
Test: only description message changes to out/build-${TARGET_PRODUCT}.ninja
Change-Id: Id2fa2d18571ca01bc81302c912b8de25f3dde7a1
Under SANITIZE_LITE, the default app_process is not instrumented.
Embedding sanitized libraries into APKs will lead to crashing apps.
So move second-stage APKs to /data/asan.
The tradeoff is that for now we won't run these sanitized binaries.
Adding support for that is future work.
Also do not do a rebuild of the boot image. This would invalidate
the first-stage results. Note that this is technically dangerous,
as stack overflow guard sizes will not be adapted for ASAN runs.
However, this is a general incompatibility.
Also do not rebuild system_other. Apps are not rebuilt, so it will
create an empty image.
(cherry picked from commit 481660ef34)
Bug: 36458146
Test: m && m SANITIZE_TARGET=address SANITIZE_LITE=true
Merged-In: I3898bc53cad264529f126e6bf0af9c6ca1736877
Change-Id: I3898bc53cad264529f126e6bf0af9c6ca1736877
For AB devices, support flashing two system partitions for factory use.
The normal system image on one partition, but without dex preopt. And a
system_other image that just contains the odex files. The dex files will
not be stripped out of the system image, in case the second system
partition is wiped.
Setting BOARD_USES_SYSTEM_OTHER_ODEX := true in the BoardConfig.mk
enables this behavior.
One can control which directories are placed in system_other by the
SYSTEM_OTHER_ODEX_FILTER configuration variable. Currently we default
to only copying only app and priv-app odexs.
Bug: 29278988
Change-Id: I7f4e87da919e7dc6a89fd8c668193cd4e98631bc
Enable mini-debug-info for the boot image by default. This
can be disabled with WITH_DEXPREOPT_DEBUG_INFO=false.
Bug: 28474219
(cherry picked from commit 58f6bfaa37)
Change-Id: Ifd59d854f01ad8cf703f16d7a6e88c2c82d47feb