Commit graph

303 commits

Author SHA1 Message Date
Dan Willemsen
32b36a8819 Merge "Add NATIVE_TESTS class, move host native tests" am: e72fc63901
am: 10461b78f0

* commit '10461b78f0955d9dba8d32045d1e35ff0f9a5c8c':
  Add NATIVE_TESTS class, move host native tests

Change-Id: Ia11b54676d3b33e58c177a5a375f29233657524e
2016-06-07 00:09:39 +00:00
Dan Willemsen
e72fc63901 Merge "Add NATIVE_TESTS class, move host native tests" 2016-06-06 23:59:23 +00:00
Dan Willemsen
d99f210545 Merge "Add LOCAL_LOGTAGS_FILES that prebuilts can use" am: 476b5b1616
am: 58b7c1c744

* commit '58b7c1c744aa49fb0686848b281ae75c2485f420':
  Add LOCAL_LOGTAGS_FILES that prebuilts can use

Change-Id: I76a6077c3945463a5b52fb8a4f5146a2590de716
2016-06-01 23:53:44 +00:00
Dan Willemsen
b0a08b874c Add LOCAL_LOGTAGS_FILES that prebuilts can use
Soong modules can define logtags files that need to be combined into
/system/etc/event-log-tags, so add a new LOCAL_LOGTAGS_FILES variable
that can be used to specify *.logtags file outside of LOCAL_SRC_FILES.

Bug: 28989759
Change-Id: I53c5d396dfb7c6006806758f351eb5cdde90fe74
2016-06-01 15:31:44 -07:00
Dan Willemsen
7fe992c0cc Add NATIVE_TESTS class, move host native tests
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
2016-05-24 12:43:16 -07:00
Ying Wang
77f67cd048 Merge "Support x86+arm multilib build."
am: d314805

* commit 'd314805c29fdbee3508b99c14ca63e1a8d170c3b':
  Support x86+arm multilib build.
2016-03-25 21:51:21 +00:00
Ying Wang
87538e4f8b Support x86+arm multilib build.
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)
2016-03-25 13:29:53 -07:00
Ying Wang
9d13d6a7e9 Merge "Phony target covers all multilib variants."
am: 165c707

* commit '165c70713ac9099833df7fd6e6ba5c5620a84a9e':
  Phony target $(LOCAL_MODULE) covers all multilib variants.
2016-03-23 23:10:26 +00:00
Ying Wang
71c58092f4 Phony target $(LOCAL_MODULE) covers all multilib variants.
Bug: 27760875
Change-Id: Ie59e2c36964fa736b17fb4185563c08a8cb75b80
2016-03-23 11:02:03 -07:00
Dan Willemsen
23afb78cf9 Merge commit 'cdaf748e3abefd93a4e45393e96717fad8564c51'
Change-Id: I3c44564b08ed46f46719dbca54d4225718bb8c59
2016-03-01 15:36:08 -08:00
Dan Willemsen
479311bc7c Remove LOCAL_ACP_UNAVAILABLE
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
2016-03-01 13:16:53 -08:00
Dan Willemsen
7f016150a0 Remove unused dependencies on $(ACP)
Most of these are calling to copy-file-to-target or similar, which no
longer use $(ACP).

Change-Id: I62287a80c577c34df587b74e70055c2f56050ce7
2016-03-01 13:15:35 -08:00
Dan Willemsen
9ffa38b193 Merge "Remove USE_NINJA=false" am: 3bfc095f53
am: d73633c082

* commit 'd73633c0824a63f7104bddf9a798bccc952b545c':
  Remove USE_NINJA=false
2016-02-29 22:19:29 +00:00
Dan Willemsen
1c6dc5b942 Remove USE_NINJA=false
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
2016-02-26 21:48:31 -08:00
Ying Wang
ea4ac87272 Merge "Don\'t ignore LOCAL_INIT_RC if LOCAL_INIT_RC_32/64 is used." am: 0e0e95e592
am: 7daeda5b80

* commit '7daeda5b80f44bb11f7bd63a70dbd5bb511bf90d':
  Don't ignore LOCAL_INIT_RC if LOCAL_INIT_RC_32/64 is used.
