Commit graph

65 commits

Author SHA1 Message Date
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
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
David Srbecky
a17e3542b2 Merge "Generate SHA-1 build ID for host-generated *.oat files (2/2)." am: 5ccc874ba1 am: 53502853b0
am: eeabe6cfbf

Change-Id: Ie9034b118f21c42ad631f6d06d7e29afa8ac8bff
2016-10-13 13:16:41 +00:00
Alexey Alexandrov
e469063a93 Generate SHA-1 build ID for host-generated *.oat files (2/2).
For host-generated *.oat files, generate a SHA-1 build ID based on the
file content and write it to .note.gnu.build-id ELF section.  This
should allow various developer tools like profilers correlate the data
captured for files like boot.oat on the device with the corresponding
known version of the file during an offline analysis.

Test: Verified that boot.oat contains the build ID section now.
Test: make test-art-host
Bug: 31292208
Change-Id: Iee48e437009488f20995e73868d5059d349701c0
2016-10-05 19:20:36 -07:00
Dan Willemsen
823097d57b Merge "Remove redundant LIBART_IMG_{HOST,TARGET}_BASE_ADDRESS" am: 2849d4f9d9 am: bd1232517d
am: d0d4c9ad9a

Change-Id: Id050ecbcb5192fb0a5370f18c87d329fffdcd176
2016-10-05 17:07:06 +00:00
Dan Willemsen
6f21a29a2c Remove redundant LIBART_IMG_{HOST,TARGET}_BASE_ADDRESS
These are exported by Soong. Caught by an upcoming change to mark
Soong-exported variables as readonly.

Test: Manual checking that the values are still the same.
Change-Id: I18e2bca588c57809c16a9f0c386aad432bfbee2c
2016-10-04 22:28:49 -07:00
David Brazdil
29441f934d resolve merge conflicts of 0976590 to nyc-mr1-dev-plus-aosp
Change-Id: I67a45fd1d034f143e9605cc2576c16aea4f8dbc9
2016-09-12 16:58:12 +01:00
David Brazdil
70470166c7 Update build rules for VDEX
ART now produces a new output file called VDEX, produced alongside the
existing OAT file. This patch updates the relevant build rules.

Bug: 30937355
Change-Id: Ib6be9f8f36c8f061dbbebd72cb55a5d4b6dc27eb
2016-09-09 09:41:10 +01:00
Alex Light
a3e8e9c6f3 resolve merge conflicts of 3f7c348 to nyc-mr1-dev-plus-aosp
Bug: 29278988

Change-Id: Icffb9a280311c7d3c45f096243ddf18f7ebecd9d
2016-06-29 15:43:54 -07:00
Alex Light
4e358ab2c3 Add system_other partition, install odex files
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
2016-06-24 11:07:15 -07:00
Jeff Hao
7d49d21ac5 Skip uses-library check for preopted apps.
am: b00263f96a

Change-Id: Icc9170bc494750eac12f141e7afd09d36564a2cc
2016-06-14 02:15:53 +00:00
Jeff Hao
b00263f96a Skip uses-library check for preopted apps.
Bug: 26880306
Change-Id: I97c75cceca30624b5f0c984a5032fdfaf632a90a
2016-06-13 17:32:06 -07:00
Ying Wang
77f67cd048 Merge "Support x86+arm multilib build."
am: d314805

* commit 'd314805c29fdbee3508b99c14ca63e1a8d170c3b':
  Support x86+arm multilib build.
2016-03-25 21:51:21 +00:00
Ying Wang
87538e4f8b Support x86+arm multilib build.
Support TARGET_2ND_ARCH as the binary translation arch.
See target/board/generic_x86_arm/BoardConfig.mk and
target/product/aosp_x86_arm.mk as example for the setup.

In BoardConfig, use the TARGET_2ND_ARCH/etc. variables to set up the
binary translation arch;
Set "TARGET_TRANSLATE_2ND_ARCH := true" to tell the build system it's
not a typical 64-bit multilib configuration.
In product makefile, use "PRODUCT_PACKAGES += libfoo_<2nd_arch>" to
install the TARGET_2ND_ARCH libraries. This also pulls in any dependency
libraries.
By default we don't install any TARGET_2ND_ARCH modules, unless it's
pulled in by PRODUCT_PACKAGES.

