summaryrefslogtreecommitdiff
path: root/trusty/coverage/coverage_test.cpp
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2020-08-25 17:05:41 +0900
committerJiyong Park <jiyong@google.com>2020-08-28 13:30:34 +0900
commit4c57596b811645d56301a8026489a500ead0852f (patch)
tree4671867537e0703d04d820938864efbae7d1cdf4 /trusty/coverage/coverage_test.cpp
parentbb81b7789504cc1d70f65486f982ea867bb8fd46 (diff)
Don't enable version lib for libadb_sysdeps
When use_version_lib is set to true, but build::GetBuildNumber() isn't used, the library can't be processed by symbol_inject. For example, $ m out/soong/.intermediates/system/core/adb/libadb_sysdeps/android/arm64_armv8-a_shared/versioned/libadb_sysdeps.so FAILED: out/soong/.intermediates/system/core/adb/libadb_sysdeps/android_arm64_armv8-a_shared/versioned/libadb_sysdeps.so out/soong/host/linux-x86/bin/symbol_inject -i out/soong/.intermediates/system/core/adb/libadb_sysdeps/android_arm64_armv8-a_shared/unstripped/libadb_sysdeps.so -o out/soong/.intermediates/system/core/adb/libadb_sysdeps/android_arm64_armv8-a_shared/versioned/libadb_sysdeps.so -s soong_build_number -from 'SOONG BUILD NUMBER PLACEHOLDER' -v $(cat out/soong/build_number.txt) symbol not found 17:09:10 ninja failed with: exit status 1 This is because the visibility of the symbol `soong_build_number` in libbuildversion.a is hidden via the -fvisibility=hidden flag for the library. In addition, -Wl,--gc-sections strips the hidden symbol when it is not referenced. This fortunately hasn't caused a problem because, for the device target, the output of symbol_inject was used only for dist outputs. libadb_sysdeps wasn't registered as dists. So versioned/libadb_sysprops.so never had a chance to be built. For the host target, in the other hand, the output of symbol_inject is used always, but --gc-sections is not used for host targets. So the symbol wasn't stripped and therefore symbol_inject could always find the symbol. This however is expected to cause a problem when the support for LinuxCross is added. It is one of the host targets, therefore symbol_inject is always used. However, unlike other host targets, --gc-sections is turned on because it inherits most of the flags from Android/ARM64. To avoid the problem, we might want to disable --gc-sections for the target. But regardless of the decision, having a build rule that always fails is not desirable - even though the build rule is essentially never triggered. Therefore, we choose to not use version lib for libadb_sysdeps because GetBuildNumber() is not used in the lib. Bug: 159685774 Test: m \ out/soong/.intermediates/system/core/adb/libadb_sysdeps/android/\ arm64_armv8-a_shared/versioned/libadb_sysdeps.so Change-Id: Ide1056b5b55e409ab809e302a697d10d759c92ce
Diffstat (limited to 'trusty/coverage/coverage_test.cpp')
0 files changed, 0 insertions, 0 deletions