Commit graph

512 commits

Author SHA1 Message Date
Ying Wang
f0ebe165b9 Generate .c for .y and .l
- 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
2016-01-12 21:07:27 -08:00
Shinichiro Hamaji
91bb1b61f8 Merge "Have symbol versions in .so.toc files" am: c610c42b99
am: bb1207f99c

* commit 'bb1207f99c392d0abc3739475a14e3075215ceca':
  Have symbol versions in .so.toc files
2016-01-07 05:23:34 +00:00
Shinichiro Hamaji
2b0caa3a67 Have symbol versions in .so.toc files
Use readelf --dyn-syms instead of nm, filtering out addresses
and sizes of symbols.

Bug: 26412928
Change-Id: I061ffb428076a79c7b255381ae4d4f8a8e7a4bd7
2016-01-06 15:13:25 +09:00
Dan Willemsen
84d7513417 Merge "Prevent changes to COMMON_GLOBAL_C(PP)FLAGS" am: d443abf1aa
am: c4ba49dbec

* commit 'c4ba49dbecfcba5db1976cf52447aaa927741a76':
  Prevent changes to COMMON_GLOBAL_C(PP)FLAGS
2016-01-05 05:53:50 +00:00
Dan Willemsen
d443abf1aa Merge "Prevent changes to COMMON_GLOBAL_C(PP)FLAGS" 2016-01-05 05:47:43 +00:00
Piotr Jastrzebski
052a00f64e Use core-oj alongside core-libart wherever required.
With some core classes moved to separate core-oj jar
we need to use the new jar.

(cherry picked from commit 89b94c827f)

Change-Id: I025c0adc70535bf23def3ab0ce28a1bfaef72514
2015-12-24 10:10:55 +00:00
Dan Willemsen
93b8a1294c Prevent changes to COMMON_GLOBAL_C(PP)FLAGS
Reorder the definitions of the core cflags so that we can prevent device
configurations from changing the global C(PP)FLAGS.

There is no reason for devices to be configuring the global cflags -- if
something needs to change for a particular device, that flag should be
defined in the BoardConfig.mk, then used in the individual makefiles
where it is needed. The common global flags also affected host tools,
which should not change between device configurations.

Bug: 26165350
Change-Id: Icece4505ce3d2a9168087d802953378534018d47
2015-12-18 12:57:57 -08:00
Dan Willemsen
c915b13a9c Merge "Define __BRILLO__ only for target modules" am: e63d3328df
am: 05177f7cb1

* commit '05177f7cb1e98b23a0c4b8899ba636ef7228e62b':
  Define __BRILLO__ only for target modules
2015-12-16 23:44:55 +00:00
Dan Willemsen
5e637bd05d Merge "Move __BRILLO__ to the core build system" am: 3931873418
am: 152755aa81

* commit '152755aa81354c7c931cb77c71ba3757a40a0cb6':
  Move __BRILLO__ to the core build system
2015-12-16 23:44:49 +00:00
Dan Willemsen
de6494b9ae Define __BRILLO__ only for target modules
__ANDROID__ is only defined for target modules, do the same for
__BRILLO__.

Change-Id: Ie1417e1a5b21c051acf05b2bd3bdb3ddd31be878
2015-12-16 15:04:51 -08:00
Dan Willemsen
16e7e0f556 Move __BRILLO__ to the core build system
In preparation for locking down COMMON_GLOBAL_CFLAGS.

Bug: 26165350
Change-Id: Ifdfb7808c1e1b624ffb0f99ab443ec2c5503a81c
2015-12-16 14:28:21 -08:00
Shinichiro Hamaji
7034d9beae Merge "Reduce unnecessary rebuilds of .dex files with restat=1" am: 542aa57f1d
am: 0d4a0a9dd5

* commit '0d4a0a9dd5c1f3528b611862cb9fa81313028d1b':
  Reduce unnecessary rebuilds of .dex files with restat=1
2015-12-15 08:17:56 -08:00
Shinichiro Hamaji
f972a4a980 Reduce unnecessary rebuilds of .dex files with restat=1
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
2015-12-14 19:07:34 +09:00
Alex Klyubin
c1b31821ef Merge "Make signapk use Conscrypt." am: 7884a63731
am: dfd2199ef6

* commit 'dfd2199ef66dcc162a0165f9a34652ae2877538d':
  Make signapk use Conscrypt.
2015-12-11 10:47:26 -08:00
Alex Klyubin
9667b18f23 Make signapk use Conscrypt.
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
2015-12-11 08:36:42 -08:00
Colin Cross
7eae1599e2 Merge "Remove extra definition of AIDL" am: 77f411e116 am: b275dd1623
am: 934e131465

* commit '934e1314658b30aa8ca22766a3404ff6955d4ece':
  Remove extra definition of AIDL
2015-12-04 17:16:34 +00:00
Colin Cross
a8b896856a Remove extra definition of AIDL
AIDL is defined in the sometimes-prebuilt tools section, remove the
extra definition that was overriding it.

Change-Id: I677bf46475fd5fd4a9258c77d91ecee806e5f205
2015-12-03 13:33:11 -08:00
Colin Cross
0559943edb Merge "Use prebuilt tools in place" am: 50e0646dbe am: 8581e58b3b
am: 64747f5101

* commit '64747f5101f3a4f2385faa493643a513bd67a557':
  Use prebuilt tools in place
