Commit graph

350 commits

Author SHA1 Message Date
Yohann Roussel
6528ea3086 Remove LOCAL_JACK_EXTRA_ARGS
Use of DEFAULT_JACK_EXTRA_ARGS and LOCAL_JACK_FLAGS provides all needed
support.

(cherry picked from commit d2b2983cc7)

Change-Id: I1cd76836792e7332bc3750408a860400b0957485
2015-10-21 17:22:27 +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
Colin Cross
a04abc8e23 Add support for LOCAL_SRC_FILES_EXCLUDE
LOCAL_SRC_FILES_EXCLUDE will be used to filter files out of
LOCAL_SRC_FILES.  A common usage will be to use
LOCAL_SRC_FILES_EXCLUDE_<arch> to remove a source file that will be
replaced with an arch-optimized version.

Change-Id: I75cc6114c47fb784bab65cae8f618c4f395f07bb
2015-10-16 17:33:01 -07:00
Ying Wang
3a3c21cafb am 094116f0: Merge "Remove the unnecessary rs_compatibility_jni_libs install rules."
* commit '094116f0374da3dcba3ff1425f0cb42caf1c6d59':
  Remove the unnecessary rs_compatibility_jni_libs install rules.
2015-09-26 01:06:38 +00:00
Ying Wang
ac30b88dc4 Remove the unnecessary rs_compatibility_jni_libs install rules.
We only build rs_compatibility_jni_libs for unbundled build or when
FORCE_BUILD_RS_COMPAT is set. We don't need to install the
rs_compatibility_jni_libs to system.img in either case.

It's bad idea to install them to system.img, because when two modules
have .rs files with the same name, their installed files conflict.

Change-Id: I7524a301c59396db464f28b17b8f8bf1f15523ca
2015-09-25 16:14:57 -07:00
Dan Albert
ded3f15eeb am 782b98ea: Merge changes I3ca9ed36,Ibd7eec5c
* commit '782b98eaa1c02d935b338f7317fef139067291bb':
  Revert "Default to hiding libgcc symbols in each object."
  Revert "Don't apply --exclude-libs for the host."
2015-09-23 23:47:37 +00:00
Dan Albert
b77aedbf1e Revert "Default to hiding libgcc symbols in each object."
This reverts commit 021b7651a5.

Bug: http://b/24166967
Change-Id: I3ca9ed36fa3b55c7eb129c209903676879720acd
2015-09-23 16:18:18 -07:00
Dan Albert
0b8113ee08 am c496b259: Merge "Default to hiding libgcc symbols in each object."
* commit 'c496b259b8dddf0eac71a50f5e258da4a353d6bb':
  Default to hiding libgcc symbols in each object.
2015-09-23 20:15:37 +00:00
Dan Albert
021b7651a5 Default to hiding libgcc symbols in each object.
Bug: http://b/24166967
Change-Id: I3dba264ae70a2e13b3edee7575139e86ef49be71
2015-09-22 16:49:28 -07:00
Dan Willemsen
c98d9a9d0f am f1c09d7f: Merge "Add HOST_CROSS_OS"
* commit 'f1c09d7fbd92a08cc51950a7d35fb5f7fc564a20':
  Add HOST_CROSS_OS
2015-09-09 18:19:13 +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
Dan Willemsen
f18345af74 am 4379e2b8: Merge "Add LOCAL_MODULE_HOST_OS"
* commit '4379e2b8bbaf2a02777f189c758e251015eb7f76':
  Add LOCAL_MODULE_HOST_OS
2015-09-04 01:31:22 +00:00
Dan Willemsen
859ac34064 Add LOCAL_MODULE_HOST_OS
Instead of wrapping a host module definition in 'ifeq($(HOST_OS),...)'
in the Android.mk files, define which hosts are supported using
LOCAL_MODULE_HOST_OS.

A blank LOCAL_MODULE_HOST_OS means that linux and darwin are supported.
A non-empty LOCAL_MODULE_HOST_OS lists the supported HOST_OSs.

Change-Id: I1e342d1908cfa00aef2c39c145b4f5f81c373bc6
2015-09-03 16:40:51 -07:00
Dan Willemsen
d174629951 am 57ff23b0: Merge "Add support for LOCAL_SRC_FILES_(host)_(arch)"
* commit '57ff23b0ed02affce494d14d8a0f5e9e4717baf7':
  Add support for LOCAL_SRC_FILES_(host)_(arch)
