Commit graph

746 commits

Author SHA1 Message Date
Jaekyun Seok
39f97ae22a Enforce RROs for all the build-time ROs
This CL is to generate every static RRO package for its target package
automatically at build-time.

BOARD_ENFORCE_RRO build variable is added to specify whether enforcing
RRO is required or not.

BOARD_ENFORCE_RRO_EXEMPT_SOURCES build variable is added to specify
the module list of which item should be exempt from enforcing RRO.

Test: tested on bullhead and sailfish
Bug: 34097942
Change-Id: I455b2ce34e66c57a540c299b5e378b7c4e78d5b8
(cherry picked from commit 3070610b72)
2017-03-30 10:43:38 +09:00
Dan Willemsen
25e9607a46 Remove USE_SOONG_UI=false
Test: m -j
Change-Id: I4eccbf9884385f11db84f6e0f28d55d21d06cac3
2017-03-20 14:22:20 -07:00
Steven Moreland
c10f1413d5 Add PRODUCT_FULL_TREBLE.
PRODUCT_FULL_TREBLE: whether the device has Treble fully enabled (no
passthrough hals, vendor.img, split sepolicy, etc..)

PRODUCT_FULL_TREBLE_OVERRIDE: used if someone wants to consider a device
as full Treble even if it didn't launch with Android O.

Bug: 35809750
Test: PRODUCT_FULL_TREBLE set appropriately with
PRODUCT_FULL_TREBLE_OVERRIDE and PRODUCT_SHIPPING_API_LEVEL = 24/25

Change-Id: I069448beaf26c70acb6c45d4228d8fdfe9476410
2017-03-01 19:08:24 -08:00
Dan Willemsen
73da612ed0 Turn USE_SOONG_UI on by default
Set USE_SOONG_UI=false to disable the new soong_ui wrapper.

Test: m -j blueprint_tools
Test: USE_SOONG_UI=false m -j blueprint_tools
Change-Id: I0b217939a29fd51e69ef594f824b14e25a4c8c4d
2017-02-28 18:57:12 +00:00
Dan Willemsen
353a659a31 Merge "Add progress indicator to Android.mk includes" 2017-02-24 17:50:13 +00:00
Dan Willemsen
33631b3580 Add progress indicator to Android.mk includes
Test: m -j
Change-Id: I1e6fd020a06b49c243be14953d9f417e64ac7b8b
2017-02-22 11:20:51 -08:00
Simran Basi
9c295b4415 Add device-tests and general-tests make targets.
Adds the device-tests and general-tests makefiles and
added include lines to main.mk so that individual test
modules can be built properly.

These targets do not build any special tradefed wrapper
that normal *TS's usually employ. They are not necessary
here.

Bug: 35350788
Test: Updated several CTS test modules to belong to these
      suites instead and ran:
      `rm -rf out; make clean; make device-tests general-tests -j`
      then verified the output.

Change-Id: I40e3958375f7b39cb56508f2812ce9760d403f6f
2017-02-21 17:04:47 -08:00
Colin Cross
4bf332a56b Merge "Don't build tests in normal builds" 2017-02-13 22:38:28 +00:00
Dan Willemsen
c5bb5a8238 Fix "Nothing to be done" messages when launching soong_ui
When specifying multiple arguments to make, we were getting messages
about nothing to be done:

m -j USE_SOONG_UI=true checkbuild tests cts blueprint_tools
...
make: Nothing to be done for `tests'.
make: Nothing to be done for `cts'.
make: Nothing to be done for `blueprint_tools'.

Test: m -j USE_SOONG_UI=true blueprint_tools libc adb
Change-Id: Id448bf0e09736fcd92ba058aec7ce556f6f778a3
2017-02-08 19:50:16 -08:00
Dan Willemsen
3eb10cf6fa Add USE_SOONG_UI to trigger soong_ui in Make mode
Test: USE_SOONG_UI=true m -j
Change-Id: Ic7a0b4e0881757b0324722d7d316fb8d13dabd9b
2017-02-06 15:04:40 -08:00
Jaekyun Seok
7ace0d60ef Prevent abuse of property overrides
To prevent abuse of PRODUCT_*PROPERTY_OVERRIDES and
ADDITIONAL*PROPERTIES, the following rules should be applied.

- Mark PRODUCT_*PROPERTY_OVERRIDES readonly after reading product
 specs.
- Disallow any changes on ADDITIONAL*PROPERTIES from product specs
 and BoardConfig.mk.
- Mark ADDITIONAL*PROPERTIES readonly before reading Android.mk
 files.

Test: building succeeded on marlin-userdebug.
Bug: 34116668
Change-Id: I93d8de086ec85ba787165a156bdcc7df04310be1
(cherry picked from commit 294286d95c)
2017-01-25 13:00:25 +09:00
Dan Willemsen
cf324af6b8 Remove generated java source post clean logic
Just move the proto and renderscript sources into their own directories
-- the entire directory is wiped if the file list changes since the
command line will change. So we can just enable/disable pulling sources
from those directories based on whether there were files in the list or
not.

Bug: 30947985
Test: m -j java
Test: Remove a proto file from a java lib, ensure the generated source
      is not included.
Change-Id: If7529979de6fa62a651933a3a974f47b033851d6
2016-12-22 10:37:31 -08:00
Colin Cross
7a14ec7968 Don't build tests in normal builds
Treehugger will catch test breakages before they are submitted, it
is no longer necessary for all developers to wait for all tests to
build.

Test: m -j
Bug: 32221202
Change-Id: Ia1ed939fa28a80df10248b9f5c2f298b1e5d2053
2016-12-20 16:18:04 -08:00
Dan Willemsen
56c6a9d1ff Remove variables exported by Soong
LLVM_RELEASE_VERSION is unused from envsetup.sh and during product
config loading.  LLVM_PREBUILTS_VERSION is still used in envsetup.sh, so
needs to stay.

Delay reading core/clang/config.mk until after Soong's variables are
read so that we don't need a copy of LLVM_PREBUILTS_BASE.

Test: Compare build-aosp_flounder.ninja
Change-Id: I85b5836a2230838c8f3766fb19c6108fc5c9ca50
2016-12-14 16:27:08 -08:00
Dan Willemsen
01a19a116f Move some configuration from main.mk to config.mk
When dumping make configuration (dump-many-var, dump-var-*), we only
load config.mk, not main.mk. One of the first things that main.mk does
is to include config.mk, so these moves are safe.

Turning off the implicit rules and other make configuration / sanity
checks should happen in all cases, so move them to config.mk

Move dont_bother_rules to config.mk so that it can be used by the ninja
configuration (which is moving in a later change). Move dont_bother into
the kati section, since it's not used elsewhere.

Test: m clean
Test: get_build_var dont_bother_goals
Change-Id: Ib3ec8aa8eebcaf743d2cdcc31f89827c4e8470a1
2016-11-10 03:32:37 +00:00
Colin Cross
e402dd8bb8 Merge "Revert "Revert "Check prebuilt sources during checkbuild"""
am: 515f43bb6e

Change-Id: Ia749b34011e02df8ceb9d0fe0e4aba34da743cb1
2016-10-30 22:14:23 +00:00
Colin Cross
01e1b8ff4b Revert "Revert "Check prebuilt sources during checkbuild""
This reverts commit 409ea88c47.

Bug: 32332829
Change-Id: Ifc8a511762cb44b455cc821f5ac712c294c321c6
2016-10-27 22:10:55 +00:00
Colin Cross
96fdb76947 Merge "Revert "Check prebuilt sources during checkbuild""
am: 526ddfb172

Change-Id: I2bd28f5b35b27e2339eb2952b9e3acdd6a470773
2016-10-26 23:32:47 +00:00
Colin Cross
409ea88c47 Revert "Check prebuilt sources during checkbuild"
This reverts commit ec8fae6f2e.

Revert this until a few oddball branches can be fixed.

Bug: 32332829
Change-Id: Ic95fa50e36cb32a4d29bf765b1f3d8384140fb0b
2016-10-26 23:25:57 +00:00
Colin Cross
84ba353fd1 Merge "Check prebuilt sources during checkbuild"
am: 0f26c64ef5

Change-Id: I961221a3e7cdcd00ea4dcbb1c88a36f138962113
2016-10-26 19:47:57 +00:00
Colin Cross
ec8fae6f2e Check prebuilt sources during checkbuild
Add prebuilt files as dependencies during checkbuild.  This will flag
prebuilt modules that have files that don't exist as errors, and also
fix building soong modules with make native, etc.

Bug: 32332829
Test: m -j checkbuild
Test: m -j host
Change-Id: Ia4e22cb640978c181de039202baf02f4fb5a94d5
2016-10-22 00:00:40 +00:00
Dan Willemsen
829ab04c9b Merge "Replace product variable stashing with .KATI_READONLY" am: 157ad04cfc am: 9d2208441c
am: 34d8c31258

Change-Id: Idc49bb5ad4890c368762cd73ac34e995b2633d1d
2016-10-06 23:53:30 +00:00
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
Colin Cross
46e7aa81e0 Merge "Enable toc optimization for host builds" am: 5d8c73e373 am: 4276c12d20
am: e4e04c2f92

Change-Id: I4db91a8f0893faa317ec7afb2e3f5d84dfcc91cf
2016-10-04 21:08:47 +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
David Zeuthen
27ac0e34fe resolve merge conflicts of c36ab42 to nyc-mr1-dev-plus-aosp
Change-Id: Iaf78fb6c723955fd92cc64194cb32bba73a9dafb
2016-09-29 14:25:03 -04: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
Dan Willemsen
83aba3a7ab Merge "Fix link_type checking" am: 665cda08f0 am: 1347d959de
am: 8459bbca6f

Change-Id: I22da0f1703995c4734a72901abe2dbcee62c1406
2016-09-20 01:01:38 +00:00
Dan Willemsen
121e284b46 Fix link_type checking
This was printing "error:", but not actually triggering an error.
Instead of trying to write a single line bash script to handle this,
move the actual check into python. This allows us to print all of the
errors for a single module before triggering the failure.

Also updates the warning format and the warn.py script to properly parse
these warning. Many of the java:sdk -> java:platform warnings are false
positives due to the lack of LOCAL_SDK_VERSION markings on prebuilts.

Individual tags can be marked as warnings now, which lets us check for
system libraries linking against vendor libraries (which won't work on
AOSP). I'm not sure this is a completely valid check, which one reason
that it's just a warning.

Test: m all_link_types (with some missing libs commented out)
Change-Id: I333e418c9a4511b7c7e826891ae481da08fbf6f9
2016-09-15 14:40:39 -07:00
Dan Willemsen
196f190592 Merge "Fix shared library install dependencies outside of /system" am: 0b3f97b0d6 am: f9fc0ea6fe
am: 7c4ced5337

Change-Id: Ibc3c3fca687f7541d779d390e3cbc6123f88e149
2016-09-13 22:51:35 +00:00
Dan Willemsen
5bdd08b2d9 Fix shared library install dependencies outside of /system
For properly picking the shared library install dependencies, HOST_OUT
and HOST_CROSS_OUT are necessary so that we don't add a dependency
between Linux and Windows. But for target modules, we must use
TARGET_OUT_ROOT instead of TARGET_OUT, or modules in /data and /vendor
won't have proper install dependencies.

Bug: 31462199
Test: m bionic-unit-tests; manual diff of generated ninja file
Change-Id: I828fa2664613296cc6c431813f5657abffdd2b8f
2016-09-13 13:47:06 -07:00
Ryan Campbell
5a63fe6856 Merge "Implement path-based enabling of code coverage." am: 1e1ecd5d07 am: 6b92bb4ebb
am: 577eab3323

Change-Id: I36a4fc67e87e8561486111263b0d6b6ed1bdefcc
2016-09-13 20:01:23 +00:00
Ryan Campbell
81c9d29dad Implement path-based enabling of code coverage.
Native coverage is enabled by setting NATIVE_COVERAGE to true
and specifying a list of paths in the COVERAGE_PATHS
environment variable. Files are exported to a zip file in the
target out directory.

Change-Id: I66a2ddd88e849bec1cc0cdae1b51fe18a007e2c3
2016-09-13 10:27:25 -07:00
Dan Willemsen
7d72b5ef71 Merge "Fix GET-INSTALL-PATH to work with Soong" am: 6b9aa6938d am: 9fc9cac0ac
am: 0e642c3e55

Change-Id: Ic608a11b5b7ccf78f75bbf4ce7086ed92e1b9e14
2016-08-15 21:26:31 +00:00
Dan Willemsen
9fc9cac0ac Merge "Fix GET-INSTALL-PATH to work with Soong"
am: 6b9aa6938d

Change-Id: I9f433cb383846ec6ccb8e39be4b30110d60d54fd
2016-08-15 21:17:33 +00:00
Dan Willemsen
53e3899222 Fix GET-INSTALL-PATH to work with Soong
This was printing all of the Soong modules in addition to the modules
defined in the ONE_SHOT_MAKEFILE. So replicate what we did with
MODULES-IN-* with GET-INSTALL-PATH-IN-* and update all the users.

Bug: 30191725
Change-Id: Ib1e4bf00f64d7a3e8cd91f44eaf1ff82fdfbf162
2016-08-12 05:10:51 +00:00
Alexey Polyudov
74140b99c4 Merge "introduce AUX build class of targets" am: 556526bf95 am: 755391d77e
am: 30937fbde2

Change-Id: I73aa67afa95b8c45c5a4e310a340bc709d0b3da0
2016-08-02 22:55:18 +00:00
Alexey Polyudov
755391d77e Merge "introduce AUX build class of targets"
am: 556526bf95

Change-Id: I52b4b3a561ceb9c1fbe71ce75a4ef4aa252a9665
2016-08-02 22:50:21 +00:00
Alexey Polyudov
ccdc311b33 introduce AUX build class of targets
AUX is a new class, similar to TARGET
While TARGET defines toolchain for Application Processors
AUX is defining toolchains for arbitrary utility cores (DSPs, GPUs,
MCUs, etc). This allows building of non-android sources as part
of Android tree and avoid using prebuilts if source code is avaliable

Bug: 29635686
Change-Id: Ie755ea054b16c3e86369f5fb2ba6eb0b384af77f
Signed-off-by: Alexey Polyudov <apolyudov@google.com>
2016-08-02 08:06:28 -07:00
Dan Albert
dee194df54 Merge changes from topic \\\'soong-sysroots\\\' am: 65de8e446c am: 01efd46bca
am: cce7b4f00a

Change-Id: Ia5f4f59a5d53c852905a50f1a54d1ec3b9e6e2a7
2016-07-28 16:12:25 +00:00
Dan Albert
01efd46bca Merge changes from topic \'soong-sysroots\'
am: 65de8e446c

Change-Id: I8c8951364c5ddd6f99a27111acdb72097ab5db42
2016-07-28 16:06:24 +00:00
Dan Albert
c61174aac1 Add a phony target for the NDK sysroots.
`make ndk` will build all the NDK sysroots.

Test: make ndk
Bug: http://b/27533932
Change-Id: Ic2f5bf61f8911f7b8d08a473f2fe0576f3e06224
2016-07-28 00:06:20 -07:00
Colin Cross
64755b9ec5 Merge \\\"Remove Android.bp logic from makefiles\\\" am: 8bc18d35ec am: 7dc26e8aa8
am: 95ebfddd5f

Change-Id: I22073f2e6788db034f7a904600100d590efec272
2016-07-12 16:31:52 +00:00
Colin Cross
7dc26e8aa8 Merge \"Remove Android.bp logic from makefiles\"
am: 8bc18d35ec

Change-Id: I50c8180c8297feb48ff5c5eba10670b36f631921
2016-07-12 16:20:29 +00:00
Colin Cross
65543c7bc2 Remove Android.bp logic from makefiles
When Soong was optional, the make build system needed extra complexity
to ignore Android.mk files that had an associated Android.bp file.  Now
that Soong is required and the Android.mk files that were obsoleted by
an associated Android.bp file have been removed, remove all of the logic
that found associated Android.bp files.  Android.mk files and Android.bp
files are now handled independently.

Change-Id: Ia6643d151b920689219ca8abd59ede44d230ba35
2016-07-11 16:57:33 -07: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
Dan Willemsen
32b36a8819 Merge "Add NATIVE_TESTS class, move host native tests" am: e72fc63901
am: 10461b78f0

* commit '10461b78f0955d9dba8d32045d1e35ff0f9a5c8c':
  Add NATIVE_TESTS class, move host native tests

Change-Id: Ia11b54676d3b33e58c177a5a375f29233657524e
2016-06-07 00:09:39 +00:00
Dan Willemsen
e72fc63901 Merge "Add NATIVE_TESTS class, move host native tests" 2016-06-06 23:59:23 +00:00
Daniel Micay
888a623881 disable unpriv perf by default in user{,debug} builds
(Cherry picked from commit fe01f56c0d5c42508e1e82f5976e4c10bb00f632)

Bug: 29054680

Change-Id: If04bc63fc366006cde842a50b7c764f89d7449a6
2016-06-01 17:01:18 -07:00