Commit graph

548 commits

Author SHA1 Message Date
Nan Zhang
ad818dcbea Support java compilation sharding for target side.
Add "LOCAL_JAVAC_SHARD_SIZE" to represent the number of java
source path entries in each shard.

Sharding is not allowed when "LOCAL_JAVAC_SHARD_SIZE" and
"LOCAL_JAR_PROCESSORS" are both enabled.

Limitation:
1. 0 <= LOCAL_JAVAC_SHARD_SIZE <= 8192
1. 0 < NUM(java_sources) <= 8192
2. 0 <= NUM(shards) <= 100

Performance Compare:
<Unsharded Build------------------------------------------------>
1. Build from clean state
rm -r -f out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/
&& time m
out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar

real	1m2.720s user	5m26.604s sys	0m39.552s

2. Incremental build
m out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar &&
touch frameworks/base/core/java/android/net/http/HttpResponseCache.java && time m
out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar

real	0m37.586s user	5m47.804s sys	0m50.388s

<Sharded Build-------------------------------------------------->
1. Build from clean state
rm -r -f out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/
&& time m
out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar

Javac Shard Size: 50----real	1m10.163s user	25m59.008s sys	1m58.460s
Javac Shard Size: 100---real	1m2.115s user	21m3.600s sys	1m15.964s
Javac Shard Size: 150---real	0m59.520s user	18m10.544s sys	1m12.628s
Javac Shard Size: 200---real	0m56.894s user	15m39.244s sys	1m11.608s
Javac Shard Size: 250---real	0m55.991s user	14m38.716s sys	1m2.292s
Javac Shard Size: 300---real	0m55.114s user	13m6.568s sys	1m8.200s
Javac Shard Size: 350---real	0m53.144s user	12m7.740s sys	1m3.836s
Javac Shard Size: 400---real	0m54.929s user	12m9.324s sys	1m4.340s
Javac Shard Size: 450---real	1m30.194s user	25m31.468s sys	1m52.416s
Javac Shard Size: 500---real	0m53.976s user	10m35.500s sys	0m55.160s

2. Incremental build
m out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar &&
touch frameworks/base/core/java/android/net/http/HttpResponseCache.java && time m
out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar

Javac Shard Size: 50-----real	0m16.322s user	1m8.648s sys	0m31.700s
Javac Shard Size: 100----real	0m16.163s user	1m22.932s sys	0m29.440s
Javac Shard Size: 150----real	0m16.611s user	1m37.828s sys	0m21.168s
Javac Shard Size: 200----real	0m16.936s user	1m49.248s sys	0m28.636s
Javac Shard Size: 250----real	0m17.509s user	1m54.944s sys	0m32.768s
Javac Shard Size: 300----real	0m18.868s user	1m54.088s sys	0m28.824s
Javac Shard Size: 350----real	0m17.629s user	1m54.108s sys	0m31.056s
Javac Shard Size: 400----real	0m18.658s user	2m7.712s sys	0m30.636s
Javac Shard Size: 450----real	0m18.874s user	2m8.808s sys	0m33.540s
Javac Shard Size: 500----real	0m19.432s user	2m24.400s sys	0m30.368s

time m nothing:
real 0m5.799s user 0m7.236s sys 0m3.068s

Test: m clean && m -j checkbuild
Bug: b/67424047
Change-Id: Id0766d2b7de7c4546d29bbc7f8a0dd0e4b9ad45b
2017-10-12 13:23:06 -07:00
Jeff Gaston
9557cae873 Implement LOCAL_TARGET_REQUIRED_MODULES
to allow a host module to specify LOCAL_TARGET_REQUIRED_MODULES
to indicate that the device module should be built.

Bug: b/64580523
Test: add "LOCAL_TARGET_REQUIRED_MODULES := \
      CtsDeviceOsTestApp CtsHostProcfsTestApp" to \
      cts/hostsidetests/os/Android.mk, run \
      `m -j CtsOsHostSideTestCases`, check \
      that CtsDeviceOsTestApp.apk was built

Change-Id: I1457a51f7cd922c059aa62955d8693b1a7539fd9
2017-08-30 13:44:26 -07:00
Jeff Gaston
6264b662f3 Merge "Update to latest jacoco usage"
am: 483fae7430

Change-Id: Ibc94d5ba6db7690441825dd655b6cb26d989b78d
2017-07-17 20:44:10 +00:00
Jeff Gaston
aaae43cd24 Update to latest jacoco usage
Bug: 36792868
Test: EMMA_INSTRUMENT_STATIC=true m -j

Change-Id: I419b543283b52be9a72f5c6b10e4cbea68782174
2017-07-14 13:04:05 -07:00
Ivan Lozano
344306a4ac Merge "Add integer_overflow sanitization build option."
am: 05900230fd

Change-Id: Id2dcea2042497ddcb7bb0b83eebee583fe3c13f8
2017-07-07 20:12:56 +00:00
Ivan Lozano
4a363734b3 Add integer_overflow sanitization build option.
Adds the SANITIZE_TARGET=integer_overflow build option to apply signed and
unsigned integer overflow sanitization globally. This implements the
Make side of the build option.

A LOCAL_SANITIZE_BLACKLIST variable is added to allow blacklists to be
defined in make files, mirroring similar functionality provided in Soong.

An additional build option is provided to control whether or not to run
in diagnostics mode, controlled by SANITIZE_TARGET_DIAG. This works the
same way that SANITIZE_TARGET does and currently only supports
'integer_overflow' as an option.

Bug: 30969751
Test: Building with and without the new flags, device boot-up, tested
various permutations of controlling the new flags from build files.

Change-Id: Iacc47e196f21aa1edff5b406bfbc564b5f4e42bd
2017-07-06 18:21:37 -07:00
Jiyong Park
3487a6127d Merge "Add LOCAL_OVERRIDES_MODULES" am: f1610d82f9
am: 9089f867d4

Change-Id: I3966676c72a0bb734da8c71765fc900fcfe85eb9
2017-06-22 04:56:12 +00:00
Treehugger Robot
f1610d82f9 Merge "Add LOCAL_OVERRIDES_MODULES" 2017-06-22 04:49:41 +00:00
Colin Cross
a1b843c2b6 Merge "Add LOCAL_JAR_PROCESSOR" am: 9f52f0d17d am: abcbe9ab86
am: dcc9240a71

Change-Id: I21ecc09b9f5678746b8bb02056583f10e90e71ee
2017-05-23 02:12:43 +00:00
Colin Cross
f8a49c5a37 Add LOCAL_JAR_PROCESSOR
Allow using a host java library as an intermediate processor step
after javac but before desugar, proguard, or dx.

Test: manual
Change-Id: I7fb843e10d96c0167f6e4371582fabcc1454521f
2017-05-22 17:30:13 -07:00
Colin Cross
761d673df4 Merge "Support LOCAL_JACK_ENABLED := javac_frontend" am: 64ed2f2478 am: d6a3273faa
am: eb2457b89e

Change-Id: I98104d161dcc709a764cb86750d3217538863fdb
2017-05-02 18:15:12 +00:00
Colin Cross
b17f285169 Support LOCAL_JACK_ENABLED := javac_frontend
Allow working around Jack bugs by using javac to compile *.java
to class files, and then pass through Jack for desugaring,
proguarding, and dexing.

Also make ANDROID_COMPILE_WITH_JACK=false override LOCAL_JACK_ENABLED.

Bug: 37483961
Test: m -j checkbuild
Test: Add LOCAL_JACK_ENABLED := javac_frontend to a target
Change-Id: I2189055aac9deccc36b8eab8e949796dddadf7a1
2017-04-28 13:39:12 -07:00
Colin Cross
e8ee68bb9b Support java annotation proccessors
The codebase is growing more uses of annotation processors,
through a mixture of LOCAL_ADDITIONAL_DEPENDENCIES and
LOCAL_JACK_FLAGS.  Add LOCAL_ANNOTATION_PROCESSORS and handle
the rest in the build system.

For now we also need LOCAL_ANNOTATION_PROCESSOR_CLASSES to
work around bad behavior in grok (b/25860419).

Test: m -j java
Change-Id: I465b021e65d25ed3ea517333a82ec4ebd63fc038
(cherry picked from commit cde14987ba)
2017-04-11 12:22:53 -07:00
Colin Cross
cde14987ba Support java annotation proccessors
The codebase is growing more uses of annotation processors,
through a mixture of LOCAL_ADDITIONAL_DEPENDENCIES and
LOCAL_JACK_FLAGS.  Add LOCAL_ANNOTATION_PROCESSORS and handle
the rest in the build system.

