aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Scull <ascull@google.com>2022-01-11 17:48:22 +0000
committerAndrew Scull <ascull@google.com>2022-01-11 19:59:30 +0000
commit2787f2249796ff0407ddf47e2c0239d52efc53d0 (patch)
treec310a17a7e54566eeae758ae6f60abe20f81a89a
parent351856679290f777df31607323f3709c5bc3deb2 (diff)
downloadavb-android-s-v2-beta-3.tar.gz
The tests were linking against libraries that had different expectations for the SHA implementation leading to memory issues. Resolve the conflicts by building the dependencies from source so the correct SHA implementation is used by all the code under test. The problems was, in part, hidden due to an atest bug b/211900473 that meant the custom SHA implementation variant of the test wasn't actually being run. It needs to be run manually to confirm the fix until that is resolved. Test: ./libavb_host_unittest_sha Bug: 211287350 Change-Id: I32b944fde9c133d1b9697a509ff66a26e084d6c4
-rw-r--r--Android.bp40
1 files changed, 12 insertions, 28 deletions
diff --git a/Android.bp b/Android.bp
index 6685ab2..0aae847 100644
--- a/Android.bp
+++ b/Android.bp
@@ -147,7 +147,8 @@ python_binary_host {
compile_multilib: "first",
}
-// on only libc and doesn't drag in any other dependencies.
+// Build libavb - this is a static library that depends
+// on only libc and libcrypto, but no other dependencies.
cc_library_static {
name: "libavb",
defaults: [
@@ -230,19 +231,8 @@ cc_library_host_static {
srcs: ["libavb_ab/avb_ab_flow.c"],
}
-cc_library_host_static {
- name: "libavb_atx_host",
- defaults: [
- "avb_defaults",
- "avb_crypto_ops_impl_boringssl",
- ],
- header_libs: [
- "avb_headers",
- ],
- export_header_lib_headers: ["avb_headers"],
- cflags: [
- "-fno-stack-protector",
- ],
+cc_defaults {
+ name: "avb_atx_sources",
srcs: ["libavb_atx/avb_atx_validate.c"],
}
@@ -256,22 +246,19 @@ cc_library_host_static {
srcs: ["libavb/avb_sysdeps_posix.c"],
}
-cc_library_host_static {
- name: "libavb_things_example",
- defaults: [
- "avb_defaults",
- "avb_crypto_ops_impl_boringssl",
- ],
- header_libs: [
- "avb_headers",
- ],
- export_header_lib_headers: ["avb_headers"],
+cc_defaults {
+ name: "avb_things_example_sources",
srcs: ["examples/things/avb_atx_slot_verify.c"],
}
cc_defaults {
name: "libavb_host_unittest_core",
- defaults: ["avb_defaults"],
+ defaults: [
+ "avb_defaults",
+ "avb_sources",
+ "avb_atx_sources",
+ "avb_things_example_sources",
+ ],
required: [
"simg2img",
"img2simg",
@@ -290,10 +277,7 @@ cc_defaults {
test_config: "test/libavb_host_unittest.xml",
test_suites: ["general-tests"],
static_libs: [
- "libavb",
"libavb_ab_host",
- "libavb_atx_host",
- "libavb_things_example",
"libgmock_host",
"libgtest_host",
],