2015-12-03 20:24:30 +00:00
Colin Cross
d2163bac6b Merge "Provide path to mainDexClasses" am: 62e99632c6 am: 4e7bf63314
am: 7e68aa8251

* commit '7e68aa8251afde9f885b7961aff5bbbabe840031':
  Provide path to mainDexClasses
2015-12-03 01:22:29 +00:00
Colin Cross
fd08247bcf Use prebuilt tools in place
Don't install the prebuilt SDK tools for TARGET_BUILD_APPS builds, just
execute them in place.  Avoids issues with duplicate rules for the
prebuilts and source modules when building with TARGET_BUILD_APPS in a
full platform tree.

Change-Id: I3cdb4f1a8208e8750310a5cc6130657613b683d1
2015-12-02 17:12:38 -08:00
Colin Cross
f87e971606 Provide path to mainDexClasses
Set MAINDEXCLASSES to the path to mainDexClasses.

Change-Id: I82532e8ea8dc7349178347e080fa0c63078ca9f5
2015-12-02 16:25:49 -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
Michael Wright
0fb087fc73 Add new Test API for CTS testing.
Bug: 25608286
Change-Id: I0334061b548970959e46392dc3a1feed8533548c
2015-11-25 11:38:44 +00:00
Piotr Jastrzebski
89b94c827f Use core-oj alongside core-libart wherever required.
With some core classes moved to separate core-oj jar
we need to use the new jar.

Change-Id: Ie069c7a93e63b1df854b3137d984b96520562609
2015-11-20 13:53:22 +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
93ee2b5869 Merge "Allow missing SONAME in .toc files" am: 457345e58c am: 7070e5dc59
am: ad397422b4

* commit 'ad397422b4da3f5faff4e2ca69d4596b97e4bd61':
  Allow missing SONAME in .toc files
2015-11-05 04:11:52 +00:00
Shinichiro Hamaji
f0972f7966 Allow missing SONAME in .toc files
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
2015-11-05 12:51:08 +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
Dan Willemsen
a1b3290c0b Merge "Don\'t use ziptime with unbundled builds" am: 29a6675983 am: 3665246dcb
am: 8ccf645f94

* commit '8ccf645f94c0b21c6407576df0ba0990d96167b1':
  Don't use ziptime with unbundled builds
2015-11-04 00:47:24 +00:00
Dan Willemsen
a25ddad7d6 Don't use ziptime with unbundled builds
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
2015-11-03 16:18:41 -08:00
Dan Willemsen
641e8888fa Merge "Remove changing uids/timestamps from zip/jar files" am: a0975edc16
am: c789be850c

* commit 'c789be850ca14b945e72412457991d7a5e13126e':
  Remove changing uids/timestamps from zip/jar files
2015-11-03 23:43:30 +00:00
Dan Willemsen
a0975edc16 Merge "Remove changing uids/timestamps from zip/jar files" 2015-11-03 21:38:45 +00:00
Ying Wang
f0b5cd2de6 Merge "Don\'t check the host JDK tools when build/core/config.mk is called from envsetup.sh." am: a63d379aab am: fb89fd36b2
am: 88f5d25be1

* commit '88f5d25be1b0756db65b34114929b4dd0bc5f05c':
  Don't check the host JDK tools when build/core/config.mk is called from envsetup.sh.
2015-11-03 00:49:23 +00:00
Ying Wang
7fcd2f9086 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
2015-11-02 16:00:47 -08:00
Dan Willemsen
48a621c277 Remove changing uids/timestamps from zip/jar files
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
2015-11-02 14:51:54 -08:00
Ying Wang
471bf958cd Merge "Normalize the product makefile path in inherit-product." am: aabff90bfe am: 3482ea54a2
am: 4f5e8cc3ca

* commit '4f5e8cc3ca6da83f11bf42d04f1a57b9af16a582':
  Normalize the product makefile path in inherit-product.
2015-10-29 00:02:58 +00:00
Ying Wang
a174261042 Normalize the product makefile path in inherit-product.
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
2015-10-28 15:20:41 -07:00
Colin Cross
a9373f8e24 Merge "Error out early on nonstandard JDK directory layouts" am: 506113d267 am: e95cf75293
am: 1ac51c013e

* commit '1ac51c013e134c7a22580f9020e3b89851153a7e':
  Error out early on nonstandard JDK directory layouts
2015-10-27 23:27:47 +00:00
Colin Cross
506113d267 Merge "Error out early on nonstandard JDK directory layouts" 2015-10-27 19:12:40 +00:00
Colin Cross
112753ca55 Error out early on nonstandard JDK directory layouts
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
2015-10-23 19:00:43 -07:00
Ying Wang
4d68879ca6 Normalize java source file paths before running "sort -u".
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
2015-10-23 13:19:47 -07:00
Ying Wang
2af4d1ad2c Normalize java source file paths before running "sort -u".
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
2015-10-22 16:35:10 -07:00
Yohann Roussel
8998d57404 Allow control of jack used for compilation
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
2015-10-21 17:22:05 +02:00
Yohann Roussel
b2c5558435 Clean call-jack and its callers
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
2015-10-21 17:02:25 +02:00
Andreas Gampe
36047501aa Merge "Build: Fix DEX2OAT_TARGET_CPU_VARIANT setting" am: 6c45f4493e am: 3c131856ee
am: 92a73a0f6c

* commit '92a73a0f6c0c768d4bc612106e0c6ddcb7fb2846':
  Build: Fix DEX2OAT_TARGET_CPU_VARIANT setting
2015-10-20 23:59:45 +00:00