Host native tests have been getting installed into
out/host/linux-x86/bin/..., but this pollutes the bin directory with a
lot of poorly named tests. Also, to support 32-bit and 64-bit tests, we
need to have different names with different suffixes. This causes
problems when tests expect to be named something specific (like gtest).
It's also convenient to store test data next to the test itself.
So with this change, native tests will be installed in
out/host/linux-x86/nativetest[64]/$(LOCAL_MODULE)/$(LOCAL_MODULE_STEM)
just like target tests get installed into /data/nativetest[64].
Implement this using a new NATIVE_TESTS class, which is like
EXECUTABLES, but sets up the install path differently, and configures
the rpath to load shared libraries with the proper relative path.
LOCAL_MODULE_RELATIVE_PATH can be used to control the directory name, it
will default to $(LOCAL_MODULE). This way multiple related tests can be
grouped together.
Target native tests also use NATIVE_TESTS now, but nothing should change
other than LOCAL_MODULE_RELATIVE_PATH can be used.
Change-Id: I535e42b1a6b21c5b8d6a580aa2f944d2be35e27d
am: 451b72438e
* commit '451b72438e974a10f3f9062ced5d455d3234e4dd':
Uncompress native libs only if they are compressed.
Change-Id: I4c680cfb228774ce93e75c644e7eee5c40988399
This changes the build system to uncompress native libraries in
preinstalled APKs only if the libraries are actually compressed.
Previously, any preinstalled APK containing native libraries was
modified by having all native libraries removed from the APK and then
re-added to the APK in uncompressed form.
Bug: 27887819
Change-Id: I3db172133e141bb6282bf3ed7070b068a826724e
Instead, use the libgcc/libatomic/libgcov from the static libraries dir,
which is provided by Soong. Copy the libraries using the Soong script if
Soong is disabled - this can be removed once USE_SOONG is removed.
Change-Id: Iad2ad20ad5c3cfc48bf1e46e594a482609098d7a
If Soong is enabled, and we're skipping an Android.mk because there is
an Android.bp file, check for an Android.soong.mk file and read that
instead. This will allow us to temporarily define modules or recurse
into subdirectories that soong does not yet support.
Change-Id: Ifdb2f0204a38a5069e53527f66ffcfb8008c11a4
am: f59ad14c1f
* commit 'f59ad14c1f7cb07a4669741f8b0bb1e938398eca':
Fix handling of version codes in minSdkVersion when signing.
Change-Id: Ie53be2528b32bc2eaa70645000ad66473422e06f
The APK signing tool, build/tools/signapk, needs to know the API Level
of the oldest platform supported by the APK. The APK's minSdkVersion
may reference that using a number (API Level) or a version code. To
handle the version code case, the existing logic was to see if it
matches $PLATFORM_VERSION_CODENAME and then substitute it with
$PLATFORM_SDK_VERSION.
However, some platforms support multiple version codes. To handle this
scenario, this commit changes the logic for computing the min API
Level for signing purposes to treat any non-numeric minSdkVersion as
$PLATFORM_SDK_VERSION.
Bug: 28715556
Change-Id: I292c96e8928b7e2f8d9716ef2be33a23a87764c4
Previously if a library has custom generated headers in
LOCAL_GENERATED_SOURCES and export its include path with
LOCAL_EXPORT_C_INCLUDE_DIRS, there is almost no way for the users of the
library to set up dependency of their object files on the generated
headers.
This change makes the generated sources dependency of the library's
export_includes, which is guaranteed generated before client code gets
compiled.
Also we added proto-generated cpp files to my_generated_sources so that
we can deal solely with $(my_generated_sources). Because many
Android.mks assume the generted .pb.hs are in $(generated_sources_dir)
instead of $(intermediates), we have to generate the source files in
$(generated_sources_dir) and make a copy in $(intermediates).
Bug: 28622149
Change-Id: I73b21443fa706f3735faf16356ed8c08fbfecca6
Bootclasspath libraries are already added in LOCAL_JAVA_LIBRARIES by
java.mk and host_dalvik_java_library.mk meaning that bootclasspath
handling was just doing a duplicate work and adding duplicated entries
to the classpath.
Also fix order of bootclasspath libraries for host.
Bug: 28307907
Change-Id: I6e98fc651a127435c029de65285dbf2cb04844af
* Call clang-tidy before every C/C++ compilation if
(1) clang-tidy is found at $(PATH_TO_CLANG_TIDY)
(2) $(my_clang) is true
(3) LOCAL_TIDY is 1 or true, or
LOCAL_TIDY is undefined and WITH_TIDY is 1 or true.
* clang-tidy is called with -checks=$(my_tidy_checks),
which has default '-*,google*,-google-readability*'
and can be overwritten by WITH_TIDY_CHECKS.
* LOCAL_TIDY_CHECKS is appended to $(my_tidy_checks)
* Extra flags are passed to clang-tidy through
WITH_TIDY_FLAGS or LOCAL_TIDY_FLAGS.
* To quickly find and fix clang-tidy warnings, set $(WITH_TIDY_ONLY)
to 1 or true to skip compilation of C/C++ files.
* Add a PHONY tidy_only target,
which includes all $(cpp_objects) and $(c_objects).
* The 'mm' and 'mmm' functions are changed to call make with
the 'tidy_only' target when WITH_TIDY_ONLY is true or 1.
In that case, only clang-tidy is called for C and C++ files.
Bug: http://b/27779618
Change-Id: I8adcfff217d68af49849b79aacee7d7654cafb1b
Those libraries are already imported (or added to the classpath in the
case of the check command) meaning that they were all duplicated.
In addition to complicating the build this was also slowing down the
compilation.
Bug: 28307907
Change-Id: Ia8665e7c5ad8b567bd02de7839fa62e67a5668f7
Mini-debug-info strip mode strips most debug information, but
maintains minimal debugging information similar to
https://sourceware.org/gdb/onlinedocs/gdb/MiniDebugInfo.html.
Bug: 27923447
Change-Id: I0405f0b3c33cb3cadeafbd22ce94d645c4dbe7b9
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
There was a typo in binary.mk. compile-dotdot-XXX-file in
definitions.mk was also using -include.
Bug: 26839129
Bug: 27886012
Change-Id: I4a0145fb70413998cc65d30d2efcd68af07b4800
(cherry picked from commit 72904774a3)
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
Bug: 27886012
Change-Id: If00e93c7a33449ec314a5cdba438475a32979f4e
(cherry picked from commit 4037c4225a)
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)
When USE_SOONG=true, ignore any Android.mk file that has an Android.bp
file in the same directory.
Change-Id: Id79bd90c2aed5dafc2f8ad2c5b7eb0aa6e81dc18
(cherry picked from commit 861ab99536)
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
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
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
(cherry picked from commit 22313f2b2a)
Change-Id: I1e7f2f5dcc7f95a44f5ebf2e4ba99931ff3ba014
After adding java.util.stream, doc-comment-check target
started to fail due to "Too many words" while
generating out/target/common/docs/doc-comment-check-timestamp.rsp
This change extends number of dumped words to 5400.
Bug: 27692239
Change-Id: Ifa75cada7b90c5737fc7a1d10325f3a49a2238ac
Set Jack min sdk according to LOCAL_SDK_VERSION. Gives Jack current
version when LOCAL_SDK_VERSION is not available.
Bug: 27371864
(cherry picked from commit c6383d6ec6)
Change-Id: Ieba0219494f29d2737d2ca234317c3af7e5e72c8
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
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
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
- 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)
- 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
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
* changes:
Remove debug statement
Tell Soong about HOST_CROSS_*
Update to use the latest clang-2629532.
Use newest clang static analyzers.
Add 64-bit windows cross-compiles
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
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
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