For now we also need LOCAL_ANNOTATION_PROCESSOR_CLASSES to
work around bad behavior in grok (b/25860419).

Test: m -j java
Change-Id: I465b021e65d25ed3ea517333a82ec4ebd63fc038
2017-04-11 09:56:09 -07:00
Colin Cross
5e58793731 Add support for LOCAL_ERROR_PRONE_FLAGS
This will allow individual modules to enable error prone checks
as needed so that the change to treat an error prone check as a
compiler error can be done atomically with the changes to fix
the issues that check reveals.

Tested with the following steps, cleaning up the targets in
between to ensure that it was rebuilt everytime.

Set LOCAL_ERROR_PRONE_FLAGS := -Xep:ClassCanBeStatic:WARN
compiler error in junit-params-test target. Built
javac-check-junit-params-test with RUN_ERROR_PRONE=true to make
sure that compilation failed.

Built the javac-check-junit-params-test without RUN_ERROR_PRONE
set to make sure that the flag is not included unless explicitly
requested.

Built the junit-params-test as normal to make sure it still
worked properly.

Bug: 31507496
Test: See above
Change-Id: I88b5800dacd0e30dd9dcfa5f42e89d1428957365
Merged-In: I88b5800dacd0e30dd9dcfa5f42e89d1428957365
(cherry picked from commit 3ca9298d99)
2017-04-07 17:46:40 -07:00
Dan Willemsen
2a8a39398b Add LOCAL_EXPORT_CFLAGS for Soong
This lets Soong pass -isystem or -I as necessary (or potentially, even
other cflags in the future).

This is not available for Android.mk use, nor exposed directly to
Android.bp users.

Test: m -j
Merged-In: Id37d4692d5fbddce467bd777903b20169f44dd6e
Change-Id: Id37d4692d5fbddce467bd777903b20169f44dd6e
2017-04-05 03:36:00 +00:00
Dan Willemsen
05909fae9f Add LOCAL_EXPORT_CFLAGS for Soong
This lets Soong pass -isystem or -I as necessary (or potentially, even
other cflags in the future).

This is not available for Android.mk use, nor exposed directly to
Android.bp users.

Test: m -j
Change-Id: Id37d4692d5fbddce467bd777903b20169f44dd6e
2017-04-05 01:04:18 +00:00
Dan Willemsen
efa8477fb4 Merge "Exclude ndk stubs from notice file list" am: b923eb60cd am: 376d29284a
am: 3ae9924032

Change-Id: Ieffc9535cafe96f2c7873bed21e86efa5e794fc4
2017-04-05 00:22:40 +00:00
Dan Willemsen
2be559488d Exclude ndk stubs from notice file list
There are many references to ndk stub libraries in the third party
notices:

out/soong/ndk/platforms/android-10/arch-arm/usr/lib/libc.so
out/soong/ndk/platforms/android-10/arch-arm/usr/lib/liblog.so
...

These are just stub libraries, and aren't distributed on the device. The
real versions of these libraries will be distributed on the device, and
already have the license information.

So let Soong set LOCAL_NO_NOTICE_FILE to prevent these from appearing.

Bug: 36867708
Test: Diff aosp_arm's system/etc/NOTICE.html.gz file before/after
Change-Id: Ifa3693bde7d3b6b9dc7a83122f9cfa24997fac50
2017-04-04 14:59:55 -07:00
Colin Cross
8fb3f39bcd Merge "Move comments to the previous line"
am: 906a3ea5d6

Change-Id: I70787abb1a80987fb89a4444c68b9658c80c0622
2017-03-28 22:27:44 +00:00
Colin Cross
349a7a7f1a Move comments to the previous line
End-of-line comments cause the variable to be set to a space, which
confuses using ifdef on it.

Test: builds
Change-Id: I7b1eb3b9febff1a5a5fca1e6623b2b36d538dacc
Merged-In: I7b1eb3b9febff1a5a5fca1e6623b2b36d538dacc
2017-03-28 13:24:45 -07:00
Colin Cross
8204eb1a87 Move comments to the previous line
End-of-line comments cause the variable to be set to a space, which
confuses using ifdef on it.

Test: builds
Change-Id: I7b1eb3b9febff1a5a5fca1e6623b2b36d538dacc
2017-03-28 17:05:18 +00:00
Jiyong Park
cbf76f6353 Add LOCAL_OVERRIDES_MODULES
LOCAL_OVERRIDES_MODULES is similar to LOCAL_OVERRIDES_PACKAGES, but is
for executables.

