From 0d7bd6be90e371b76884f01524437223fdcd7a23 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Mon, 2 Dec 2019 13:47:23 +0900 Subject: [PATCH 1/2] Use apex_available property Use apex_available property to prevent modules that are only for the ART apex from being used outside of the APEX. Bug: 128708192 Bug: 133140750 Bug: 129006418 Test: m Test: m libnativeloader doesn't install anything. (because it doesn't have "//apex_available:platform". Test: Add "libnativeloader" to shared_libs of "libvndksupport" which is installed to /system/lib. Then the build fails with following error: error: system/core/libvndksupport/Android.bp:3:1: module "libvndksupport" variant "android_arm_armv8-a_core_shared": depends on //art/libnativeloader:libnativeloader which is not visible to this module Change-Id: I964d0125cfedb454a60c098bf1a1797201d5dd40 --- core/main.mk | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) diff --git a/core/main.mk b/core/main.mk index 6935efa5b7..d00c62db3f 100644 --- a/core/main.mk +++ b/core/main.mk @@ -1112,47 +1112,6 @@ endef # art/build/apex/art_apex_test.py. # TODO(b/128708192): Implement this restriction in Soong instead. -# ART APEX (native) libraries -APEX_MODULE_LIBS := \ - libadbconnection.so \ - libadbconnectiond.so \ - libandroidicu.so \ - libandroidio.so \ - libart-compiler.so \ - libart-dexlayout.so \ - libart-disassembler.so \ - libart.so \ - libartbase.so \ - libartbased.so \ - libartd-compiler.so \ - libartd-dexlayout.so \ - libartd.so \ - libartpalette.so \ - libdexfile.so \ - libdexfile_external.so \ - libdexfiled.so \ - libdexfiled_external.so \ - libdt_fd_forward.so \ - libdt_socket.so \ - libicui18n.so \ - libicuuc.so \ - libicu_jni.so \ - libjavacore.so \ - libjdwp.so \ - libnativebridge.so \ - libnativehelper.so \ - libnativeloader.so \ - libnpt.so \ - libopenjdk.so \ - libopenjdkjvm.so \ - libopenjdkjvmd.so \ - libopenjdkjvmti.so \ - libopenjdkjvmtid.so \ - libpac.so \ - libprofile.so \ - libprofiled.so \ - libsigchain.so \ - # Runtime (Bionic) APEX (native) libraries APEX_MODULE_LIBS += \ libc.so \ @@ -1169,15 +1128,6 @@ APEX_MODULE_LIBS += \ APEX_MODULE_LIBS += \ libneuralnetworks.so \ -# ART APEX JARs (Java libraries) -APEX_MODULE_LIBS += \ - apache-xml.jar \ - bouncycastle.jar \ - core-icu4j.jar \ - core-libart.jar \ - core-oj.jar \ - okhttp.jar \ - # Conscrypt APEX JARs (Java libraries) APEX_MODULE_LIBS += \ conscrypt.jar \ From 439b829b42e557f072436613ba987b7928680433 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 3 Dec 2019 12:54:35 +0900 Subject: [PATCH 2/2] Find the jar libraries in APEX from the correct path JAR libraries in the ART and conscrypt APEXes are no longer built for the platform. Therefore, the path out/target/common/_intermediates does not exist. Instead use the path out/target/common/._intermediates paths for those APEX-only jars. Bug: 128708192 Bug: 133140750 Test: m Change-Id: I5fb725403ac22198e5ce6d77ca97c5f3392fabfd --- core/tasks/boot_jars_package_check.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/tasks/boot_jars_package_check.mk b/core/tasks/boot_jars_package_check.mk index dc79e237d3..ba383f514b 100644 --- a/core/tasks/boot_jars_package_check.mk +++ b/core/tasks/boot_jars_package_check.mk @@ -22,7 +22,10 @@ ifdef PRODUCT_BOOT_JARS intermediates := $(call intermediates-dir-for, PACKAGING, boot-jars-package-check,,COMMON) stamp := $(intermediates)/stamp -built_boot_jars := $(foreach j, $(PRODUCT_BOOT_JARS), \ +art_boot_jars := $(addsuffix .com.android.art.release,$(filter $(ART_APEX_JARS), $(PRODUCT_BOOT_JARS))) +conscrypt_boot_jars := $(addsuffix .com.android.conscrypt,$(filter conscrypt, $(PRODUCT_BOOT_JARS))) +noncore_boot_jars := $(filter-out $(ART_APEX_JARS) conscrypt, $(PRODUCT_BOOT_JARS)) +built_boot_jars := $(foreach j, $(art_boot_jars) $(conscrypt_boot_jars) $(noncore_boot_jars), \ $(call intermediates-dir-for, JAVA_LIBRARIES, $(j),,COMMON)/classes.jar) script := build/make/core/tasks/check_boot_jars/check_boot_jars.py whitelist_file := build/make/core/tasks/check_boot_jars/package_whitelist.txt