Skip to content

plugin: json - gcc failed - version node not found for symbol type ...@... #19529

@fsenart

Description

@fsenart

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.8 linux/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/fsenart/projects"
GORACE=""
GOROOT="/home/fsenart/tools/go1.8"
GOTOOLDIR="/home/fsenart/tools/go1.8/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build992249354=/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"

What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

package main

type Foo struct {
	Bar string `json:"Bar@baz,omitempty"`
}

func Dummy() {
	print(&Foo{})
}

What did you expect to see?

I expect to be able to build the above code as a plugin:

go build -buildmode=plugin -o issue.so

What did you see instead?

# issue_json
/home/fsenart/tools/go1.8/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: $WORK/issue_json/_obj/exe/a.out.so: version node not found for symbol type..namedata.Bar.json:"Bar@baz,omitempty"
/usr/bin/ld: failed to set dynamic section sizes: Bad value
collect2: error: ld returned 1 exit status

Observations

  • The error happens only when using the @ sign in the json tag
  • The error does not happen when building the exact same program in regular mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions