New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: -buildmode=plugin -linkshared -> build failure #18671

Open
navytux opened this Issue Jan 15, 2017 · 3 comments

Comments

Projects
None yet
6 participants
@navytux
Contributor

navytux commented Jan 15, 2017

Please answer these questions before submitting your issue. Thanks!

What did you do?

Hello up there. I'm trying to build plugin dynamically linked to other go packages and it fails. Details below:

  • we have fresh go checkout + src/all.bash run
  • then go install -buildmode=shared std was run
  • a sample test plugin source:

---- 8< ---- (myplugin.go)

package main

import (
        "fmt"
)

func PlugFunc() {
        fmt.Println("myplugin.PlugFunc")
}

func init() {
        fmt.Println("myplygin.init")
}
  • I'm trying to build it as go build -buildmode=plugin -linkshared myplugin.go

What did you expect to see?

Build succeeds; myplugin.so dynamically links to packages it imports.

What did you see instead?

# command-line-arguments
runtime.islibrary: missing Go type information for global symbol: size 1

(for the reference building without -linkshared succeeds)

Does this issue reproduce with the latest release (go1.7.4)?

No, there is no plugin support in go1.7 at all:

$ go17 build -buildmode=plugin myplugin.go 
buildmode=plugin not supported

Possibly related issues:

#17150

System details

go version devel +76f981c8d8 Sat Jan 14 17:11:31 2017 +0000 linux/amd64
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/kirr/go"
GORACE=""
GOROOT="/home/kirr/src/tools/go/go"
GOTOOLDIR="/home/kirr/src/tools/go/go/pkg/tool/linux_amd64"
GCCGO="/usr/bin/gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build611710721=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
GOROOT/bin/go version: go version devel +76f981c8d8 Sat Jan 14 17:11:31 2017 +0000 linux/amd64
GOROOT/bin/go tool compile -V: compile version devel +76f981c8d8 Sat Jan 14 17:11:31 2017 +0000 X:framepointer
uname -sr: Linux 4.8.0-2-amd64
Distributor ID:	Debian
Description:	Debian GNU/Linux testing (stretch)
Release:	testing
Codename:	stretch
/lib/x86_64-linux-gnu/libc.so.6: GNU C Library (Debian GLIBC 2.24-8) stable release version 2.24, by Roland McGrath et al.
gdb --version: GNU gdb (Debian 7.12-4) 7.12
@crawshaw

This comment has been minimized.

Contributor

crawshaw commented Jan 16, 2017

This is a feature I couldn't find time for in 1.8, but I would like to see in 1.9. (After darwin support.)

I'm not sure if this warrants a better error message for 1.8. Thoughts, @bradfitz, @ianlancetaylor?

@crawshaw crawshaw added this to the Go1.9 milestone Jan 16, 2017

@navytux

This comment has been minimized.

Contributor

navytux commented Jan 17, 2017

@crawshaw thanks for feedback.

@bradfitz bradfitz modified the milestones: Go1.9, Go1.10 Jun 7, 2017

@rsc rsc modified the milestones: Go1.10, Go1.11 Dec 1, 2017

@gopherbot gopherbot modified the milestones: Go1.11, Unplanned May 23, 2018

@libscott

This comment has been minimized.

libscott commented Jun 22, 2018

Also ran into this issue, with go 1.10.2 and 1.10.3; downgrading to 1.9.7 it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment