Commit graph

242 commits

Author SHA1 Message Date
Ying Wang
ca3641d600 resolved conflicts for merge of 3907c03e to lmp-mr1-dev-plus-aosp
Change-Id: I6900c8cdf1d161fbcede73547fad1750df9abab6
2014-10-09 19:31:56 -07:00
Ying Wang
20ebd2ef08 Introduce per-product per-module dex-preopt config
- Added LOCAL_DEX_PREOPT_FLAGS to pass extra flags to dex2oat.
- Added macro add-product-dex-preopt-module-config to specify almost
  arbitrary dex-preopt config/flags to modules in product
  configuration:
  $(call \
  add-product-dex-preopt-module-config,<module_name_list>,<config_or_flags>)
  How <config_or_flags> is interpreted is decided by
  dex_preopt_odex_install.mk and dex2oat. For now if it's "disable" we
  disable dexpreopt for the given modules; otherwise pass it to dex2oat as
  command line flags.
- If there are multiple configs for the same module in the product
  inheritance, the first takes precedence.
- Added PRODUCT_DEX_PREOPT_DEFAULT_FLAGS so you can specify default
  dex2oat flags in product configuration.
- Added PRODUCT_DEX_PREOPT_BOOT_FLAGS to specify flags of building boot.oat.

Bug: 17791867
Change-Id: I1b2955e8e51039e94d1ff43a3265a8d03598632c
2014-10-08 10:11:17 -07:00
Chih-Hung Hsieh
0a37887412 am 14012488: am 09cdd500: Merge "Clear all LOCAL_CLANG_*FLAGS*."
* commit '140124884050264721e22cb08f713a7da76b36d4':
  Clear all LOCAL_CLANG_*FLAGS*.
2014-09-30 22:14:06 +00:00
Chih-Hung Hsieh
78b6cea65e Clear all LOCAL_CLANG_*FLAGS*.
Although only some of these flags will be used for some
targets or hosts, they must all be cleared to avoid carrying
over from one project to another.

BUG: 17677366
Change-Id: I6d26fa7e5bf2ff11758728810d4874f3759aebe7
2014-09-30 21:50:58 +00:00
Chih-Hung Hsieh
916a954d8c am b9b2d21c: am 4a8d5c1a: Merge "Add local Clang+target specific flags."
* commit 'b9b2d21c04d0ba65ad56a26f8306e9afa7d99694':
  Add local Clang+target specific flags.
2014-09-27 03:00:29 +00:00
Chih-Hung Hsieh
619fdb8d77 Add local Clang+target specific flags.
BUG: 17677366
Change-Id: I75522fb56fdf4d27ea1f5f0ae15866b13ae6e206
2014-09-26 17:19:49 -07:00
Dan Albert
b43af8807f resolved conflicts for merge of 326f9450 to lmp-mr1-dev-plus-aosp
Change-Id: I10e578a3d10a03312cbc4058a92f02ccaba1739c
2014-09-24 09:51:05 -07:00
Dan Albert
4bbc6c790b Add option for generating coverage info.
To enable building with coverage, the environment variable
NATIVE_COVERAGE must be set to true.

Set `LOCAL_NATIVE_COVERAGE := true` to generate coverage information for
a given component.

This is currently not supported for clang (b/17574078, b/17583330).

If static library A is included in a binary B (dynamic or static
executable, or shared library), and A is built with coverage
information, B is required to link with libgcov.a. Since the make does
not offer a good way to track this dependency, link libgcov.a even if
LOCAL_NATIVE_COVERAGE is not set (but still guarded by NATIVE_COVERAGE).
This ensures that all of the libgcov dependencies will always be
resolved, and causes no change in the resulting binary if coverage is
not used.

Bug: 10134489
Change-Id: Id5a19f2c215e4be80e6eae27ecc19b582f2f6813
2014-09-23 15:19:02 -07:00
Dan Albert
46edd9b103 am 92421720: am 98f7742a: Merge "Move selection of C++ STL into the build system."
* commit '9242172094691c7203ba7cf0a5e5db611ca9032b':
  Move selection of C++ STL into the build system.