2016-02-25 18:35:20 +00:00
Ying Wang
41d66783c4 Don't ignore LOCAL_INIT_RC if LOCAL_INIT_RC_32/64 is used.
It's a valid situation for all three of LOCAL_INIT_RC, LOCAL_INIT_RC_32,
and LOCAL_INIT_RC_64 to be used.

Bug: 26773181
Change-Id: If9661f93b1823279075fc3d55195f7a939e01b6f
2016-02-24 17:34:52 -08:00
Ying Wang
c2555118be Use LOCAL_COMPATIBILITY_SUPPORT_FILES relative to .
am: 150fd17a40

* commit '150fd17a408c9e609bbc7a938542edf7c94aa872':
  Use LOCAL_COMPATIBILITY_SUPPORT_FILES relative to $(TOP).
2016-02-17 22:11:46 +00:00
Ying Wang
150fd17a40 Use LOCAL_COMPATIBILITY_SUPPORT_FILES relative to $(TOP).
So that you can have LOCAL_COMPATIBILITY_SUPPORT_FILES generated in the
out directory.

Change-Id: I3e011fc3db5de170f7befcb12841d230283671a6
(cherry picked from commit c3e4b2f390)
2016-02-17 20:36:15 +00:00
Dan Willemsen
6863fe23a9 Merge "Add 64-bit windows cross-compiles"
am: 8c4f25f12f

* commit '8c4f25f12fe0fe8265fb8849cf7cb2fc482ae7e5':
  Add 64-bit windows cross-compiles
2016-02-09 21:14:21 +00:00
Dan Willemsen
9ecbf83259 Add 64-bit windows cross-compiles
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
2016-02-05 16:33:18 -08:00
Colin Cross
df674b1e9e Merge "Build .toc when building a module by name" am: 1b21a15049
am: af5b95ac90

* commit 'af5b95ac90ae06cf9efc52436e2e24d8c55541ce':
  Build .toc when building a module by name
2016-02-04 23:19:16 +00:00
Colin Cross
e2b8f68785 Build .toc when building a module by name
Building a module by name with make <module name>, or with mm or mma
through all_modules, should also build the .toc file so that future uses
of mm on modules that depend on this one can find the .toc file.

Bug: 26936761
Change-Id: Id0c592f0860a10b732b2b5b13c7e967c9bcb1c6b
2016-02-04 13:31:16 -08:00
Ying Wang
4106b2e4c9 Merge "Disable .toc optimization for host modules." am: 7b92312ea1
am: 8449b88b2e

* commit '8449b88b2e64f49a6858ec36acca9e877585802e':
  Disable .toc optimization for host modules.
2015-12-15 19:32:42 +00:00
Ying Wang
c01f2dcb10 Disable .toc optimization for host modules.
Host binaries may be run during the build process and the internal
implementation of the shared libraries makes a difference for the build
result. This change makes sure host tools get re-linked and re-run when
any of its dependency libraries gets updated.
DEX2OAT is such a host tool. We also changed DEX2OAT as full dependency
of dex-preoptimization, so we rebuild the odex files if DEX2OAT itself,
or any dependency libraries changed.

Bug: 24597504
Change-Id: Idf0d9be82ccebd826d9c5b405a39cff437e0af29
2015-12-15 10:00:19 -08:00
Ying Wang
d657d00245 Fix missing $.
Bug: 24139963
Change-Id: Ia39cff486c51f845215976bb483baffeb9e56a80
2015-12-07 12:20:59 -08:00
Colin Cross
f344fe0850 Merge changes I1de10391,I4399ca26,Iec3b2b0b am: bff3c9b4c1 am: bae8872294
am: dbeab8de65

* commit 'dbeab8de6543db1d0393789cb18ee7fd7ed8fedd':
  Use libstdc++ for ijar
  Build ijar for apps build
  Use .KATI_RESTAT to reduce unnecessary rebuilds of .jar files
2015-12-01 00:07:45 +00:00
Shinichiro Hamaji
89b255ab71 Use .KATI_RESTAT to reduce unnecessary rebuilds of .jar files
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
2015-11-30 11:16:23 -08:00
Shinichiro Hamaji
d973ed9f47 Merge "Revert "Use .KATI_RESTAT to reduce unnecessary rebuilds of .jar files"" am: 2ff3ad9045 am: 51ef51c4ad
am: 371b8c7f77

