Commit Graph

461 Commits

Author SHA1 Message Date
Mohamad Ayyash 95fe0025c1 Always build squashfs host tools
Now that mac compatibility has been fixed

BUG: 27657762
Change-Id: I49933ccedf74b9d172967dad721971a752047da6
Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
2016-04-04 12:33:24 -07:00
Miao Wang 5d4d1d8ebb Merge "[RenderScript] Update the build rules for x86_64 support lib." 2016-04-01 20:22:41 +00:00
Miao Wang 4121aa9bb8 [RenderScript] Update the build rules for x86_64 support lib.
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)
2016-03-31 15:26:24 -07:00
Ying Wang 858657366f Remove support of disabling Jack.
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
2016-03-30 14:03:12 -07:00
Shinichiro Hamaji d3ce14c325 Fix dependencies around tools/*-event-log-tags.py
We should regenerate merged tag files and java sources when
these scripts are updated.

Change-Id: Id5f11d6f480f3f74dab08f01e929ee2d7fafd2d0
2016-03-30 03:04:40 +09:00
Ying Wang fbc5b9f56b Rebuild odex files in PDK fusion build.
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)
2016-03-25 11:06:04 -07:00
Ying Wang 72bc59ce8b Remove rmtypedefs from the build system.
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
2016-03-24 12:25:56 -07:00
David Zeuthen d995f4b04d Add support for Brillo Verified Boot.
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
2016-03-18 15:25:43 -04:00
Yohann Roussel 233584bb80 Remove JILL, JACK_JAR and JILL_JAR
Also ensure that sdk.atree can find jack.jar and jill.jar from prebuilt.

Bug: 27372042
Change-Id: Ie266104e51c09fa21ccb09c1f27ad7068472965c
2016-03-17 15:21:28 +01:00
Yohann Roussel a023f41f13 Merge "Revert "Inform Jack of the min sdk"" 2016-03-15 15:04:54 +00:00
Yohann Roussel 962282bde2 Revert "Inform Jack of the min sdk"
This reverts commit 94451580af.

Bug: 27371864
Change-Id: I60a8c89b2ab8a6cbde4dd3b0aed24b71700815ab
2016-03-15 15:02:11 +00:00
Yohann Roussel b5ea85a903 Revert "Remove one debug line"
This reverts commit d2fafe5734.

Change-Id: I8915604faafb21cf15c0f11ee8a770be2cfc9614
2016-03-15 14:51:28 +00:00
Yohann Roussel d2fafe5734 Remove one debug line
Change-Id: I6de104dd2ca42404d45f3f4b91ccadd03d391f1c
2016-03-15 11:06:51 +01:00
Yohann Roussel 10baeeebc4 Merge "Inform Jack of the min sdk" 2016-03-15 09:42:11 +00:00
Yohann Roussel 94451580af Inform Jack of the min sdk
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
2016-03-11 11:55:57 +01:00
Dan Willemsen 1487f31d83 Use hermetic ckati/makeparallel prebuilts
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
2016-03-09 17:19:30 -08:00
Martin Blumenstingl 764f9339f1 Removed duplicate definition of E2FSCK
Change-Id: I810711ad05e198ee1f9606c37649e80df7b55fa5
2016-03-06 22:38:19 +01:00
Dan Willemsen d4390d3007 Remove unused config variables
These either don't exist or are not used.

Change-Id: I219e4691337223357797fae47ce112df8428bdfa
2016-03-01 01:14:03 -08:00
Chih-Hung Hsieh 765c1ea6d7 Use newest clang static analyzers.
* When WITH_STATIC_ANALYZER is set and non-zero, and clang compiler is used,
  call new clang ccc-analyzer or c++-analyzer.
* Otherwise, if WITH_SYNTAX_CHECK is set and non-zero,
  call compiler with -fsyntax-only.
* Replace "--sysroot=path" with "--sysroot path", to work with ccc-analyzer.
* ccc-analyzer executes the original compilation command to generate
  object files before calling clang with --analyze to do static analysis.
* When clang is called with --analyze, macro __clang_analyzer__ is defined.

BUG: 13287788

Change-Id: I5edb25b52998d871385dd000778db2ce83224078
2016-02-11 16:43:51 -08:00
Dan Willemsen 8c4f25f12f Merge "Add 64-bit windows cross-compiles" 2016-02-09 20:54:10 +00:00
Dan Willemsen fdf89cd575 Disable java when JAVA_NOT_REQUIRED is set
Change-Id: Id3056cde93302be20000bf7af33aeed0fa8fdf52
2016-02-08 17:02:48 -08: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 655dd3ea76 Merge "Move PDK selection into config.mk" 2016-02-02 20:34:30 +00:00
Colin Cross 6b66fcf378 Move PDK selection into config.mk
config.mk needs to know TARGET_BUILD_PDK in order to select prebuilt
tools.  Move the selection of TARGET_BUILD_PDK into config.mk.

Change-Id: I1f73c92917887f27259b2db64b3779a2fe0df162
2016-02-01 18:05:07 -08:00
Colin Cross 41fed8c082 Merge "Don't force color diagnostics outside of ninja" 2016-02-01 18:57:50 +00:00
Colin Cross d3f3ab77fd Set flag when using sdk tools in place
New version of build/ execute the tools from prebuilts/sdk/tools in
place, old versions copy them to $(HOST_OUT_EXECUTABLES).  build/ and
prebuilts/sdk often use mixed versions, set a flag that
prebuilts/sdk/tools/Android.mk can use to determine when it is using an
old build/ directory.

Change-Id: Iad2f96c35203fd3b0976946d229bfa8ab4acb150
2016-01-20 16:08:49 -08:00
Dan Willemsen 5c3f812507 Merge "Add -Werror=date-time to target builds" 2016-01-16 20:13:30 +00:00
Colin Cross dbd43849fb Don't force color diagnostics outside of ninja
Building with USE_NINJA=false and piping build output to a file will
result in ANSI color codes in the build output.  Only force ANSI codes
on when building with ninja, which strips the ANSI codes when writing
build output to a non-TTY.

Change-Id: Ifd2fb53799fd99c23b7ad91cdb84d943bf707db0
2016-01-13 14:05:54 -08:00
Ying Wang 64088f2459 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-11 17:41:56 -08:00
Dan Willemsen eff0611096 Add -Werror=date-time to target builds
The lack of a changing timestamp improves reproducibility of builds, and
helps create smaller OTAs.

Bug: 24204119
Change-Id: I68acfb53be962ffd5c488337517dadb950a13b6f
2016-01-08 16:29:50 -08: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 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 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 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 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 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 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
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 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 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 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 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 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 a0975edc16 Merge "Remove changing uids/timestamps from zip/jar files" 2015-11-03 21:38:45 +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