Commit graph

102 commits

Author SHA1 Message Date
Bob Badour
17831e3da3 Remove LOCAL_LICENSE_KINDS from core makefiles.
Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I4deec3e07862e89dd32880774efb4624a9723cf2
2021-02-16 04:37:23 -08:00
Bob Badour
0390580262 [LSC] Add LOCAL_LICENSE_KINDS to build/make
Added SPDX-license-identifier-Apache-2.0 to:
  target/product/sysconfig/Android.bp
  tools/apicheck/Android.bp
  tools/product_config/Android.bp
  tools/releasetools/Android.bp
  tools/signapk/Android.bp
  tools/signtos/Android.bp
  tools/zipalign/Android.bp
  tools/ziptime/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-CC-BY SPDX-license-identifier-GPL
    SPDX-license-identifier-GPL-2.0 SPDX-license-identifier-LGPL
    SPDX-license-identifier-MIT legacy_not_a_contribution
    legacy_restricted
to:
  Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-CC-BY SPDX-license-identifier-GPL
    SPDX-license-identifier-MIT
to:
  tools/Android.bp
  tools/droiddoc/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0
    SPDX-license-identifier-LGPL SPDX-license-identifier-MIT
to:
  core/base_rules.mk
  core/dex_preopt_libart.mk
  core/package_internal.mk

Added SPDX-license-identifier-Apache-2.0 legacy_not_a_contribution
to:
  target/board/Android.mk

Added legacy_restricted
to:
  core/tasks/tools/package-modules.mk
  target/product/gsi/Android.bp
  target/product/gsi/Android.mk
  target/product/security/Android.bp
  target/product/security/Android.mk
  tools/acp/Android.bp
  tools/atree/Android.bp
  tools/fs_config/Android.bp
  tools/fs_config/Android.mk
  tools/fs_get_stats/Android.bp
  tools/libhost/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Id67a4eb1312940f999643b2ae57f45f34f120724
2021-02-14 10:37:20 -08:00
Yo Chiang
3ca4980d36 Auto-generate dexpreopt boot image module
Add prebuilt modules that installs bootjar dexpreopt files generated by
soong, for example `dexpreopt_bootjar.boot_arm64` installs .art / .oat /
.vdex, etc for the framework boot image ("boot") for primary arch
("arm64").

Bug: 159196136
Test: TH built artifacts noop
Test: Check device boot images are installed
Test: ./prebuilts/build-tools/linux-x86/bin/ninja -f out/combined-aosp_arm64.ninja -t browse
Test: Check that generated dependency graph is sane
Test: Check that bootjar dexpreopt bits are listed in `m dump-files`
Change-Id: Ia30b37be9be972c5e28b5840923801ea7237a237
2020-07-14 15:49:08 +08:00
David Srbecky
6dd11eccc5 Install boot.art image for host as well (used by ART tests).
This will allow us to remove the core.art image compiled in make.

Test: m test-art-host-gtest
Bug: 147817558
Bug: 147819342
Change-Id: Ie17e5818ddeb200843b13d36ade6d1a5428a9a48
2020-02-27 21:04:49 +00:00
Colin Cross
02b50d12be Remove TARGET_TRANSLATE_2ND_ARCH
TARGET_TRANSLATE_2ND_ARCH is never set to true any more,
TARGET_NATIVE_BRIDGE_ARCH := arm is always used instead.

Bug: 141242600
Test: m checkbuild
Change-Id: Id3e0614a1d8a088d37929655b74fecd812606db2
2019-09-18 16:23:04 +00:00
Nicolas Geoffray
7e8ca9a174 Move the profile rule out of dex_preopt_libart.mk.
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
Change-Id: If5b8fbb0c3310eb42f676d7b5267dcee679f7e19
2019-04-05 18:44:15 +01:00
Nicolas Geoffray
269bc741a5 Support for install multiple boot images.
Bug: 119800099
Test: m && /system/framework/arm/apex*.art files exist
Change-Id: I78023f1086446c2c44ff6b282993537b053c0588
2019-02-22 15:33:23 +00:00
Colin Cross
47e384c3d6 Remove dexpreopting of boot jars from Make
Dexpreopting of boot jars is now implemented in
build/soong/java/dexpreopt_bootjars.go.