Bug: 27526885
Change-Id: I0578e9c80da0532d2fa886a8fcdb140bbc703009
(cherry-pick from commit 277e75a488)
2016-03-25 13:29:53 -07:00
Ying Wang
fbc5b9f56b Rebuild odex files in PDK fusion build.
To rebuild odex files of Java libraries and apps,
we store the jars/apks without stripping the classes.dex inside the
platform.zip. We also save the build variables that may affect how we
rebuild an odex in pdk_dexpreopt_config.mk in the platform.zip.
We store the files and configuration only for libraries/apps that get
installed to the system.img (or vendor.img).

In PDK fusion build, we auto-generate prebuilt module definitions for
the javalib.jar and package.dex.apk carried in the platform.zip, using
configuration stored in pdk_dexpreopt_config.mk.
With the prebult modules, we override the implicit rule that directly
copies the odex from the platform.zip.
To rebuild odex of javalib.jar, we added support for prebuilt shared Java
library to prebiult_internal.mk. An installable prebuilt Java library is
treated as shared Java library, i.e. with classes.dex in the jar instead
of a set of .class files.
For apks in the platform.zip, we install the stripped version from
platform files inside platform.zip, instead of the package.dex.apk,
using a new variable LOCAL_REPLACE_PREBUILT_APK_INSTALLED. We can't
strip package.dex.apk because we can't re-sign the stripped apk at this
point.

We generate prebuilt module only if it's not already defined in the
source tree.

Bug: 27543283
Change-Id: I9e146f8b713d6f57c397fd28d88c9ab700757ca1
(cherry-pick from commit 3a61eeb6cb)
2016-03-25 11:06:04 -07:00
Ying Wang
fc16dca602 Merge "Rebuild odex files in PDK fusion build." into nyc-dev 2016-03-15 21:23:50 +00:00
Ying Wang
222ebac10c Fix warning of "overriding commands for target ...boot.oat".
There seems to be bug in Kati that when we write it as:
LIBART_TARGET_BOOT_ART_EXTRA_FILES += boot.oat $(patsubst
%.art,%.oat,$(LIBART_TARGET_BOOT_ART_EXTRA_FILES))

boot.oat ends up in the value twice.
This works around the bug, filed as bug/27676615.

Bug: 27546601
Change-Id: Ifc330280496083a4c817e53bc5c77c86e48a2426
2016-03-15 12:26:55 -07:00
Ying Wang
3a61eeb6cb Rebuild odex files in PDK fusion build.
To rebuild odex files of Java libraries and apps,
we store the jars/apks without stripping the classes.dex inside the
platform.zip. We also save the build variables that may affect how we
rebuild an odex in pdk_dexpreopt_config.mk in the platform.zip.
We store the files and configuration only for libraries/apps that get
installed to the system.img (or vendor.img).

In PDK fusion build, we auto-generate prebuilt module definitions for
the javalib.jar and package.dex.apk carried in the platform.zip, using
configuration stored in pdk_dexpreopt_config.mk.
With the prebult modules, we override the implicit rule that directly
copies the odex from the platform.zip.
To rebuild odex of javalib.jar, we added support for prebuilt shared Java
library to prebiult_internal.mk. An installable prebuilt Java library is
treated as shared Java library, i.e. with classes.dex in the jar instead
of a set of .class files.
For apks in the platform.zip, we install the stripped version from
platform files inside platform.zip, instead of the package.dex.apk,
using a new variable LOCAL_REPLACE_PREBUILT_APK_INSTALLED. We can't
strip package.dex.apk because we can't re-sign the stripped apk at this
point.

We generate prebuilt module only if it's not already defined in the
source tree.

Bug: 27543283
Change-Id: I9e146f8b713d6f57c397fd28d88c9ab700757ca1
2016-03-14 21:01:46 -07:00
Joe Onorato
fcec686a25 Turn off excess printing during the build which makes errors harder to find.
Change-Id: I588de5ddc0aa7dcaacc4ea185c13c2fa3748888a
(cherry-pick from commit 401ffaeb75)
2016-03-09 18:09:02 -08:00
Joe Onorato
401ffaeb75 Turn off excess printing during the build which makes errors harder to find.
Change-Id: I588de5ddc0aa7dcaacc4ea185c13c2fa3748888a
2016-03-09 15:25:07 -08:00
Colin Cross
52dcb2f816 Install boot.art extra files individually
The rule that builds boot.art also produces boot.oat, boot-*.art, and
boot-*.oat as a side effect, and the install rule for boot.art was
installing them using *.art and *.oat.  This meant that PDK builds had
no rule to install the extra files, so it used the ones from the
platform.zip file instead of the locally built ones.