Bug: 36491275
Test: LOCAL_OVERRIDES_MODULES := foo should prevent a target executable
foo from being installed. If foo is not a target executable, error
should be reported.

Change-Id: I558f3d94105f9e319f8413c1290799f1c70ee131
2017-03-24 19:31:49 +09:00
Dan Willemsen
a471822a57 Merge "Add LOCAL_VENDOR_MODULE as a synonym to LOCAL_PROPRIETARY_MODULE" am: d69837deea am: 6acc699303
am: ac6291f639

Change-Id: I3687f90010d283326d1d3c2ac545fb39b5996a21
2017-03-21 06:16:51 +00:00
Dan Willemsen
6acc699303 Merge "Add LOCAL_VENDOR_MODULE as a synonym to LOCAL_PROPRIETARY_MODULE"
am: d69837deea

Change-Id: I4402a902cf1f490445a952904668693b8bc2b7fa
2017-03-21 06:08:20 +00:00
Dan Willemsen
05a2b931e9 Add LOCAL_VENDOR_MODULE as a synonym to LOCAL_PROPRIETARY_MODULE
The vendor image will have more than just proprietary modules in it
under Treble, so let's stop marking open source code as proprietary just
to move it to vendor.

Bug: 36452052
Test: compare build-aosp_arm.ninja before/after, no changes.
Test: Try defining LOCAL_VENDOR_MODULE / LOCAL_PROPRIETARY_MODULE in the
same and different ways, ensure it works.
Change-Id: I0ab046bcb7563a20d44ed00667e18497ef0873a8
2017-03-20 20:57:04 -07:00
Sen Jiang
67b7aaab7d Merge "Remove DBus support." am: cf858d873b am: efcda5173d
am: 3d6b408aea

Change-Id: I183f58049ef63ce8f6bfbd67554199878b7a69cb
2017-03-03 21:02:37 +00:00
Sen Jiang
efcda5173d Merge "Remove DBus support."
am: cf858d873b

Change-Id: I09cbc25da9f801128b21bbda691f18f465fb2c9c
2017-03-03 20:57:36 +00:00
Sen Jiang
d1f397e8b4 Remove DBus support.
external/dbus and external/dbus-binding-generator was removed from
the manifest.

Bug: 31602715
Test: make checkbuild
Change-Id: Iea0277720acad8ac0fa630b8745f90fb3c3b5f00
2017-03-02 18:00:21 -08:00
Mathieu Chartier
c185f742e1 Merge "Add local preopt options for generating app image and profile"
am: fea31c0b9e

Change-Id: I58a6232ff9b001669b6b0f2c88e42b282e2e0ddc
2017-03-03 01:18:16 +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
Mathieu Chartier
9968fdcd85 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

Change-Id: Ib79ada86a4ac617491723f80d99a3add3d52a7f4
2017-02-28 16:06:40 -08:00
Dan Willemsen
dc750c31ca Merge "Add Header Library support to Make" am: 4f794fdd50 am: ea2687fab6
am: 4a78c9e50f

Change-Id: I711c810cef8487c2d8e7b53deb9ccaad89592b1d
2017-02-18 06:22:20 +00:00
Dan Willemsen
ea2687fab6 Merge "Add Header Library support to Make"
am: 4f794fdd50

Change-Id: I44b0f0fe5c0f4d65bf205165e4ec05403f738066
2017-02-17 23:55:16 +00:00
Dan Willemsen
4f794fdd50 Merge "Add Header Library support to Make" 2017-02-17 23:50:41 +00:00
Colin Cross
9256be1822 Merge changes I7e8fcd2e,Ie12d743c am: 547f7393d7 am: 8283b186be
am: 7d8a028cd3

Change-Id: Ife691c9e00e766293e3648348e3c86b92f96fd56
2017-02-17 22:45:38 +00:00
Colin Cross
8283b186be Merge changes I7e8fcd2e,Ie12d743c
am: 547f7393d7

Change-Id: Id9cd5b894a599ca660363234863fdfc6602575d2
2017-02-17 22:34:39 +00:00
Colin Cross
79e2f73b6c Re-enable dx support
This is a partial revert of commits:
858657366f Remove support of disabling Jack.
3ae7861252 Remove javac support in host dex rules.
22313f2b2a Remove rules for building dex with dx

