Commit graph

9475 commits

Author SHA1 Message Date
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
Sami Tolvanen
b3038bedcd Merge "Revert "build: pass version and patch level to mkbootimg"" into nyc-dev 2016-03-14 15:49:15 +00:00
Sami Tolvanen
1bca9fb6d4 Revert "build: pass version and patch level to mkbootimg"
This reverts commit e555f77962.

Bug: 27580174
Change-Id: I0fd1ddb64d2fd4f91b0ecbc1ab8953a1324a10eb
2016-03-14 15:47:11 +00:00
Ian Pedowitz
e5df61318e PLATFORM_PREVIEW_SDK_VERSION = 2 for DP2
Bug: 27150977
Change-Id: I8b86b5565dbdf81dffb4bc9ba0eef8a3c3f91d20
2016-03-11 22:13:36 -08:00
Stephen Hines
efd50b725b Switch to clang-2658975.
Bug: http://b/27482631

This fixes an issue where krait compiles were not passing the proper
flags to the assembler when -no-integrated-as is used. This was
preventing ART from switching to clang in some cases.

(cherry picked from commit c503d8ef58)

Change-Id: I4a0efb78f37fee73bf61841f0347328b8f61c192
2016-03-11 15:03:18 -08:00
Andreas Gampe
6f0a902081 Merge changes I4a2692f3,Ifd8d3a2c into nyc-dev
* changes:
  Build: Only preopt boot images in eng builds
  Revert "Don't preopt on eng builds."
2016-03-11 16:20:51 +00:00
Andreas Gampe
4df565786a Build: Only preopt boot images in eng builds
As a middle way between full preopt/high performance/long builds,
and no preopt/low performance/fast turnaround, preopt only the
boot image in eng builds.

Bug: 26794212
Change-Id: I4a2692f3ce84823cd40c6b7d672fd73257739ef8
2016-03-10 15:34:46 -08:00
Andreas Gampe
6c6c51aa79 Revert "Don't preopt on eng builds."
This reverts commit 7effde0048.

Bug: 25801231
Bug: 26794212
2016-03-10 15:07:27 -08:00
Ying Wang
bd07ad01b5 Add dependency on boot_singer and vboot_singer if necessary.
Change-Id: Ic10c2ae6a0debf51100a30eb11217e77060a6066
2016-03-10 21:01:54 +00:00
Neil Fuller
e82f56c4f7 Merge "Make the language version selection smarter" into nyc-dev 2016-03-10 09:45:55 +00: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
Mohamad Ayyash
6a3185f23d Merge "Hook incremental ext4 image generation into build" into nyc-dev 2016-03-09 20:56:19 +00:00
Elliott Hughes
b59457f852 Merge "Move BUILD_NATIVE_BENCHMARK over to libgoogle-benchmark." into nyc-dev 2016-03-09 15:56:50 +00: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
Elliott Hughes
9919d3be55 Move BUILD_NATIVE_BENCHMARK over to libgoogle-benchmark.
Bug: http://b/24803663

(cherry picked from commit 577f8407e9)

Change-Id: If1af37c419abe284677253c33de45dcb5ef6ea8d
2016-03-08 14:56:27 -08:00
Sami Tolvanen
e555f77962 build: pass version and patch level to mkbootimg
Add --os_version and --os_patch_level arguments to mkbootimg.

Needs matching changes from
  I57682611e0c27fec5ed284da7d9a788383ff98b1

Bug: 27498078
Bug: 22914603
Change-Id: I04e20b0de40d864aac92ac7bcf466a6cbde3d0e4
(cherry pick from commit 8fb47f191f)
2016-03-08 08:21:52 -08:00
Neil Fuller
decb797276 Make the language version selection smarter
Any artifacts that are targeting SDK versions < 24
and not explicitly setting the LOCAL_JAVA_LANGUAGE_VERSION
are now defaulted to 1.7.

