Commit graph

265 commits

Author SHA1 Message Date
Narayan Kamath
e886392c37 am 37a44faa: Merge "Store native libs aligned to PAGE_SIZE"
* commit '37a44faa7266c8a7e0cc5077a4c028d6f5bfa7f7':
  Store native libs aligned to PAGE_SIZE
2015-02-26 12:45:34 +00:00
Dmitriy Ivanov
13e5965306 Store native libs aligned to PAGE_SIZE
- Add a new flag to zipalign (-p) that page aligns shared
  libraries (zip entries ending with ".so") in the archive.

- Add a new build variable LOCAL_PAGE_ALIGN_SHARED_LIBRARIES
  to turn on this behaviour in zipalign.

- Add a new LOCAL_JNI_SHARED_LIBRARIES_ZIP_OPTIONS to control
  zip behaviour.

Bug: 8076853
Bug: 19330157

Co-Authored-By: Simon Baldwin <simonb@google.com>
Co-Authored-By: Dimitry Ivanov <dimitry@google.com>
Change-Id: I1aa2c039bb2a590ae72f256acc9ba5401c2c59b1
2015-02-26 12:31:40 +00:00
Ying Wang
7c05897b69 am e937ac81: Merge "Add new build flag LOCAL_DONT_DELETE_JAR_DIRS."
* commit 'e937ac814c7f4e1989509f94f7ac8ae5b28a3526':
  Add new build flag LOCAL_DONT_DELETE_JAR_DIRS.
2015-01-29 18:05:13 +00:00
Fredrik Roubert
cc93f0c87c Add new build flag LOCAL_DONT_DELETE_JAR_DIRS.
Normally the build function initialize-package-file will delete all
class files and all directory entries from JAR files, but sometimes
external projects (eg. ICU4J) depend on having directory entries in
their JAR files.

This change adds the flag LOCAL_DONT_DELETE_JAR_DIRS (analogous to the
flag LOCAL_DONT_DELETE_JAR_META_INF) which when set will skip deletion
of directory entries in initialize-package-file.

Change-Id: I4464b947b7528fca23925affa95e4071915f04d4
2015-01-29 17:44:27 +00:00
Stephen Hines
b2f5510365 am 4bad2d21: Merge "Add more support for GLOBAL_CONLYFLAGS."
* commit '4bad2d2156bcb589c2d1bb223a074edc39aa428c':
  Add more support for GLOBAL_CONLYFLAGS.
2014-12-02 18:52:12 +00:00
Stephen Hines
1568029218 Add more support for GLOBAL_CONLYFLAGS.
This will be necessary to support -std=gnu99 mode for clang 3.6, which
defaults to C11 mode (unlike prior releases that use C99).

Change-Id: Iea84582f9f12ba76b988463cbc0a20bd61042538
2014-12-01 15:36:26 -08:00
Ying Wang
0217e3b20b resolved conflicts for merge of a4f415d6 to lmp-mr1-dev-plus-aosp
Change-Id: Ibb54bce20342bd386ec85388d48c1c08e8b80197
2014-11-18 16:28:04 -08:00
Ying Wang
a4f415d65e am ea4dfb75: Merge "Support prebuilt apk source selection based on PRODUCT_AAPT_PREF_CONFIG" into lmp-mr1-dev
* commit 'ea4dfb7551e680f7496e1d35c05bdad10ca58b4a':
  Support prebuilt apk source selection based on PRODUCT_AAPT_PREF_CONFIG
2014-11-19 00:23:00 +00:00
Ying Wang
43f7a3226a Support prebuilt apk source selection based on PRODUCT_AAPT_PREF_CONFIG
Two new LOCAL variables are added to support dpi-specific prebuilt apk
selection:
- LOCAL_DPI_VARIANTS: specify a list of dpis the module provides with
  specific prebuilt.
  Example: LOCAL_DPI_VARIANTS := xxhdpi xhdpi hdpi mdpi
- LOCAL_DPI_FILE_STEM: specify the dpi-specific source file name
  pattern.
  Example: LOCAL_DPI_FILE_STEM := MyApp-%.apk
  "%" will be substitued by $(PRODUCT_AAPT_PREF_CONFIG) in the core
  build system.
  If you don't set up LOCAL_DPI_FILE_STEM, the default is
  $(LOCAL_MODULE)_%.apk.

The build system searches $(PRODUCT_AAPT_PREF_CONFIG) in a prebuilt apk
module's $(LOCAL_DPI_VARIANTS). If not found, use whatever
$(LOCAL_SRC_FILES) as the source file; Otherwise use $(LOCAL_DPI_FILE_STEM)
to construct the dpi-specific apk's source file name, and use whatever
directory name of $(LOCAL_SRC_FILES).

