Commit graph

30275 commits

Author SHA1 Message Date
Dan Willemsen
c1f17ffc7d Replace product variable stashing with .KATI_READONLY
Instead of using rot13 / rot26, use the Kati extension to mark these
variables as readonly.

Move $(strip) for a few variables to before they're marked readonly. Use
a different variable for modifications to BOARD_KERNEL_CMDLINE in
build/core/Makefile.

Test: build/tools/kati_all_products.mk on AOSP and internal master
Test: build-aosp_bullhead.ninja the same before / after
Change-Id: If98b24af763831a9c5c2de38037a69ab1bf9e023
2016-10-06 10:50:26 -07:00
Treehugger Robot
480678e220 Merge "Add tool to run kati for all products" 2016-10-05 22:56:03 +00:00
Dan Willemsen
4c364620ac Add tool to run kati for all products
Test: get_build_var all_named_products
Test: build/tools/kati_all_products.sh
Change-Id: I3496cb4c59a1edb11c9149b95ecabd3a828b8972
2016-10-05 14:04:21 -07:00
Treehugger Robot
2849d4f9d9 Merge "Remove redundant LIBART_IMG_{HOST,TARGET}_BASE_ADDRESS" 2016-10-05 16:51:15 +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
Colin Cross
7bc7704921 Merge "Fix empty mac .toc generation" 2016-10-05 02:35:02 +00:00
Colin Cross
6338f23a36 Merge "Don't prune $(OUT_DIR) from findleaves.py" 2016-10-05 01:38:04 +00:00
Colin Cross
cff9a64a48 Fix empty mac .toc generation
If a shared library has no exported symbols grep will return exit code
1 meaning no matches, but this should not be considered an error
during toc generation.

Test: external/clang/build.py
Change-Id: If589da38ad8b844fe1aff4738481cebea75cca42
2016-10-04 17:01:29 -07:00
Colin Cross
ae58e2bfa5 Don't prune $(OUT_DIR) from findleaves.py
Pruning $(OUT_DIR) can be overaggressive if $(OUT_DIR) matches the name
of any directory in the source tree that contains Android.mk files.
Pruning $(OUT_DIR) is no longer necessary, as one of the first things
the build system does is put an empty Android.mk file in there to avoid
recursing into it.

Bug: 31941856
Test: m -j OUT_DIR=angler
Change-Id: I7c5e95816f35bd5906845716d56cca76de7fa1ad
2016-10-04 16:35:21 -07:00
David Zeuthen
70209ad9f0 Merge "Make room for AVB hashtree and metadata." 2016-10-04 22:32:27 +00:00
Chih-hung Hsieh
4b4b2da13d Merge "Accept environment variables DEFAULT_*_TIDY_CHECKS" 2016-10-04 22:25:26 +00:00
David Zeuthen
4014a9daa7 Make room for AVB hashtree and metadata.
While the system.img images currently built with AVB support verify
correctly, mounting the filesystem content fails. This is because
'avbtool add_hashtree_footer' used to claim some of the unused /
DONT_CARE space for stashing the verity tables and this resulting in the
mapped device ending up being smaller causing the mount failure.

Fix this by leaving enough room for AVB hashtree and metadata before
building the image. This is achieved by moving the AVB hashtree support
into build_image.py and using a just added '--calc_max_image_size'
option to 'avbtool add_hashtree_footer' to figure out how much space to
leave out.

This depends on https://android-review.googlesource.com/#/c/281821/

Bug: 31264226
Test: Mounting dm-verity set up from system.img now works.

Merged-In: I4c5de1004c1059f8c582e76b3b8517d427aa1a87

Change-Id: I945a5f1f6782791736cd319f216cfa6b448fb04d
2016-10-04 17:32:16 -04:00
Colin Cross
5d8c73e373 Merge "Enable toc optimization for host builds" 2016-10-04 20:57:53 +00:00
Chih-Hung Hsieh
8fdda6e495 Accept environment variables DEFAULT_*_TIDY_CHECKS
* Define DEFAULT_GLOBAL_TIDY_CHECKS/DEFAULT_EXTERNAL_VENDOR_TIDY_CHECKS
  only if it is not already defined.