Bug: 27495650
Bug: 26753820
Bug: 27377071
Change-Id: Ia903cd5bf14c1947c485384d095a93c0aa23d272
2016-03-08 13:56:49 +00:00
Yabin Cui
9963b699f3 Enable LOCAL_POST_LINK_CMD for non-static executables.
It is needed to insert testdata section into simpleperf cts test.

Bug: 27387280
Change-Id: I58cea106d135f535626d8624a016bd2aaceeb8ea
(cherry picked from commit 273e9109c1)
2016-03-07 13:22:06 -08:00
Ying Wang
f56ffa5851 Fix dumping variables of absolute paths.
Calling $(abspath) is better than checking and prepending $(PWD) if
necessary.

Bug: 27429759
Change-Id: Ia156f8a5d6b88b6090f4d23c7f9166bd62d3ab70
(cherry-pick from commit 80ceadc945)
2016-03-07 12:00:41 -08:00
Julien Desprez
ffc9c52243 Support build old version of cts
Bug: 27508747
Change-Id: I3d474f6f6534e172ecf1d0a6c833a9dfa6164344
2016-03-07 17:11:14 +00:00
Ying Wang
7dfdb843b2 Speed up lunch/tapas/etc. shell utility functions.
1. Combined ~10 calls to the make build system to only one.
   We added a phony target "dump-many-vars" to the build system to dump
   "<var>=<value>" pairs. We then store the pairs as shell variables.
   With this cache get_build_var/get_abs_build_var can just return
   the shell variables instead of querying the build system.
2. Prune .git when we search for AndroidProduct.mks.

In internal source tree lunch time was reduced from ~15s to ~1.5s.

Bug: 27429759

(cherry picked from commit 08800fd905)

Change-Id: I862a0ec3c1aae97c552054dacec133e857042edf
2016-03-04 14:02:03 -08:00
Ying Wang
063d0455e0 Align up java-lib-files and java-lib-deps.
- For host Java libraries, java-lib-files should return javalib.jar.
- Host dalvik Java libraries are special: factor out
  host-dex-java-lib-files.
- Be explict that jack-lib-deps equals jack-lib-files.

Bug: 27451686
Change-Id: I9235384354e119ef7ebbf29b7e525d1ceea242e0
2016-03-03 13:48:43 -08:00
Mohamad Ayyash
f876555893 Hook incremental ext4 image generation into build
Allows passing the *.base_fs or *.map files for system and vendor in
INTERNAL_SYSTEM_BASE_FS_PATH and INTERNAL_VENDOR_BASE_FS_PATH variables
respectively.

Internal Design Doc: go/incremental-ext4
BUG: 26839493
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>

Change-Id: Ie57ef6dbfa6084268b6535fe0a673a3b4aaa6e2f
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-03-03 12:07:21 -08:00
Ying Wang
aad03eceed Merge "Add --auto-add-overlay if a module has LOCAL_STATIC_ANDROID_LIBRARIES" into nyc-dev 2016-03-03 18:09:31 +00:00
Ying Wang
b7b38d4d5d Merge "[DO NOT MERGE] Update BUILD_ID for nyc branches." into nyc-dev 2016-03-03 17:34:59 +00:00
Neil Fuller
79586ad032 Merge "Add JarJar support to BUILD_HOST_JAVA_LIBRARY" into nyc-dev 2016-03-03 09:11:09 +00:00
Yohann Roussel
1501a9a8b5 Merge "Use Jack to check build" into nyc-dev 2016-03-03 08:47:41 +00:00
Ying Wang
75e962a87e Add --auto-add-overlay if a module has LOCAL_STATIC_ANDROID_LIBRARIES
Bug: 25958912
Change-Id: Iafba9eefde0823095775474bcb7cc5b6c21fd248
2016-03-02 18:55:46 -08:00
Ying Wang
f5fedfa8e4 [DO NOT MERGE] Update BUILD_ID for nyc branches.
Bug: 27327323
Change-Id: I60985c66a41cbece69f0a19c19bde7695b2ca48e
2016-03-02 18:18:07 -08:00
Ying Wang
2a7af11a2c Merge "Calls aapt2 when a static Java library has LOCAL_STATIC_ANDROID_LIBRARIES" into nyc-dev 2016-03-03 00:55:24 +00:00
Ying Wang
bfffd93a02 Merge "Clean generated source dir if .proto/.rs is gonee." into nyc-dev 2016-03-02 18:19:26 +00:00
Ying Wang
0302dc1301 Merge "Support arch specific variants of LOCAL_STRIP_MODULE/LOCAL_PACK_MODULE_RELOCATIONS" into nyc-dev 2016-03-02 18:03:30 +00:00
Stuart Scott
cc52da8dae Add cts_v2 phony target for temporary build fix.
Change-Id: I770dc800dbcdff2c31e370410b32e2ee079f308b
2016-03-02 08:42:41 -08:00
Neil Fuller
30b21ad579 Add JarJar support to BUILD_HOST_JAVA_LIBRARY
This will allow us to convert icu4j-icudata / icu4j-icutzdata
targets to "host" targets rather than "target" targets.
Right now they are forcing Jack off just so they can use
javac + jarjar (even though the resulting file is used on
host).

