]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.boringcrypto] crypto/internal/boring: add -pthread linker flag
authorCherry Mui <cherryyz@google.com>
Fri, 3 Dec 2021 22:13:08 +0000 (17:13 -0500)
committerCherry Mui <cherryyz@google.com>
Mon, 6 Dec 2021 16:54:47 +0000 (16:54 +0000)
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 <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
src/crypto/internal/boring/boring.go

index f34243fe2696d9e5e4d516753935b26bf61e0062..b8804ceb68c259c19582509ed06269332380dbf8 100644 (file)
@@ -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"