Commit graph

638 commits

Author SHA1 Message Date
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
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
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
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
Treehugger Robot
daba887656 Merge "Use ASAN prebuilts if SANITIZE_HOST includes address" 2016-10-07 01:08:07 +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
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
Colin Cross
921be36569 Merge "Split -isystem headers into separate variables" 2016-07-21 17:51:13 +00:00
Colin Cross
23ba612aad Split -isystem headers into separate variables
Split the variables that contain header directories into ones that
should be prefixed with -isystem and ones that should be prefixed with
-I in preparation for moving some headers from -isystem to -I.

Add $(wildcard) around SRC_HEADERS to match the soong behavior, and move
users of SRC_HEADERS from config.mk to binary.mk so that the exported
soong value is present.

Test: no changes to build.ninja compile rules
Change-Id: Iadecbbf4351a01e53cb57e721d31f4f836bb82d9
2016-07-20 23:09:29 -07:00
Colin Cross
17904fabbf Merge \"Factor out common include directories into helper\"
am: 95fa32b577

Change-Id: I720d7c02de3d11b4a5a3328946433aa7274f1bb6
2016-07-20 21:24:29 +00:00
Treehugger Robot
95fa32b577 Merge "Factor out common include directories into helper" 2016-07-20 21:11:22 +00:00
Pirama Arumuga Nainar
adac150e40 Merge \"Disable warnings triggered in Clang r271374\"
am: 11e0e36462

Change-Id: I315936308c883352a195dc4aff0b9f42757019f1
2016-07-19 23:40:23 +00:00
Colin Cross
e25fd79337 Factor out common include directories into helper
Refactor includes in transform-*-to-o to simplify future changes to the
default include paths.

Test: whitespace-only changes to the compile rules in build.ninja
Change-Id: I766af1f22a4838d933691b6df37530db3ba4e21d
2016-07-19 15:09:50 -07:00
Pirama Arumuga Nainar
1679c3649b Disable warnings triggered in Clang r271374
http://b/28149048
http://b/29823425

Disable -Wnull-dereference.  The second bug above tracks that this
warning gets re-enabled.

Test: Tested build, boot and common usage for Arm, Arm64, x86, x86_64,
Mips images in AOSP and internal branch.

Change-Id: Ie41a495dd9bb247d3609f4848d7669d1faaeeb79
2016-07-19 20:32:28 +00:00
Dan Willemsen
ffb643e487 Merge \"Use more prebuilt build-tools\"
am: 6c0c720389

Change-Id: Icb67388bf084f2de872e9df8747b70cbde42b5f9
2016-06-14 22:28:02 +00:00
Dan Willemsen
7c2d228701 Use more prebuilt build-tools
For acp, we've been using an old prebuilt in prebuilts/sdk, but it's not
part of the SDK. Instead, we'll use a prebuilt in the build-tools
repository.

For ijar, we've been using the host libstdc++ to workaround the lack of
libc++ on some unbundled branches. Instead, use a prebuilt that can use
libc++.

For ziptime, we've been disabling it on unbundled branches, due to the
lack of libc++. Instead, use a prebuilt version of ziptime that can use
the prebuilt libc++.

Change-Id: If80f845ea06f76e3fe6765964e77c864eaf303d0
2016-06-14 13:50:38 -07:00
Yohann Roussel
9530d9131c Merge \\"Do not force turn off of Jack warning\\" am: 0a26fc0ace
am: 5185323de9

Change-Id: I054396d9bdb88822ca75be61a88e18f08213242d
2016-06-13 14:48:53 +00:00
Yohann Roussel
0a26fc0ace Merge "Do not force turn off of Jack warning" 2016-06-13 14:33:48 +00:00
Dan Willemsen
74da7c9272 Merge \\"Rewrite LDLIBS and SHARED_LIBRARIES\\" am: a8d13592ac
am: d8210177af

Change-Id: If466674f33ba7d98a0f8da249bc0dc57efdcf621
2016-06-08 21:17:05 +00:00
Yohann Roussel
bf17172521 Do not force turn off of Jack warning
When ANDROID_JACK_EXTRA_ARGS is defined there is no reason to still turn
off those warnings.

Change-Id: Ic7ac02c72ed3b7b0eaca9394c9fc7d92d5dfa871
2016-06-08 17:00:09 +02:00
Dan Willemsen
6731b495ca Rewrite LDLIBS and SHARED_LIBRARIES
LOCAL_LDLIBS was the only correct way to use NDK libraries, but few used
it correctly. It also often got confused with LOCAL_LDFLAGS, so move the
flags to the correct variable.

For binaries that weren't using the NDK (empty LOCAL_SDK_VERSION), it
was never valid to use LOCAL_LDLIBS, as dependencies would not be
properly set up, and could lead to random build failures. So convert any
-l linker flags to using LOCAL_SHARED_LIBRARIES automatically.

For binaries built using the NDK (LOCAL_SDK_VERSION set), they were
required to use LOCAL_LDLIBS for prebuilt NDK libraries, otherwise they
would get headers and dependencies to the platform versions. Any
non-prebuilt LOCAL_LDLIBS would miss dependencies. So move the NDK
prebuilt libraries to LDLIBS from SHARED_LIBRARIES, and move everything
else to SHARED_LIBRARIES.

So now, for device modules, LOCAL_SHARED_LIBRARIES should always be
used, and we'll do the right thing. LOCAL_LDLIBS should only be used for
host libraries from the system.