Test: builds
Change-Id: Ie12d743cbe978bdeb030910848b67f5945a4fec8
2017-02-16 14:08:45 -08:00
Dan Willemsen
8dae49c5e1 Add Header Library support to Make
We currently use static libraries without any source files to represent
header libraries, but Soong actually has cc_library_headers. So to
export those in a separate namespace from static libraries, implement
them in Make as well.

This also adds a nice pretty-warning / pretty-error macro that can be
used to print out standard warning messages pointing to the real source
file having the problem.

Test: Use a header library exported by Soong in a Make module
Change-Id: I3486539e247524cb82a20620745fc7be03014e14
2017-02-15 16:04:49 -08:00
Dan Willemsen
d282426b07 Merge "Support Soong native coverage" am: c9fa07c958 am: 0c2bd30961 am: c9f5ca3969
am: ce18a0d8f4

Change-Id: I86d2e1e13367bbb728b5488742383149ad7bdd9b
2017-02-15 00:44:15 +00:00
Dan Willemsen
c9f5ca3969 Merge "Support Soong native coverage" am: c9fa07c958
am: 0c2bd30961

Change-Id: I68a695f1524331d6516ce16cad8ade3162072336
2017-02-15 00:39:13 +00:00
Dan Willemsen
0f90908026 Support Soong native coverage
Soong (or any other prebuilt) can provide a .gcnodir file using
LOCAL_PREBUILT_COVERAGE_ARCHIVE. Just like today, if one isn't provided
for static libraries, an empty one will be created for Make modules to
use.

Also fixes a problem I noticed including whole static libs having
coverage into static libs. It was trying to write to /WHOLE since
PRIVATE_INTERMEDIATES_DIR was not set.

Bug: 32749731
Test: See build/soong change for soong-side tests
Test: Enabled coverage of a soong static lib, then include it in a make
static lib with LOCAL_WHOLE_STATIC_LIBRARIES and ensure that the any
shared libraries using the make static lib get the embedded coverage
information.
Change-Id: I32762f099c9757074fec922ee4822f819c9ceaf5
2017-02-10 09:27:35 -08:00
Dan Willemsen
3208098830 Merge "Sort clear_vars.mk again" am: 05106468f8 am: 03b7efd871 am: dc59849984
am: b6deae08fe

Change-Id: I1a187a12738b13d5a86f7b171bb0f57b1909c7ff
2017-02-10 00:31:45 +00:00
Dan Willemsen
dc59849984 Merge "Sort clear_vars.mk again" am: 05106468f8
am: 03b7efd871

Change-Id: I211ea6e5e596f752a62fbf47994fbcaaca01cd4d
2017-02-10 00:21:21 +00:00
Dan Willemsen
88ac806adf Sort clear_vars.mk again
Test: none
Change-Id: Id776e81977695c4b488f44b155f2c098d5f8b61a
2017-02-09 14:28:22 -08:00
Dan Albert
8791fe60d0 Merge "Add c_std and cpp_std properties." am: 220ca4d04b am: 66496c4b96 am: 492a5ff3eb
am: 3bb28719cf

Change-Id: Ifbe68f1cca96b8205f52ac30277a0a454f9c8b8b
2017-02-06 19:29:16 +00:00
Dan Albert
492a5ff3eb Merge "Add c_std and cpp_std properties." am: 220ca4d04b
am: 66496c4b96

Change-Id: I88fe9bebf9f389717135a9137762dd932ab7a139
2017-02-06 19:25:38 +00:00
Dan Albert
76bfcd4ab2 Add c_std and cpp_std properties.
Test: Checked showcommands ouput for each setting.
Bug: None
Change-Id: Ibc25f3977eaaecfd1fb99a27c9e15acae0ec4106
2017-02-03 16:43:06 -08:00
Dan Willemsen
1d324167f1 Merge "Support non-gtest NATIVE_TESTS" am: 561b0a3753 am: 1ef5112475 am: 4ad881c067
am: 27f489cd00

Change-Id: I85c5afe2a217c8335320885b00fc61ffbf159ba7
2016-12-22 20:53:08 +00:00
Dan Willemsen
4ad881c067 Merge "Support non-gtest NATIVE_TESTS" am: 561b0a3753
am: 1ef5112475

Change-Id: I7c16881f0efb637bf13a0af1e4c89640d7e218e6
2016-12-22 20:42:06 +00:00