2015-08-28 03:49:02 +00:00
Dan Willemsen
399c59f3aa am d5deac8d: Merge "Add _(darwin|linux|windows)"
* commit 'd5deac8db951ec0a1c9edd806ea1758b836f8c46':
  Add _(darwin|linux|windows)
2015-08-28 03:49:01 +00:00
Dan Willemsen
85ac8d2a00 Add support for LOCAL_SRC_FILES_(host)_(arch)
For boringssl, which has architecture specific host assembly files

Bug: 23566667

Change-Id: Ia4602d28e93a1b3d1400cf95417b5e446c5fb84b
2015-08-28 03:38:43 +00:00
Dan Willemsen
7a5498568f Add _(darwin|linux|windows)
So that we can support building both linux and windows binaries at the
same time on a linux host. This replaces the ifeq($(HOST_OS),...) checks
in Android.mk files.

Bug: 23566667

Change-Id: I693e11984e36d55bb6f09fa0d49bc485463e16fb
2015-08-28 03:36:22 +00:00
Ying Wang
4270d91bbe am 8a3241e3: am 11a38e7a: Merge "Support LOCAL_INIT_RC."
* commit '8a3241e39ad541666aeff291b088e7277b5519ca':
  Support LOCAL_INIT_RC.
2015-08-20 21:00:07 +00:00
Ying Wang
8a3241e39a am 11a38e7a: Merge "Support LOCAL_INIT_RC."
* commit '11a38e7a9164bc3268344ce716c4bd12b08cb05c':
  Support LOCAL_INIT_RC.
2015-08-20 20:53:32 +00:00
Ying Wang
9fe15ac757 Support LOCAL_INIT_RC.
A module can install a companion init.rc file,
by specifying:
LOCAL_INIT_RC := <init.rc-file-path-replative-to-LOCAL_PATH>
You can also use the variant with _32 or _64 suffix.

Bug: 23186545
Change-Id: I00a96509f5707ae39361a0c5555fa59d46c90322
2015-08-20 12:15:15 -07:00
Christopher Wiley
9c49f0affa am 688b4a3d: am 4d2b79f9: Merge "Generate DBus proxies and adaptors separately"
* commit '688b4a3db72b58e8908ecdb24e6c4d64a44fdbc6':
  Generate DBus proxies and adaptors separately
2015-08-19 22:31:03 +00:00
Christopher Wiley
688b4a3db7 am 4d2b79f9: Merge "Generate DBus proxies and adaptors separately"
* commit '4d2b79f99ef34a504fe9f7e362a861d7ddee5659':
  Generate DBus proxies and adaptors separately
2015-08-19 18:37:48 +00:00
Christopher Wiley
529f176ee1 Generate DBus proxies and adaptors separately
Enable daemons exposing an interface over DBus to easily
build client libraries.  Now daemons can write rules like:

include $(CLEAR_VARS)
LOCAL_MODULE := libdbus-binding-example-client
LOCAL_DBUS_PROXY_PREFIX := dbus-example-example
LOCAL_SRC_FILES := \
    dbus_bindings/org.chromium.Example.Manager.dbus.xml \
    dbus_bindings/dbus-service-config.json
include $(BUILD_SHARED_LIBRARY)

to expose a client library.

While here, add support for generating independent adaptor header
files on a per interface basis.

Bug: 22608897
Change-Id: I011f9afc234811c31e445898321c2731c482fa77
2015-08-19 11:14:16 -07:00
Ying Wang
6c4176e2d0 am 8b4d1432: am cd7dfdb4: Merge "Cleanups."
* commit '8b4d1432395733db45e2dfaeee24fe44d3c49bbe':
  Cleanups.
2015-07-23 02:06:39 +00:00
Ying Wang
8b4d143239 am cd7dfdb4: Merge "Cleanups."
* commit 'cd7dfdb4bf3f7d431d2a37908c550a83a282bf22':
  Cleanups.
2015-07-21 23:57:42 +00:00
Ying Wang
bbd4755647 Cleanups.
- Deleted unused functions in definitions.mk.
- lint is never fully functional in the platform source tree.
- Retire LOCAL_DIST_BUNDLED_BINARIES: now the build system/framework
  supports JNI embedded in apk.