Bug: http://b/27779618
Test: build with WITH_TIDY=1 and define those variables.
Change-Id: I201c9da3769d6ef658a75d4a1bf42ec6816d4069
2016-10-04 10:18:02 -07:00
Przemyslaw Szczepaniak
a8c8dadd09 Merge "Fix for non-empty a[name] tags in openJdk based javadocs." 2016-10-04 11:35:58 +00:00
Przemyslaw Szczepaniak
4bce2866fb Fix for non-empty a[name] tags in openJdk based javadocs.
openJdk based android javadoc contains <a name=... tags
that are non-empty. Currently they are being hidden,
causing badly formatted pages for some java.* classes
(missing text and random whitespace blocks).

This change makes the existing a[name] hiding rule
apply only to empty tags.

Test: make docs
Bug: 31700998
Change-Id: Ifa75bbabe308d7aed0cce6165c1113e5a382a121
(cherry picked from commit a7edd92c45)
2016-10-04 10:31:54 +00:00
Colin Cross
d2ff157159 Enable toc optimization for host builds
The toc optimization had been disabled for host builds to ensure that
the timestamp of the final binary changed whenever its implementation
changed, in order to support rerunning host tools that were modified
during incremental builds.  However, only the final install rule must be
re-run to update the timestamp, and not the link rule.

Update the shared library install dependencies to use normal
dependencies instead of order-only dependencies for host modules, and
then enable the the toc optimization for host modules.  If the
implementation of a library changes it will be reinstalled, and
libraries or binaries that depend on it will also be reinstalled.

Bug: 26015464
Test: m -j; touch art/disassembler/disassembler_x86.cc; m -j, verify
      out/host/linux-x86/bin/oatdump is updated
Change-Id: I0a14decc1994eb55ad269d841943aef66e320c63
2016-10-03 17:53:44 -07:00
Colin Cross
e0f42b41f6 Merge "Propagate signals through makeparallel" 2016-10-04 00:23:54 +00:00
Colin Cross
cf8afef2eb Merge "exec makeparallel" 2016-10-04 00:23:47 +00:00
Colin Cross
6548b54dfd Merge "Revert "Remove -d keepdepfile from ninja command line"" 2016-10-04 00:23:37 +00:00
Colin Cross
49c45aecc4 Propagate signals through makeparallel
Set up a signal handler in makeparallel that will forward SIGHUP,
SIGINT, SIGQUIT, and SIGTERM to the child process.

Bug: 31907490
Test: m -j & killall make; pgrep -a ninja
Test: make makeparallel_test
Change-Id: I306e5335ed1b2c7056804d5da377a2f283877f30
2016-10-03 15:33:11 -07:00
Colin Cross
a5471a6723 exec makeparallel
bash doesn't kill children when it receives SIGTERM.  Since makeparallel
is the last command run by the shell, run it with exec to replace the
shell with makeparallel so make can send the signal directly to
makeparallel.

Bug: 31907490
Test: m -j & killall make; pgrep -a makeparallel
Change-Id: If8aeb51ec224234da5f05eae3382ce77f48a57e2
2016-10-03 15:33:06 -07:00
Colin Cross
647d383788 Revert "Remove -d keepdepfile from ninja command line"
This reverts commit 4aca571552.

Test: builds
Change-Id: Iddb3517a4596e84404db1738fa95eb15f435a42d
2016-10-03 15:28:58 -07:00
Dan Willemsen
f009531772 Merge "Optimize rebuilds by reducing $(shell) usage" 2016-10-03 21:20:36 +00:00
Dan Willemsen
b011810c25 Optimize rebuilds by reducing $(shell) usage
$(shell) isn't particularly fast in Kati, and they have to be executed
both when reading the makefiles and determining whether the ninja file
needs to be regenerated.

Right now, the regen time is mostly hidden because we run them in
parallel. We've also configured it to ignore any commands that contain
"echo", "date", or the output directory. That happens to remove most
commands that contain side effects, so running them in parallel is fine.

But the side effects contain some important things, like the clean up
necessary when switching products. So I'm removing those filters, and
then we'll need to run the shell commands in sequence, since there will
be side-effects. That makes regen take longer though, so use pure-Make
implementations instead of $(shell) where possible.

This set of changes reduces aosp/master aosp_arm64-eng build $(shell)
usage and time by 2/3:

*kati*: func shell time: 3.135095 / 709
*kati*: func shell time: 1.067331 / 236

Bug: 30947985
Test: Manual test lines for math functions
Test: Compare build-aosp_arm64.ninja before/after
Change-Id: I4fc9d6318957992921972994f277c17918e7e1eb
2016-09-30 21:14:13 -07:00
Dan Willemsen
847d965b9e Merge "Remove LOCAL_CTS_GTEST_LIST_EXECUTABLE" 2016-10-01 01:43:37 +00:00
Treehugger Robot
ad49deb5e6 Merge "releasetools: Clean up sign_target_files_apks.py." 2016-10-01 00:11:33 +00:00
Treehugger Robot
3d38042a00 Merge "Use DEFAULT_EXTERNAL_VENDOR_TIDY_CHECKS for vendor/google_devices" 2016-09-30 23:25:17 +00:00
Tao Bao
9aa4b9b1b6 releasetools: Clean up sign_target_files_apks.py.
Remove the obsolete workaround for API 24. Also make it pylint clean.

Test: 1. Sign a target_files.zip and get identical results.
      2. `pylint --rcfile=pylintrc sign_target_files_apks.py` gives 10.00/10.

Change-Id: I21736f959c5182486fd8ccebea9bbc594edef9fb
2016-09-30 15:29:09 -07:00
Chih-Hung Hsieh
10efc73c06 Use DEFAULT_EXTERNAL_VENDOR_TIDY_CHECKS for vendor/google_devices
Many source files under vendor/google_devices
are old third party code with too many clang-tidy
misc-macro-parentheses warnings.

Test: build with WITH_TIDY=1
Change-Id: I79248af3ece9c7a4436b8cf5e6c25f224fd8201b
2016-09-30 14:50:43 -07:00
Tao Bao
0a5b59e78b Merge "releasetools: Fix the reference to OPTIONS.info_dict." 2016-09-30 17:39:22 +00:00
Dan Willemsen
3aa39a4903 Remove LOCAL_CTS_GTEST_LIST_EXECUTABLE
The one user has now been removed, so this is no longer necessary.

Test: None
Change-Id: I8fb9e7b90f664af616368685d81f8b10d0687306
2016-09-29 22:37:04 -07:00
Tao Bao
b31b94e159 releasetools: Fix the reference to OPTIONS.info_dict.
sign_target_files_apks.py calls common.GetBootableImage() but without
calling 'OPTIONS = common.OPTIONS' first. In common.GetBootableImage(),
we should use the local info_dict parameter instead of OPTIONS.info_dict.

Test: sign_target_files_apks.py generates signed-TF.zip successfully.

Change-Id: Ia3d32b88691c26e5fb98feea709e3e3c3eb70fdb
2016-09-29 22:04:50 -07:00
Treehugger Robot
1c0b5eaf83 Merge "Add LOCAL_EXPORT_C_INCLUDE_DEPS" 2016-09-30 01:38:04 +00:00
Dan Willemsen
ba6a164da7 Add LOCAL_EXPORT_C_INCLUDE_DEPS
This shouldn't be necessary for most makefiles, since we add
$(LOCAL_GENERATED_SOURCES) to this already included, but for prebuilts
that aren't actually prebuilts (Soong modules), we need to pass
dependencies so that the generated headers are built before being used.

Bug: 31742855
Test: Use, inspect build-*.ninja
Change-Id: I8d9f675af639d3f40780d48a016fc079a82531c2
2016-09-29 12:08:29 -07:00
David Zeuthen
8ee6d119d1 Merge "Update for new Android Verified Boot (AVB)." 2016-09-29 17:48:40 +00:00
David Zeuthen
2ce63edab7 Update for new Android Verified Boot (AVB).
This updates the build system for the new Android Verified Boot
codebase. As this is based on Brillo Verified Boot, this change replaces
the existing BVB support.

Android Verified Boot is enabled by the BOARD_AVB_ENABLE variable

 BOARD_AVB_ENABLE := true

This will make the build system create vbmeta.img which will contain a
hash descriptor for boot.img, a hashtree descriptor for system.img, a
kernel-cmdline descriptor for setting up dm-verity for system.img and
append a hash-tree to system.img.

Additionally, the descriptors are left in boot.img and system.img so a
third party can create their own vbmeta.img file linking - using the
option --chain_partition - to these images. If this is not needed
footers can be erased using the 'avbtool erase_footer' command. It's
also harmless to just leave them in the images.

By default, the algorithm SHA256_RSA4096 is used with a test key from
the AVB source directory. This can be overriden by the
BOARD_AVB_ALGORITHM and BOARD_AVB_KEY_PATH variables to use e.g. a
4096-bit RSA key and SHA-512:

 BOARD_AVB_ALGORITHM := SHA512_RSA4096
 BOARD_AVB_KEY_PATH := /path/to/rsa_key_4096bits.pem

To prevent rollback attacks, the rollback index should be increased on a
regular basis. The rollback index can be set with the
BOARD_AVB_ROLLBACK_INDEX variable:

 BOARD_AVB_ROLLBACK_INDEX := 5

If this is not set, the rollback index defaults to 0.

The variable BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS can be used to specify
additional options passed to 'avbtool make_vbmeta_image'. Typical
options to be used here include '--prop', '--prop_from_file', and
'--chain_partition'.

The variable BOARD_AVBTOOL_BOOT_ADD_HASH_FOOTER_ARGS can be used to
specify additional options passed to 'avbtool add_hash_footer' for
boot.img. Typical options to be used here include '--hash_algorithm' and
'--salt'.

The variable BOARD_AVBTOOL_SYSTEM_ADD_HASHTREE_FOOTER_ARGS can be used
to specify additional options passed to 'avbtool add_hashtree_footer'
for systems.img. Typical options to be used here include
'--hash_algorithm', '--salt', and '--block_size'.

BUG=31264226
TEST=Manually tested on edison-eng by inspecting {boot, system,
  vbmeta}.img in out/ directory as well as their counterparts in
  the IMAGES/ directory of edision-target_files-eng.zeuthen.zip

Merged-In: Ic9a61cfc65c148b12996e57f04da5432eef6b982

Change-Id: I97042655bca15e7eac899f12c5bada2f6184d307
2016-09-29 11:19:36 -04:00
Treehugger Robot
312c310f7c Merge "Only run warn.py's main function if it is the main program." 2016-09-29 03:58:07 +00:00
Stephen Hines
7ec2a39c3f Merge "Switch to using clang-3289846." 2016-09-29 02:56:50 +00:00
Meike Baumgärtner
ac9d5df349 Only run warn.py's main function if it is the main program.
Test: run warn.py --byproject build.log
Change-Id: I155cce8c952d6d8a02c8e1809bf61a46c847c26e
2016-09-28 17:59:08 -07:00
Treehugger Robot
6784a3fcdd Merge "Fix pylint warning and refactor project_list." 2016-09-28 17:47:41 +00:00
Tao Bao
6e12b72966 Merge "Analyze unchanged blocks in odex files." 2016-09-28 17:08:10 +00:00
Stephen Hines
183b142ac9 Switch to using clang-3289846.
Bug: http://b/30252254
Test: Built/boot platform using latest prebuilts.
Change-Id: I7c9357a99afec323fd766e93b5d5e941e9e06244
2016-09-28 08:51:55 -07:00
Chih-Hung Hsieh
9f766239f0 Fix pylint warning and refactor project_list.
Bug: 31377083
Test: run warn.py --byproject build.log
Change-Id: Id442cf6608bf5c14784063c05f5ff0b731f17486
2016-09-27 21:13:52 -07:00
Chih-hung Hsieh
aa5f2ccde2 Merge "Fix Google pylint warnings." 2016-09-28 04:10:26 +00:00
Treehugger Robot
c114bd9dbf Merge "Remove WITH_SYNTAX_CHECK" 2016-09-28 01:44:24 +00:00
Chih-Hung Hsieh
b426c54e8a Fix Google pylint warnings.
* Rename 'severity' to 'Severity'.
* Fix bad line indentations and space.

Test: run warn.py --byproject build.log
Change-Id: I33d701cca408b5ca4715be8d44c890942b7d132a
2016-09-27 18:15:40 -07:00
Treehugger Robot
9796175d0f Merge "Add buttons to group warning by project or severity." 2016-09-27 21:10:40 +00:00
Evgenii Stepanov
2358c55d70 Merge "Enable LOCAL_SANITIZE:=cfi and add LOCAL_SANITIZE_DIAG." 2016-09-27 20:51:41 +00:00
Treehugger Robot
f69e48b30b Merge "Remove spaces from DEFAULT_TIDY_HEADER_DIRS" 2016-09-27 01:10:30 +00:00