]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.boringcrypto] cmd/link: allow internal linking for crypto/internal/boring
authorRuss Cox <rsc@golang.org>
Wed, 23 Aug 2017 02:52:15 +0000 (22:52 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 24 Aug 2017 18:37:31 +0000 (18:37 +0000)
Change-Id: I5b122ad23f75296dab8cec89a4e50dcca7fa9b3f
Reviewed-on: https://go-review.googlesource.com/57944
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/go/go_boring_test.go [new file with mode: 0644]
src/cmd/link/internal/ld/lib.go

diff --git a/src/cmd/go/go_boring_test.go b/src/cmd/go/go_boring_test.go
new file mode 100644 (file)
index 0000000..0000497
--- /dev/null
@@ -0,0 +1,20 @@
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main_test
+
+import "testing"
+
+func TestBoringInternalLink(t *testing.T) {
+       tg := testgo(t)
+       defer tg.cleanup()
+       tg.parallel()
+       tg.tempFile("main.go", `package main
+               import "crypto/sha1"
+               func main() {
+                       sha1.New()
+               }`)
+       tg.run("build", "-ldflags=-w -extld=false", tg.path("main.go"))
+       tg.run("build", "-ldflags=-extld=false", tg.path("main.go"))
+}
index 023410512c9d1bdcec776513646eb4238fe18123..59dc4e7acc5bdf54d67aae4373246b371a57f17f 100644 (file)
@@ -856,6 +856,7 @@ var hostobj []Hostobj
 // These packages can use internal linking mode.
 // Others trigger external mode.
 var internalpkg = []string{
+       "crypto/internal/boring",
        "crypto/x509",
        "net",
        "os/user",