Change-Id: I6314cb20d1544c704ccbc4c1f9cccb9c54fb5a51
2015-07-21 16:03:19 -07:00
Ying Wang
1f59fcb23d am 8f908ade: am 2e26f896: Merge "Simplify LOCAL_NO_CRT."
* commit '8f908ade58fd21d5bb27b7a42f8f07553c237df6':
  Simplify LOCAL_NO_CRT.
2015-07-04 02:58:23 +00:00
Stephen Hines
8e75fb2acb am fc493003: am b2275868: Merge "Add LOCAL_NO_LIBGCC."
* commit 'fc4930034fc2694decc264ba2d217ab60e50d182':
  Add LOCAL_NO_LIBGCC.
2015-07-04 02:58:18 +00:00
Ying Wang
8f908ade58 am 2e26f896: Merge "Simplify LOCAL_NO_CRT."
* commit '2e26f896a65563f750f2d459d13cc8edfa705d95':
  Simplify LOCAL_NO_CRT.
2015-07-02 23:06:54 +00:00
Ying Wang
491fca9809 Simplify LOCAL_NO_CRT.
Change-Id: If2486e4861071df6b225fe7f387530a38f554484
2015-07-02 15:58:34 -07:00
Stephen Hines
fc4930034f am b2275868: Merge "Add LOCAL_NO_LIBGCC."
* commit 'b2275868e15caef2a04f0530749cc06415ef10f6':
  Add LOCAL_NO_LIBGCC.
2015-07-02 18:45:45 +00:00
Ying Wang
75011b2003 Add LOCAL_NO_LIBGCC.
This can be used to compile independent libraries without the need for
libgcc.a.

Change-Id: I924200995569d9a978ddbaa6ec321d80734f1374
2015-07-02 11:05:27 -07:00
Dan Albert
6f3527fe60 am cf66a791: am 4fbb83dd: Merge "Add support for LOCAL_SANITIZE := integer."
* commit 'cf66a79130a7382a583f20197f42436a5c1d4095':
  Add support for `LOCAL_SANITIZE := integer`.
2015-06-19 18:16:24 +00:00
Dan Albert
cf66a79130 am 4fbb83dd: Merge "Add support for LOCAL_SANITIZE := integer."
* commit '4fbb83dd3b69729fe08e4a18dd13ca536ae7376f':
  Add support for `LOCAL_SANITIZE := integer`.
2015-06-19 18:03:12 +00:00
Dan Albert
630e81ab99 am 9b187b35: am 20f4a364: Merge "Cleanup unused clear_vars.mk entry."
* commit '9b187b35f32f427dbd6af21614dfefa03177b594':
  Cleanup unused clear_vars.mk entry.
2015-06-19 17:45:07 +00:00
Dan Albert
9b187b35f3 am 20f4a364: Merge "Cleanup unused clear_vars.mk entry."
* commit '20f4a364a83d9a3906d3cf8b866d00437f8ff2d4':
  Cleanup unused clear_vars.mk entry.
2015-06-19 17:35:15 +00:00
Dan Albert
abf4bc916a Add support for LOCAL_SANITIZE := integer.
This also does a bit of cleanup in config_sanitizers.mk. The result is
that `LOCAL_SANITIZE := <any arbitrary ubsan group>` should function
fine for both host and target.

This is a superset of LOCAL_DETECT_INTEGER_OVERFLOWS, so remove that.
This also checks integer division by zero.  It's supposed to cover
shifting undefined behaviors as well, but apparently it does not
(though `LOCAL_SANITIZE := shift` works fine).

Change-Id: I4ac99eafa6920a3f8cb82af37ce56ff0fdb95223
2015-06-19 10:28:06 -07:00
Dan Albert
1578c487c9 Cleanup unused clear_vars.mk entry.
Change-Id: Ibd7b87d1364a60289609a267a287c4afa1d5e5cb
2015-06-19 10:24:07 -07:00
Nick Kralevich
ad48a4655a am d400f774: am dcac4582: Merge "Add support for LOCAL_DETECT_INTEGER_OVERFLOWS"
* commit 'd400f7740d1f8105c5d4d5fdb355f08808c729a5':
  Add support for LOCAL_DETECT_INTEGER_OVERFLOWS