Test: m checkbuild
Change-Id: I036510e7674b876976ce191c5b18bf0b7a15c6ee
2019-02-15 13:00:14 -08:00
Nicolas Geoffray
f084e7847e Pass the right dex files to dex preopt.
We currently pass the boot dex files installed on /system, but these
may be eg stripped. That's currently OK as dex2oat is looking
at the dex files in boot.oat, but dex2oat could look at them for
various reasons.

Test: m
Change-Id: I85915c979cf94ec29751b10a0d8a5957b6cea956
2019-01-23 16:07:02 +00:00
Nicolas Geoffray
6ce12f56de dex_preopt: differentiate between updatable boot jars and non-updatable boot jars.
bug: 119868597
Test: m
Change-Id: I2f12ed6f37b629effc30e7b0c3310dc32e5ff4c8
2019-01-17 14:35:41 +00:00
Colin Cross
6db5b0ea9a Move dexpreopting to Soong
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
2018-12-17 13:46:17 -08:00
Colin Cross
b8901d7fb8 Revert "Move dexpreopting to Soong"
This reverts commit e736c58043.

Test: none
Bug: 119412419
2018-12-14 11:49:55 -08:00
Colin Cross
e736c58043 Move dexpreopting to Soong
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
2018-12-12 17:21:22 -08:00
Colin Cross
3ec2c61549 Pass --avoid-storing-invocation to dex2oat
Pass --avoid-storing-invocation to dex2oat, which will remove the
command line from the final .odex files.  This will help make the
.odex files reproducible across devices and build system changes,
simplifying comparisons.

Bug: 119412419
Test: m checkbuild
Change-Id: I46cedadab9a87addc0f9e35f7bbe578beae1df60
2018-11-28 11:57:47 -08:00
Vladimir Marko
a332207767 Prebuild: Remove --compile-pic and -Xnorelocate.
The --compile-pic argument is obsolete, all generated code
is now PIC.

The -Xnorelocate is ignored by dex2oat since
    https://android-review.googlesource.com/771001
where the option was reinterpreted from "use patchoat if
needed" to "relocate the boot image in memory if possible"
and dex2oat forbids that relocation.

Test: Pixel 2 XL boots.
Bug: 77856493
Change-Id: I60cdf81267a129be8a482af26fb865110561268e
2018-10-09 17:35:07 +01:00
Vladimir Marko
e47795ba3d Build: Remove boot*.art.rel file generation.
These files are now unused, patchoat shall be removed soon.

Test: m
Test: Pixel 2 XL boots.
Bug: 77856493
Change-Id: I07babe7e6b2657e340265e74042e958a91678329
2018-10-02 08:54:11 +01:00
Neil Fuller
9fb70170d4 Remove out-of-date comment / logic
The comment refers to a core.jar which hasn't existed in
a while.

Bug: 113148576
Test: Treehugger / build only
Change-Id: I032b0e42bb42dfa495f20dca6cd6b4f577052121
2018-08-28 13:18:25 +01:00
Shibin George
9dd9e680b9 Allow multiple profiles to be added as part of boot.prof
Extend PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION such that
multiple text-based profiles can be fed to profman to be included
in boot.prof

BUG: 70292748
Test: profman with --dump-only option shows that additional
      text-based profiles are also being read if they have
      been added to PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION

Change-Id: I8a6437a323e43b61612c67038abdde200607c513
2018-07-04 18:05:07 +00:00
Dan Willemsen
406418d055 Fix UML build
If there aren't any boot dex files, we can't generate a boot image
profile.

Test: lunch uml-eng; m
Test: diff build-aosp_arm.ninja
Change-Id: I09cc1ef37379d9d353958c8aa75731f3d29df759
2018-06-19 23:03:34 -07:00
Jiyong Park
565ec59f1f org.apache.http.legacy.boot is renamed to org.apache.http.legacy.impl
The name of the runtime library name for the SDK library
org.apache.http.legacy has changed to org.apache.http.legacy.impl as it
is now built using java_sdk_library construct where *.impl suffix is
automatically added to the runtime lib.

Bug: 77577799
Test: m -j
Merged-In: Ie049d06d78cc403454c2885def88a167975b4204
Change-Id: Ie049d06d78cc403454c2885def88a167975b4204
(cherry picked from commit 7f9a1a49cf)
2018-05-22 20:37:30 +09:00
Mathieu Chartier
116790dae8 Use $(AAPT) instead of aapt for verifying uses libraries
For SDK builds, $(AAPT) points to a prebuilt and aapt is not
necessarily in the path.

