Fix namespacing of err_save_state_st. In I1893343fee1b43b3e31e9d66a244475ffc4a35f1, this struct was moved to the bssl namespace. Turns out it does not work to define a struct this way; it causes deltas in the symbol names when symbol prefixing is turned on: $ for f in libcrypto.a CMakeFiles/crypto_test.dir/**/*.o; do nm -a "$f" | grep ERR_restore_state; done 0000000000001a08 T __ZN4bssl14brlogenshfegle17ERR_restore_stateEPKNS_17err_save_state_stE U __ZN4bssl14brlogenshfegle17ERR_restore_stateEPKNS0_17err_save_state_stE $ for f in libcrypto.a CMakeFiles/crypto_test.dir/**/*.o; do nm --demangle -a "$f" | grep ERR_restore_state; done 0000000000001a08 T bssl::brlogenshfegle::ERR_restore_state(bssl::err_save_state_st const*) U bssl::brlogenshfegle::ERR_restore_state(bssl::brlogenshfegle::err_save_state_st const*) So it looks like the bssl:: hack can currently only be used for variable and function definitions, and most definitely not for types. Note that this issue only happens with Clang, not with GCC: https://godbolt.org/z/nsq5K95dc <-> https://godbolt.org/z/fhfMn5Td6 Bug: 42220000 Change-Id: Ic1396212ce1baed6b53a4ed92c089a1d145bd480 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/86067 Auto-Submit: Rudolf Polzer <rpolzer@google.com> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com>
diff --git a/crypto/err/err.cc b/crypto/err/err.cc index 491070c..3c51ae4 100644 --- a/crypto/err/err.cc +++ b/crypto/err/err.cc
@@ -747,11 +747,15 @@ void ERR_load_RAND_strings(void) {} -struct bssl::err_save_state_st { +BSSL_NAMESPACE_BEGIN + +struct err_save_state_st { struct err_error_st *errors; size_t num_errors; }; +BSSL_NAMESPACE_END + void bssl::ERR_SAVE_STATE_free(ERR_SAVE_STATE *state) { if (state == nullptr) { return;