2015-06-15 22:17:35 +00:00
Nick Kralevich
d400f7740d am dcac4582: Merge "Add support for LOCAL_DETECT_INTEGER_OVERFLOWS"
* commit 'dcac45820e4ce7faad4dbfd187f8b788964c9981':
  Add support for LOCAL_DETECT_INTEGER_OVERFLOWS
2015-06-15 22:04:47 +00:00
Nick Kralevich
99d92506ac Add support for LOCAL_DETECT_INTEGER_OVERFLOWS
Add build system support for LOCAL_DETECT_INTEGER_OVERFLOWS. When enabled,
an attempt to perform an integer arithmetic operation which overflows
will result in a call to abort(). This is intended for security
sensitive code, where integer overflow operations are not expected
nor desirable.

Two classes of underflows/overflows are detected and blocked:

1) Signed integer underflow/overflow.
2) Unsigned integer underflow/overflows.

Signed integer overflows are undefined behavior, according to the
C standard. Unsigned integer overflows are defined behavior, but
still undesirable in security sensitive code.

Only clang is supported today. gcc has -ftrapv for handling signed
integer overflow, but it's widely considered broken
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35412) and we're
deliberately avoiding it's use here.

Change-Id: Ib4918dc84e37e83d4205e5035544545d91671e5f
Vaguely-Related-Bug: 11859726
2015-06-15 14:52:09 -07:00
Dimitry Ivanov
9c836723b7 am 72bced8a: Merge changes from topic \'prebuilt-open-from-apk\' into mnc-dev
* commit '72bced8a758a3a8427768d97e6d763f6a706d2b1':
  Uncompress .so files before signing the apk.
  Don't extract jni from prebuilt apks.
2015-06-04 20:19:49 +00:00
Ying Wang
abffa466cc am b7e6e8bb: Merge "Support to configure and build multiple custom images."
* commit 'b7e6e8bb6d00dc2677b297e548aff92f97066ab5':
  Support to configure and build multiple custom images.
2015-06-03 17:11:10 +00:00
Ying Wang
4540a85dd4 Support to configure and build multiple custom images.
Build additional images requested by the product makefile.
This script gives the ability to build multiple additional images and
you can configure what modules/files to include in each image.
1. Define PRODUCT_CUSTOM_IMAGE_MAKEFILES in your product makefile.
   PRODUCT_CUSTOM_IMAGE_MAKEFILES is a list of makefiles.
   Each makefile configures an image.
   For image configuration makefile foo/bar/xyz.mk, the built image
   file name
   will be xyz.img. So make sure they won't conflict.
2. In each image's configuration makefile, you can define variables:
  - CUSTOM_IMAGE_MOUNT_POINT, the mount point, such as "oem", "odm"
    etc.
  - CUSTOM_IMAGE_PARTITION_SIZE
  - CUSTOM_IMAGE_FILE_SYSTEM_TYPE
  - CUSTOM_IMAGE_DICT_FILE, a text file defining a dictionary
    accepted by BuildImage() in tools/releasetools/build_image.py.
  - CUSTOM_IMAGE_MODULES, a list of module names you want to include
    in the image; Not only the module itself will be installed to proper
    path in the image, you can also piggyback additional files/directories
    with the module's LOCAL_PICKUP_FILES.
  - CUSTOM_IMAGE_COPY_FILES, a list of "<src>:<dest>" to be copied to
    the image. <dest> is relativ to the root of the image.

To build all those images, run "make custom_images".

Bug: 19609718
Change-Id: Ic73587e08503a251be27797c7b00329716051927
(cherry picked from commit 5fcf1094f9)
2015-06-03 09:56:29 -07:00
Ying Wang
1fb0152ff7 Don't extract jni from prebuilt apks.
- We don't need LOCAL_PAGE_ALIGN_JNI_SHARED_LIBRARIES now, for we always
  page-align jni shared libraries and store them umcompressed.
- For prebuilt apks, we don't extract jni any more; Instead we always run
  uncompress-shared-libs on them.
- For apks built from source, we still install the jni separately, because
  that way multiple apks can share the same jni and it saves space.

