Skip to content
Browse files

Prelink libraries while installing.

  • Loading branch information...
1 parent 4ecded7 commit e23e7cee55bfda8c391c4f9cecdeab96f4f4660f ting-yuan committed
Showing with 25 additions and 1 deletion.
  1. +20 −1 Android.mk
  2. +5 −0 default-gecko-config
View
21 Android.mk
@@ -149,7 +149,17 @@ ifeq ($(B2G_SYSTEM_APPS),1)
PRESERVE_B2G_WEBAPPS := 1
endif
-$(LOCAL_INSTALLED_MODULE): $(LOCAL_BUILT_MODULE) gaia/profile.tar.gz
+ifeq ($(ENABLE_GLOBAL_PRELINK),1)
+APRIORI := $(HOST_OUT_EXECUTABLES)/apriori$(HOST_EXECUTABLE_SUFFIX)
+PRELINK_MAP := $(abspath $(LOCAL_PATH)/prelink.map)
+ifeq ($(MOZ_DMD),1)
+PRELOAD_LIBS := -Dlibmozglue.so -Dlibdmd.so
+else
+PRELOAD_LIBS := -Dlibmozglue.so
+endif
+endif
+
+$(LOCAL_INSTALLED_MODULE): $(LOCAL_BUILT_MODULE) gaia/profile.tar.gz $(APRIORI) $(PRELINK_MAP)
@echo Install dir: $(TARGET_OUT)/b2g
ifeq ($(PRESERVE_B2G_WEBAPPS), 1)
@@ -170,6 +180,15 @@ endif
cd $(TARGET_OUT) && tar xvfz $(abspath $<)
+ifeq ($(ENABLE_GLOBAL_PRELINK),1)
+ $(APRIORI) \
+ $(PRELOAD_LIBS) \
+ -L$(TARGET_OUT_SHARED_LIBRARIES) \
+ -L$(TARGET_OUT)/b2g \
+ -p $(PRELINK_MAP) \
+ `find $(TARGET_OUT)/b2g -name "lib*.so"`
+endif
+
# Target to create Gecko update package (MAR)
DIST_B2G_UPDATE_DIR := $(GECKO_OBJDIR)/dist/b2g-update
UPDATE_PACKAGE_TARGET := $(DIST_B2G_UPDATE_DIR)/b2g-gecko-update.mar
View
5 default-gecko-config
@@ -60,3 +60,8 @@ ac_add_options --disable-ion
if [ "${MOZ_DMD:-0}" != 0 ]; then
ac_add_options --enable-dmd
fi
+
+if [ "${ENABLE_GLOBAL_PRELINK:-0}" != 0 ]; then
+# Disable ELF_HACK on B2G for prelink.
+ac_add_options --disable-elf-hack
+fi

0 comments on commit e23e7ce

Please sign in to comment.
Something went wrong with that request. Please try again.