2014-09-19 00:15:23 +00:00
Dan Albert
b05f2ca150 Move selection of C++ STL into the build system.
Preparing for migration from stlport to libc++. STL selection is done
with LOCAL_CXX_STL (valid values are default, none, libc++,
libc++_static, stlport, stlport_static, bionic).

The selection of the STL is as follows:

    if LOCAL_CXX_STL == 'default'
      ifdef LOCAL_SDK_VERSION
        Use whatever STL the other NDK options have selected.
      else
        Use bionic's libstdc++ for target, GNU libstdc++ for host. This
        is compatible with the existing build options.
      endif
    else
      if LOCAL_CXX_STL == 'stlport'
        Use stlport.
      else if LOCAL_CXX_STL == 'libc++'
        Use libc++.
      else if LOCAL_CXX_STL == ''
        Don't use any STL.
      endif
    endif

Bug: 15193147
Change-Id: If712ba0ae7908d8147a69e29da5c453a183d6540
2014-09-18 16:38:20 -07:00
Ying Wang
781da04001 am b9add847: am 53e95027: Merge "Add LOCAL_POST_LINK_CMD."
* commit 'b9add847ee1eade4ff517655decfc1790bb77d60':
  Add LOCAL_POST_LINK_CMD.
2014-09-05 23:54:29 +00:00
Ying Wang
8b3476986a Add LOCAL_POST_LINK_CMD.
For now we support LOCAL_POST_LINK_CMD only for static executables.
This fixed the hack of building linker which need to insert additional
step after link.

Bug: 17403674
Change-Id: Iefdfe1e3fab3a30c5d4ad701d46f931481eab572
2014-09-05 15:47:59 -07:00
Chih-Hung Hsieh
ace83ae389 am 2202dc0a: am 1051d5dc: Merge "Add LOCAL_CLANG_*FLAGS for clang only flags."
* commit '2202dc0af3ab86e2a73bf816012aaea65fb93d91':
  Add LOCAL_CLANG_*FLAGS for clang only flags.
2014-09-05 02:34:31 +00:00
Chih-Hung Hsieh
9aa69a6752 Add LOCAL_CLANG_*FLAGS for clang only flags.
To be used only for some modules.

Change-Id: I107ec37f11f738f860598f0c86c4ad7ec20c9011
2014-09-04 18:43:16 -07:00
Tim Murray
3a20a17111 am 965fa22d: am 039cd7e0: Merge "Add LOCAL_NO_FPIE."
* commit '965fa22d85aa1af3974c5f32e3c3325e66781f73':
  Add LOCAL_NO_FPIE.
2014-09-03 23:07:46 +00:00
Tim Murray
595d0dbd5b Add LOCAL_NO_FPIE.
Not all executables should be built with -pie.

bug 15814177

Change-Id: I402e8a531866b507ee80a0bf677f9f3551ca7693
2014-09-03 15:39:50 -07:00
Ying Wang
1425e2d8c0 Support LOCAL_PACKAGE_SPLITS.
Support LOCAL_PACKAGE_SPLITS, which accepts a list of resource lables
and generates multiple apks. The build system sets up rules to sign and
zipalign the split apks.

Bug: 16319961
Change-Id: I344b3d1c7eb158c6d0df879093d666a89870aadd
2014-07-22 17:37:11 -07:00
Ying Wang
f951b7743f am 1c00c702: am 45322890: am d2aa51b8: Merge "Clean the last bit of LOCAL_BUILD_HOST_DEX."
* commit '1c00c7026c23967ca33524356dc11d9885f960f9':
  Clean the last bit of LOCAL_BUILD_HOST_DEX.
2014-07-08 00:31:00 +00:00
Ying Wang
1c00c7026c am 45322890: am d2aa51b8: Merge "Clean the last bit of LOCAL_BUILD_HOST_DEX."
* commit '45322890266c1d704b130fabd7ee5bab5db35997':
  Clean the last bit of LOCAL_BUILD_HOST_DEX.
2014-07-08 00:26:10 +00:00
Ying Wang
f25318a5f9 Clean the last bit of LOCAL_BUILD_HOST_DEX.
Long live LOCAL_BUILD_HOST_DEX!

