]> Cypherpunks repositories - gostls13.git/commitdiff
plugin: add freebsd/amd64 plugin support
authorAyan George <ayan@ayan.net>
Fri, 23 Aug 2019 15:38:12 +0000 (11:38 -0400)
committerIan Lance Taylor <iant@golang.org>
Tue, 3 Sep 2019 14:27:24 +0000 (14:27 +0000)
Change-Id: I4e7b0e99fd0f6f7d6a8ef60e9d3cb5baeb80a2b6
Reviewed-on: https://go-review.googlesource.com/c/go/+/191617
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/dist/test.go
src/cmd/go/internal/work/init.go
src/cmd/link/internal/ld/config.go
src/plugin/plugin.go
src/plugin/plugin_dlopen.go
src/plugin/plugin_stubs.go

index f63c94697c85c8b12fa7a1aeed382adc0ff8e11d..3be9754e6745db56794f556274961fd5ebea4346 100644 (file)
@@ -972,6 +972,8 @@ func (t *tester) supportedBuildmode(mode string) bool {
                        return true
                case "darwin-amd64":
                        return true
+               case "freebsd-amd64":
+                       return true
                }
                return false
        case "pie":
index 35d3a505cc7d362607932d3c9decff4e51cb8479..c220d87123efd5540eedf96694c02461e9d08726 100644 (file)
@@ -197,6 +197,7 @@ func buildModeInit() {
                        case "darwin/amd64":
                                // Skip DWARF generation due to #21647
                                forcedLdflags = append(forcedLdflags, "-w")
+                       case "freebsd/amd64":
                        default:
                                base.Fatalf("-buildmode=plugin not supported on %s\n", platform)
                        }
index 8525a033dafa15e3380ed1b5f12eab4f09e292ea..e119599317bc3acf786b9956cb62db42ef16bead 100644 (file)
@@ -95,7 +95,7 @@ func (mode *BuildMode) Set(s string) error {
                        default:
                                return badmode()
                        }
-               case "darwin":
+               case "darwin", "freebsd":
                        switch objabi.GOARCH {
                        case "amd64":
                        default:
index 5506e956925fe722b5cd544072936d630e9445af..4a524bfa3f02ebe48b18886f6bf627e97287ad71 100644 (file)
@@ -13,7 +13,7 @@
 // already part of the program are called. The main function is not run.
 // A plugin is only initialized once, and cannot be closed.
 //
-// Currently plugins are only supported on Linux and macOS.
+// Currently plugins are only supported on Linux, FreeBSD, and macOS.
 // Please report any issues.
 package plugin
 
index 03d3f08717c16dbe16174da7919575f9134dba6a..9200fdc3cb1563edb691fbb5e8c8bec179ceab77 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build linux,cgo darwin,cgo
+// +build linux,cgo darwin,cgo freebsd,cgo
 
 package plugin
 
index 40a41643b1e02ad6368f2a91aa5f236afc034614..1893203017b1b63fb6bbe88ffd29676620ad778a 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !linux,!darwin !cgo
+// +build !linux,!freebsd,!darwin !cgo
 
 package plugin