* commit '371b8c7f770f8215e6bda1433e5f236c106b4e64':
  Revert "Use .KATI_RESTAT to reduce unnecessary rebuilds of .jar files"
2015-11-27 04:07:51 +00:00
Shinichiro Hamaji
3ae7f66bab Revert "Use .KATI_RESTAT to reduce unnecessary rebuilds of .jar files"
This reverts commit c1f5d9c203.

Change-Id: I7e9969a060e3f1380154da65e76134168aee15d8
2015-11-27 03:58:51 +00:00
Shinichiro Hamaji
534bd29363 Merge "Use .KATI_RESTAT to reduce unnecessary rebuilds of .jar files" am: c9a1b27845 am: 27770abe27
am: b42da32564

* commit 'b42da32564886ab7d3d5a2518b6868cd8fab9c78':
  Use .KATI_RESTAT to reduce unnecessary rebuilds of .jar files
2015-11-26 05:37:01 +00:00
Shinichiro Hamaji
c1f5d9c203 Use .KATI_RESTAT to reduce unnecessary rebuilds of .jar files
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
2015-11-19 17:10:35 +09:00
Shinichiro Hamaji
4f23722dd9 Merge "Use .KATI_RESTAT to reduce unnecessary rebuilds of binaries" am: 2f8ffa61be am: 7557ad2bbd
am: 506c43c871

* commit '506c43c87193433533245150673f5d386aa10953':
  Use .KATI_RESTAT to reduce unnecessary rebuilds of binaries
2015-11-05 01:33:46 +00:00
Shinichiro Hamaji
0e7587a9ea Use .KATI_RESTAT to reduce unnecessary rebuilds of binaries
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
2015-11-04 15:23:59 +09:00
Ying Wang
719f198d5a Set up CTS copy rules only once for multilib build.
Bug: 21762834
Change-Id: I488893b2fd26c9aaeb92ae494bc46e86dad1622d
2015-10-20 18:18:40 -07:00
Colin Cross
6dcda02e4c resolved conflicts for 5acaa9dc to master
Change-Id: Idbadd1127e9524b6ecb571cdc7338d106ca2be3f
2015-09-28 19:25:15 -07:00
Colin Cross
a4447e8c89 Don't add dependencies on Makefiles when using ninja
Ninja has an implicit dependency on the command being run, and kati will
regenerate the ninja manifest if any read makefile changes, so there is no
need to have dependencies on makefiles.
This won't catch all the cases where LOCAL_ADDITIONAL_DEPENDENCIES contains
a .mk file, because a few users of LOCAL_ADDITIONAL_DEPENDENCIES don't
include base_rules.mk, but it will fix the most common ones.

Bug: 23566977
Change-Id: I66de882421376303ab7233c8ce7274548f6b2199
2015-09-28 16:29:52 -07:00
Ying Wang
e42e43e071 am 34a38f2c: am 945bc2f2: am 92facb1f: Merge "Substitue "/" with "-" in the MODULES-IN phony goal names."
* commit '34a38f2c6cf02e7b200d967e256aa12c4d96e76b':
  Substitue "/" with "-" in the MODULES-IN phony goal names.
2015-09-25 00:14:59 +00:00
Ying Wang
61cd884a11 Substitue "/" with "-" in the MODULES-IN phony goal names.
This avoids Ninja's path canonicalization on those goal names.
Without this, Ninja complains about duplicate rules for
MODULES-IN/a/b/.. and MODULES-IN/a.

Bug: 24309760
Change-Id: Id3aa9da5d3887a2cd1426cbb5fdf35659c65805e
2015-09-24 16:24:42 -07:00
Ying Wang
da88400c0a am feca5313: am 2f9f1fb3: resolved conflicts for 964f06b1 to stage-aosp-master
* commit 'feca5313b73dbc163d6a73a6e93ee918e83e3bc7':
  Re-implement mma/mmma using make goals.
2015-09-24 04:17:53 +00:00
Ying Wang
caeaa08f9d Re-implement mma/mmma using make goals.
Previously we use command line variable BUILD_MODULES_IN_PATHS which
causes kati to regenerate build.ninja if any variable value changes.