Change-Id: I8de23cfc78edc554606a2e1a8a955e8bc3ad02b0
2014-07-07 17:15:38 -07:00
Ying Wang
904446ce0b am 1a3d260f: am e69d4350: Merge "Support to add JNI of both archs in multilib build."
* commit '1a3d260f68755b476aa867477fc75d47ef5317bf':
  Support to add JNI of both archs in multilib build.
2014-06-25 18:46:34 +00:00
Ying Wang
58f8cf7273 am 904446ce: am 1a3d260f: am e69d4350: Merge "Support to add JNI of both archs in multilib build."
* commit '904446ce0b3f430ac88ae0c08b9c613721474cd5':
  Support to add JNI of both archs in multilib build.
2014-06-25 18:52:02 +00:00
Ying Wang
8e20ef6205 Support to add JNI of both archs in multilib build.
Use "LOCAL_MULTILIB := both" to install jni libraries of both archs in
multilib build.
The build system will package jni of both archs to the apk, or install
them to the right location on the system image and create symlinks,
extract .so files from prebuilt apk, etc if appropriate.

Bug: 15849902
Change-Id: I7e147b5a47db476584c38250de7b36c75ea40d81
2014-06-25 09:07:01 -07:00
Ying Wang
274ad525c1 am 32aff808: am 6bfbfee5: am a45a5d27: Merge "Set default LOCAL_MULTILIB only if LOCAL_MODULE_HOST_ARCH isn\'t restricted"
* commit '32aff8085a2f5fed34a4d28b78bb52a10a5b5751':
  Set default LOCAL_MULTILIB only if LOCAL_MODULE_HOST_ARCH isn't restricted
2014-06-11 20:49:37 +00:00
Ying Wang
32aff8085a am 6bfbfee5: am a45a5d27: Merge "Set default LOCAL_MULTILIB only if LOCAL_MODULE_HOST_ARCH isn\'t restricted"
* commit '6bfbfee5358715933fa90cc3ecd8fcf43338315b':
  Set default LOCAL_MULTILIB only if LOCAL_MODULE_HOST_ARCH isn't restricted
2014-06-10 23:32:41 +00:00
Ying Wang
6e85f8b0de Set default LOCAL_MULTILIB only if LOCAL_MODULE_HOST_ARCH isn't restricted
Otherwise we may end up conflict between LOCAL_MODULE_HOST_ARCH and the
default multilib mode.
Also removed the unneeded variants of LOCAL_MODULE_HOST_ARCH.

Change-Id: I9e5a0144da3cb6310be0ddf098738987e51305de
2014-06-10 16:24:31 -07:00
Ying Wang
9df5043594 resolved conflicts for merge of 536d4a76 to master
Change-Id: Ib655d08e5c9272aef1fd1e130b5fb2b63148a55e
2014-05-28 11:05:47 -07:00
Ying Wang
536d4a761b am 7e4c73d5: am aae7e3fa: Merge "Support LOCAL_CLANG with arch/bit suffix."
* commit '7e4c73d5885402f5c301309094ce3dbceef0ecd3':
  Support LOCAL_CLANG with arch/bit suffix.
2014-05-28 16:18:56 +00:00
Ying Wang
7e4c73d588 am aae7e3fa: Merge "Support LOCAL_CLANG with arch/bit suffix."
* commit 'aae7e3fa66ecf6bf796ba9a107d8f066498ab10b':
  Support LOCAL_CLANG with arch/bit suffix.
2014-05-28 16:14:54 +00:00
Ying Wang
824344af00 Support LOCAL_CLANG with arch/bit suffix.
Precedence: LOCAL_CLANG_<arch> > LOCAL_CLANG_<32|64> > LOCAL_CLANG.

Bug: 15257067
Change-Id: I86b72f3bec162834591287d3b5231b5f40f9a431
2014-05-27 13:06:08 -07:00
Jeff Brown
4c4aa99ced Support more precise package exclusion from JAR files.
Allow LOCAL_JAR_PACKAGES to work on subpackages.  Previously it
only worked on top-level packages due to a bug in how the directories
were recursively deleted.

Add LOCAL_JAR_EXCLUDE_PACKAGES to allow specific subpackages to
be excluded.  This rule applies after LOCAL_JAR_PACKAGES has
selected which packages to include.  It may also be used independently.

