Run jack with no outputs as a quick check for compilation errors and use
a timestamp to store that check was made.
Bug: 19069325
(cherry picked from commit 43084d9f49)
Change-Id: I9b84b503b28cfdfa245f91da0061ee3a79386b28
And everything special-cased on that. Add a warning if USE_NINJA is
set to let users know that it no longer changes anything.
Change-Id: Ib8739151fe26ea6bf8f76b7ac2b8f4097dab0b47
These have been using SHARED_LIBRARIES, but aren't elf shared libraries.
Continue installing them to /system/lib[64], but do not apply any other
normal shared library logic to them.
Change-Id: I3055ff86bb7b116c7107c41578ed6f0f304b1cf1
This changes the build system to provide the signapk tool with the
minSdkVersion of the APK being signed. signapk in turn will then use
SHA-256 instead of SHA-1 if minSdkVersion is 18 (JB MR2) or higher
(see c2c49ed0c1).
To avoid increasing incremental OTA update package sizes for already
released platforms, release build scripts disable the above logic when
signing target files ZIPs for pre-N platforms.
Bug: 25643280
Change-Id: I3f2faaf49c6fa392ffbf1ee9f30de476f9f73231
This is mostly the same as the existing 2ND_HOST / HOST_CROSS support.
The interesting thing I did here was make x86 the 'first' architecture,
and x86_64 the second. This way LOCAL_MULTILIB := first defaults to
32-bit windows modules.
windows-x86/bin <- defaults to 32-bit executables
windows-x86/lib <- 32-bit libraries, like before
windows-x86/lib64 <- 64-bit libraries
windows-x86/obj <- 32-bit intermediates
windows-x86/obj64 <- 64-bit intermediates
Then modules are registered with the names:
host_cross_liblog <- 32-bit, like before
host_cross_liblog_64 <- 64-bit
Bug: 26957718
Change-Id: I9f119411acb43e973ec1e6bca3c1dc291c91556c
This is a reland of 4c474617d4
This time, we use awk instead of sed, and the script works
on Mac.
For C++ code llvm-rs-cc defines two targets but it defines
three targets for Java. The sed script was updated to handle
both cases appropriately.
Bug: 26839129
Change-Id: I1bca7d253764554d552950e03deedabaa9b7f17e
This is similar to 2e45fd036a
but this CL is for generated java code.
For C++ code llvm-rs-cc defines two targets but it defines
three targets for Java. The sed script was updated to handle
both cases appropriately.
Bug: 26839129
Change-Id: I5c7705c67f3c65c4c14f74558e603f8ec9f35879
We have been reordering objects to the linker based on how they were
generated. In soong, they're ordered based on the order listed in the
src_files.
Keep track of which source files created which object files so that we
can create the ordered list. Optionally change the order, based on
BINARY_OBJECTS_ORDER. That way we can compare make and soong builds.
Since we're keeping track of the used source files, warn when an entry
in LOCAL_SRC_FILES is not used. (whether it is an unused file like a
header, or a typo)
LOCAL_GENERATED_SOURCES is not verified, since it is valid to add
headers and other files in that list (to set up dependencies).
Change-Id: I1dfbbb3aa570c11c1db3b7133e46ed0b8c3b8989
Building an app with Jack and with the environment variable
EMMA_INSTRUMENT_STATIC set to true will apply code coverage
onto the app targeting Jacoco.
Bug: 20115492
Change-Id: Ief3640fa3faa466f7f6aaa9739e06d3db24110a0
This changes the build system to provide the signapk tool with the
minSdkVersion of the APK being signed. signapk in turn will then use
SHA-256 instead of SHA-1 if minSdkVersion is 18 (JB MR2) or higher
(see c2c49ed0c1).
To avoid increasing incremental OTA update package sizes for already
released platforms, release build scripts disable the above logic when
signing target files ZIPs for pre-N platforms.
Bug: 25643280
Change-Id: I058393e0971d0d6559dbd69ea902754c6c7cab14
(cherry picked from commit de5bc04717)
This was a regression since kati has been introduced. This CL
introduces include-depfile function to make it easier to write
Makefiles which work with both make and kati.
As ninja can handle only a single dependency file per a build
rule, now we merge multiple .d files generated by llvm-rs-cc
into a .d file.
Change-Id: Iaf64a8f0523ab98115837e6e06abd50f06620363
Both aidl and clang/gcc were putting their dependencies in the same
place. Move aidl's dependencies to a file ending with .aidl.P rather
than the compiler's .P.
While here, inform kati that we have these special dep files.
Bug:26409006
Test: Rebuild, note both files being generated
Change-Id: I29d2eea822235d60713c2059f3a314e475eb5aa3
Transform ../ to dotdot/ for C++ generateds from .aidl source files.
This forces us to use one layer of indirection to calculate the build
rules for .aidl files, since we can no longer use a pattern rule.
This was tested by modifying system/tools/aidl's Android.mk to refer to
its .aidl files by going up two directories and then repeating the
directories again. When I print the build rules with $(info) I see that
dotdot/ appears in appropriate places (C++ paths, but not .aidl paths).
Bug: 26407018
Test: Described above.
Change-Id: I397c9d10408c0c66d8b5a247a1f34eb4bf4f74ce
- For .l/.y source files, generate .c files; for .ll/.yy source files,
generate c++ files.
- Simplified the rules by adding the generated sources to
my_generated_sources.
- Simplified generated header file naming by always using .h extension
with bison's "--defines=" option.
- Removed the unnecesarry conditional inclusion to the generated
headers. Bison already automatically generates such things.
Bug: 26492989
Change-Id: I9ab6dc149c258f7642bc36c3fa32f90ff7ee51a4
When USE_SOONG=true, ignore any Android.mk file that has an Android.bp
file in the same directory.
Change-Id: Id79bd90c2aed5dafc2f8ad2c5b7eb0aa6e81dc18
After switching to OpenJdk, doc-comment-check target
started to fail due to "Too many words (5082)" while
generating out/target/common/docs/doc-comment-check-timestamp.rsp
This change extends number of dumped words to 5200.
Bug: 25758743
(cherry picked from commit 972a2681c6)
Change-Id: I9b8516d1e7c113d667dcfb7963ee352972677afa
Default source version is 1.7 in Jack B and Jack C so this means no
change to default. Not forcing it in the build rules will allow to
change it in LOCAL_JACK_FLAGS.
Bug: 26257295
Change-Id: If9b5fe250eea4bc6bcb3c16ad9cf7024d399ff3c
The .dex.toc files are created by dexdump, which outputs all
information in a .dex file which may affect compilation of
other modules.
For prebuilt java libraries and static java libraries, we'll
output empty .toc files and don't set restat=1. .dex.toc files
are necessary even for static java libraries because they can
be referenced by LOCAL_JAVA_LIBRARIES (instead of
LOCAL_STATIC_JAVA_LIBRARIES).
We don't use this optimization for apps build. We cannot build
dexdump for apps build due to lack of libc++.
Performance:
$ m && touch \
frameworks/base/core/java/com/google/android/util/Procedure.java \
&& time m
Before: 3m48s
After: 1m46s
Bug: 24597504
Change-Id: Id1665923b414dee705dc60af4c021390a19ea26f
This makes the signapk tool use Conscrypt (where possible) instead of
the platform-default JCA providers and the Bouncy Castle JCA provider.
This speeds up (by 10-30%) APK and OTA update signing because
Conscrypt's crypto primitives are backed by BoringSSL.
Previously, the signapk tool consisted only of the signapk.jar.
Because Conscrypt is backed by native code, signapk now consists of
signapk.jar and crypto_openjdk_jni shared library. This requires that
users of the tool be updated to provide a suitable -Djava.library.path
argument to the Java runtime. This change updates all known users of
the tool inside the Android source tree to do so.
Bug: 26097626
Change-Id: I8411b37d7f771ed99269751a3007dff103083552
When $(call func) in the makefile text expansion includes newline, gmake
reports error "missing separator". But it's fine if the expansion includes
only spaces. That's a bit odd.
This change fixes the "missing separator".
Change-Id: I094e5ae1725699ebfa4ed66544eef037dd68714c
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.
(cherry picked from commit c1f5d9c203)
Bug: 24597504
Change-Id: Iec3b2b0b0e674bee5d80cce3c300dc8fad6e7c13
When the 4th argument specified is non-empty then it attempts to
use either HOST_OUT_GEN_COMMON or TARGET_OUT_GEN_COMMON
depending on whether the 3rd argument is non-empty or not
respectively. Unfortunately, those two variables do not exist,
the correct names for those variables is HOST_OUT_COMMON_GEN and
TARGET_OUT_COMMON_GET.
Change-Id: I66edb02824c06e0f504ebe04ff80ddbd77a16c95
LOCAL_DONT_DELETE_JAR_META_INF is meant for deleting resources carried
by static Java libraries, see comment in clear_vars.mk.
For a module's own resources, we should pick up whatever in
LOCAL_JAVA_RESOURCE_DIRS.
The same applies when building .jack from a prebult jar in
transform-jar-to-jack.
Bug: 25860887
Change-Id: I20c120e039342a1124362c5f8747eace94b03931
(cherry-pick from commit 996ae38ffd)
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
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
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
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
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
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
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
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
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