Commit graph

662 commits

Author SHA1 Message Date
Paul Duffin
fc3d49651d Revert "Remove legacy-test from TARGET_DEFAULT_JAVA_LIBRARIES"
This reverts commit 01fc887a07.

A number of build breakages occurred which were not caused by presubmit checks.

Change-Id: I1351dba594c8a8b210416f75a67c68554d5b9372
2017-02-06 14:58:02 +00:00
Paul Duffin
01fc887a07 Remove legacy-test from TARGET_DEFAULT_JAVA_LIBRARIES
Bug: 30188076
Test: make checkbuild
Change-Id: I8cc9d4f7aad5d9c0fb0a52a5f5d430c6d28050ce
2017-01-20 11:38:44 +00: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
f1e23b77f4 Merge "Soong now exports AIDL_CPP"
am: 06a2daac72

Change-Id: I704c568b71cd95c6a17545d6694095b72e5c097c
2016-12-06 02:25:36 +00:00
Treehugger Robot
06a2daac72 Merge "Soong now exports AIDL_CPP" 2016-12-06 02:20:40 +00:00
Dan Willemsen
32b283171e Soong now exports AIDL_CPP
So remove it here.

Test: mmma -j system/tools/aidl
Change-Id: Ia92ce6499881c1aec42900fcfdb4e790a67b62b5
2016-12-05 15:16:38 -08:00
The Android Automerger
ada51f3b8f Manually merge commit 'c13da91' into stage-aosp-master
* commit 'c13da91':
  Add support for creating ext4 images with mke2fs

BUG:33304034
2016-12-03 04:02:09 +00:00
Treehugger Robot
c13da91023 Merge "Add support for creating ext4 images with mke2fs" 2016-12-02 22:48:23 +00:00
Paul Duffin
74f8ee05de Merge "Replace core-junit with legacy-test"
am: 32cc1f80e5

Change-Id: Id425eff2aaafdf8ad63bc66ef2d28f71d32d6e8b
2016-12-01 10:42:16 +00:00
Paul Duffin
6470f4fa99 Replace core-junit with legacy-test
m -j32 checkbuild cts droid
adb reboot bootloader
fastboot flashall -w
cts-tradefed run cts -m CtsLibcoreTestCases

Bug: 30188076
Test: As above
Change-Id: I2d49cb3c451cb265d026f9a700a61b3fc0d2ed82
2016-11-30 13:50:56 +00:00
Dan Willemsen
dc556b4bc0 Prohibit host modules from using LOCAL_COPY_HEADERS
am: 6e51ef61a7

Change-Id: Id7c80e4dba5a505a04ce47d459c0a525debc4d53
2016-11-29 20:42:37 +00:00
Dan Willemsen
323efd3035 Add basic VNDK support in Make
am: bab0fa6928

Change-Id: Ie2bc9062891b2f8000b1db471b27f58c74190e92
2016-11-29 20:42:32 +00:00
Dan Willemsen
6e51ef61a7 Prohibit host modules from using LOCAL_COPY_HEADERS
There are no users left, so remove all of this.

Test: lunch aosp_arm-eng; m -j native
Test: build/tools/kati_all_products.sh on aosp and internal master
Change-Id: I32f5c8b470a43dd203d7e20c192167630e4e6888
2016-11-28 13:46:17 -08:00
Dan Willemsen
bab0fa6928 Add basic VNDK support in Make
Add BOARD_VNDK_VERSION and LOCAL_USE_VNDK to specify the version of the
VNDK that will be used globally, and whether to use the VNDK on a module
basis.

If the board is using the VNDK:

* LOCAL_COPY_HEADERS may only be used by modules defining LOCAL_USE_VNDK
* LOCAL_USE_VNDK modules will compile against the NDK headers and stub
  libraries, but continue to use the platform libc++.
* LOCAL_USE_VNDK modules will not have the global includes like
  system/core/include, but it will use device-specific kernel headers.

This change does not attempt to enforce any linking constraints, that
will come in a later patch.

Test: out/build-aosp_arm.ninja is identical before/after
Change-Id: Icce65d4974f085093d500b5b2516983788fe2905
2016-11-28 13:46:17 -08:00
Adrien Schildknecht
9a072cc0b0 Add support for creating ext4 images with mke2fs
We are investigating replacing make_ext4fs with the upstream tool mke2fs.
To mitigate the trouble that may arise if the new tool behave differently
compared to the old one, there will be a transition period.

Devices that want to use the new way of creating ext4 images can set the
variable "TARGET_USES_MKE2FS" to true in their BoardConfig.mk
By default, the build system will choose the old tool 'make_ext4fs'.

