软件平台:Android11
硬件平台:QCS6125
近日,在基线代码的Hardware层添加了HIDL接口,整编出现了如下报错:
[ 46% 55871/118986] //hardware/interfaces/graphics/composer/2.4:android.hardware.graphics.composer@2.4 header-abi-diff android.hardware.graphics.composer@2.4.so.abidiff
FAILED: out/soong/.intermediates/hardware/interfaces/graphics/composer/2.4/android.hardware.graphics.composer@2.4/android_vendor.30_arm64_armv8-a_shared/android.hardware.graphics.composer@2.4.so.abidiff
(prebuilts/clang-tools/linux-x86/bin/header-abi-diff -allow-unreferenced-changes -allow-unreferenced-elf-symbol-changes -lib android.hardware.graphics.composer@2.4 -arch arm64 -o 'out/soong/.intermediates/hardware/interfaces/graphics/composer/2.4/android.hardware.graphics.composer@2.4/android_vendor.30_arm64_armv8-a_shared/android.hardware.graphics.composer@2.4.so.abidiff' -new 'out/soong/.intermediates/hardware/interfaces/graphics/composer/2.4/android.hardware.graphics.composer@2.4/android_vendor.30_arm64_armv8-a_shared/android.hardware.graphics.composer@2.4.so.lsdump' -old prebuilts/abi-dumps/vndk/30/64/arm64_armv8-a/source-based/android.hardware.graphics.composer@2.4.so.lsdump)|| (echo 'error: Please update ABI references with: $ANDROID_BUILD_TOP/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l android.hardware.graphics.composer@2.4' && (mkdir -p $DIST_DIR/abidiffs && cp 'out/soong/.intermediates/hardware/interfaces/graphics/composer/2.4/android.hardware.graphics.composer@2.4/android_vendor.30_arm64_armv8-a_shared/android.hardware.graphics.composer@2.4.so.abidiff' $DIST_DIR/abidiffs/) && exit 1)
******************************************************
error: VNDK library: android.hardware.graphics.composer@2.4's ABI has INCOMPATIBLE CHANGES Please check compatibility report at: out/soong/.intermediates/hardware/interfaces/graphics/composer/2.4/android.hardware.graphics.composer@2.4/android_vendor.30_arm64_armv8-a_shared/android.hardware.graphics.composer@2.4.so.abidiff
******************************************************
error: Please update ABI references with: $ANDROID_BUILD_TOP/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l android.hardware.graphics.composer@2.4
[ 46% 55872/118986] //hardware/interfaces/radio/1.1:android.hardware.radio@1.1 header-abi-linker android.hardware.radio@1.1.so.lsdump
[ 46% 55873/118986] Install: out/target/product/qssi/system/apex/com.android.vndk.current/lib64/android.hardware.secure_element@1.2.so
[ 46% 55874/118986] //system/hardware/interfaces/net/netd/1.0:android.system.net.netd@1.0 link android.system.net.netd@1.0.so
[ 46% 55875/118986] //hardware/interfaces/media/c2/1.0:android.hardware.media.c2@1.0 generate toc android.hardware.media.c2@1.0.so
看起来像是VNDK校验的问题,这个问题可以通过多个渠道规避解决,一种就是修改build的规则,将VNDK校验关掉,一种是直接修改校验文件,我才用的后者,于是按照日志中的提示,执行了如下指令:
$ANDROID_BUILD_TOP/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l android.hardware.graphics.composer@2.4 -product XXX
注意后边的product参数是在执行前边部分报错退出来的,需要将自己的product参数加上,去android根目录执行上述指令,最后会提示如下生成文件:
[100% 367/367] writing build rules ...
build/make/core/Makefile:892: warning: overriding commands for target `out/target/product/trinket/vendor/lib/modules/rdbg.ko'
build/make/core/Makefile:892: warning: ignoring old commands for target `out/target/product/trinket/vendor/lib/modules/rdbg.ko'
[100% 833/833] //hardware/interfaces/graphics/composer/2.4:android.hardware.graphics.composer@2.4 header-abi-linker android.hardware.graphics.composer@2.4.so.lsdump
Creating dumps for target_arch: arm and variant armv7-a-neon
Created abi dump at /home/jianbin/code/LINUX/android/prebuilts/abi-dumps/vndk/30/64/arm_armv7-a-neon/source-based/android.hardware.graphics.composer@2.4.so.lsdump
Creating dumps for target_arch: arm64 and variant armv8-a
Created abi dump at /home/jianbin/code/LINUX/android/prebuilts/abi-dumps/vndk/30/64/arm64_armv8-a/source-based/android.hardware.graphics.composer@2.4.so.lsdump
可以看到在prebuilts目录生成了两个lsdump文件,cd到相应目录,git status看到文件确实被修改了,git commit这俩文件即可,这样其他人sync下来,直接就会build通过而不再报这个错误。
Mark。