Bug: 18388705
Change-Id: I63cae73f1b6f880302142abc476b3ce1fb5500b5
2014-11-17 17:05:27 -08:00
Ying Wang
007026f0eb am 3fe170c5: Merge "Add support for prebuilt AARs." into lmp-mr1-ub-dev
* commit '3fe170c51ea1eca253164fa8738ab42b5b9aaa6b':
  Add support for prebuilt AARs.
2014-11-03 18:07:45 +00:00
Nick Kralevich
0a5105bd25 am e4cbc2af: Merge "Revert "Add support for prebuilt AARs."" into lmp-mr1-ub-dev
* commit 'e4cbc2af5f476d9eb875253584260bed807acddf':
  Revert "Add support for prebuilt AARs."
2014-11-02 16:53:29 +00:00
Ying Wang
e9dd9f2bfc Add support for prebuilt AARs.
- You can give a .aar as source file to a prebuilt static Java library
  module. The build system will set up dependencies and rules to extract
  classes.jar and other resource files.
- To build against a prebuilt AAR module, use:
  LOCAL_STATIC_JAVA_AAR_LIBRARIES := <module names of aar prebuilt AARs>
  The build system will set up rules to merge the library's
  AndroidManifest.xml with the main AndroidManifest.xml, add the AAR's
  resource dirs and link/merge the AAR's classes.jar.

Bug: 18168693
Change-Id: Ic2c1d20572a93bd98dbc72f8a39e26b459e442c2
2014-11-02 16:51:49 +00:00
Nick Kralevich
e4cbc2af5f Merge "Revert "Add support for prebuilt AARs."" into lmp-mr1-ub-dev 2014-11-02 05:15:26 +00:00
Nick Kralevich
bcf8683b29 Revert "Add support for prebuilt AARs."
master doesn't compile anymore.

This reverts commit f567292504.

Change-Id: Icc16fe5360d1222740b803e9dd006081e3c66e46
2014-11-02 05:11:11 +00:00
Ying Wang
5ba418c00a am be6a3db2: Merge "Introduce per-product per-module dex-preopt config" into lmp-mr1-dev
* commit 'be6a3db20b5d2242bc3b459c5b69b1d8ef86aa54':
  Introduce per-product per-module dex-preopt config
2014-10-31 21:48:56 +00:00
Ying Wang
70d617aaf5 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
(cherry picked from commit 20ebd2ef08)

Change-Id: I2ee36892b40655c96837ee7a663dda1d25830878
2014-10-31 10:12:54 -07:00
Ying Wang
4ef8133a42 am f5672925: Add support for prebuilt AARs.
* commit 'f56729250448200834c5c95c86c937e887d73623':
  Add support for prebuilt AARs.
2014-10-31 00:13:50 +00:00
Ying Wang
f567292504 Add support for prebuilt AARs.
- You can give a .aar as source file to a prebuilt static Java library
  module. The build system will set up dependencies and rules to extract
  classes.jar and other resource files.
- To build against a prebuilt AAR module, use:
  LOCAL_STATIC_JAVA_AAR_LIBRARIES := <module names of aar prebuilt AARs>
  The build system will set up rules to merge the library's
  AndroidManifest.xml with the main AndroidManifest.xml, add the AAR's
  resource dirs and link/merge the AAR's classes.jar.

Bug: 18168693
Change-Id: I478913d5d498f800b322529d7c2c2c0ea78425e5
2014-10-29 23:40:52 +00:00
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
8755756f26 resolved conflicts for merge of 3907c03e to lmp-dev-plus-aosp
Change-Id: I580ab0693609ff506da7346548a45322000114d1
2014-10-09 19:29:53 -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
eca4ce832e am 14012488: am 09cdd500: Merge "Clear all LOCAL_CLANG_*FLAGS*."
* commit '140124884050264721e22cb08f713a7da76b36d4':
  Clear all LOCAL_CLANG_*FLAGS*.
2014-09-30 23:52:08 +00: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
1184754c22 am b9b2d21c: am 4a8d5c1a: Merge "Add local Clang+target specific flags."
* commit 'b9b2d21c04d0ba65ad56a26f8306e9afa7d99694':
  Add local Clang+target specific flags.
2014-09-27 02:59:47 +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
7655a97984 resolved conflicts for merge of 326f9450 to lmp-dev-plus-aosp
Change-Id: I66360da623a6e7ac04610c3252f24ed69f7e4b1e
2014-09-24 09:42:39 -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
220b01ba27 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:16:16 +00: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