@heschi noticed that it appeared first in https://go.dev/cl/362654 but it looked unrelated so it was ignored. We suspect this is a real failure of a flaky (EDIT: I was wrong, it's deterministic) test that was recently exposed. Low priority because it doesn't actually block boring crypto releases, but it does add noise to the process.
The boringcrypto syso references pthread functions, so we need to pass -pthread to the C linker.
I spent a while looking into why this is not failing before. It turns out that on 1.17 the tests there simply don't depend on any crypto packages, so the syso is not linked in. On tip, it does depend on crypto, possibly though fuzzing as a test dependent. I can reproduce the error with 1.17 branch with a test explicitly using crypto, e.g. go test -linkshared crypto/sha1. Will send a CL soon.
goboringcrypto_linux_amd64.syso references pthread functions, so
we need to pass -pthread to the C linker when external linking.
Usually it is automatically added when linking with runtime/cgo
package. But in shared linkage the runtime/cgo package may be in
a separate DSO and not part of this invocation.
Trust: Cherry Mui <email@example.com>
Run-TryBot: Cherry Mui <firstname.lastname@example.org>
TryBot-Result: Gopher Robot <email@example.com>
Reviewed-by: Filippo Valsorda <firstname.lastname@example.org>