Test: make -j32 <some SDK build> tests
Bug: 70934104
Bug: 67345922
Change-Id: Icfd62a4e3ec284ed59a61714765e5a909a27947d
2018-05-14 10:18:02 -07:00
Mathieu Chartier
cda2ef1d84 Fix some issues with LOCAL_USES_LIBRARIES
Properly check the value of PRIVATE_ENFORCE_USES_LIBRARIES instead of
only checking that the variable is non-empty.

Change the logic to use product libraries instead of the common ones.
This is required so that dex2oat can find the oat files when stripping
is enabled.

Bug: 70934104
Bug: 67345922
Test: manual

Change-Id: Iee71c2b26f3c0e136a8971ab913725b2b6e100b8
2018-05-11 13:51:02 -07:00
Mathieu Chartier
d022b65c98 Add support for preopt with uses-libraries
Required libraries are specified with LOCAL_USES_LIBRARIES
Optional libraries are specified with LOCAL_OPTIONAL_USES_LIBRARIES

The make rule cross references the libraries against what's stored
in the manifest.

Verification is enabled if LOCAL_ENFORCE_USES_LIBRARIES is true. This
defaults to true if either of LOCAL_USES_LIBRARIES or
LOCAL_OPTIONAL_USES_LIBRARIES are specified.

Bug: 70934104
Bug: 67345922
Test: manual

(cherry picked from commit 09f3b97f4b)

Merged-In: Ifca7d1a993620e9d0e42dc497a4a5d7a6c3f4172
Change-Id: I670431f938c31115a7812c1857c31b9f71675632
2018-05-10 11:52:26 -07:00
Calin Juravle
25ef4c018a Remove profman --skip-apk-verification flag
This happens by default now.

Test: make
Bug: 73313191
Change-Id: I5cc0efb656e1b44a161420c49250640bc9d702c5
2018-04-27 17:23:12 -07:00
Andreas Gampe
35ab4203ef Revert "Build: Support for compiled-classes file"
This reverts commit 96a522037f.

Bug: 76145463
Test: m
Change-Id: I5a368cd01812e16869352ec219eae095df4919c4
2018-04-13 13:08:13 -07:00
bowen_lai
4570fdbb4c Create symbolic boot vdex files for different ISAs
Create only one vdex file and share between different ISAs.
By sharing vdex file, zygote32 and zygote64 can share the same file and
the system partition size is reduced by about 32MB.

Test: make framework & check boot.vdex and boot-*.vdex files
Test: test system boots with no selinux violations

Bug: 64211239

Change-Id: I31ede4b6aa342f2047d9309b8c631217e6699202
2018-02-12 19:45:21 -08:00
David Brazdil
b8fa6dd104 Revert "Revert "Apply hiddenapi build tool on boot jars""
This reverts commit 4a2926a44e.

Reason for revert: The original CL caused two issues:
1) Increased app startup because `profman` failed to verify boot
jars and created an empty profile for the boot image. All methods
in the framework therefore ran interpreted/JITed. New flag
"--skip-apk-verification" has been added to `profman` to fix
the issue in CL Iad614e47feada293218c11cff985a8012ca49a0f.
2) Caused a crash in Mockito CTS tests because jvmti did not
remove hiddenapi access flags from boot jars before using them.
This has been fixed with CL Ibc9a96a6b541c06844f276db009ac29514f7a3bb.

Bug: 64382372
Bug: 72550707
Test: make test-art-host
Change-Id: Ie8c58714455662f042f56b2977b01b75c5ec7d2f
2018-01-30 18:25:46 +00:00
Alex Klyubin
a1b5dfe151 Reland: Add boot.art.rel files to system image
This file is used to verify that all differences between /system
boot*.art and /data/dalvik-cache boot*.art only consist of relocation
changes. The goal is to mitigate /data/dalvik-cache boot*.art files
being a persistence vector.

Test: Build and ensure boot.art.rel files are on the image.
Bug: 66697305
Change-Id: I68c445da46b2d3099ee347a04af4fbb84da85b0d
2018-01-19 14:34:32 -08:00
Treehugger Robot
d3a6ff9bdb Merge "Revert "Add boot.art.rel files to system image"" 2018-01-19 14:35:01 +00:00
Ian Pedowitz
74076b7556 Revert "Add boot.art.rel files to system image"
This reverts commit d616e0e820.

