From: Cherry Mui Date: Fri, 3 Dec 2021 22:13:08 +0000 (-0500) Subject: [dev.boringcrypto] crypto/internal/boring: add -pthread linker flag X-Git-Tag: go1.19beta1~484^2~31 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=21fa0b2199;p=gostls13.git [dev.boringcrypto] crypto/internal/boring: add -pthread linker flag 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. Fixes #49965. Change-Id: I3a9983e715ee804594a14006f212f76769ad71db Reviewed-on: https://go-review.googlesource.com/c/go/+/369161 Trust: Cherry Mui Run-TryBot: Cherry Mui TryBot-Result: Gopher Robot Reviewed-by: Filippo Valsorda --- diff --git a/src/crypto/internal/boring/boring.go b/src/crypto/internal/boring/boring.go index f34243fe26..b8804ceb68 100644 --- a/src/crypto/internal/boring/boring.go +++ b/src/crypto/internal/boring/boring.go @@ -7,7 +7,12 @@ package boring -// #include "goboringcrypto.h" +/* +// goboringcrypto_linux_amd64.syso references pthread functions. +#cgo LDFLAGS: "-pthread" + +#include "goboringcrypto.h" +*/ import "C" import ( "crypto/internal/boring/sig"