Change-Id: Ibd0e495be1a20c84b59c9da132e92100ef3f8705
2014-05-23 18:41:19 -07:00
Ying Wang
2f4c0a8617 am 8a724260: am 4e151105: Merge "Support to extract JNI libs from prebuilt APK"
* commit '8a724260f2a3900808e0e733b893a37c119fe3f1':
  Support to extract JNI libs from prebuilt APK
2014-05-21 01:10:15 +00:00
Ying Wang
8a724260f2 am 4e151105: Merge "Support to extract JNI libs from prebuilt APK"
* commit '4e151105a02ba09acb277c6a084252d01c561a5f':
  Support to extract JNI libs from prebuilt APK
2014-05-21 01:06:03 +00:00
Ying Wang
7cf9f28b5f Support to extract JNI libs from prebuilt APK
Use LOCAL_PREBUILT_JNI_LIBS to install prebuilt JNI libraries extracted
from the prebuilt apk, or prebuilts as source, to the app specific lib path.
LOCAL_PREBUILT_JNI_LIBS accepts 2 kinds of files:
- Files like @path/to/libfoo.so (path inside the apk) are JNI libs
  extracted from the prebuilt apk. In this case, all embedded JNI libs
  inside the prebuilt apk are stripped.
- Files like path/to/libfoo.so (path relative to LOCAL_PATH) are
  prebuilts in the source tree.

Those prebuilt JNI libs are not defined as modules in the build system,
so this works around possible module name conflict.

Bug: 13170859
Change-Id: I91bb844cc11b3621a85733bc7e8910f168957ef0
2014-05-20 18:02:17 -07:00
Brian Carlstrom
8d422a3a0b am 8074ff4d: am a8355eca: am 64f3a191: Merge "Multilib support for odex"
* commit '8074ff4d0f962a933586b9809d1f1bdffe1fe5ed':
  Multilib support for odex
2014-05-19 17:04:54 +00:00
Brian Carlstrom
8074ff4d0f am a8355eca: am 64f3a191: Merge "Multilib support for odex"
* commit 'a8355ecaadf9a0d052165d0cc14564927eb9a202':
  Multilib support for odex
2014-05-19 16:59:16 +00:00
Brian Carlstrom
a8355ecaad am 64f3a191: Merge "Multilib support for odex"
* commit '64f3a191f92a6ab84a8175ad480633b8c58ac900':
  Multilib support for odex
2014-05-19 16:53:35 +00:00
Ying Wang
b9aa5d43de Multilib support for odex
If the VM is libart and DEXPREOPT is enabled,
- For a Java library and the boot image, we build for both 1st arch and
  2nd arch.
- For an app, we build for the multilib arch the module is targeted for.
The odex file will be in <arch_name>/<module_name>.odex inside the same
dir where the jar/apk file gets installed.
Nothing changed if it's built for libdvm.

Bug: 14694978
Change-Id: I45118a83758b41d52d6c9e38f93f0ba2775a6c74
2014-05-18 22:04:58 -07:00
Ying Wang
8200231ae1 am e50f2d9f: am 40b49d30: am a74ade94: Merge "Support host multilib build"
* commit 'e50f2d9f32a27d8290692dbf99ab8b247ef9d553':
  Support host multilib build
2014-05-15 01:09:49 +00:00
Ying Wang
e50f2d9f32 am 40b49d30: am a74ade94: Merge "Support host multilib build"
* commit '40b49d3043bd41ca5548b99b537038187fdca258':
  Support host multilib build
2014-05-15 00:44:53 +00:00
Ying Wang
40b49d3043 am a74ade94: Merge "Support host multilib build"
* commit 'a74ade945776e80f99f3b05d06a131cfd353c3f6':
  Support host multilib build
2014-05-15 00:41:37 +00:00
Ying Wang
6feb6d5607 Support host multilib build
This change basically ported our target multilib to the host side.
It supports 2 host build modes: x86 and x86_64 multilib build.
For now you need to set "BUILD_HOST_64bit=true" to switch to x86_64
multilib build. Later we'll default to x86_64 build and have a flag
to force 32-bit only build, which may be needed by SDK build.

In host module definition, like in target ones, you can use the
following
LOCAL variables to set up multilib configuration:
LOCAL_MULTILIB: can be "both", "first", "32" or "64".
It also supports the same set of arch or 32-vs-64 specific LOCAL
variables.
By default, it builds only for the first arch.