Bug: 27218410
Change-Id: I7062c698389d98b0dde5690280a9140c3b12cbf7
2016-03-02 11:19:41 +00:00
Ying Wang
d5ffec9383 Clean generated source dir if .proto/.rs is gonee.
Similar to how we clean the generated source dir if .aidl becomes
obsolete.

Bug: 26688474
Change-Id: I66c5b6d6513259b5f4f4bac84f384f4bf953d82a
2016-03-01 22:22:43 -08:00
Ying Wang
b6eb8ddbde Support arch specific variants of LOCAL_STRIP_MODULE/LOCAL_PACK_MODULE_RELOCATIONS
So that we can disable only one in multilib modules.

Bug: 27442756
Change-Id: I4ca379fac997f9165c47cb93d34bf1f483f5a241
2016-03-01 20:21:37 -08:00
Stephen Hines
ed68f54ba0 Merge changes I769ed278,I99cb69ea,I57bcbed0,I6e51e51f,Iab2d36e2 into nyc-dev
* changes:
  Remove debug statement
  Tell Soong about HOST_CROSS_*
  Update to use the latest clang-2629532.
  Use newest clang static analyzers.
  Add 64-bit windows cross-compiles
2016-03-01 21:36:15 +00:00
Ying Wang
e585397497 Calls aapt2 when a static Java library has LOCAL_STATIC_ANDROID_LIBRARIES
We expect to build the module's own packare-res.apk from the
LOCAL_STATIC_ANDROID_LIBRARIES in this case.

Bug: 25958912
Change-Id: I4d0294c867f5fb636983d630493a3b188279cae9
2016-03-01 12:08:26 -08:00
Dimitry Ivanov
837d60f49a Merge "Add options for dynamic linker developer warnings" into nyc-dev 2016-03-01 17:50:02 +00:00
Adam Lesinski
7214d224b8 Merge "AAPT2: Enable product/config filtering and improve source ordering" into nyc-dev 2016-03-01 17:49:04 +00:00
Yohann Roussel
e792abc2d9 Use Jack to check build
Run jack with no outputs as a quick check for compilation errors and use
a timestamp to store that check was made.

Bug: 19069325

(cherry picked from commit 43084d9f49)

Change-Id: I9b84b503b28cfdfa245f91da0061ee3a79386b28
2016-03-01 16:57:20 +01:00
Stuart Scott
794308f169 Switch to CTSv2
bug:21762834
Change-Id: If91fd4de148241760ff29cbe227864e301a9fca7
2016-02-29 20:47:35 -08:00
Dan Willemsen
48fd6d4dc0 Remove debug statement
(cherry picked from commit dbf0792279)

Change-Id: I769ed278012d3b77f6446c24787ea8d3fe29861a
2016-02-29 13:55:37 -08:00
Dan Willemsen
fe7f737103 Tell Soong about HOST_CROSS_*
This configures Soong to build windows binaries, which requires support
for 64-bit windows binaries in BUILD_PREBUILT for USE_SOONG=true.

