The export_includes file for a library needs to express a dependency on
all generated exported headers. For aidl generated headers, express a
dependency on the .cpp file instead, since the generator promises to
generate this file last. Unfortunately, the C++ headers generated from
a .aidl file depend on the contents of the file.
Change-Id: I9402b364e4538b502c0958ac8c7bd72cb0add724
It is common for developers to generate/compile AIDL in a static
library, then link that library into an executable. When doing this,
developers need to export the generated headers.
Bug: 25779424
Test: a refactoring of the aidl Android.mk shows this works
Change-Id: I4f7d471a601d2a683cb5a9da5e02e3fab576c26a
The same optimization was done for binaries in
https://android-review.googlesource.com/#/c/175250/
To create a TOC file from .jar files, this change introduces
ijar, which is designed for this purpose. Only #include lines
were modified from the original version.
https://github.com/bazelbuild/bazel/tree/master/third_party/ijar
Performance:
$ m && touch
frameworks/base/core/java/com/google/android/util/Procedure.java && time
m
Before: 4m30s (1580 targets)
After: 3m57s (772 targets)
Unfortunately, the improvement is small yet, but local
experiments showed we can cut ~2 more minutes if the similar
optimization is done for .dex files.
Bug: 24597504
Change-Id: Id54953aea25e497c8ebbe783b03f13b488577c6a
Not sure why my previous testing was working without this, but kati is
a bit pickier about ?= vs :=.
Change-Id: I80243a3c93dec7fd9b8e6f92e2c6cc956706ace0
Kati generates a shell script to run ninja, but that makes it difficult
to customize the ninja command line. Switch to sourcing the new env
script and then starting ninja manually.
Change-Id: I7139290a463018ddf5e05b4d61a0d2f18b1a2247
Files built by soong will be installed using BUILD_PREBUILT, and may
include prerequesites of the acp binary. Allow specifying
LOCAL_ACP_UNAVAILABLE:=true on prebuilts.
Change-Id: Iccfe61092f90b61f397a45f5334b0c1c0f439b32
The automated build will need to do a two stage build, and we want to
do that without altering the source directory. Building with
`make LLVM_PREBUILTS_BASE=/path/to/prebuilts` will build using an
arbitrary toolchain instead of the installed one.
Bug: http://b/17441393
Change-Id: I4ff5c5224fbb8ebeb3a752907d6c4cd0a925aa1e
The config file will be passed to delta_generator to add the postinstall
field in the update payload.
Bug: 24537566
Change-Id: I06b8d9d0b2c37f9a3e7a844ac4d9e2eead8cd4d2
TEST: make dist
With this flag, goma's client (gomacc) fails when local
compiler is different from goma's. Without this, goma's
backend finds a fallback compiler which looks closer to the
local compiler using version info, etc.
Bug: 25668061
Change-Id: I64ff81751f3fe960a557ddb2ca30a090c26c4327
The relocation packer is part of prebuilts/misc, and pulling that
repository into the manifest requires pulling in a lot of other things
not needed by the simpler builds (like the clang toolchain manifest).
Bug: http://b/17441393
Change-Id: If4a94804fc1a3f81215b840247f8e332d0b510c1
Before adding them to the apk or javalib.jar. This allows the entries
order to be reproducible and will help to have a reproducible build.
Bug: 25629246
Change-Id: Ie596aecfdd08047ea9f9071896a2b980e7200b41
check_prereq is a tool for recovery API v2, which has been obselete
since we moved to v3 in [1].
[1] commit e08991e02a7d678f2574e85289a34b2a9a537c82
Bug: 24621915
Change-Id: Ie96348fb56c5a3e029cac2417b59d8eb62dc085b
This was extracting the shared libraries into a temporary directory,
then adding them back into the zip file using the raw filesystem
ordering. Fix that by passing a sorted list to zip.
Bug: 24201956
Change-Id: I59c41151968be6faf289e04719a9992157eb405d
It should be the complete name with suffix .so to use libart.
At present, unnecessarily falls back like below.
"Falling back from libart to libart.so after dlopen error:
dlopen failed: library "libart" not found"
Change-Id: Ie5da35a71d6661434d2097c842407e6a254f8f58
Signed-off-by: randy.jeong <randy.jeong@samsung.com>
This reverts commit f7dbab16ff.
Bug: 23396112
Switch from "-fsanitize-undefined-trap-on-error" to
"-fsanitize-trap=all". The former ends up accidentally leaving
unresolved calls to __ubsan* helper functions in the object file with
clang 3.8. The latter is used when we don't include address sanitizer,
and replaces any misbehavior with a direct call to abort().
The build requires LINUX_KERNEL_COPYING when building
the notices. Change from depending on a file in
prebuilds/qemu-kernel to one in /build/core.
This is required as Brillo does not have the qemu-kernel
in its checkout.
BUG=25578534
Change-Id: Ieff6970035d27884c0769106e507284c1096c33f
Only if an app has LOCAL_INSTRUMENTATION_FOR, it can get the emma
classes from the target app and we don't need to instrument the test app
itself.
Change-Id: If0fba50ddae757254fc58ca104d729d61603fd78
For AB builds, add the build type to META/build_type.txt so the
server can easily determine user, userdebug, and eng builds
from each other.
Bug: 25420005
Change-Id: I6e4de2ba36a6fd1208c65a434d4725bb93d2cee6
At least one shared object in internal repo doesn't have
SONAME entry in its dynamic segment because it is created by
objcopy instead of a linker.
Change-Id: If7106da022ff1e4e925191402f9072795dc3ddcb
[Second attempt, this time with updated mac prebuilt]
Switches default linker from -fuse-ld-bfd to
-fuse-ld=gold, and enables -Wl,--icf=safe. This
changes reduces /system/lib64/*.so text size
by about 2% for N9.
Change-Id: I587075aae9d70cb6b16e55dc9cd1052580ac2626
ziptime fails on zip file larger than 2GB.
These zip files won't installed on device and we don't care that much
about their reprodudcibility across builds.
Change-Id: I47062928d075a59eda92dd5333e59502f490d1cb
When a shared object is rebuilt, all dependent libraries and
executables are rebuilt. Such rebuild is unnecessary when there
is no interface change. With this patch, .toc files will be
generated for all .so files. The rule which generates .toc files
has ninja's restat=1 and .toc files are not changed ninja won't
rebuild dependent targets.
Performance:
$ m && touch bionic/libc/stdio/stdio.c && time m
Before: 1m03s (2563 targets)
After: 21s (90 targets)
Bug: 24597504
Change-Id: Ia5dd950273d143f4e99eee8bef7478f1a94cd138
ANDROID_GOALS: any Android goals that need to be built.
KATI_GOALS: goals that we need to pass to Kati.
NINJA_GOALS: goals we need to pass to Ninja.
For modifier Android goals (dist, INTERNAL_MODIFIER_TARGETS),
we don't need to pass them to Ninja. See also commit
80e46c7c5c.
Restore the dist rule removed by the above commit.
Previously "droid" was never passed to Ninja. That's incorrect.
"make droid docs" should build both docs and droiod.
Fixed with this change.
Change-Id: I5c28061fe0ebe7848872ee349056d029b787ff71
Some of the trees are unable to compile native code with the normal
build rules, even though they can build kati.
Bug: 24201956
Change-Id: I2afc3468480b2c78407d62323e6b82979c8ee254
am: a63d379aab
* commit 'a63d379aab75fe3991320319f63faddd3b84b287':
Don't check the host JDK tools when build/core/config.mk is called from envsetup.sh.
Envsetup.sh (lunch) relies on config.mk to get build varaible values; while
config.mk may rely on envsetup.sh to set up JAVA_HOME/PATH.
Without this change config.mk may be checking the host JDK tools before
JAVA_HOME/PATH get set up.
Change-Id: I1e6b5e33147258832ce2f0a425f9526ef4782c43
Pass -X to zip so that Unix UID/GID and extra timestamps aren't
saved into the zip files.
Add a new tool, ziptime, that uses a very stripped down copy of
zipalign. It no longer depends on libandroidfw, and now rewrites the
timestamps in place instead of making a copy of the zipfile. This should
improve speed and reduce disk requirements, especially with the large
packaging zip files.
Bug: 24201956
Change-Id: I50f68669f659da1b4393e964ad40b6aafb00c1e7
When searching device, product, or hardware, allow
find to follow symlinks.
Add KATI_EMULATE_FIND=false to allow disabling the find
emulator which changes findleaves.py behavior wrt
symlinks.
BUG=24605247
TEST=works with CL:783781 (without the find wrapper in that CL)
Change-Id: Ia9d0e4add391a56f34828a09a6cec3f435ccc548
Specifically, do not error out if no installable apps are found.
- When creating an archive of all the apps, and if no apps exist
for the target, generate an empty archive file.
- If building for a target with no installable jar(s) or apk(s),
generate an empty package stats file.
The former is just an output artifact. The latter is used
by the upload_pkg_stats.py script which correctly handles
an empty input file.
BUG: 23421592
Change-Id: I48db9f9e1f61914d8fd938130e09b41849685450
This reverts commit 3c2c064c87.
zipalign depends on libandroidfw, and some setups don't include frameworks/base.
Bug: 24201956
Change-Id: I48ee95808924f6b2221f0a49ab205c2565096b1f
Pass -X to zip so that Unix UID/GID and extra timestamps aren't
saved into the zip files.
Add a new option to zipalign, -t, to replace all timestamps with static
timestamps (2008 Jan 1 00:00:00). Use this for all non-APK zip files.
APK zip timestamps are set based on the certificate date in SignApk.
Bug: 24201956
Change-Id: Ifb619fc499ba9d99fc624f2acd5f8de36d78ef8e
- For unmodified "make product-graph" and "make dump-products",
load only the current product configuration makefiles. This is much
faster than loading all product makefiles.
- For "make product-graph ANDROID_PRODUCT_GRAPH=--all",
"make dump-products ANDROID_DUMP_PRODUCTS=all", load all product
makefiles.
- Move product-graph.mk out of build tasks, so we can skip loading all
the Android.mks, which takes long and we don't really need them.
More importantly, with all product makefiles loaded, modules in
Android.mks are prone to clash (if they are conditionally included
by variables set up in product makefiles) and lead to parse-time
error.
Change-Id: Idc1d6b0c23eb2c8bb34fdd7a1fa4d56171768d21
Some vendor product makefiles call $(inherit-product) on the same
product makefile with different paths, by using "../" in relative paths.
However inherit-product requires unique path as ID for a product
makefile, for bookkeeping purpose.
Normalize the product makefile path in inherit-product, if the path
contains "../".
Change-Id: I1a864ce120c713d8e79ec179213b9fc9352aba53
make 3.81 has a bug where combining an up-to-date .INTERMEDIATE rule
with -j causes an infinite loop (http://savannah.gnu.org/bugs/?15919).
.INTERMEDIATE was only necessary to support multiple outputs while only
running a command once, remove .INTERMEDIATE by replacing
$(KATI_OUTPUTS) dependencies with $(KATI_BUILD_NINJA). We can assume
that $(KATI_NINJA_SH) will be updated at the same time as
$(KATI_BUILD_NINJA), and not explicitly depend on it.
Also remove generateonly and fastincremental, which are no longer
necessary and were overcomplicating ninja.mk. kati now always runs due
to FORCE, and ninja is run by a phony rule that depends on
$(KATI_BUILD_NINJA).
Bug: 25344116
Change-Id: I99d2713b1532ea11d83da9a11b1be26cfe13a5d2
Don't generate recovery.img when calling 'make dist' if
TARGET_NO_RECOVERY is set. The build system passes the flag to the
packaging script which then generates recovery.img conditionally.
Bug: 25329471
Change-Id: Ifbc999300d5c31e897878f81e231ae7dd2aca660
Causes build failures on Darwin.
prebuilts/gcc/darwin-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin/ld.gold: warning: cannot scan executable section 5 of out/target/product/flounder/obj/SHARED_LIBRARIES/libdl_intermediates/libdl.o for Cortex-A53 erratum because it has no mapping symbols.
prebuilts/gcc/darwin-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin/ld.gold: warning: cannot scan executable section 8 of out/target/product/flounder/obj/SHARED_LIBRARIES/libdl_intermediates/libdl.o for Cortex-A53 erratum because it has no mapping symbols.
prebuilts/gcc/darwin-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin/ld.gold: warning: cannot scan executable section 11 of out/target/product/flounder/obj/SHARED_LIBRARIES/libdl_intermediates/libdl.o for Cortex-A53 erratum because it has no mapping symbols.
prebuilts/gcc/darwin-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin/ld.gold: error: treating warnings as errors
This reverts commit 127d110172.
Change-Id: I1d3de90f5ae777b66a8f94fbcc9ccde8a9e3001c
kati takes the first @echo command in a rule and turns it in to a ninja
description that gets pretty-printed. The GET-INSTALL-PATH is only
@echo commands and is parsed by development/testrunner/runtest.py, so
it fails to parse the pretty-printed first test.
Add a dummy @echo to GET-INSTALL-PATH for kati to use as the
description, so the rest of the @echo commands are left unmodified.
Change-Id: I192fde48b26726a2f6760448f819243bd2f21312
On Darwin, javac may be located in a nonstandard directory layout such as:
/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javac
The sed command to replace bin/javac with lib/tools.jar would fail to
match, resulting in the HOST_JDK_TOOLS_JAR being set to the javac path.
Since javac exists, the checks for missing tools.jar would all pass, and
javac would be added to the classpath instead of tools.jar, and causing
hard to debug errors about missing com.sun.javadoc when building doclava.
Change the sed command to replace /javac$, which should always be found,
with /../lib/tools.jar.
Change-Id: I5072f04636a5c14b3aeaa3a5cc3b366feae89c37
We rely on "sort -u" to dedupe aidl/logtags generated java files added
by both from $(all_java_sources) and from "find
$(PRIVATE_SOURCE_INTERMEDIATES_DIR) -name '*.java".
But "sort -u" doesn't work if any of the aidl/logtags source file path
has "../" in it.
This change fixes this issue by normalizing the source file paths before
passing them to "sort -u".
Change-Id: I12d2c4e0397bed9f426a1ed9b13608d72d01e0df
When an app has a resource directory, but the
directory contain no resources, R.stamp is not created.
This leads to that such apps are always rebuilt,
even when there are no changes.
This patch changes so that an empty R.stamp is
created even if there are no resources.
This leads to that affected apps are not rebuilt
unless changed.
Change-Id: Ia63e5b1913a4456402700b615ba7f9d56d2da852
To accommodate new changes (such as error correction in [1]) to BBOTA
in N release. We bump up the version to keep the OTA script backward
compatible.
Needs the matching CL in commit
1fdec8685af858c5ff4f45d2e3059186ab5ed2ab.
[1]: commit 0a7b47397db3648afe6f3aeb2abb175934c2cbca
Change-Id: Ib9158b455cd5905fe2d4742ce81feb1b7583054f
In order to have all the A/B updater variables in the same AB_OTA_
namespace we rename UPDATE_AB_PARTITIONS to AB_OTA_PARTITIONS.
Bug: None
Test: `make dist` includes the partitions.txt file if properly configured.
Change-Id: Ied4faabd7e2f0ab8a5007afb44ad2f38df8d630d
Switches default linker from -fuse-ld-bfd to
-fuse-ld=gold, and enables -Wl,--icf=safe. This
changes reduces /system/lib64/*.so text size
by about 2% for N9.
Change-Id: I0ef2483e1c47c34e63292dad6f6bf532359b733e
am: e0c7b4ec96
* commit 'e0c7b4ec96d4aa584f79a24aea7c682a114143d8':
Remove LOCAL_JACK_EXTRA_ARGS
Allow control of jack used for compilation
Clean call-jack and its callers
Use of DEFAULT_JACK_EXTRA_ARGS and LOCAL_JACK_FLAGS provides all needed
support.
(cherry picked from commit d2b2983cc7)
Change-Id: I1cd76836792e7332bc3750408a860400b0957485
Version of Jack used to compile a module can now be control from
a dedicated mk located in prebuilts/sdk/tools
Bug: 24564814
(cherry picked from commit b68c9a498d)
Change-Id: I7809dc966026ff94b5cb2daa7e2c63762ca4768d
This is possible now that we have the new Jack server.
Also fix dependency from dex/jack target to jack script
instead of jack.jar.
(cherry picked from commit 5e50b34221)
Change-Id: I8e7aa5087ba8d73cc93140ddfca8f4ab2f505175
The secondary variant fallback was not set. The build system expects
the variants, so system properties were malformed for x86-64:
[dalvik.vm.isa.x86.variant]: [dalvik.vm.isa.x86.features=default]
Bug: 24989387
Change-Id: Idbf54f81494f2650ad56080305807fd6b7ed4161
LOCAL_SRC_FILES_EXCLUDE will be used to filter files out of
LOCAL_SRC_FILES. A common usage will be to use
LOCAL_SRC_FILES_EXCLUDE_<arch> to remove a source file that will be
replaced with an arch-optimized version.
Change-Id: I75cc6114c47fb784bab65cae8f618c4f395f07bb
With the order-only dependency if the jni so files is updated,
make won't rebuild the system.img, which has dependency only on the apk
file.
Bug: 24865400
Change-Id: I9d5bee82b8a712a2c24dabaa0cd4c50174ea219f
Don't pass the arg list as argument in any bash command;
Instead store the arg list to the arg list file and
run "jar @arg-lsit-file".
Note we need to quote the arguments in the arg list file.
This fixed "argument list too long" build error on Mac.
Bug: 24789595
Change-Id: I718f84e540d82bb83516824894a473b2961da278
GCC & Clang encode the current working directory into the symbol files.
Even if the binaries are stripped before being installed, the build-id
hash will be different. This means that two different checkouts will
produce different installed binaries, even if the sources are identical.
To prevent this, set PWD=/proc/self/cwd, so that it replaces the
absolute path with the static path /proc/self/cwd. With GCC, use
-fdebug-prefix-map to remove that static path. Our clang does not yet
support this flag, but it was merged in r250094.
This does change the behavior when using gdb -- you now need to be in
$ANDROID_BUILD_TOP before gdb will load the sources.
Bug: 24204119
Change-Id: I792d65b042b7a3fdc78d567c5a6e93cdf0141b9b
When using the A/B updater, include the product id string to
target_files.zip.
This is needed by the Omaha backend.
Bug: 24946811
Change-Id: I2ce5f6cffe440c29a1820348ee215c71cec07861
Append error-correcting codes to verified partitions provided that
PRODUCT_SUPPORTS_VERITY_FEC is true.
This moves verity metadata to be after the hash tree, and requires
matching changes from
Ide48f581bbba77aed6132f77b309db71630d81ed
Bug: 21893453
Change-Id: I6945cbab99e214566a1f9d3702333f2dbbc35816
The list of archs of a pure java apk (no native libs) is empty.
In this case get-prebuilt-src-arch still return 'none'.
If it's set to LOCAL_MODULE_TARGET_ARCH, it makes the apk
be incompatible with the building target. It's not good.
Just return empty in this case.
Change-Id: Ide75cdb08c8480c8e7d3a0ac59f41831fbc18bd5
Don't pass the arg list as argument in any bash command;
Instead store the arg list to the arg list file and
run "jar @arg-lsit-file".
This fixed "argument list too long" build error on Mac.
Bug: 24789595
Change-Id: I3e5cd18fd988f12f0876b152b8bf07d07b56119e
To consolidate the number of places that we're using 'find' in the tree,
add some more helpers:
all-named-dirs-under
all-subdir-named-dirs
all-named-files-under
all-subdir-named-files
This change also makes many of the current helpers use these helpers
instead of using their own implementation.
The 'dirs' helpers are using '-type d' so that they only output
directories. It's probably safe to use '-type f' for the files helpers,
but that increased the kati load time by ~20%.
Bug: 24204119
Change-Id: I3312e2fe8c146f10955e1d986ad15d9c8be494e1
There are multiple versions of this in the tree. Let's standardize on
one that will work for everyone, and will sort the results.
Bug: 24204119
Change-Id: I09fcd80e1e8e35e64d8a8a62bbc096f87b02603f
To consolidate the number of places that we're using 'find' in the tree,
add some more helpers:
all-named-dirs-under
all-subdir-named-dirs
all-named-files-under
all-subdir-named-files
This change also makes many of the current helpers use these helpers
instead of using their own implementation.
The 'dirs' helpers are using '-type d' so that they only output
directories. It's probably safe to use '-type f' for the files helpers,
but that increased the kati load time by ~20%.
Bug: 24204119
Change-Id: I3312e2fe8c146f10955e1d986ad15d9c8be494e1
When using the A/B updater, include the product version string to
target_files.zip.
This is needed by the Omaha backend.
BUG: 24743570
Change-Id: Idaba06624c1de452b1e1f9d3ebec851229af987a
6ff74ce8ee
should have made this workaround unnecessary. Now, even with
old build/core, "m -j32 PRODUCT-aosp_mips64-eng dist" does not
output a ninja file with "$(cat )".
Bug: 24384320
Change-Id: I262edf00dce39f39ec4e55d5ed7b1b6f8d931f33
Even if word list is empty.
Not creating the file was causing print of error messages that were
not preventing compilation to continue when compiling Java module with
no source.
Change-Id: I095b85f85ed6fcef5882afa39d4af51b78124c7c
The OTA/bin tools are not needed in the target files zip when using
the A/B OTA updater.
Bug: 24577767
Change-Id: I7938a906e4d73709aaa944e8065f922536072e27
gcc color diagnostics stopped working when the flag was moved to
TARGET_GLOBAL_CFLAGS, as that gets overwritten by combo/select.mk. Put
it back in COMMON_GLOBAL_CFLAGS, and then let the windows build filter
it out, similar to the way clang deals with unknown flags.
Change-Id: I2db221edb893d81f199494e7515d1b9282c12fae
The list of A/B partitions updated is product-specific. Normally you
would update boot and system, but the product could require to update
other partitions during a system update. This patch packages the list
of A/B partitions configured to be updated when using the A/B updater.
The list can be set in the product makefile by setting the make
variable UPDATE_AB_PARTITIONS.
Bug: 24387863
Test: `make dist` creates the META/ab_partitions.txt in the target_files.zip
Change-Id: I4226ab05c7c7cd74721b06f1da64c6cf4d0e52ac
Bug: 23396112
Switch from "-fsanitize-undefined-trap-on-error" to
"-fsanitize-trap=all". The former ends up accidentally leaving
unresolved calls to __ubsan* helper functions in the object file with
clang 3.8. The latter is used when we don't include address sanitizer,
and replaces any misbehavior with a direct call to abort().
Change-Id: I8a67461b45f5f1dd9f2d179b6b64a4ca905e999f
We should pass --gen_all_targets to have targets which are not declared
as .PHONY. However, this triggers some nasty behavior inherited from
make, where targets can get variables from things that depend on them.
--gen_all_targets will traverse the targets starting at random points in
the dependency tree, and any variables set higher in the tree will not
be visible. To work around this, keep --gen_all_phony_targets, which
will start traversing at the phony targets first. This will enter the
tree traversal at points we know don't use inherited variables, like
checkbuild or the PARSE_TIME_MAKE_GOALS, and will reach all the
dependencies that use inherited variables in the right order.
--gen_all_targets will then fill in any remaining targets that were not
in the main dependency tree, and hopefully none of them use any
inherited variables.
Bug: 24384320
Change-Id: I1ff07b7ef26e9481baae678e7fe0933b6d05f2a7
Many of these may not make a difference in the output images, but it's a
good idea to keep the make system as repeatable as possible.
Change-Id: I31804b8ad5805148ed08be7426a242a16f4d0df3
Many of the packages on ALL_PREBUILTS grandfathered list are no longer
in the tree. Remove them to whittle the list down, so we can tackle the
remaining items.
Change-Id: Id6c026727ed7bef36d1803719df05d2e50afc5cc
Move the ninja files from $(PRODUCT_OUT)/build.ninja to
$(OUT_DIR)/build-$(TARGET_PRODUCT).ninja. This will improve incremental
builds of host modules after swithing target products, because the
.ninja_deps file will be accurate across builds.
Change-Id: Ia12746ccde0de31f6fccd111b2bdbd48fc6900d7