Test: m otapackage with TARGET_USES_MKE2FS={,false,true}
Change-Id: I282bcb9efe335a86c53986283090ca947d65c7f8
2016-11-18 17:06:29 -08:00
Dan Willemsen
c87ea75be2 Merge "Fix vendor/google/build/ninja_config.mk"
am: a9daf15d87

Change-Id: I15afdf34b43317b3566a3c390b09f57fafbadec9
2016-11-11 05:41:02 +00:00
Dan Willemsen
1ff5fa11c4 Fix vendor/google/build/ninja_config.mk
This needs to be included between PARSE_TIME_MAKE_GOALS and KATI_GOALS

Test: m -j <target-from-internal>
Change-Id: I7284f05336b921d40f04ff5811a47bd0d17a066f
2016-11-10 19:41:27 -08:00
Dan Willemsen
0c3eaa8cf4 Split (ninja|soong).mk into config and rule portions
am: 04f53ed923

Change-Id: I5766f8a60440669c6cda418a4423d159c9697bcb
2016-11-10 23:04:13 +00: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
Dan Willemsen
04f53ed923 Split (ninja|soong).mk into config and rule portions
So that an external tool can read the configuration using
dump-many-vars, and write out the soong.variables file while only
loading config.mk.

Also remove dumpvar-% from PARSE_TIME_MAKE_GOALS, since it's only used
with CALLED_FROM_SETUP / config.mk. This provides an easy way to test
this change as well.

Test: get_build_var NINJA
Test: get_build_var ANDROID_GOALS
Test: get_build_var NINJA_GOALS
Test: get_build_var KATI_GOALS
Test: MAKECMDGOALS="droid sdk dumpvar-ANDROID_GOALS" get_build_var ANDROID_GOALS
Test: MAKECMDGOALS="droid sdk dumpvar-NINJA_GOALS" get_build_var NINJA_GOALS
Test: MAKECMDGOALS="droid sdk dumpvar-KATI_GOALS" get_build_var KATI_GOALS
Test: MAKECMDGOALS="out/build-a.ninja dumpvar-ANDROID_GOALS" get_build_var ANDROID_GOALS
Test: get_build_var SOONG_MAKEVARS_MK
Test: get_build_var SOONG_VARIABLES
Test: CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core make -f build/core/config.mk out/soong/soong.variables showcommands
Test: Compare soong.variables from above, and before/after with `m`
Test: Compare out before/after with `m doesnotexist`
Test: `m dist doesnotexist`
Change-Id: I1bc291aa165297c930fe600067edad6ce4979210
2016-11-09 17:53:33 -08:00
Dan Willemsen
cfabc42af9 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-09 17:29:23 -08:00
Dan Willemsen
662c90bc11 Merge "Remove variables exported by Soong"
am: 4e5df99720

Change-Id: If8f414d4699ed061238cc8da576bb8c50a07a509
2016-10-21 01:21:25 +00:00
Dan Willemsen
db3bfcea66 Remove variables exported by Soong
These are all variables that we export from Soong, and are only used
after Soong's make_vars.mk is read.

Test: Compare build-aosp_flounder.ninja before/after -- only whitespace
Change-Id: Ibb6c6d7bc00ff5840a72c2bba5d97ac4b4724df3
2016-10-18 17:26:07 -07:00
Chih-hung Hsieh
a70f8fc5d5 Merge "Add -Werror to compile warning free projects." am: 355e96774b am: 05388b7618
am: 9f82feb9e6

Change-Id: I2738360c847b6181756b46801d90d26de04933b0
2016-10-13 01:06:18 +00:00
Chih-Hung Hsieh
bab0488828 Add -Werror to compile warning free projects.
* Add -Werror if LOCAL_PATH is in the WARNING_DISALLOWED project list,
  or not in the WARNING_ALLOWED project list.

Test: Build for major targets.
Change-Id: I12235ee1ca1c1837530693699e705e1955275565
2016-10-11 15:38:39 -07:00
Dan Willemsen
9f9d5f001f Merge "Use ASAN prebuilts if SANITIZE_HOST includes address" am: daba887656 am: 3a14d45f83
am: b4cfe8c7f9