Change-Id: Ide34c7afdcfb6507a378d45a42471729e489a9e0
2016-06-07 21:59:55 -07:00
Dan Willemsen
238f4aafd2 resolve merge conflicts of dfcf2e0 to nyc-dev-plus-aosp
Change-Id: I5473ac42db3dba12dffb1d40eb9096d738ef977b
2016-05-26 15:01:20 -07:00
Dan Willemsen
056609ccfe Remove unnecessary variables
These are all either recently unused due to the removal of CFLAGS/etc,
or have been exported by Soong and are no longer necessary.

Change-Id: I5930d43fda21acc8202b3d8ea010fbefb6ae4cf1
2016-05-25 21:23:20 -07:00
Dan Willemsen
3f6927a862 Merge "Remove (C|CPP|CONLY|LD)FLAGS checked by Soong" am: 15409e8f20
am: c78767f66d

* commit 'c78767f66d06f2edd46e10fcc5c1ee2053565549':
  Remove (C|CPP|CONLY|LD)FLAGS checked by Soong

Change-Id: I9e63f52a421f9a4358887fdb76c055b51d7903ea
2016-05-19 22:20:34 +00:00
Dan Willemsen
174feb906f Remove (C|CPP|CONLY|LD)FLAGS checked by Soong
At the beginning of every build, Soong has exported its version of these
variables, and has been ensuring that when sorted, the result is the
same. So these variables all have the same flags of the Soong ones, but
may be in different orders. We don't believe any of the remaining order
differences matter. As we remove the Make definitions, the exported
Soong variables will take over.

This only removes lines that change one of these variables:

  [2ND_][CLANG_]HOST_CROSS_GLOBAL_CFLAGS
  [2ND_][CLANG_]HOST_CROSS_GLOBAL_CONLYFLAGS
  [2ND_][CLANG_]HOST_CROSS_GLOBAL_CPPFLAGS
  [2ND_][CLANG_]HOST_CROSS_GLOBAL_LDFLAGS
  [2ND_][CLANG_]HOST_GLOBAL_CFLAGS
  [2ND_][CLANG_]HOST_GLOBAL_CONLYFLAGS
  [2ND_][CLANG_]HOST_GLOBAL_CPPFLAGS
  [2ND_][CLANG_]HOST_GLOBAL_LDFLAGS
  [2ND_][CLANG_]TARGET_GLOBAL_CFLAGS
  [2ND_][CLANG_]TARGET_GLOBAL_CONLYFLAGS
  [2ND_][CLANG_]TARGET_GLOBAL_CPPFLAGS
  [2ND_][CLANG_]TARGET_GLOBAL_LDFLAGS

Many other variables are unnecessary now too, but those will be removed
in another change. For those we can ensure the build.ninja file does not
change, but we expect it to change here due to the ordering differences.

Change-Id: I0bd0778706d02ee27b2784dd8dc6b2c71d37bd3a
2016-05-18 18:10:04 -07:00
Dan Willemsen
7ec97fdc16 Merge "Remove make variables exported from Soong" am: 30b57cd7d5
am: f85807f794

* commit 'f85807f794266ccebbcba8aaf2732b1fb945519d':
  Remove make variables exported from Soong

Change-Id: I453366e23996f4b68acc5367146829050f00798e
2016-05-18 00:43:02 +00:00
Dan Willemsen
4863dafcb1 Remove make variables exported from Soong
These have all been strictly checked by Soong, so the values currently
match. Just remove them so that the make variables exported by Soong
will take over.

This also removes some of the GCC reconfiguration, since we haven't
implemented that in Soong. If it becomes useful in the future, we'll
implement it there.

Some things like TARGET_TOOCHAIN_ROOT can nearly be removed, but are
used before the Soong-exported make_vars.mk is loaded. In that case,
added to the clang cflags, so it can be removed once the cflags are
removed.

Others, like LLVM_PREBUILTS_VERSION are loaded even earlier -- in
envsetup.sh before we've even configured Soong. So for now, keep the
Make definition, and continue ensuring it's the same as the Soong
version.

Change-Id: I554b27062ac43610828a8c06d640d919a2dc21ca
2016-05-16 20:39:58 -07:00
Colin Cross
5f1660ebf4 Merge "Update prebuilt build tools path" am: 405b73ea10
am: f51ed4020f

* commit 'f51ed4020fcabe9d7a8e7f72fb3852ff2871f0a1':
  Update prebuilt build tools path

Change-Id: I99082fbc8427454265e50ae2ca4235f48c426761
2016-05-05 19:07:28 +00:00
Colin Cross
facdca17d5 Update prebuilt build tools path
Build tools have been moved from prebuilts/sdk/tools to
prebuilts/build-tools.

Bug: 27857138
Change-Id: I60be42c197d420897dab77808c25818c9d2e81df
2016-05-04 16:02:02 -07:00
Keun Soo Yim
46a259651f resolve merge conflicts of 72b82dc to nyc-dev-plus-aosp
Change-Id: I6e62226774584154ad1a802594e386fe7942504b
2016-04-25 15:27:21 -07:00
Keun Soo Yim
3d4847525f build rule change for VTS (vendor test suite)'s metadata files
Change-Id: I76b81529a97b672e08632703d2f6a2777ee8811e
2016-04-25 13:06:57 -07:00