Link libcrypto with -Bsymbolic.
Prevents crypto-related symbols from being resolved from
libraries earlier in the search path and e.g. breaking the
FIPS integrity checks.
Bug: 160231064
Test: m && flashall
Change-Id: I9c9f7139f518770b4553e89d91f9a69aa700478e
diff --git a/Android.bp b/Android.bp
index b6a9c2f..49e5083 100644
--- a/Android.bp
+++ b/Android.bp
@@ -67,6 +67,12 @@
host: {
host_ldlibs: ["-lpthread"],
},
+ android: {
+ // On FIPS builds (i.e. Android only) prevent other libraries
+ // from pre-empting symbols in libcrypto which could affect FIPS
+ // compliance and cause integrity checks to fail. See b/160231064.
+ ldflags: ["-Wl,-Bsymbolic"],
+ },
},
local_include_dirs: ["src/crypto"],