The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 1 | LOCAL_PATH:= $(call my-dir) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 2 | |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 3 | ####################################### |
| 4 | # init.rc |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 5 | include $(CLEAR_VARS) |
| 6 | |
| 7 | LOCAL_MODULE := init.rc |
| 8 | LOCAL_SRC_FILES := $(LOCAL_MODULE) |
| 9 | LOCAL_MODULE_CLASS := ETC |
| 10 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
| 11 | |
| 12 | include $(BUILD_PREBUILT) |
Evgenii Stepanov | 0d2dde5 | 2015-08-07 17:04:37 -0700 | [diff] [blame] | 13 | |
| 14 | ####################################### |
Mark Salyzyn | 7864e36 | 2016-01-28 09:32:53 -0800 | [diff] [blame] | 15 | # init-debug.rc |
| 16 | include $(CLEAR_VARS) |
| 17 | |
| 18 | LOCAL_MODULE := init-debug.rc |
| 19 | LOCAL_SRC_FILES := $(LOCAL_MODULE) |
| 20 | LOCAL_MODULE_CLASS := ETC |
| 21 | LOCAL_MODULE_TAGS := debug |
| 22 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/init |
| 23 | |
| 24 | include $(BUILD_PREBUILT) |
| 25 | |
| 26 | ####################################### |
Evgenii Stepanov | 0d2dde5 | 2015-08-07 17:04:37 -0700 | [diff] [blame] | 27 | # asan.options |
Ivan Krasin | 5039d8c | 2015-09-18 11:59:46 -0700 | [diff] [blame] | 28 | ifneq ($(filter address,$(SANITIZE_TARGET)),) |
Andreas Gampe | 8ccc1ad | 2016-06-22 20:05:59 -0700 | [diff] [blame] | 29 | |
Evgenii Stepanov | 0d2dde5 | 2015-08-07 17:04:37 -0700 | [diff] [blame] | 30 | include $(CLEAR_VARS) |
| 31 | |
| 32 | LOCAL_MODULE := asan.options |
| 33 | LOCAL_MODULE_CLASS := ETC |
| 34 | LOCAL_SRC_FILES := $(LOCAL_MODULE) |
| 35 | LOCAL_MODULE_PATH := $(TARGET_OUT) |
| 36 | |
| 37 | include $(BUILD_PREBUILT) |
Andreas Gampe | 8ccc1ad | 2016-06-22 20:05:59 -0700 | [diff] [blame] | 38 | |
Andreas Gampe | df5496a | 2017-03-21 19:36:48 -0700 | [diff] [blame] | 39 | # ASAN extration. |
| 40 | ASAN_EXTRACT_FILES := |
| 41 | ifeq ($(SANITIZE_TARGET_SYSTEM),true) |
| 42 | include $(CLEAR_VARS) |
| 43 | LOCAL_MODULE:= asan_extract |
| 44 | LOCAL_MODULE_TAGS := optional |
| 45 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 46 | LOCAL_SRC_FILES := asan_extract.sh |
| 47 | LOCAL_INIT_RC := asan_extract.rc |
| 48 | # We need bzip2 on device for extraction. |
| 49 | LOCAL_REQUIRED_MODULES := bzip2 |
| 50 | include $(BUILD_PREBUILT) |
| 51 | ASAN_EXTRACT_FILES := asan_extract |
| 52 | endif |
| 53 | |
Evgenii Stepanov | 0d2dde5 | 2015-08-07 17:04:37 -0700 | [diff] [blame] | 54 | endif |
| 55 | |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 56 | ####################################### |
| 57 | # init.environ.rc |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 58 | |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 59 | include $(CLEAR_VARS) |
| 60 | LOCAL_MODULE_CLASS := ETC |
| 61 | LOCAL_MODULE := init.environ.rc |
| 62 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
Colin Cross | 44b65d0 | 2010-04-20 14:32:50 -0700 | [diff] [blame] | 63 | |
Evgenii Stepanov | 0d2dde5 | 2015-08-07 17:04:37 -0700 | [diff] [blame] | 64 | EXPORT_GLOBAL_ASAN_OPTIONS := |
Ivan Krasin | 5039d8c | 2015-09-18 11:59:46 -0700 | [diff] [blame] | 65 | ifneq ($(filter address,$(SANITIZE_TARGET)),) |
Evgenii Stepanov | 0d2dde5 | 2015-08-07 17:04:37 -0700 | [diff] [blame] | 66 | EXPORT_GLOBAL_ASAN_OPTIONS := export ASAN_OPTIONS include=/system/asan.options |
Andreas Gampe | df5496a | 2017-03-21 19:36:48 -0700 | [diff] [blame] | 67 | LOCAL_REQUIRED_MODULES := asan.options $(ASAN_OPTIONS_FILES) $(ASAN_EXTRACT_FILES) |
Evgenii Stepanov | 0d2dde5 | 2015-08-07 17:04:37 -0700 | [diff] [blame] | 68 | endif |
Ryan Campbell | 0b36473 | 2017-02-21 17:27:02 -0800 | [diff] [blame] | 69 | |
| 70 | EXPORT_GLOBAL_GCOV_OPTIONS := |
| 71 | ifeq ($(NATIVE_COVERAGE),true) |
| 72 | EXPORT_GLOBAL_GCOV_OPTIONS := export GCOV_PREFIX /data/misc/gcov |
| 73 | endif |
| 74 | |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 75 | # Put it here instead of in init.rc module definition, |
| 76 | # because init.rc is conditionally included. |
| 77 | # |
Daniel Rosenberg | 595003a | 2015-07-28 15:14:39 -0700 | [diff] [blame] | 78 | # create some directories (some are mount points) and symlinks |
Daniel Rosenberg | 52b5915 | 2015-10-28 13:13:37 -0700 | [diff] [blame] | 79 | LOCAL_POST_INSTALL_CMD := mkdir -p $(addprefix $(TARGET_ROOT_OUT)/, \ |
Steve Muckle | 1a3e306 | 2018-01-04 08:42:15 -0800 | [diff] [blame] | 80 | sbin dev proc sys system data odm oem acct config storage mnt $(BOARD_ROOT_EXTRA_FOLDERS)); \ |
Elliott Hughes | ff1ef9f | 2017-12-06 08:59:02 -0800 | [diff] [blame] | 81 | ln -sf /system/bin $(TARGET_ROOT_OUT)/bin; \ |
Daniel Rosenberg | 595003a | 2015-07-28 15:14:39 -0700 | [diff] [blame] | 82 | ln -sf /system/etc $(TARGET_ROOT_OUT)/etc; \ |
Nick Kralevich | c4084c6 | 2016-11-19 12:09:33 -0800 | [diff] [blame] | 83 | ln -sf /data/user_de/0/com.android.shell/files/bugreports $(TARGET_ROOT_OUT)/bugreports; \ |
Daniel Rosenberg | 595003a | 2015-07-28 15:14:39 -0700 | [diff] [blame] | 84 | ln -sf /sys/kernel/debug $(TARGET_ROOT_OUT)/d; \ |
| 85 | ln -sf /storage/self/primary $(TARGET_ROOT_OUT)/sdcard |
Dan Willemsen | 0790431 | 2016-07-08 18:08:51 -0700 | [diff] [blame] | 86 | ifdef BOARD_USES_VENDORIMAGE |
Daniel Rosenberg | 52b5915 | 2015-10-28 13:13:37 -0700 | [diff] [blame] | 87 | LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/vendor |
Junichi Uekawa | 07b6996 | 2015-11-12 07:49:47 +0900 | [diff] [blame] | 88 | else |
| 89 | LOCAL_POST_INSTALL_CMD += ; ln -sf /system/vendor $(TARGET_ROOT_OUT)/vendor |
Daniel Rosenberg | 595003a | 2015-07-28 15:14:39 -0700 | [diff] [blame] | 90 | endif |
Jaekyun Seok | dff165d | 2017-11-28 12:10:10 +0900 | [diff] [blame] | 91 | ifdef BOARD_USES_PRODUCTIMAGE |
| 92 | LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/product |
| 93 | else |
| 94 | LOCAL_POST_INSTALL_CMD += ; ln -sf /system/product $(TARGET_ROOT_OUT)/product |
| 95 | endif |
Bowgo Tsai | 00749af | 2017-11-15 18:06:48 +0800 | [diff] [blame] | 96 | |
| 97 | # For /odm partition. |
| 98 | LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/odm |
| 99 | # For Treble Generic System Image (GSI), system-as-root GSI needs to work on |
| 100 | # both devices with and without /odm partition. Those symlinks are for devices |
| 101 | # without /odm partition. For devices with /odm partition, mount odm.img under |
| 102 | # /odm will hide those symlinks. |
| 103 | LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/app $(TARGET_ROOT_OUT)/odm/app |
| 104 | LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/bin $(TARGET_ROOT_OUT)/odm/bin |
| 105 | LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/etc $(TARGET_ROOT_OUT)/odm/etc |
| 106 | LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/firmware $(TARGET_ROOT_OUT)/odm/firmware |
| 107 | LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/framework $(TARGET_ROOT_OUT)/odm/framework |
| 108 | LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/lib $(TARGET_ROOT_OUT)/odm/lib |
| 109 | LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/lib64 $(TARGET_ROOT_OUT)/odm/lib64 |
| 110 | LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/overlay $(TARGET_ROOT_OUT)/odm/overlay |
| 111 | LOCAL_POST_INSTALL_CMD += ; ln -sf /vendor/odm/priv-app $(TARGET_ROOT_OUT)/odm/priv-app |
| 112 | |
Patrick Tjin | c6535a3 | 2016-05-13 14:22:14 -0700 | [diff] [blame] | 113 | ifdef BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE |
| 114 | LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/cache |
| 115 | else |
| 116 | LOCAL_POST_INSTALL_CMD += ; ln -sf /data/cache $(TARGET_ROOT_OUT)/cache |
| 117 | endif |
Daniel Rosenberg | 52b5915 | 2015-10-28 13:13:37 -0700 | [diff] [blame] | 118 | ifdef BOARD_ROOT_EXTRA_SYMLINKS |
| 119 | # BOARD_ROOT_EXTRA_SYMLINKS is a list of <target>:<link_name>. |
| 120 | LOCAL_POST_INSTALL_CMD += $(foreach s, $(BOARD_ROOT_EXTRA_SYMLINKS),\ |
| 121 | $(eval p := $(subst :,$(space),$(s)))\ |
| 122 | ; mkdir -p $(dir $(TARGET_ROOT_OUT)/$(word 2,$(p))) \ |
| 123 | ; ln -sf $(word 1,$(p)) $(TARGET_ROOT_OUT)/$(word 2,$(p))) |
| 124 | endif |
Alex Deymo | e120b47 | 2016-02-29 17:23:36 -0800 | [diff] [blame] | 125 | # The A/B updater uses a top-level /postinstall directory to mount the new |
| 126 | # system before reboot. |
| 127 | ifeq ($(AB_OTA_UPDATER),true) |
| 128 | LOCAL_POST_INSTALL_CMD += ; mkdir -p $(TARGET_ROOT_OUT)/postinstall |
| 129 | endif |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 130 | |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 131 | include $(BUILD_SYSTEM)/base_rules.mk |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 132 | |
Ying Wang | 7011a85 | 2014-06-14 09:11:02 -0700 | [diff] [blame] | 133 | # Regenerate init.environ.rc if PRODUCT_BOOTCLASSPATH has changed. |
Narayan Kamath | 1fabc35 | 2014-08-05 15:42:34 +0100 | [diff] [blame] | 134 | bcp_md5 := $(word 1, $(shell echo $(PRODUCT_BOOTCLASSPATH) $(PRODUCT_SYSTEM_SERVER_CLASSPATH) | $(MD5SUM))) |
Ying Wang | 7011a85 | 2014-06-14 09:11:02 -0700 | [diff] [blame] | 135 | bcp_dep := $(intermediates)/$(bcp_md5).bcp.dep |
| 136 | $(bcp_dep) : |
| 137 | $(hide) mkdir -p $(dir $@) && rm -rf $(dir $@)*.bcp.dep && touch $@ |
| 138 | |
| 139 | $(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/init.environ.rc.in $(bcp_dep) |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 140 | @echo "Generate: $< -> $@" |
| 141 | @mkdir -p $(dir $@) |
| 142 | $(hide) sed -e 's?%BOOTCLASSPATH%?$(PRODUCT_BOOTCLASSPATH)?g' $< >$@ |
Narayan Kamath | 1fabc35 | 2014-08-05 15:42:34 +0100 | [diff] [blame] | 143 | $(hide) sed -i -e 's?%SYSTEMSERVERCLASSPATH%?$(PRODUCT_SYSTEM_SERVER_CLASSPATH)?g' $@ |
Evgenii Stepanov | 1cbe3d9 | 2015-06-12 15:42:20 -0700 | [diff] [blame] | 144 | $(hide) sed -i -e 's?%EXPORT_GLOBAL_ASAN_OPTIONS%?$(EXPORT_GLOBAL_ASAN_OPTIONS)?g' $@ |
Ryan Campbell | 0b36473 | 2017-02-21 17:27:02 -0800 | [diff] [blame] | 145 | $(hide) sed -i -e 's?%EXPORT_GLOBAL_GCOV_OPTIONS%?$(EXPORT_GLOBAL_GCOV_OPTIONS)?g' $@ |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 146 | |
Ying Wang | 7011a85 | 2014-06-14 09:11:02 -0700 | [diff] [blame] | 147 | bcp_md5 := |
| 148 | bcp_dep := |
Jiyong Park | 450cff4 | 2017-04-05 14:24:14 +0900 | [diff] [blame] | 149 | |
Justin Yun | dd16301 | 2018-01-10 09:38:19 +0900 | [diff] [blame] | 150 | # If BOARD_VNDK_VERSION is defined, append PLATFORM_VNDK_VERSION to base name. |
| 151 | define append_vndk_version |
Justin Yun | 210ff94 | 2017-12-07 17:31:53 +0900 | [diff] [blame] | 152 | $(strip \ |
Justin Yun | dd16301 | 2018-01-10 09:38:19 +0900 | [diff] [blame] | 153 | $(if $(BOARD_VNDK_VERSION), \ |
| 154 | $(basename $(1)).$(PLATFORM_VNDK_VERSION)$(suffix $(1)), \ |
| 155 | $(1) \ |
Justin Yun | 210ff94 | 2017-12-07 17:31:53 +0900 | [diff] [blame] | 156 | ) \ |
| 157 | ) |
| 158 | endef |
| 159 | |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 160 | # Update namespace configuration file with library lists and VNDK version |
| 161 | # |
| 162 | # $(1): Input source file (ld.config.txt) |
| 163 | # $(2): Output built module |
| 164 | # $(3): VNDK version suffix |
Justin Yun | 8065a60 | 2018-02-14 14:07:59 +0900 | [diff] [blame] | 165 | # $(4): true if libz must be included in llndk not in vndk-sp |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 166 | define update_and_install_ld_config |
Justin Yun | 8065a60 | 2018-02-14 14:07:59 +0900 | [diff] [blame] | 167 | # If $(4) is true, move libz to llndk from vndk-sp. |
| 168 | $(if $(filter true,$(4)),\ |
| 169 | $(eval llndk_libraries_list := $(LLNDK_LIBRARIES) libz) \ |
| 170 | $(eval vndksp_libraries_list := $(filter-out libz,$(VNDK_SAMEPROCESS_LIBRARIES))),\ |
| 171 | $(eval llndk_libraries_list := $(LLNDK_LIBRARIES)) \ |
| 172 | $(eval vndksp_libraries_list := $(VNDK_SAMEPROCESS_LIBRARIES))) |
| 173 | |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 174 | llndk_libraries := $(call normalize-path-list,$(addsuffix .so,\ |
Justin Yun | 8065a60 | 2018-02-14 14:07:59 +0900 | [diff] [blame] | 175 | $(filter-out $(VNDK_PRIVATE_LIBRARIES),$(llndk_libraries_list)))) |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 176 | private_llndk_libraries := $(call normalize-path-list,$(addsuffix .so,\ |
Justin Yun | 8065a60 | 2018-02-14 14:07:59 +0900 | [diff] [blame] | 177 | $(filter $(VNDK_PRIVATE_LIBRARIES),$(llndk_libraries_list)))) |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 178 | vndk_sameprocess_libraries := $(call normalize-path-list,$(addsuffix .so,\ |
Justin Yun | 8065a60 | 2018-02-14 14:07:59 +0900 | [diff] [blame] | 179 | $(filter-out $(VNDK_PRIVATE_LIBRARIES),$(vndksp_libraries_list)))) |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 180 | vndk_core_libraries := $(call normalize-path-list,$(addsuffix .so,\ |
| 181 | $(filter-out $(VNDK_PRIVATE_LIBRARIES),$(VNDK_CORE_LIBRARIES)))) |
| 182 | sanitizer_runtime_libraries := $(call normalize-path-list,$(addsuffix .so,\ |
| 183 | $(ADDRESS_SANITIZER_RUNTIME_LIBRARY) \ |
| 184 | $(UBSAN_RUNTIME_LIBRARY) \ |
| 185 | $(TSAN_RUNTIME_LIBRARY) \ |
| 186 | $(2ND_ADDRESS_SANITIZER_RUNTIME_LIBRARY) \ |
| 187 | $(2ND_UBSAN_RUNTIME_LIBRARY) \ |
| 188 | $(2ND_TSAN_RUNTIME_LIBRARY))) |
| 189 | # If BOARD_VNDK_VERSION is not defined, VNDK version suffix will not be used. |
| 190 | vndk_version_suffix := $(if $(strip $(3)),-$(strip $(3))) |
| 191 | |
| 192 | $(2): PRIVATE_LLNDK_LIBRARIES := $$(llndk_libraries) |
| 193 | $(2): PRIVATE_PRIVATE_LLNDK_LIBRARIES := $$(private_llndk_libraries) |
| 194 | $(2): PRIVATE_VNDK_SAMEPROCESS_LIBRARIES := $$(vndk_sameprocess_libraries) |
| 195 | $(2): PRIVATE_VNDK_CORE_LIBRARIES := $$(vndk_core_libraries) |
| 196 | $(2): PRIVATE_SANITIZER_RUNTIME_LIBRARIES := $$(sanitizer_runtime_libraries) |
| 197 | $(2): PRIVATE_VNDK_VERSION := $$(vndk_version_suffix) |
| 198 | $(2): $(1) |
| 199 | @echo "Generate: $$< -> $$@" |
| 200 | @mkdir -p $$(dir $$@) |
| 201 | $$(hide) sed -e 's?%LLNDK_LIBRARIES%?$$(PRIVATE_LLNDK_LIBRARIES)?g' $$< >$$@ |
| 202 | $$(hide) sed -i -e 's?%PRIVATE_LLNDK_LIBRARIES%?$$(PRIVATE_PRIVATE_LLNDK_LIBRARIES)?g' $$@ |
| 203 | $$(hide) sed -i -e 's?%VNDK_SAMEPROCESS_LIBRARIES%?$$(PRIVATE_VNDK_SAMEPROCESS_LIBRARIES)?g' $$@ |
| 204 | $$(hide) sed -i -e 's?%VNDK_CORE_LIBRARIES%?$$(PRIVATE_VNDK_CORE_LIBRARIES)?g' $$@ |
| 205 | $$(hide) sed -i -e 's?%SANITIZER_RUNTIME_LIBRARIES%?$$(PRIVATE_SANITIZER_RUNTIME_LIBRARIES)?g' $$@ |
| 206 | $$(hide) sed -i -e 's?%VNDK_VER%?$$(PRIVATE_VNDK_VERSION)?g' $$@ |
| 207 | |
Justin Yun | 8065a60 | 2018-02-14 14:07:59 +0900 | [diff] [blame] | 208 | llndk_libraries_list := |
| 209 | vndksp_libraries_list := |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 210 | llndk_libraries := |
| 211 | private_llndk_libraries := |
| 212 | vndk_sameprocess_libraries := |
| 213 | vndk_core_libraries := |
| 214 | sanitizer_runtime_libraries := |
| 215 | vndk_version_suffix := |
| 216 | endef # update_and_install_ld_config |
| 217 | |
Ying Wang | 5748ee9 | 2013-07-23 18:03:37 -0700 | [diff] [blame] | 218 | ####################################### |
Jiyong Park | 450cff4 | 2017-04-05 14:24:14 +0900 | [diff] [blame] | 219 | # ld.config.txt |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 220 | # |
| 221 | # For VNDK enforced devices that have defined BOARD_VNDK_VERSION, use |
Justin Yun | 27bdc37 | 2018-02-08 08:46:59 +0900 | [diff] [blame] | 222 | # "ld.config.txt" as a source file. This configuration includes strict VNDK |
| 223 | # run-time restrictions for vendor process. |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 224 | # Other treblized devices, that have not defined BOARD_VNDK_VERSION or that |
Justin Yun | 27bdc37 | 2018-02-08 08:46:59 +0900 | [diff] [blame] | 225 | # have set BOARD_VNDK_RUNTIME_DISABLE to true, use "ld.config.vndk_lite.txt" |
Justin Yun | 8a9a8ee | 2018-02-02 13:22:02 +0900 | [diff] [blame] | 226 | # as a source file. This configuration does not have strict VNDK run-time |
| 227 | # restrictions. |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 228 | # If the device is not treblized, use "ld.config.legacy.txt" for legacy |
| 229 | # namespace configuration. |
Jiyong Park | 450cff4 | 2017-04-05 14:24:14 +0900 | [diff] [blame] | 230 | include $(CLEAR_VARS) |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 231 | LOCAL_MODULE := ld.config.txt |
| 232 | LOCAL_MODULE_CLASS := ETC |
| 233 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC) |
Jiyong Park | 450cff4 | 2017-04-05 14:24:14 +0900 | [diff] [blame] | 234 | |
Jiyong Park | ecc703c | 2017-08-04 19:08:06 +0900 | [diff] [blame] | 235 | _enforce_vndk_at_runtime := false |
Jiyong Park | ecc703c | 2017-08-04 19:08:06 +0900 | [diff] [blame] | 236 | ifdef BOARD_VNDK_VERSION |
| 237 | ifneq ($(BOARD_VNDK_RUNTIME_DISABLE),true) |
| 238 | _enforce_vndk_at_runtime := true |
| 239 | endif |
| 240 | endif |
| 241 | |
| 242 | ifeq ($(_enforce_vndk_at_runtime),true) |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 243 | # for VNDK enforced devices |
Justin Yun | dd16301 | 2018-01-10 09:38:19 +0900 | [diff] [blame] | 244 | LOCAL_MODULE_STEM := $(call append_vndk_version,$(LOCAL_MODULE)) |
Jiyong Park | ecc703c | 2017-08-04 19:08:06 +0900 | [diff] [blame] | 245 | include $(BUILD_SYSTEM)/base_rules.mk |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 246 | $(eval $(call update_and_install_ld_config,\ |
Justin Yun | 27bdc37 | 2018-02-08 08:46:59 +0900 | [diff] [blame] | 247 | $(LOCAL_PATH)/etc/ld.config.txt,\ |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 248 | $(LOCAL_BUILT_MODULE),\ |
| 249 | $(PLATFORM_VNDK_VERSION))) |
Jiyong Park | ecc703c | 2017-08-04 19:08:06 +0900 | [diff] [blame] | 250 | |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 251 | else ifeq ($(PRODUCT_TREBLE_LINKER_NAMESPACES)|$(SANITIZE_TARGET),true|) |
| 252 | # for treblized but VNDK non-enforced devices |
| 253 | LOCAL_MODULE_STEM := $(call append_vndk_version,$(LOCAL_MODULE)) |
| 254 | include $(BUILD_SYSTEM)/base_rules.mk |
| 255 | $(eval $(call update_and_install_ld_config,\ |
Justin Yun | 27bdc37 | 2018-02-08 08:46:59 +0900 | [diff] [blame] | 256 | $(LOCAL_PATH)/etc/ld.config.vndk_lite.txt,\ |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 257 | $(LOCAL_BUILT_MODULE),\ |
Justin Yun | 8065a60 | 2018-02-14 14:07:59 +0900 | [diff] [blame] | 258 | $(if $(BOARD_VNDK_VERSION),$(PLATFORM_VNDK_VERSION)),\ |
| 259 | true)) |
Jiyong Park | ecc703c | 2017-08-04 19:08:06 +0900 | [diff] [blame] | 260 | |
Jiyong Park | 450cff4 | 2017-04-05 14:24:14 +0900 | [diff] [blame] | 261 | else |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 262 | # for legacy non-treblized devices |
| 263 | LOCAL_SRC_FILES := etc/ld.config.legacy.txt |
| 264 | LOCAL_MODULE_STEM := $(LOCAL_MODULE) |
| 265 | include $(BUILD_PREBUILT) |
| 266 | |
| 267 | endif # if _enforce_vndk_at_runtime is true |
| 268 | |
| 269 | _enforce_vndk_at_runtime := |
| 270 | |
| 271 | ####################################### |
| 272 | # ld.config.noenforce.txt |
| 273 | # |
| 274 | # This file is a temporary configuration file only for GSI. Originally GSI has |
| 275 | # BOARD_VNDK_VERSION defined and has strict VNDK enforcing rule based on |
Justin Yun | 27bdc37 | 2018-02-08 08:46:59 +0900 | [diff] [blame] | 276 | # "ld.config.txt". However for the devices, that have not defined |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 277 | # BOARD_VNDK_VERSION, GSI provides this configuration file which is based on |
Justin Yun | 27bdc37 | 2018-02-08 08:46:59 +0900 | [diff] [blame] | 278 | # "ld.config.vndk_lite.txt". |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 279 | # Do not install this file for the devices other than GSI. |
| 280 | include $(CLEAR_VARS) |
| 281 | LOCAL_MODULE := ld.config.noenforce.txt |
Jiyong Park | 450cff4 | 2017-04-05 14:24:14 +0900 | [diff] [blame] | 282 | LOCAL_MODULE_CLASS := ETC |
| 283 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC) |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 284 | LOCAL_MODULE_STEM := $(LOCAL_MODULE) |
| 285 | include $(BUILD_SYSTEM)/base_rules.mk |
| 286 | $(eval $(call update_and_install_ld_config,\ |
Justin Yun | 27bdc37 | 2018-02-08 08:46:59 +0900 | [diff] [blame] | 287 | $(LOCAL_PATH)/etc/ld.config.vndk_lite.txt,\ |
Justin Yun | cbbf195 | 2018-01-16 11:46:21 +0900 | [diff] [blame] | 288 | $(LOCAL_BUILT_MODULE),\ |
Justin Yun | 8065a60 | 2018-02-14 14:07:59 +0900 | [diff] [blame] | 289 | $(PLATFORM_VNDK_VERSION),\ |
| 290 | true)) |
Jiyong Park | e04e4e7 | 2017-08-22 10:25:18 +0900 | [diff] [blame] | 291 | |
| 292 | ####################################### |
| 293 | # llndk.libraries.txt |
| 294 | include $(CLEAR_VARS) |
| 295 | LOCAL_MODULE := llndk.libraries.txt |
| 296 | LOCAL_MODULE_CLASS := ETC |
| 297 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC) |
Justin Yun | dd16301 | 2018-01-10 09:38:19 +0900 | [diff] [blame] | 298 | LOCAL_MODULE_STEM := $(call append_vndk_version,$(LOCAL_MODULE)) |
Jiyong Park | e04e4e7 | 2017-08-22 10:25:18 +0900 | [diff] [blame] | 299 | include $(BUILD_SYSTEM)/base_rules.mk |
Jiyong Park | e04e4e7 | 2017-08-22 10:25:18 +0900 | [diff] [blame] | 300 | $(LOCAL_BUILT_MODULE): PRIVATE_LLNDK_LIBRARIES := $(LLNDK_LIBRARIES) |
Jiyong Park | 74857cc | 2017-10-13 16:36:49 +0900 | [diff] [blame] | 301 | $(LOCAL_BUILT_MODULE): |
Jiyong Park | e04e4e7 | 2017-08-22 10:25:18 +0900 | [diff] [blame] | 302 | @echo "Generate: $@" |
| 303 | @mkdir -p $(dir $@) |
| 304 | $(hide) echo -n > $@ |
| 305 | $(hide) $(foreach lib,$(PRIVATE_LLNDK_LIBRARIES), \ |
| 306 | echo $(lib).so >> $@;) |
| 307 | |
| 308 | ####################################### |
| 309 | # vndksp.libraries.txt |
| 310 | include $(CLEAR_VARS) |
| 311 | LOCAL_MODULE := vndksp.libraries.txt |
| 312 | LOCAL_MODULE_CLASS := ETC |
| 313 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC) |
Justin Yun | dd16301 | 2018-01-10 09:38:19 +0900 | [diff] [blame] | 314 | LOCAL_MODULE_STEM := $(call append_vndk_version,$(LOCAL_MODULE)) |
Jiyong Park | e04e4e7 | 2017-08-22 10:25:18 +0900 | [diff] [blame] | 315 | include $(BUILD_SYSTEM)/base_rules.mk |
Jiyong Park | e04e4e7 | 2017-08-22 10:25:18 +0900 | [diff] [blame] | 316 | $(LOCAL_BUILT_MODULE): PRIVATE_VNDK_SAMEPROCESS_LIBRARIES := $(VNDK_SAMEPROCESS_LIBRARIES) |
Jiyong Park | 74857cc | 2017-10-13 16:36:49 +0900 | [diff] [blame] | 317 | $(LOCAL_BUILT_MODULE): |
Jiyong Park | e04e4e7 | 2017-08-22 10:25:18 +0900 | [diff] [blame] | 318 | @echo "Generate: $@" |
| 319 | @mkdir -p $(dir $@) |
| 320 | $(hide) echo -n > $@ |
| 321 | $(hide) $(foreach lib,$(PRIVATE_VNDK_SAMEPROCESS_LIBRARIES), \ |
| 322 | echo $(lib).so >> $@;) |