From dd400c3af140111e9a496642b6f8f9ed1ca0f52a Mon Sep 17 00:00:00 2001 From: David Gross Date: Mon, 28 Jun 2021 15:49:58 -0700 Subject: Fix bitrot: RSTest_CompatLib[19] tests stopped building MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (1) Incorrect path to librsjni.so because of typo in earlier change; fixed by fixing typo. (2) clang did not specify the target architecture (I don't know what changed so that this no longer works); fixed by specifying target architecture and changing from gcc linker to lld (gcc linker didn't understand the options it was being passed by clang). Test: blueline-userdebug Test: make -j FORCE_BUILD_RS_COMPAT=true ENABLE_RSTESTS=true \ RSTestForward_21_1_2 RSTestForward_22_0_2 \ RSTestForward_23_0_3 RSTestForward_24_0_3 RSTestForward_25_0_2 \ RSTestBackward RSTestBackward19 RSTest RSTest_Compat RSTest_Compat19 Test: unzip -t ${PATH_TO_APK} # confirm that .so files are present in RSTest_Compat[19] but not for the other APKs # confirm that .bc files are present in RSTestBackward19 but not for the other APKs Test: adb shell am instrument [--abi armeabi-v7a] \ -w ${TEST_PACKAGE_NAME}/androidx.test.runner.AndroidJUnitRunner # Run four times: # "--abi" argument present or absent; always omit for # RSTest_Compat[19], which only support platform default ABI # "adb shell setprop debug.rs.forcecompat 0" or "1" # Note that RSTestBackward19 only supports 32-bit ABI, so both # runs (with and without "--abi" argument) are actually armeabi-v7a Test: After run, check logcat for RenderScript_jni # (missing): not built against support library; expected for all tests except RSTest_Compat[19] # "RenderScript_jni: RS native mode"; expected for RSTest_Compat[19] when setprop debug.rs.forcecompat is 0 # "RenderScript_jni: RS compat mode"; expected for RSTest_Compat[19] when setprop debug.rs.forcecompat is 1 Change-Id: Icfaa226f2e1bfa909cb3bcbbe960f2804c355d2a --- core/definitions.mk | 4 ++-- core/java_renderscript.mk | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/definitions.mk b/core/definitions.mk index 102827bb3a..c44e7180a6 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -1106,11 +1106,11 @@ define transform-bc-to-so $(hide) mkdir -p $(dir $@) $(hide) $(BCC_COMPAT) -O3 -o $(dir $@)/$(notdir $(<:.bc=.o)) -fPIC -shared \ -rt-path $(RS_PREBUILT_CLCORE) -mtriple $(RS_COMPAT_TRIPLE) $< -$(hide) $(PRIVATE_CXX_LINK) -shared -Wl,-soname,$(notdir $@) -nostdlib \ +$(hide) $(PRIVATE_CXX_LINK) -fuse-ld=lld -target $(CLANG_TARGET_TRIPLE) -shared -Wl,-soname,$(notdir $@) -nostdlib \ -Wl,-rpath,\$$ORIGIN/../lib \ $(dir $@)/$(notdir $(<:.bc=.o)) \ $(RS_PREBUILT_COMPILER_RT) \ - -o $@ $(CLANG_TARGET_GLOBAL_LDFLAGS) -Wl,--hash-style=sysv \ + -o $@ $(CLANG_TARGET_GLOBAL_LLDFLAGS) -Wl,--hash-style=sysv \ -L $(SOONG_OUT_DIR)/ndk/platforms/android-$(PRIVATE_SDK_VERSION)/arch-$(TARGET_ARCH)/usr/lib64 \ -L $(SOONG_OUT_DIR)/ndk/platforms/android-$(PRIVATE_SDK_VERSION)/arch-$(TARGET_ARCH)/usr/lib \ $(call intermediates-dir-for,SHARED_LIBRARIES,libRSSupport)/libRSSupport.so \ diff --git a/core/java_renderscript.mk b/core/java_renderscript.mk index 572d6e4a4b..055ff14600 100644 --- a/core/java_renderscript.mk +++ b/core/java_renderscript.mk @@ -107,7 +107,7 @@ renderscript_intermediate := $(intermediates)/renderscript # Prevent these from showing up on the device # One exception is librsjni.so, which is needed for # both native path and compat path. -rs_jni_lib := $(call intermediates-dir-for,SHARED_LIBRARIES,librsjni.so)/librsjni.so +rs_jni_lib := $(call intermediates-dir-for,SHARED_LIBRARIES,librsjni)/librsjni.so LOCAL_JNI_SHARED_LIBRARIES += librsjni ifneq (,$(TARGET_BUILD_USE_PREBUILT_SDKS)$(FORCE_BUILD_RS_COMPAT)) -- cgit v1.2.3