Generate a list of the files that should be produced by the boot.art
build, and manually create install rules for them that depend on the
built boot.art and are depended on by the installed boot.art.

Bug: 27546601
Change-Id: I9734491c3179bca2d4b2ae13b0c6a03e4c26b0b2
2016-03-08 18:00:05 -08:00
Jeff Hao
5aabca204f Build: Build changes for multi oat/image support.
Use the --multi-image option to generate a preopted boot image. This
generates a separate oat file and image file output for each dex file
input.

Stop inlining core.

(cherry picked from commit d1d3fd933f)

Change-Id: Ibd23bc06d346ff404cabd88f7461f041af6016dd
2015-12-24 10:10:55 +00:00
Jeff Hao
d1d3fd933f Build: Build changes for multi oat/image support.
Use the --multi-image option to generate a preopted boot image. This
generates a separate oat file and image file output for each dex file
input.

Stop inlining core.

Change-Id: I4437a2d43bc9b9695516bc4b90a5b59a147e13d5
2015-12-23 17:37:35 -08:00
Ying Wang
c01f2dcb10 Disable .toc optimization for host modules.
Host binaries may be run during the build process and the internal
implementation of the shared libraries makes a difference for the build
result. This change makes sure host tools get re-linked and re-run when
any of its dependency libraries gets updated.
DEX2OAT is such a host tool. We also changed DEX2OAT as full dependency
of dex-preoptimization, so we rebuild the odex files if DEX2OAT itself,
or any dependency libraries changed.

Bug: 24597504
Change-Id: Idf0d9be82ccebd826d9c5b405a39cff437e0af29
2015-12-15 10:00:19 -08:00
Fredrik Roubert
8a3dd242ac Remove $(DEX2OAT) from DEX2OAT_DEPENDENCY when USE_DEX2OAT_DEBUG is set.
Currently, DEX2OATD_DEPENDENCY is created by appending $(DEX2OATD) to
the value of DEX2OAT_DEPENDENCY and then if USE_DEX2OAT_DEBUG is set,
DEX2OAT_DEPENDENCY is set to DEX2OATD_DEPENDENCY, adding a dependency
on $(DEX2OAT) even in configurations where this will not be built.

This change removes DEX2OATD and DEX2OATD_DEPENDENCY entirely to instead
assign dex2oat or dex2oatd to DEX2OAT depending on USE_DEX2OAT_DEBUG,
making it possible to build with these flags set:

USE_DEX2OAT_DEBUG=true
ART_BUILD_HOST_NDEBUG=false
ART_BUILD_HOST_DEBUG=true
ART_BUILD_TARGET_NDEBUG=false
ART_BUILD_TARGET_DEBUG=true
make build-art-host

Change-Id: I4fa75d1b7e9751c73c43ec943fd8446cc231a070
2015-07-28 11:54:08 -07:00
David Srbecky
d8fae9a6a6 Pass --no-generate-debug-info to dex2oat.
The two flags have been merged and renamed in ART.

Change-Id: Iffc1dcc6764367239d6f45a3598cdb2c5d5d5013
2015-05-28 16:32:55 +01:00
David Srbecky
299d3f4960 Add --include-cfi compiler option.
Decouple generation of CFI from the rest of debug symbols.
This makes it possible to generate oat with CFI but without
the rest of debug symbols.

This is in line with intention of the .eh_frame section.
The section does not have the .debug_ prefix because it
is considered somewhat different to the rest of debug symbols.

Change-Id: I32816ecd4f30ac4e0dc69d69a4993e349c737f96
2015-04-13 19:50:51 +01:00
Richard Uhler
820fe32d46 Store odex files in oat/<isa>/ directory.
Previously odex files were stored alongside the dex location as:
  dex location: /foo/bar/base.apk
  odex location: /foo/bar/<isa>/base.odex

This changes where odex files are stored, adding an "oat" directory:
  dex location: /foo/bar/base.apk
  odex location: /foo/bar/oat/<isa>/base.odex

See also the corresponding change in platform/art and
platform/frameworks/native.

