Replaces old LOCAL_EMMA_COVERAGE_FILTER by new variables:
- LOCAL_JACK_COVERAGE_INCLUDE_FILTER for included classes
- LOCAL_JACK_COVERAGE_EXCLUDE_FILTER for excluded classes
Both variables can contain a comma-separated list of class names,
where * and ? are accepted wildcard (like foo.?ar.*).
When code coverage is enabled, we will use these variables to
pass code coverage filters on the Jack command-line.
Bug: 28014424
Change-Id: Ic29c99b6feb7ea2251c29d659e7ea1f1c46d1ed1
Now that mac compatibility has been fixed
BUG: 27657762
Change-Id: I49933ccedf74b9d172967dad721971a752047da6
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
When building apps with EMMA_INSTRUMENT=true, we must ensure that
jacoco is at least on the classpath (or even embedded for unbundled
branches) and that proguard will ignore jacoco classes. Otherwise
the Jack compilation would fail.
For unbundled build, we include the proguard configuration file
build/core/proguard.jacoco.flags to ignore jacoco classes.
For full build, we ensure jacoco is on the classpath during the
jack compilation.
Bug: 27607712
(cherry picked from commit d9641e01f3)
Change-Id: Ib46c91d03721f2418b15c17546d4f322f2f90a28
Bug: 19735423
- Unlike other archs, x86_64 has both usr/lib and usr/lib64. we need
to search for libm.so and libc.so in lib64/. Otherwise the linker
will report error.
Change-Id: I2859bee066a9eb100828d90da8adf0f9817d77e6
(cherry picked from commit 57ef7ea490)
Used to select between releases of the NDK (r10, r11, etc).
Some of the libraries we use in Android come as prebuilts from
google3, which are most likely built against an older NDK than what
we have in the platform. Since things may not be ABI compatible
release to release, we need to keep legacy versions accessible for
those to keep building.
Change-Id: Ia3df42fa6f3a7bd5108ff6bbb0f2ca06239c3be9
We removed code and variables related to running dx on classes.jar in
this change. Also removed target emma rules (but kept the emma rules for
host java libraries), for it's now done by Jack.
We still support to build classes.jar (and javalib.jar for static Java
libraries) using javac, because tools like javadoc need class files as
input.
Removed the obsolete install-dex-debug.
Bug: 27400061
Change-Id: If0bcdfe62cb181a98754fb0dbe1c12c92e38d3e8
Keep coverage.em file name for host rules where Jack is not called.
(Partially reverts change 491c9ce48a)
Bug: 27822188
Change-Id: Ia9344e17ecbecfb9c335608740ab7dc5490c48d5
Soong uses the copy of `ar` in the OSX SDK instead of the wrapper in
/usr/bin/ar. /usr/bin/ar appears to be a thin wrapper that looks up the
current SDK and passes execution to it. Soong does this so that it can
actually set up a dependency on the tool.
Change-Id: Ia4e4fbe3287539933fa98a1354c3ccee91f4d552
Clang and MinGW are not expected to work together currently, and you get
strange errors when this is attempted. Instead, error out with a clear
error message.
Before the windows build rewrite, we'd just explicitly set my_clang to
false without checking what the module asked for. Now, error out if the
module explicitly asked for clang, since by default they'd have it
already if it wasn't for windows. That way when Clang+Windows does
become possible, it can gradually be tested by setting LOCAL_CLANG to
true.
Change-Id: I9e0b0dca30946d94894119443f2fd0593cee1793
Support TARGET_2ND_ARCH as the binary translation arch.
See target/board/generic_x86_arm/BoardConfig.mk and
target/product/aosp_x86_arm.mk as example for the setup.
In BoardConfig, use the TARGET_2ND_ARCH/etc. variables to set up the
binary translation arch;
Set "TARGET_TRANSLATE_2ND_ARCH := true" to tell the build system it's
not a typical 64-bit multilib configuration.
In product makefile, use "PRODUCT_PACKAGES += libfoo_<2nd_arch>" to
install the TARGET_2ND_ARCH libraries. This also pulls in any dependency
libraries.
By default we don't install any TARGET_2ND_ARCH modules, unless it's
pulled in by PRODUCT_PACKAGES.
Bug: 27526885
Change-Id: I0578e9c80da0532d2fa886a8fcdb140bbc703009
(cherry-pick from commit 277e75a488)
So that we don't mess up with the vendor path check by accident.
Bug: 27543283
Change-Id: I6c34caefe3ff4abfdd8349a32c68fcca524cfd8e
(cherry-pick from commit efaf5efd06)
To rebuild odex files of Java libraries and apps,
we store the jars/apks without stripping the classes.dex inside the
platform.zip. We also save the build variables that may affect how we
rebuild an odex in pdk_dexpreopt_config.mk in the platform.zip.
We store the files and configuration only for libraries/apps that get
installed to the system.img (or vendor.img).
In PDK fusion build, we auto-generate prebuilt module definitions for
the javalib.jar and package.dex.apk carried in the platform.zip, using
configuration stored in pdk_dexpreopt_config.mk.
With the prebult modules, we override the implicit rule that directly
copies the odex from the platform.zip.
To rebuild odex of javalib.jar, we added support for prebuilt shared Java
library to prebiult_internal.mk. An installable prebuilt Java library is
treated as shared Java library, i.e. with classes.dex in the jar instead
of a set of .class files.
For apks in the platform.zip, we install the stripped version from
platform files inside platform.zip, instead of the package.dex.apk,
using a new variable LOCAL_REPLACE_PREBUILT_APK_INSTALLED. We can't
strip package.dex.apk because we can't re-sign the stripped apk at this
point.
We generate prebuilt module only if it's not already defined in the
source tree.
Bug: 27543283
Change-Id: I9e146f8b713d6f57c397fd28d88c9ab700757ca1
(cherry-pick from commit 3a61eeb6cb)
We no longer use emma with Jack. However, during the process of a
full build, we may run the emma task and overwrite the coverage file
generated by Jack with the one from emma because they use the same
filename.
This CL renames coverage files generated by emma so they no longer
break those created by Jack.
Bug: 27822188
Change-Id: Ie3fdc2b8f53deafbefbd6973e39f29d8c46f371e
- Remove javac support in host_dalvik_java_library.mk
- Simplify host_dalvik_static_java_library.mk by including
host_dalvik_java_library.mk instead of host_java_library.mk.
- Take configure_local_jack out of host_java_library_common.mk because
it's only needed by host dalvik java libraries.
Bug: 27400061
Change-Id: I4088b09092198118d832a759663bbaadff669ed5
We don't need to run rmtypedefs in javac compilation now, because the
runtime libraries are compiled by only jack, which takes care of
rmtypedefs by itself.
Bug: 27828139
Change-Id: Ie480ae5aead8f3f58f956978fc4a05c28a35dec6
javac-check covers all classes.jars that are compiled with javac
instead of jack. This target is required by tools that still need java
class files as input.
Bug: 26705771
Change-Id: I6896b9a6026a2a0dae6145d1ef5a839756aa3458
My previous attempt at properly handling symlinked OUT_DIRs only worked
if the symlink was to a different directory, not one in the same
directory.
This time, make sure that both make and soong use the same
representation of the output directory by passing BUILDDIR to
bootstrap.bash. Soong has been updated to pick whether to use a relative
or absolute path back to the source tree depending on what makes sense.
If the BUILDDIR or the path back to the source tree change, re-run the
bootstrap.
Also, move the $OUT_DIR/Android.mk and $OUT_DIR/CleanSpec.mk generation
to before Kati runs. In the case that $TOP/out was symlinked to
$TOP/out.angler:
1) Soong generates out.angler/soong/Android.mk
2) Kati's find generator produces in-memory tree of the filesystem
3) $(shell ) creates out.angler/Android.mk
4) The emulated findleaves Android.mk search finds
out.angler/soong/Android.mk since the in-memory tree is never updated.
This doesn't happen in the normal case, because we pass --prune=$OUT_DIR
to findleaves.
Change-Id: Ib0fdae2e80f75ddcf33a3c8c5ea0978f5308b437
On Darwin ar would fail if there is no object file to add.
We work around by adding a dummy.o to the .a and then deleting it.
Bug: 27800477
Change-Id: I68bbebea2726058c25863d7026a645a520d05167
Why? For one, libgcc's unwinder makes use of `dl_iterate_phdr`. Also,
libgabi++ (the home grown C++ RT we use for stlport) uses
`dlopen` for liblog when reporting fatal errors. The LLVM unwinder
which is used by libc++ also uses libdl.
Requiring a dependency on libdl seems less objectionable than
requiring one on liblog. We could always change libgabi++ to use
syslog instead, but that will only reach logcat for newer devices
(possibly L+, definitely M+).
Requiring libdl seems like the best option here, especially given
that libgcc needs it anyway.
Change-Id: I4acfaf38145c39fc15a76fbb282a46786e5322f1
The following variables are introduced
BOARD_BVB_ENABLE: can be set to true to build boot.img and system.img
files compatible with Brillo Verfied Boot.
BOARD_BVB_ROLLBACK_INDEX: can be set to an integer to use for the
rollback index.
BOARD_BVB_KEY_PATH, BOARD_BVB_ALGORITHM: If set, the former must be a
path to the private key used to sign the boot image and the latter must
be the algorithm to use. If unset, a test-key stored in the tree will
be used.
BOARD_BVB_MAKE_BOOT_IMAGE_ARGS: Extra options to pass to 'bvbtool
make_boot_image'.
BOARD_BVB_SIGN_BOOT_IMAGE_ARGS: Extra options to pass to 'bvbtool
sign_boot_image'.
BOARD_BVB_ADD_IMAGE_HASHES_ARGS: Extra options to pass to 'bvbtool
add_image_hashes'.
BOARD_CUSTOM_BVBTOOL: Can be set to specify what bvbtool program to
use.
The existing BOARD_KERNEL_CMDLINE variable is also used, as are existing
kernel and initrd-related variables. Therefore, simply adding
BOARD_BVB_ENABLE := true
to an existing Makefile should do the trick.
Bug: 26185038
TEST=Added 'BOARD_BVB_ENABLE := true' to hardware/bsp/intel/soc/edison/soc.mk
and built an image and then ran bvbtool's info_boot_image and
info_image_hashes commands on the resulting boot.img and system.img
files and verified that the information was correct. Also ran 'm dist'
and verified that the boot.img and system.img files in the resulting
target_files.zip file had similar information.
Change-Id: I08045ed8b0cbddc7c3acdd3a6f2c4bb75cb44bbc
http://b/26987366
- Use clang-2690385 to build RenderScript toolchain.
- Use armv7-linux-androideabi as the triple used to build RenderScript
runtime libraries.
Change-Id: I582e8b25bbc38b101a2e765028ed61edbce7bdc2
Prevent platform modules from linking against libstdc++ as their STL
implementation. NDK modules may still use libstdc++.
Change-Id: I317c9bb90ca7d2e0c1f5770bbdff8075dfe3cc83
Split out Soong's missing dependency option from Unbundled_build. There
are builds other than unbundled builds that don't have a full platform
tree (AOSP llvm branch is one example).
When this is set to true, Soong will defer the error for missing
dependencies until a module is attempted to be built, instead of when
it is reading and generating the build rules. So for platform builds it
will still fail early if something is missing.
Change-Id: I56cb881ff55f5928b77cddc0d67086c3d37e43d7
Set Jack min sdk according to LOCAL_SDK_VERSION. Gives Jack current
version when LOCAL_SDK_VERSION is not available.
Bug: 27371864
Change-Id: I5db233fe09aed0fae37fe9a92658bc8f24b86cdf
This is just to ensure no dex file is built with dx any more, cleaning
of the build rules from Jack optionality is still to be done.
Bug: 27218410
Change-Id: Iea2c66802b6c64c52690ad9d6d487bdce5f50b79
* When my_global_santitize is set and requires ASAN,
link with ASAN library even when local module is not
instrumented with ASAN, unless the local module is
the ASAN library itself.
* Add -Wl,--as-needed to my_ldflags for shared libraries
so that unneeded ASAN library would not become
a dependent of the built .so file.
* Change shared file and executable file link argument order
so that -Wl flags will have effect on linked-in libraries.
* Remove unused ADDRESS_SANITIZER_CONFIG_EXTRA_SHARED_LIBRARIES.
BUG: 27614834
Change-Id: I4eda6003f1f24e498cba91c043dbe1fabe522686
There was a typo in binary.mk. compile-dotdot-XXX-file in
definitions.mk was also using -include.
Bug: 26839129
Change-Id: I4a0145fb70413998cc65d30d2efcd68af07b4800
This patch allows usage of a custom CCACHE_COMPILERCHECK setting
for the special cases when "content" strategy is not enough to ensure
that results retrieved from the cache are accurate for the current
compiler.
BUG=none
Change-Id: I30be5182cfb36ec30f38b9a2fac89290bd5df910
Signed-off-by: Stefan Stanacar <stefan.stanacar@intel.com>
Without switching on USE_SOONG, this lets us verify that all builds have
blueprint/soong/go, and can generate a build.ninja file without
producing errors.
Change-Id: I79451ce24c8b5b6745e41d951153265441c33e8a
Any artifacts that are targeting SDK versions < 24
and not explicitly setting the LOCAL_JAVA_LANGUAGE_VERSION
are now defaulted to 1.7.
Bug: 27495650
Bug: 26753820
Bug: 27377071
(cherry-picked from commit decb797276)
Change-Id: I0734b6e690bea32def3dc435c9ce0bd90b845e79
Soong needs to be able to reverse the relative path to out. Switch to
absolute paths if .. won't work because of out being a symlink to
somewhere else.
Bug: 27612837
Change-Id: Ib8b9e0f80523148cfd4b69a03d164578916d8fd5
Set Jack min sdk according to LOCAL_SDK_VERSION. Gives Jack current
version when LOCAL_SDK_VERSION is not available.
Bug: 27371864
Change-Id: Ieba0219494f29d2737d2ca234317c3af7e5e72c8
Currently, we're building against the native host version of libc++ and
other headers. Instead, use prebuilts of ckati/makeparallel built with
Soong against the included libc++ and sysroot. Building ckati /
makeparallel doesn't work well in unbundled branches that don't have all
of the libc++ dependencies to do successful host builds.
KATI is default variable defined when running under Kati, don't use it
for other purposes. Use CKATI instead.
Bug: 27533820
Change-Id: I82d66f5e34e3341a3cee4c5c83cd1d9a54d057ff
Build binaries usable on older machines even if older SDKs are not
installed. Older SDKs can no longer be installed on newer Xcode
versions.
Change-Id: I0c9f2534466a127a19107820879c2856bfac0076
We've been including the system libc++ headers even if we're building
against our version of libc++. Stop doing that, and only add the headers
to our path if we're using the system libraries.
If nothing is specified, on recent OSX versions, libc++ is the default
c++ library instead of libstdc++. We've been explicitly including the
libc++ headers on all versions, but that breaks old versions. Force us
over to libc++, since the system libstdc++ does not support C++11, and
libc++ is still supported on our oldest version (10.8).
Change-Id: I1fccee8da0f425e10ccc9d3247ed40664eb6ada0
/Developer was removed in Xcode 4.3. Our minimum SDK version is 10.8,
which implies at least Xcode 4.4, and our documentation requires
Xcode 4.5.2.
Change-Id: Ib343df6ded6e98222d8ee2e542e1f3fadd2b1397
Bug: http://b/27482631
This fixes an issue where krait compiles were not passing the proper
flags to the assembler when -no-integrated-as is used. This was
preventing ART from switching to clang in some cases.
Change-Id: I24966bf1ff84305df3586ab01d1aae7d5922aa11
When a static library uses LOCAL_EXPORT_C_INCLUDE_DIRS, then is included
entirely in another library with LOCAL_WHOLE_STATIC_LIBRARIES, all the
symbols are reexported, so reexport the headers too.
Change-Id: I92cf17894fc991a5b5ecb59ca5e095e407c98de4
1. Combined ~10 calls to the make build system to only one.
We added a phony target "dump-many-vars" to the build system to dump
"<var>=<value>" pairs. We then store the pairs as shell variables.
With this cache get_build_var/get_abs_build_var can just return
the shell variables instead of querying the build system.
2. Prune .git when we search for AndroidProduct.mks.
In internal source tree lunch time was reduced from ~15s to ~1.5s.
Bug: 27429759
Change-Id: I24e88598f6fab598ef26518885fd5e86e71a772d
- For host Java libraries, java-lib-files should return javalib.jar.
- Host dalvik Java libraries are special: factor out
host-dex-java-lib-files.
- Be explict that jack-lib-deps equals jack-lib-files.
Bug: 27451686
Change-Id: I9235384354e119ef7ebbf29b7e525d1ceea242e0
(cherry-pick from commit 063d0455e0)
This will allow us to convert icu4j-icudata / icu4j-icutzdata
targets to "host" targets rather than "target" targets.
Right now they are forcing Jack off just so they can use
javac + jarjar (even though the resulting file is used on
host).
Bug: 27218410
(cherry picked from commit 30b21ad579)
Change-Id: I4f16896606bcfdd00164078eeb142d05b29bb832
Also specify "-d keepdepfile" to ninja so .P files won't be
deleted by ninja.
-include for .s files are removed because GCC doesn't
generate .d files for .s files.
Bug: 26839129
Change-Id: If00e93c7a33449ec314a5cdba438475a32979f4e
Similar to how we clean the generated source dir if .aidl becomes
obsolete.
Bug: 26688474
Change-Id: I66c5b6d6513259b5f4f4bac84f384f4bf953d82a
(cherry-pick from commit d5ffec9383)
So that we can disable only one in multilib modules.
Bug: 27442756
Change-Id: I4ca379fac997f9165c47cb93d34bf1f483f5a241
(cherry-pick from commit b6eb8ddbde)
am: a65b01fc09
* commit 'a65b01fc09b47c83e59dc4757c76eafba1e15cbc':
Remove LOCAL_ACP_UNAVAILABLE
Remove unused dependencies on $(ACP)
Replace some uses of acp with cp
Now that copy-file-to-target doesn't use acp, nothing in the acp build
path uses acp, so we don't need to special case it to prevent loops.
Change-Id: I12810c1b064d0c03135a80077a76bc4c9cc18b24
ACP was originally created to overcome differences with cp between
Linux, Darwin, and Windows. We've since dropped Windows as a build host,
and don't use features like '-u' anymore.
For most of our current usecases, 'acp' is identical to 'cp' except that
it splits 'cp -p' into 'acp -p' for mode and ownership, and 'acp -t' for
timestamps. On Linux, this could be specified using
'--preserve=mode,ownership', but Darwin doesn't have this.
Since we're removing the destination file before copying, 'cp' already
preserves the mode (modulated by the umask). So the only extra thing
that gets preserved with 'acp -p' is ownership, which we should not care
about in the build system. (In many cases we shouldn't be preserving
mode either, so that readonly source trees can actually be marked
readonly, but that will be a future change)
Change-Id: Ied96fdc303ac5c774347c07363daec8b6dfb22e4
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
If there's a symlink as the destination to one of these macros,
currently we'll write to the destination of that symlink instead of
overwriting the symlink. We've run into this a few times when a module
is added to replace a symlink that used to exist via
LOCAL_POST_INSTALL_CMD. These have required manual discovery, and
additions to CleanSpec.mk files:
http://android-review.googlesource.com/143334
Use `rm -f` for single-file targets to remove the destination before
copying. On Linux, `cp --remove-destination` can work, but is not
supported by Darwin or acp.
There may still be problems with dependencies when symlinks are
involved, since ninja will use the destination of the symlink to check
whether it is up to date. But at least with this change, if any
dependency gets regenerated, we'll properly reset the file.
Change-Id: I6d3ac0bd9ced5e21a0ff9dad0eaff012a7bc9c75
When switch build types or products, it's no longer necessary to special
case these projects that change their command line based on the build
type or product. Ninja keeps track of the command line last used to
create a file, and will mark it as dirty if the new command line is
different.
Change-Id: I905ff9599eae2952bddc05e7328f77f0849be20a
Places whitelisted brillo tests and the whitelist itself
in a zip when run.
BUG: 27385399
Change-Id: I93c2ea8cc521292a6de811bb47bc87a727edd21f
TEST: manual make dist brillo_tests, confirmed desired files were in zip.
When the build type changes (for example, from "shamu-userdebug"
to "shamu-user"), the build system doesn't delete all files
and start over. Rather, build artifacts from the old build type
are reused for the new build type.
This is problematic for the recovery SELinux policy, which differs
between build types. Reusing a userdebug policy on a user build
is inappropriate and could lead to security bugs.
Force the deletion of the recovery SELinux policy when changing
build types, so it can be properly regenerated. This is consistent
with how we treat the normal SELinux policy (see commit
a8b3d54101).
Change-Id: I4ebafe3712dc121644828f6538865061aad58cc0
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
Modify the compiler flags for Jack and javac.
This has the following effects:
1) Generally, some of the type inference rules changed.
2) javac: bytecode is generated with the v52 major version (not v51)
3) jack: Java 8 language features are supported.
The javac / dx toolchain does not support Java 8 language features.
Bug: 26753820
(cherry picked from commit fda1ace26116a6677cc77c92c24e5259817fb86e)
Change-Id: I07769de473775d95b13feb38c0eb37086eb120f7