This needs to be included between PARSE_TIME_MAKE_GOALS and KATI_GOALS
Test: m -j <target-from-internal>
Change-Id: I7284f05336b921d40f04ff5811a47bd0d17a066f
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
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
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
* 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
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
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
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
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
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
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
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
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
Pass the USE_GOMA flag to soong, and export the CC_WRAPPER environment
variable after adding gomacc to it.
Bug: 31142427
Change-Id: I6de698a40817c0615b03fa17bd27075465d79ffd
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
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>
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
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
http://b/28149048http://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
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
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
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
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
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