Bug: 19550105
Change-Id: I4c6be4f0c41ff175904846db8e360c4af815b265
2015-03-18 12:41:31 -07:00
Andreas Gampe
06d86e929d Build: Fail preopting apps when there are verifier errors
Expectation is that classes in pre-compiled apps should be structurally
sound and not cause a hard failure.

Bug: 19606409
Change-Id: Idc9da4d4c6bd259555671c657d3414a97940717f
2015-03-05 19:18:18 -08:00
Nikola Veljkovic
a57aaa3664 [MIPS64] Set ART base address for mips64
Set ART base address for mips64 to the same value as for mips32.

Change-Id: Idd3a05c87867bce9eb769cfec412102944703a43
2014-12-23 13:50:18 +01:00
Andreas Gampe
96a522037f Build: Support for compiled-classes file
Allow a compiled-classes file for pre-opting.

Bug: 18410571

(cherry picked from commit 4fec0bb265)

Change-Id: I8c69dd0fb8c04aaae0c4f062049cc9cce7d755c7
2014-11-18 15:09:51 -08:00
Ying Wang
0c9b3bac65 Install preloaded-classes as a standalone configuration file
Install preloaded-classes as a standalone configuration file
/system/etc/preloaded-classes, so we can configure different file per product.
To override the default frameworks/base/preloaded-classes, just override
in your product configuration makefile with PRODUCT_COPY_FILES before it
inherits from build/target/product/base.mk: if there are multiple items
in PRODUCT_COPY_FILES with the same destination, the first one takes
precedence.

Bug: 18305157
Change-Id: I937632b4a1aa73310ec90e73fd708fbd0c704a21
2014-11-17 11:26:29 -08:00
Ian Rogers
a18a28305d Pass instruction set variant to dex2oat.
Also, add it to the ANDROID_BUILD_PROPERTIES.
Remove non-default instruction set features.
Bug: 18056890

Change-Id: I9169cdfecbb176f62b941852948222edc3f511fd
2014-11-08 17:07:23 -08:00
Ying Wang
20ebd2ef08 Introduce per-product per-module dex-preopt config
- Added LOCAL_DEX_PREOPT_FLAGS to pass extra flags to dex2oat.
- Added macro add-product-dex-preopt-module-config to specify almost
  arbitrary dex-preopt config/flags to modules in product
  configuration:
  $(call \
  add-product-dex-preopt-module-config,<module_name_list>,<config_or_flags>)
  How <config_or_flags> is interpreted is decided by
  dex_preopt_odex_install.mk and dex2oat. For now if it's "disable" we
  disable dexpreopt for the given modules; otherwise pass it to dex2oat as
  command line flags.
- If there are multiple configs for the same module in the product
  inheritance, the first takes precedence.
- Added PRODUCT_DEX_PREOPT_DEFAULT_FLAGS so you can specify default
  dex2oat flags in product configuration.
- Added PRODUCT_DEX_PREOPT_BOOT_FLAGS to specify flags of building boot.oat.

Bug: 17791867
Change-Id: I1b2955e8e51039e94d1ff43a3265a8d03598632c
2014-10-08 10:11:17 -07:00
Nicolas Geoffray
4c0c390f30 Fix typo.
Change-Id: I738ad878a2961d118b5a89bf7d434606df2fad92
2014-10-07 11:17:09 +01:00
Nicolas Geoffray
75c08b2118 Make which dex2oat version to use configurable.
Change-Id: Ic13cf6f9dfb117193a5101781945c501d138955c
2014-10-07 08:30:18 +00:00
Brian Carlstrom
a4331e35b6 Add --no-include-debug-symbols to avoid bloat in user builds
Bug: 16938924

(cherry picked from commit 91b9d01b6b)

Change-Id: I0b744e0aaacc11fe8983f22f56ffc546a07ae764
2014-08-28 18:10:42 -07:00
Alex Light
ce090d3f45 Make system use patchoat to relocate during runtime.
Change DexPreOpt to include patch information of all compiled files so
we can relocate at runtime.

Bug: 15358152

Change-Id: Ibe92d8b55a24bbf718b0416a21b76e5df7a2de26
2014-08-05 10:22:09 -07:00
Ian Rogers
87f0d006f2 Vary non-image Xmx for dex2oat on MIPS.
The image Xmx is already fixed at 64m. The issue is in the non boot image case.

Change-Id: Idd508187ce8ac3d3c8dbe357c74bc33a5c8185dd
2014-07-16 22:25:35 -07:00