module_arch_supported.mk did not support 64-bit being the secondary
architecture when evaluating multilib conditionals. All other uses of
HOST_*_IS_64_BIT already check the proper version.

(cherry picked from commit d6e3b84185)

Change-Id: I99cb69ea1756b8258f15d3630c75c9ffe277aaef
2016-02-29 13:55:14 -08:00
Nick Kralevich
133e1e1f16 delete recovery policy on changing build types
When the build type changes (for example, from "shamu-userdebug"
to "shamu-user"), the build system doesn't delete all files
and start over. Rather, build artifacts from the old build type
are reused for the new build type.

This is problematic for the recovery SELinux policy, which differs
between build types. Reusing a userdebug policy on a user build
is inappropriate and could lead to security bugs.

Force the deletion of the recovery SELinux policy when changing
build types, so it can be properly regenerated. This is consistent
with how we treat the normal SELinux policy (see commit
a8b3d54101).

(cherry picked from commit 3cb10bbd3b)

Change-Id: I1d8ad7e06112777c66abed4546dadb85d35e33e1
2016-02-29 08:45:31 -08:00
Dimitry Ivanov
f22789edd0 Add options for dynamic linker developer warnings
Add bionic options that enable developer warnings for
beta/preview builds.

Bug: http://b/27365747
Change-Id: Ifc2ab706975558824522da5eece186e1660969ad
2016-02-27 01:18:24 -08:00
Stephen Hines
6f82901188 Update to use the latest clang-2629532.
Bug: http://b/25642296

(cherry picked from commit 352bccb65e)

Change-Id: I57bcbed0d7d51864ba7d7325334e9bbbba9f847b
2016-02-26 18:51:26 -08:00
Chih-Hung Hsieh
71d8cbd9b6 Use newest clang static analyzers.
* When WITH_STATIC_ANALYZER is set and non-zero, and clang compiler is used,
  call new clang ccc-analyzer or c++-analyzer.
* Otherwise, if WITH_SYNTAX_CHECK is set and non-zero,
  call compiler with -fsyntax-only.
* Replace "--sysroot=path" with "--sysroot path", to work with ccc-analyzer.
* ccc-analyzer executes the original compilation command to generate
  object files before calling clang with --analyze to do static analysis.
* When clang is called with --analyze, macro __clang_analyzer__ is defined.

BUG: 13287788

(cherry picked from commit 765c1ea6d7)

Change-Id: I6e51e51ff4ed3ce514f60d090494dcdf6e520b04
2016-02-26 18:51:26 -08:00
Dan Willemsen
7e57b8ca57 Add 64-bit windows cross-compiles
This is mostly the same as the existing 2ND_HOST / HOST_CROSS support.

The interesting thing I did here was make x86 the 'first' architecture,
and x86_64 the second. This way LOCAL_MULTILIB := first defaults to
32-bit windows modules.

  windows-x86/bin   <- defaults to 32-bit executables
  windows-x86/lib   <- 32-bit libraries, like before
  windows-x86/lib64 <- 64-bit libraries
  windows-x86/obj   <- 32-bit intermediates
  windows-x86/obj64 <- 64-bit intermediates

Then modules are registered with the names:

  host_cross_liblog    <- 32-bit, like before
  host_cross_liblog_64 <- 64-bit

Bug: 26957718

(cherry picked from commit 9ecbf83259)

Change-Id: Iab2d36e20d7002568c3534e7781e9ac8ab21a4a9
2016-02-26 18:51:26 -08:00
Adam Lesinski
e758f9319d AAPT2: Enable product/config filtering and improve source ordering
- Restore old ordering of resource files to match AAPT behavior
- Change the order in which overlays are processed.

Change-Id: I9da88f6b4124e7f89a70eb485b4591d5c4c87d38
2016-02-26 16:11:20 -08:00