summaryrefslogtreecommitdiffstats
path: root/core/dex_preopt_odex_install.mk
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2014-10-30 16:08:07 -0700
committerAndreas Gampe <agampe@google.com>2014-11-18 14:58:48 -0800
commit97f28c63d448bcf41366fb15bc10d412a1e7d59e (patch)
tree27ce7c022cd034c64e9c3ea7634aef4692c426f7 /core/dex_preopt_odex_install.mk
parent39961b926e637fd29cc6a32d956553c59c65e37c (diff)
downloadbuild-97f28c63d448bcf41366fb15bc10d412a1e7d59e.zip
build-97f28c63d448bcf41366fb15bc10d412a1e7d59e.tar.gz
build-97f28c63d448bcf41366fb15bc10d412a1e7d59e.tar.bz2
core: Use WITH_DEXPREOPT_PIC=true to have dex2oat build pic oat files
When WITH_DEXPREOPT=true is set, if we also set WITH_DEXPREOPT_PIC=true then the build will generate position-independent OAT images. This means that all the system applications no longer need to be relocated into /data/dalvik-cache and this can achieve saving disk space at the cost of slightly slower running code. Bug: 18035729 (cherry picked from commit da9f1a7e82b7e6d0677553f211835625078347f2) Change-Id: Ifd517c842f48bf31568bf5ff56667298d422c2c0
Diffstat (limited to 'core/dex_preopt_odex_install.mk')
-rw-r--r--core/dex_preopt_odex_install.mk6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk
index 90ae08f..cb38261 100644
--- a/core/dex_preopt_odex_install.mk
+++ b/core/dex_preopt_odex_install.mk
@@ -105,6 +105,12 @@ ifndef LOCAL_DEX_PREOPT_FLAGS
LOCAL_DEX_PREOPT_FLAGS := $(PRODUCT_DEX_PREOPT_DEFAULT_FLAGS)
endif
endif
+
+# Compile apps with position-independent code if WITH_DEXPREOPT_PIC=true
+ifeq (true,$(WITH_DEXPREOPT_PIC))
+ LOCAL_DEX_PREOPT_FLAGS += --compile-pic
+endif
+
$(built_odex): PRIVATE_DEX_PREOPT_FLAGS := $(LOCAL_DEX_PREOPT_FLAGS)
# Use pattern rule - we may have multiple installed odex files.