Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework the Bazel workaround's relationship with linkstatic
Due to a longstanding Bazel flaw (bazelbuild/bazel#22041), we need to split all our mixed C/C++ targets in two. Ideally this split would behave as if the Bazel flaw were fixed, with the split-out library statically linked with the other source files. Accordingly, the helper macro sets linkstatic = True. It turns out linkstatic = True does not work this way. Bazel interprets linkstatic such that, if A(test, linkshared) -> B(library) -> C(library, linkstatic), C will be statically linked into A, not B. This is probably to avoid diamond dependency problems but means it is not possible for a cc_library split to be transparent, only cc_binary and cc_test. So what is happening is that every cc_test that links libcrypto is getting mlkem.cc statically linked into it, separate from the rest of libcrypto! That means we're getting the worst of both worlds: worse cache hit rate for tests that link libcrypto AND our C/C++ bits are still not contained in the same library. linkstatic = True on the helper is still valuable in cc_test and cc_binary, but otherwise inherit the outer value. Change-Id: I1089c58c6ddaa90c89efd8cdcebd88169b0236c8 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/71508 Reviewed-by: Bob Beck <[email protected]> Commit-Queue: David Benjamin <[email protected]>
- Loading branch information