Reason for revert: b/72207339 - user builds are failing with this change

Bug: 72207339
Bug: 66697305
Change-Id: Ia309d04d837851ae11518f05aca468ecca895e6f
Test: Before the revert, taimen-user does not build.  After the revert taimen-user builds
2018-01-19 12:43:38 +00:00
Treehugger Robot
eb38b51733 Merge "Add boot.art.rel files to system image" 2018-01-19 05:14:36 +00:00
Alex Klyubin
d616e0e820 Add boot.art.rel files to system image
This file is used to verify that all differences between /system
boot*.art and /data/dalvik-cache boot*.art only consist of relocation
changes. The goal is to mitigate /data/dalvik-cache boot*.art files
being a persistence vector.

Test: Build and ensure boot.art.rel files are on the image.
Bug: 66697305
Change-Id: I41486dd541e429f2f2b4c4a521009ee5e81e50b9
2018-01-17 15:20:06 -08:00
Mathieu Chartier
8fd29b3653 Don't default my_use_profile_for_boot_image to true for PDK builds
This causes an unsatisfiable dependency on frameworks/base.

Bug: 67663308
Test: make

(cherry-picked from commit 83bae866e6)

Change-Id: Iba0c3893b49386591f84eb893abf0b577b9716a0
Merged-In: I06e45e8ca66ab6547bf1df25119dda80d44e50f6
2018-01-16 20:02:27 -08:00
Mathieu Chartier
ce94494b93 Enable profile based boot image by default
Use profile based boot image instead of the compiled classes version.

Results using profile from ag/2815407
Storage savings:
Boot art+vdex+oat size: 78305556->61539326 (-17MB)

New system server profile has more methods (1.5MB -> 4MB oat) since it
has more coverage from use cases.

Ram savings (sample averages for CUJ test):
Average PSS of 3 runs (~100 samples total):
.Boot_vdex: 9359K -> 9902K
.oat_mmap: 21857K -> 13372K
.Heap: 29779K -> 29483K
.Boot_art: 15736K -> 18096K
.LinearAlloc: 9112K -> 8965K
Total PSS: 85846K -> 79819K (-6MB)

Average pages read from flash (512MB device) for CUJ tests (3 samples):
1508MB -> 1183MB

Bug: 37966211
Test: make and flash

(cherry-picked from commit bf9023ae7a)

Change-Id: Icf3039ef871b68d806ef7b7c8ad2220c3a37ce90
Merged-In: Id8f9b08490a50e2ccf39e8acc00b0c4e8ec782b0
2018-01-16 20:02:18 -08:00
Jaekyun Seok
5fb6a3eb9f Move ART default properties into system partition
Bug: 64661857
Bug: 68755013
Test: confirmed that ART default properties were stored in
/system/etc/prop.default on sailfish device

Change-Id: Ie07d3049de5ac395cfb9105e208fe7825080fa15
2017-11-08 00:56:43 +00:00
Treehugger Robot
57048cd455 Merge "Build: Move preopt classpath to private variable" 2017-10-20 00:01:20 +00:00
Mathieu Chartier
a2cc65b099 Fix boot image profile in make files
Update location to framework/base/config instead of frameworks/base

Fixed dex2oat dependency to my_out_boot_image_profile_location
instead of my_out_profile_location.

Bug: 37966211
Test: make and flash

Merged-In: I446f11216cf6342861bbbf56ac5c4da2f36fb755

(cherry picked from commit 75edf540e2)

Change-Id: I4a34be8a344880d3e2ccaea3ed0e6390616e0d6c
2017-09-02 23:47:32 +00:00
Andreas Gampe
1207c86cd6 Build: Move preopt classpath to private variable
Move DEX2OAT_CLASS_LOADER_CONTEXT to
PRIVATE_DEX2OAT_CLASS_LOADER_CONTEXT in preparation for actual
classpaths.

Bug: 65256727
Test: m
Test: oatdump --oat-file=$OUT/system/framework/oat/arm64/wifi-service.odex --header-only
Change-Id: I5bcfebcd3be1a187954f550dbe1d3aa1d5099052
2017-09-02 15:22:43 -07:00
Treehugger Robot
5848fedea8 Merge "Add dirty-images-objects handling to boot image build." 2017-08-05 00:55:48 +00:00
Jeff Hao
b454ee195a Add dirty-images-objects handling to boot image build.
Allows grouping of classes with dirty static fields to be grouped
together in the image to have fewer dirty pages.