TODO: Remove the old rules of BUILD_MODULES_IN_PATHS in
build/core/main.mk and ninja.mk once users have re-sourced envsetup.sh.
Probably in a few weeks.

Caveat: With this change, if a user sources the new envsetup.sh, mma/mmma
won't work in old branches from the same shell.

Bug: 24309760
Change-Id: I212e82aeebaaa2bd4114e2066f1995da8886b5e2
2015-09-23 16:31:02 -07:00
Ying Wang
25e01177de Add LOCAL_COMPATIBILITY_SUPPORT_FILES to copy arbitrary CTS support files.
LOCAL_COMPATIBILITY_SUPPORT_FILES is a list of <src>:<dest>,
where <src> is relative to LOCAL_PATH and <dest> is relative to the
suite's testcases out directory.
We keep the rule to auto-detect AndroidTest.xml and DynamicConfig.xml,
so you don't need to modify the existing cts Android.mks.

Bug: 24139963
Bug: 21762834
Change-Id: Iecb83fcbcf8c7575c27802bfd773e4134aec39d5
2015-09-17 12:38:23 -07:00
Dan Willemsen
7586773bc5 am 3cf749c7: am c98d9a9d: am f1c09d7f: Merge "Add HOST_CROSS_OS"
* commit '3cf749c78a7d97ed41b0a8f3ee3598738d6d543d':
  Add HOST_CROSS_OS
2015-09-09 18:37:20 +00:00
Dan Willemsen
f1c09d7fbd Merge "Add HOST_CROSS_OS" 2015-09-09 18:13:21 +00:00
Dan Willemsen
057aaea54a Add HOST_CROSS_OS
Instead of using recursive make to change the HOST_OS when building the
windows SDK under linux, add the concept of cross-building to another
host os.

Bug: 23566667
Change-Id: I6dc525b601b6251d458d197c30bf4660d7485502
2015-09-09 18:12:29 +00:00
Ying Wang
90a25b95d5 am 6f2e72ec: am cbac8789: am af72e1b3: Merge "Move part of logtags stuff back to base_rules.mk."
* commit '6f2e72ec999e855c6ac215e6edced17a1d7f2e22':
  Move part of logtags stuff back to base_rules.mk.
2015-09-04 18:12:56 +00:00
Yasuhiro Matsuda
ff82e82a1e Move part of logtags stuff back to base_rules.mk.
Otherwise event tags for non-Java modules
(e.g. logcat, libsurfaceflinger) are not generated.

BUG: 23803975
Change-Id: I6fd53fe2ca39102787fc513aa8c23f906b94f253
2015-09-04 20:02:49 +09:00
Ying Wang
847b7503b6 am 08f82e9b: am 119cec9a: am 4e2f1903: Merge "Clean up Javac a little bit."
* commit '08f82e9b33185b3969e364648b22c9ead07d6c29':
  Clean up Javac a little bit.
2015-09-02 21:41:59 +00:00
Ying Wang
447d69678e Clean up Javac a little bit.
- Added GLOBAL_JAVAC_DEBUG_FLAGS and merge it to
  PRIVATE_JAVACFLAGS/PRIVATE_JACK_FLAGS to get rid of
  PRIVATE_JAVAC_DEBUG_FLAGS/PRIVATE_JACK_DEBUG_FLAGS.
- With Java rules out of base_rules.mk we can get rid
  of java_alternative_checked_module now.

Change-Id: I1a14716c785e3d49330a75044107662ce96a9307
2015-09-02 10:04:18 -07:00
Ying Wang
68ec6f60ec resolved conflicts for merge of 3ead0a7b to master
Change-Id: Id4a0e030a9ac9c5dad041493eafc97f91af8f7c5
2015-09-01 10:00:23 -07:00
Ying Wang
956dcccf76 Move Java stuff out of base_rules.mk
- Moved the target-only .aidl and .logtag rules to java.mk.
- Moved the .proto rules,  Java library dependency calculation,
  Java resource processing and Java-related
  target-specific and global variables setup to a new java_common.java,
  which is shared by both target and host Java modules.
- Minor cleanup for the moved code.

Bug: 23597357
Change-Id: Ic3eb72e26bb1a663e5739abe0a935f96b88bc352
2015-08-28 17:17:19 -07:00