system/corennnnn
修订版 | c45e40ff18445bff25be6ad0562c97acf557ef44 (tree) |
---|---|
时间 | 2016-09-04 08:46:51 |
作者 | David Ng <dave@code...> |
Commiter | Steve Kondik |
Add optional target-specific LD_PRELOAD to environment
Append additional libraries defined in TARGET_LDPRELOAD to the
LD_PRELOAD environment if it is defined.
Conflicts:
Change-Id: I15f083df87605d2b708b56311430e11409a09dd7
@@ -78,16 +78,21 @@ endif | ||
78 | 78 | |
79 | 79 | include $(BUILD_SYSTEM)/base_rules.mk |
80 | 80 | |
81 | -# Regenerate init.environ.rc if PRODUCT_BOOTCLASSPATH has changed. | |
82 | -bcp_md5 := $(word 1, $(shell echo $(PRODUCT_BOOTCLASSPATH) $(PRODUCT_SYSTEM_SERVER_CLASSPATH) | $(MD5SUM))) | |
81 | +# Regenerate init.environ.rc if PRODUCT_BOOTCLASSPATH or TARGET_LDPRELOAD has changed. | |
82 | +bcp_md5 := $(word 1, $(shell echo $(PRODUCT_BOOTCLASSPATH) $(PRODUCT_SYSTEM_SERVER_CLASSPATH) $(TARGET_LDPRELOAD) | $(MD5SUM))) | |
83 | 83 | bcp_dep := $(intermediates)/$(bcp_md5).bcp.dep |
84 | 84 | $(bcp_dep) : |
85 | 85 | $(hide) mkdir -p $(dir $@) && rm -rf $(dir $@)*.bcp.dep && touch $@ |
86 | 86 | |
87 | +ifneq ($(strip $(TARGET_LDPRELOAD)),) | |
88 | + TARGET_LDPRELOAD_STR := :$(TARGET_LDPRELOAD) | |
89 | +endif | |
90 | + | |
87 | 91 | $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/init.environ.rc.in $(bcp_dep) |
88 | 92 | @echo "Generate: $< -> $@" |
89 | 93 | @mkdir -p $(dir $@) |
90 | - $(hide) sed -e 's?%BOOTCLASSPATH%?$(PRODUCT_BOOTCLASSPATH)?g' $< >$@ | |
94 | + $(hide) sed -e 's?%BOOTCLASSPATH%?$(PRODUCT_BOOTCLASSPATH)?g'\ | |
95 | + -e 's?%TARGET_LDPRELOAD%?$(TARGET_LDPRELOAD_STR)?g' $< >$@ | |
91 | 96 | $(hide) sed -i -e 's?%SYSTEMSERVERCLASSPATH%?$(PRODUCT_SYSTEM_SERVER_CLASSPATH)?g' $@ |
92 | 97 | $(hide) sed -i -e 's?%EXPORT_GLOBAL_ASAN_OPTIONS%?$(EXPORT_GLOBAL_ASAN_OPTIONS)?g' $@ |
93 | 98 |
@@ -9,4 +9,5 @@ on init | ||
9 | 9 | export ASEC_MOUNTPOINT /mnt/asec |
10 | 10 | export BOOTCLASSPATH %BOOTCLASSPATH% |
11 | 11 | export SYSTEMSERVERCLASSPATH %SYSTEMSERVERCLASSPATH% |
12 | + export LD_PRELOAD libsigchain.so%TARGET_LDPRELOAD% | |
12 | 13 | %EXPORT_GLOBAL_ASAN_OPTIONS% |