(cherry-picked from commit 865d54caf2)

Bug: 62554875
Test: mm test-art-host

Merged-In: I2486d2704d74a192f1ecdc02589e569b61efa4ae
Change-Id: I2486d2704d74a192f1ecdc02589e569b61efa4ae
2017-08-03 11:04:11 -07:00
Calin Juravle
965f8aec4c Replace -classpath with --class-loader-context for preopt
Use --class-loader-context to pass the context to dex2oat instead of using
runtime arguments.

In preparation to simplify dex2oat handling of contexts.

Bug: 38138251
Test: make & check that the prebuilds have '&' as their classpath key
Change-Id: Iad2fc4364173f59f41886556222ec69f87a0bd52
2017-08-02 17:19:27 -07:00
Mathieu Chartier
a61acf62c9 Add support for using profiles for boot images
Added two product flags:
PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE
PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION

If PRODUCT_USE_PROFILE_FOR_BOOT_IMAGE is enabled (default false), a
art profile is used to create the preopted boot image. This profile
is also passed to the runtime in AndroidRuntime.cpp.

The profile is created from the
PRODUCT_DEX_PREOPT_BOOT_IMAGE_PROFILE_LOCATION variable that defaults
to "frameworks/base/boot-image-profile.txt".

(cherry picked from commit 77226f6333)

Bug: 37966211
Test: make and flash

Merged-In: Ic89cc4c0c4d39aa9726843f5d9c2fb1dedeb7885
Change-Id: Ic89cc4c0c4d39aa9726843f5d9c2fb1dedeb7885
2017-07-28 11:17:32 -07:00
Nicolas Geoffray
a65a41dcdb Merge "Pass --force-determinism to prebuilts." 2017-05-08 09:29:55 +00:00
Nicolas Geoffray
a5bb180a89 Pass --force-determinism to prebuilts.
bug: b/37442966
Test: build
Change-Id: I231803874f6f2a7245a4ef03d50a271d3c29fc9f
2017-04-28 15:01:22 +01:00
Nicolas Geoffray
cdd4343bb2 Don't preopt system server apps in system_other.
bug:36532541
bug:33799337

Test: m -j32 && find out/target -name \*.odex

(cherry picked from commit a2c6c0b11e)

Change-Id: Ic4396bb6c543af1c05f56030495caafb245ea304
2017-04-28 12:34:53 +01:00
Mathieu Chartier
fea31c0b9e Merge "Add local preopt options for generating app image and profile" 2017-03-03 01:14:03 +00:00
Mathieu Chartier
a4b993b5b9 Add local preopt options for generating app image and profile
If true, LOCAL_DEX_PREOPT_APP_IMAGE cause dex2oat to generate an app
image.

If true, LOCAL_DEX_PREOPT_GENERATE_PROFILE generates a profile based
on a class listing. LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING must be
defined in this case.

Bug: 34929159

Test: device booting, image loaded

(cherry picked from commit 9968fdcd85)

Change-Id: Ib79ada86a4ac617491723f80d99a3add3d52a7f4
2017-03-02 15:17:04 -08:00
Richard Uhler
41408b0e1a Don't include patch information for dex preopt.
Because we always compile pic, patch information is not needed.

Test: phone boots.
Bug: 33192586
Change-Id: I46a6db713e0ce21300e3f4b86bd771a68eeed0c4
2017-02-28 17:05:12 +00:00
Mathieu Chartier
192b91c97f Add support for preopted app images
Enable iff WITH_DEXPREOPT_APP_IMAGE is true.

Test: Clean + build with the flag on and off. Tested Sailfish
booting.

Bug: 34927277

(cherry picked from commit e8ab2a71d7)

Change-Id: I63f98a85c69d99746b11bb6e85c23cf5e48910cf
2017-02-10 13:39:08 -08:00
Richard Uhler
c30981e2d0 Remove option for non-pic dex preopt.
Test: make checkbuild, aosp_bullhead-userdebug boots.
Bug: 33192586

Change-Id: I4dd179fac33d777fb10cc85a99ff68c3b0d0e03d
2016-12-19 09:52:25 +00:00