To keep path compatibility, in x86_64 build files are still output to
out/host/linux-x86; Both 32-bit and 64-bit executables are in
out/host/linux-86/bin;
In x86_64 build 32-bit shared libraries are installed to
out/host/linux-x86/lib32
and 64-bit shared libraries are installed to out/host/linux-x86/lib;
32-bit object files are output to out/host/linux-x86/obj32 and 64-bit
object files
are output to out/host/linux-x86/obj.

Bug: 13751317
Change-Id: I6044f83b7db369a33e05209e8c588eb6dc83409f
2014-05-14 16:55:04 -07:00
Ying Wang
1ba08f6b7c am 2d41656c: am f6603f75: Merge "Add tool to package up built modules."
* commit '2d41656cdb41853e42a7ea2c0597ce505ef51750':
  Add tool to package up built modules.
2014-05-09 00:10:43 +00:00
Ying Wang
2d41656cdb am f6603f75: Merge "Add tool to package up built modules."
* commit 'f6603f753d492823e19d0677d5a9ccfc16f51805':
  Add tool to package up built modules.
2014-05-09 00:06:35 +00:00
Ying Wang
989ac38d93 Add tool to package up built modules.
With this change, you can package up modules while avoiding installing
them to the system.img or userdata.img.
- build/core/tasks/tools/package-modules.mk
  You can use this template to package up modules into a zip file and
  preserve the installed file paths.
- LOCAL_PICKUP_FILES, you can use this variable to package up extra
  files/directories.

Bug: 13585955
Change-Id: I103042b24ccf17cf5dc90c016d97ed1dd293e50b
2014-05-08 17:01:06 -07:00
Ying Wang
3b81aabbd0 Add tool to package up built modules.
With this change, you can package up modules while avoiding installing
them to the system.img or userdata.img.
- build/core/tasks/tools/package-modules.mk
  You can use this template to package up modules into a zip file and
  preserve the installed file paths.
- LOCAL_PICKUP_FILES, you can use this variable to package up extra
  files/directories.

Bug: 13585955
Change-Id: I103042b24ccf17cf5dc90c016d97ed1dd293e50b
2014-05-05 16:46:52 -07:00
Bill Yi
1e4adfa837 Merge commit '8113e43601aac7702b9ec007e81a179826143d1e' into HEAD 2014-04-29 11:32:53 -07:00
Ying Wang
b8888432f0 Set up rules to build oem.img
To build oem.img:
- You must define BOARD_OEMIMAGE_PARTITION_SIZE in your BoardConfig.mk
- The file system type will be the same as system.img and userdata.img.
- To install a module to oem.img, use "LOCAL_OEM_MODULE := true"
- run "make -j48 showcommands oem_image dist". By default it's not
  built.

Bug: 13367676
Change-Id: I1a26d4d0c61b72ecffe60279667b1b3de050780d
2014-04-28 09:43:51 -07:00
Ying Wang
74eb6600b4 Support to extract JNI libs from prebuilt APK
Use LOCAL_PREBUILT_JNI_LIBS to install prebuilt JNI libraries extracted
from the prebuilt apk, or prebuilts as source, to the app specific lib path.
LOCAL_PREBUILT_JNI_LIBS accepts 2 kinds of files:
- Files like @path/to/libfoo.so (path inside the apk) are JNI libs
  extracted from the prebuilt apk. In this case, all embedded JNI libs
  inside the prebuilt apk are stripped.
- Files like path/to/libfoo.so (path relative to LOCAL_PATH) are
  prebuilts in the source tree.

Those prebuilt JNI libs are not defined as modules in the build system,
so this works around possible module name conflict.

Bug: 13170859
Change-Id: I91bb844cc11b3621a85733bc7e8910f168957ef0
2014-04-18 20:13:41 -07:00
Colin Cross
87cf2b5bec am 25313cd3: am 59cc3f5d: am 5b1fa1c8: Merge "build: remove LOCAL_NO_2ND_ARCH"
* commit '25313cd32a78108945d65144399fc292350e9e0a':
  build: remove LOCAL_NO_2ND_ARCH
2014-04-12 00:12:20 +00:00