Determine product partition path on build time Path of product partitoin can be set as /product or /system/product whether generate extra product partition or not. Substitute %PRODUCT% to relevant path to know linker which path should search and permit. Bug: 110286945 Test: m -j # Check /system/etc/ld.config.$(PLATFORM_VNDK_VERSION).txt Change-Id: I6ca177d0c9c5af00ad821879fece40848331fc8d Merged-In: I6ca177d0c9c5af00ad821879fece40848331fc8d (cherry picked from commit cccad0bf8461ab575a5861f9bc68c9f8f69db582)
diff --git a/rootdir/Android.mk b/rootdir/Android.mk index 80e068a..5f5c363 100644 --- a/rootdir/Android.mk +++ b/rootdir/Android.mk
@@ -204,6 +204,7 @@ $$(hide) sed -i -e 's?%VNDK_CORE_LIBRARIES%?$$(PRIVATE_VNDK_CORE_LIBRARIES)?g' $$@ $$(hide) sed -i -e 's?%SANITIZER_RUNTIME_LIBRARIES%?$$(PRIVATE_SANITIZER_RUNTIME_LIBRARIES)?g' $$@ $$(hide) sed -i -e 's?%VNDK_VER%?$$(PRIVATE_VNDK_VERSION)?g' $$@ + $$(hide) sed -i -e 's?%PRODUCT%?$$(TARGET_COPY_OUT_PRODUCT)?g' $$@ llndk_libraries_list := vndksp_libraries_list :=
diff --git a/rootdir/etc/ld.config.txt b/rootdir/etc/ld.config.txt index eebad2b..42dc7ab 100644 --- a/rootdir/etc/ld.config.txt +++ b/rootdir/etc/ld.config.txt
@@ -7,7 +7,7 @@ # absolute path of an executable is selected. dir.system = /system/bin/ dir.system = /system/xbin/ -dir.system = /product/bin/ +dir.system = /%PRODUCT%/bin/ dir.vendor = /odm/bin/ dir.vendor = /vendor/bin/ @@ -39,7 +39,7 @@ namespace.default.isolated = true namespace.default.search.paths = /system/${LIB} -namespace.default.search.paths += /product/${LIB} +namespace.default.search.paths += /%PRODUCT%/${LIB} # We can't have entire /system/${LIB} as permitted paths because doing so # makes it possible to load libs in /system/${LIB}/vndk* directories by @@ -51,8 +51,7 @@ namespace.default.permitted.paths = /system/${LIB}/drm namespace.default.permitted.paths += /system/${LIB}/extractors namespace.default.permitted.paths += /system/${LIB}/hw -namespace.default.permitted.paths += /product/${LIB} -namespace.default.permitted.paths += /system/product/${LIB} +namespace.default.permitted.paths += /%PRODUCT%/${LIB} # These are where odex files are located. libart has to be able to dlopen the files namespace.default.permitted.paths += /system/framework namespace.default.permitted.paths += /system/app @@ -64,12 +63,9 @@ namespace.default.permitted.paths += /odm/app namespace.default.permitted.paths += /odm/priv-app namespace.default.permitted.paths += /oem/app -namespace.default.permitted.paths += /product/framework -namespace.default.permitted.paths += /product/app -namespace.default.permitted.paths += /product/priv-app -namespace.default.permitted.paths += /system/product/framework -namespace.default.permitted.paths += /system/product/app -namespace.default.permitted.paths += /system/product/priv-app +namespace.default.permitted.paths += /%PRODUCT%/framework +namespace.default.permitted.paths += /%PRODUCT%/app +namespace.default.permitted.paths += /%PRODUCT%/priv-app namespace.default.permitted.paths += /data namespace.default.permitted.paths += /mnt/expand @@ -92,14 +88,10 @@ namespace.default.asan.permitted.paths += /odm/app namespace.default.asan.permitted.paths += /odm/priv-app namespace.default.asan.permitted.paths += /oem/app -namespace.default.asan.permitted.paths += /product/${LIB} -namespace.default.asan.permitted.paths += /product/framework -namespace.default.asan.permitted.paths += /product/app -namespace.default.asan.permitted.paths += /product/priv-app -namespace.default.asan.permitted.paths += /system/product/${LIB} -namespace.default.asan.permitted.paths += /system/product/framework -namespace.default.asan.permitted.paths += /system/product/app -namespace.default.asan.permitted.paths += /system/product/priv-app +namespace.default.asan.permitted.paths += /%PRODUCT%/${LIB} +namespace.default.asan.permitted.paths += /%PRODUCT%/framework +namespace.default.asan.permitted.paths += /%PRODUCT%/app +namespace.default.asan.permitted.paths += /%PRODUCT%/priv-app namespace.default.asan.permitted.paths += /mnt/expand ############################################################################### @@ -335,7 +327,7 @@ namespace.system.isolated = false namespace.system.search.paths = /system/${LIB} -namespace.system.search.paths += /product/${LIB} +namespace.system.search.paths += /%PRODUCT%/${LIB} namespace.system.asan.search.paths = /data/asan/system/${LIB} namespace.system.asan.search.paths += /system/${LIB} @@ -353,4 +345,4 @@ [postinstall] namespace.default.isolated = false namespace.default.search.paths = /system/${LIB} -namespace.default.search.paths += /product/${LIB} +namespace.default.search.paths += /%PRODUCT%/${LIB}