Change-Id: Ie4ef75194162b8b0aa3efc4dd3b8f6a883115116
2016-10-07 01:21:07 +00:00
Treehugger Robot
daba887656 Merge "Use ASAN prebuilts if SANITIZE_HOST includes address" 2016-10-07 01:08:07 +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
Dan Willemsen
3b4d17ffe7 Use ASAN prebuilts if SANITIZE_HOST includes address
Test: SANITIZE_HOST=address m -j showcommands
Change-Id: Ifdca98d5fa32867005ace99e1eb5188e22923ac6
2016-10-05 23:26:24 -07:00
Jakub Adamek
44dd3e2842 Install runtime resource overlay without subdir.
am: a08a1015bc

Change-Id: I1ca2e029b79bf125145d2031a722914fe24dd299
2016-10-05 20:03:45 +00:00
Jakub Adamek
a08a1015bc Install runtime resource overlay without subdir.
Runtime resource overlay is a bare APK with just the overlaid
resources. There is no need for additional subdir.
See http://go/sku-colors.

Bug: 31692079
Change-Id: Iff3d58f941e764a7be3ec04cafeefd592bd8b944
2016-10-05 10:03:28 +01:00
Colin Cross
7bc7704921 Merge "Fix empty mac .toc generation" 2016-10-05 02:35:02 +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
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
Dan Willemsen
e68100e8bb Remove WITH_SYNTAX_CHECK
It's no longer used. The majority of the platform is on clang anyways.

Test: m -j
Change-Id: I4fb4375eaad2469e169d34c47ae3fe2a0540aeec
2016-09-26 17:37:19 -07:00
Dan Willemsen
665cda08f0 Merge "Fix link_type checking" 2016-09-19 21:54:09 +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
Colin Cross
4ed13c38a5 Remove SRC_SYSTEM_HEADERS
It is inherited from Soong now.

Bug: 31492149
Change-Id: Ia9bfd9662dba16032dac68b55b4f0743c0688139
2016-09-15 09:29:15 -07:00
Colin Cross
067d781530 Remove global linker search paths
Remove the global linker search path, as it can cause spurious build
failures.  If a library with the same name as a system library is in the
process of being written to the directory in the global search path, and
the linker may try to read the partially-written built one instead of the
system one.  We already use full paths to libraries for target builds,
do the same for host builds.  Also remove the normalize library
functions, they are no longer necessary.

Test: m -j checkbuild
Bug: 31393456
Change-Id: If9fc631e111f568c700fd73e103445c30d7e9d11
2016-09-09 11:01:15 -07:00
Casey Dahlin
29e2b21c0a Add tool to copy files in to fat16 images
fat16copy.py can be used to copy files or directories in to the root of
a fat16 image.

Usage: fat16copy <image> <file> [<file> ...]

Test: Used to compose a Raspberry Pi 3 boot image
Bug: 28912590
Change-Id: I29c9eec3786e2c5cc94f9a160360bac850809a93
2016-09-02 14:13:47 -07:00
Colin Cross
44005d41dc Don't double-wrap with gomacc
config.mk is parsed by make and then kati, and goma.mk appends to
CC_WRAPPER.  Only export it from make so gomacc doesn't appear twice on
the command line.

Bug: 31142427
Change-Id: I5ad97ee3a00b013faa620215c839499b48528e00
2016-08-31 13:51:16 -07:00
Colin Cross
5a5befb7c0 Enable goma in soong
Pass the USE_GOMA flag to soong, and export the CC_WRAPPER environment
variable after adding gomacc to it.

Bug: 31142427
Change-Id: I6de698a40817c0615b03fa17bd27075465d79ffd
2016-08-31 09:48:21 -07:00
Dan Willemsen
96963dfd4d Merge "Use soong_zip and zip2zip to make dist faster"
am: 6dcdb45485

Change-Id: I9a4241b436f7dead5de7b02d3af56004b1eed42f
2016-08-11 19:33:10 +00:00
Dan Willemsen
5e29cad1d5 Use soong_zip and zip2zip to make dist faster
soong_zip parallelizes the compression when creating a zip file, which
makes these packaging steps far shorter.

zip2zip skips the decompression and recompression during the -img- file
creation.

For an aosp_arm64-eng aosp/master build:

target_files.zip: 92s to 60s
symbols.zip: 147s to 7s
img.zip: 64s to 0.5s

There's still room to parallelize the image compression during
target_files.zip (add_img_to_target_files step takes most of the time)

Change-Id: I7b6a91e4a7dbeda2e49ca936b10181cff2f973d7
2016-08-10 16:13:58 -07: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
Colin Cross
768291a37c Merge \"Split -isystem headers into separate variables\"
am: 921be36569

Change-Id: Icd539e53caa9ad55e900b394c6005bb3606dce70
2016-07-21 17:58:10 +00:00