diff options
| -rw-r--r-- | Android.mk | 70 | ||||
| -rw-r--r-- | build/Android.common_path.mk | 2 | ||||
| -rwxr-xr-x | tools/buildbot-build.sh | 31 |
3 files changed, 53 insertions, 50 deletions
diff --git a/Android.mk b/Android.mk index 9483335073..9d76b2da7f 100644 --- a/Android.mk +++ b/Android.mk @@ -476,6 +476,23 @@ build-art-host: $(HOST_OUT_EXECUTABLES)/art $(ART_HOST_DEPENDENCIES) $(HOST_CO .PHONY: build-art-target build-art-target: $(TARGET_OUT_EXECUTABLES)/art $(ART_TARGET_DEPENDENCIES) $(TARGET_CORE_IMG_OUTS) +######################################################################## +# Workaround for not using symbolic links for linker and bionic libraries +# in a minimal setup (eg buildbot or golem). +######################################################################## + +PRIVATE_BIONIC_FILES := \ + bin/bootstrap/linker \ + bin/bootstrap/linker64 \ + lib/bootstrap/libc.so \ + lib/bootstrap/libm.so \ + lib/bootstrap/libdl.so \ + lib/bootstrap/libdl_android.so \ + lib64/bootstrap/libc.so \ + lib64/bootstrap/libm.so \ + lib64/bootstrap/libdl.so \ + lib64/bootstrap/libdl_android.so \ + PRIVATE_ART_APEX_DEPENDENCY_FILES := \ bin/dalvikvm32 \ bin/dalvikvm64 \ @@ -540,18 +557,6 @@ PRIVATE_ART_APEX_DEPENDENCY_LIBS := \ lib64/libprofile.so \ lib64/libvixl.so \ -PRIVATE_RUNTIME_APEX_DEPENDENCY_FILES := \ - bin/linker \ - bin/linker64 \ - lib/bionic/libc.so \ - lib/bionic/libdl.so \ - lib/bionic/libdl_android.so \ - lib/bionic/libm.so \ - lib64/bionic/libc.so \ - lib64/bionic/libdl.so \ - lib64/bionic/libdl_android.so \ - lib64/bionic/libm.so \ - PRIVATE_CONSCRYPT_APEX_DEPENDENCY_LIBS := \ lib/libcrypto.so \ lib/libjavacrypto.so \ @@ -599,9 +604,18 @@ define extract-from-apex done endef -# Copy or extract some required files from APEXes to the `system` (TARGET_OUT) -# directory. This is dangerous as these files could inadvertently stay in this -# directory and be included in a system image. +# Generate copies of Bionic bootstrap artifacts and ART APEX +# libraries in the `system` (TARGET_OUT) directory. This is dangerous +# as these files could inadvertently stay in this directory and be +# included in a system image. +# +# Copy some libraries into `$(TARGET_OUT)/lib(64)` (the +# `/system/lib(64)` directory to be sync'd to the target) for ART testing +# purposes: +# - Bionic bootstrap libraries, copied from +# `$(TARGET_OUT)/lib(64)/bootstrap` (the `/system/lib(64)/bootstrap` +# directory to be sync'd to the target); +# - Programs and libraries from various APEXes. # # This target is only used by Golem now. # @@ -613,21 +627,20 @@ endef # ART APEX. .PHONY: standalone-apex-files standalone-apex-files: deapexer \ + libc.bootstrap \ + libdl.bootstrap \ + libdl_android.bootstrap \ + libm.bootstrap \ + linker \ $(RELEASE_ART_APEX) \ - $(RUNTIME_APEX) \ $(CONSCRYPT_APEX) \ $(I18N_APEX) + for f in $(PRIVATE_BIONIC_FILES); do \ + tf=$(TARGET_OUT)/$$f; \ + if [ -f $$tf ]; then cp -f $$tf $$(echo $$tf | sed 's,bootstrap/,,'); fi; \ + done $(call extract-from-apex,$(RELEASE_ART_APEX),\ $(PRIVATE_ART_APEX_DEPENDENCY_LIBS) $(PRIVATE_ART_APEX_DEPENDENCY_FILES)) - # The Runtime APEX has the Bionic libs in ${LIB}/bionic subdirectories, - # so we need to move them up a level after extraction. - $(call extract-from-apex,$(RUNTIME_APEX),\ - $(PRIVATE_RUNTIME_APEX_DEPENDENCY_FILES)) && \ - for libdir in $(TARGET_OUT)/lib $(TARGET_OUT)/lib64; do \ - if [ -d $$libdir/bionic ]; then \ - mv -f $$libdir/bionic/*.so $$libdir; \ - fi || exit 1; \ - done $(call extract-from-apex,$(CONSCRYPT_APEX),\ $(PRIVATE_CONSCRYPT_APEX_DEPENDENCY_LIBS)) $(call extract-from-apex,$(I18N_APEX),\ @@ -640,8 +653,10 @@ standalone-apex-files: deapexer \ # Also include libartbenchmark, we always include it when running golem. # libstdc++ is needed when building for ART_TARGET_LINUX. -# Also include the Bionic libraries (libc, libdl, libdl_android, libm) and -# linker. +# Also include the bootstrap Bionic libraries (libc, libdl, libdl_android, +# libm). These are required as the "main" libc, libdl, libdl_android, and libm +# have moved to the ART APEX. This is a temporary change needed until Golem +# fully supports the ART APEX. # # TODO(b/129332183): Remove this when Golem has full support for the # ART APEX. @@ -679,6 +694,7 @@ build-art-target-golem: $(RELEASE_ART_APEX) com.android.runtime $(CONSCRYPT_APEX $(TARGET_CORE_IMG_OUT_BASE).art \ $(TARGET_CORE_IMG_OUT_BASE)-interpreter.art \ libartpalette-system \ + libc.bootstrap libdl.bootstrap libdl_android.bootstrap libm.bootstrap \ icu-data-art-test-i18n \ tzdata-art-test-tzdata tzlookup.xml-art-test-tzdata \ tz_version-art-test-tzdata icu_overlay-art-test-tzdata \ diff --git a/build/Android.common_path.mk b/build/Android.common_path.mk index e55e79b616..762a3a4d98 100644 --- a/build/Android.common_path.mk +++ b/build/Android.common_path.mk @@ -158,8 +158,6 @@ DEBUG_ART_APEX := com.android.art.debug # Testing ART APEX, used in ART device testing. TESTING_ART_APEX := com.android.art.testing -# Runtime (Bionic) APEX -RUNTIME_APEX := com.android.runtime # Conscrypt APEX CONSCRYPT_APEX := com.android.conscrypt # i18n APEX diff --git a/tools/buildbot-build.sh b/tools/buildbot-build.sh index da80337f3b..dde156dbe6 100755 --- a/tools/buildbot-build.sh +++ b/tools/buildbot-build.sh @@ -85,8 +85,9 @@ elif [[ $mode == "target" ]]; then make_command="build/soong/soong_ui.bash --make-mode $j_arg $extra_args $showcommands build-art-target-tests $common_targets" make_command+=" libnetd_client-target toybox sh" make_command+=" debuggerd su gdbserver" + make_command+=" libstdc++ " # vogar requires the class files for conscrypt. - make_command+=" conscrypt" + make_command+=" conscrypt " make_command+=" ${ANDROID_PRODUCT_OUT#"${ANDROID_BUILD_TOP}/"}/system/etc/public.libraries.txt" # Targets required to generate a linker configuration for device within the # chroot environment. The *.libraries.txt targets are required by @@ -95,9 +96,14 @@ elif [[ $mode == "target" ]]; then # work in an unbundled tree. make_command+=" host_linkerconfig_all_targets sanitizer.libraries.txt vndkcorevariant.libraries.txt" # Additional targets needed for the chroot environment. - make_command+=" event-log-tags" - # Needed to extract prebuilt APEXes. - make_command+=" deapexer" + make_command+=" crash_dump event-log-tags" + # Needed to extract prebuilts apexes. + make_command+=" deapexer " + # Build the bootstrap Bionic artifacts links (linker, libc, libdl, libm). + # These targets create these symlinks: + # - from /system/bin/linker(64) to /apex/com.android.runtime/bin/linker(64); and + # - from /system/lib(64)/$lib to /apex/com.android.runtime/lib(64)/$lib. + make_command+=" linker libc.bootstrap libdl.bootstrap libdl_android.bootstrap libm.bootstrap" # Build/install the required APEXes. make_command+=" ${apexes[*]}" fi @@ -182,23 +188,6 @@ if [[ $mode == "target" ]]; then done done - # Create system symlinks for the Runtime APEX. Normally handled by - # installSymlinkToRuntimeApex in soong/cc/binary.go, but we have to replicate - # it here since we don't run the install rules for the Runtime APEX. - for b in linker{,_asan}{,64}; do - echo "Symlinking /apex/com.android.runtime/bin/$b to /system/bin" - ln -sf /apex/com.android.runtime/bin/$b $ANDROID_PRODUCT_OUT/system/bin/$b - done - for p in $ANDROID_PRODUCT_OUT/system/apex/com.android.runtime/lib{,64}/bionic/*; do - lib_dir=$(expr $p : '.*/\(lib[0-9]*\)/.*') - lib_file=$(basename $p) - src=/apex/com.android.runtime/${lib_dir}/bionic/${lib_file} - dst=$ANDROID_PRODUCT_OUT/system/${lib_dir}/${lib_file} - echo "Symlinking $src into /system/${lib_dir}" - mkdir -p $(dirname $dst) - ln -sf $src $dst - done - # Create linker config files. We run linkerconfig on host to avoid problems # building it statically for device in an unbundled tree. |