With this change, for most prebuilt apks, we don't need to specify
LOCAL_PREBUILT_JNI_LIBS ("@lib/<abi>/foo.so") any more, for the build
system automatically replaces the embedded jni with uncompressed files;
But if a prebuilt is a fat apk (i.e. containing jni not needed by the
current product architecture), you still need LOCAL_PREBUILT_JNI_LIBS to
specify what jni to keep. Otherwise all embedded jni will be replaced with
uncompressed files, that wastes space.

Bug: 8076853
Change-Id: Ic3666dc72bf17cd293787414dd185470b365f967
2015-06-01 19:19:45 -07:00
Yohann Roussel
f09e59eb52 [DO NOT MERGE] Compile using Jack.
This allows to compile dex targeted java sources using Jack and Jill.
Default is still to compile with the legacy toolchain. Default can be
switched to the new toolchain by setting environement variable:
export ANDROID_COMPILE_WITH_JACK=true
Toolchain can also be forced for one module by defining
LOCAL_JACK_ENABLED:=full # disabled, full, incremental
in the mk portion defining the module.

Jack execution environement can be controlled with:

Global variable ANDROID_JACK_VM allow to change the jvm executing Jack.
Global variable ANDROID_JACK_VM_ARGS allows to change default args given
to the jvm.
Global variable ANDROID_JACK_EXTRA_ARGS allows to define some default args
to give to Jack

LOCAL_JACK_VM_ARGS allows to override default args given to the jvm for
the module.
LOCAL_JACK_EXTRA_ARGS allows to override default args passed to Jack.

This includes cherry-picks of the following changes:
b4c49cba57
22c3fa6d73
138768c1bb
5dd3e1d312
83d5d04047
8bc90fd2d6
140274707e
0fbc9ff2a2
833b427d72
f9a27f45b4
2809666941
37822c443d
c6b44d43c3
d2a76c14bf
06744f60fc
95573d5036
b821391614
2794e7b582
801f2c44d0
c76d99dca1
f528e132d6
76a5e0bd1a
e25b3984ff Partially, only Jack related parts werekept
ec46a3b71f
abee3a9f41
77cbe10fd9
daf07db4cd
b6bfb5893a

Ie all Jack related changes untill
b6bfb5893a
except
a96cc59ab5 "Use Jack by default"

Change-Id: If9d47ef1c4fd1e6765ad2a47d816c1ad3cfab0e3
2015-05-19 18:31:05 +02:00
Ying Wang
0d0f91e385 am 7acd4a5a: Merge "Revert "Don\'t extract jni from prebuilt apks."" into mnc-dev
* commit '7acd4a5afdecf883fb83a39b30715ad3d408e50c':
  Revert "Don't extract jni from prebuilt apks."
2015-05-04 19:16:56 +00:00
Ying Wang
97dfa3177d Revert "Don't extract jni from prebuilt apks."
This reverts commit 3797466fbd.

Bug: 20810492
Bug: 20811499
Change-Id: Ic922d9daccc4550db489c0f3d4ad6b4ff85b5e60
2015-05-04 18:39:46 +00:00
Ying Wang
c1be19a8ee am 37c9b500: Merge "Don\'t extract jni from prebuilt apks." into mnc-dev
* commit '37c9b500ed8c739ca4b47b41bc77863d0971f9f4':
  Don't extract jni from prebuilt apks.
2015-05-02 16:53:45 +00:00
Ying Wang
3797466fbd Don't extract jni from prebuilt apks.
- We don't need LOCAL_PAGE_ALIGN_JNI_SHARED_LIBRARIES now, for we always
  page-align jni shared libraries and store them umcompressed.
- For prebuilt apks, we don't extract jni any more; Instead we always run
  uncompress-shared-libs on them.
- For apks built from source, we still install the jni separately, because
  that way multiple apks can share the same jni and it saves space.

With this change, for most prebuilt apks, we don't need to specify
LOCAL_PREBUILT_JNI_LIBS ("@lib/<abi>/foo.so") any more, for the build
system automatically replaces the embedded jni with uncompressed files;
But if a prebuilt is a fat apk (i.e. containing jni not needed by the
current product architecture), you still need LOCAL_PREBUILT_JNI_LIBS to
specify what jni to keep. Otherwise all embedded jni will be replaced with
uncompressed files, that wastes space.

Bug: 8076853
Change-Id: Icf07e0998ac3602e6e05e80fed836fbafca33e01
2015-05-01 16:09:58 -07:00