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/link: -buildmode=plugin fails on linux/arm64 #17138

Open
crawshaw opened this Issue Sep 16, 2016 · 6 comments

Comments

Projects
None yet
7 participants
@crawshaw
Contributor

crawshaw commented Sep 16, 2016

At least on the builder, it tickles gold the wrong way:

/tmp/workdir/go/pkg/tool/linux_arm64/link: running gcc failed: exit status 1
/usr/bin/ld.gold: internal error in global, at ../../gold/aarch64.cc:4973

Odd, as the plugin mode mostly depends on linker configuration used by either c-shared or shared.

gopherbot pushed a commit that referenced this issue Sep 16, 2016

cmd/dist: disable plugin test on arm64
Mysterious error and no time or easy machine access to investigate
now, so disabling the -buildmode=plugin test on arm64. (The arm
version is working as expected.)

Updates #17138

Change-Id: I4cc56ddf47e7597213462e48d4934a765168bd07
Reviewed-on: https://go-review.googlesource.com/29363
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@mwhudson

This comment has been minimized.

Contributor

mwhudson commented Sep 18, 2016

Do you know which version of gold is installed?

@mwhudson

This comment has been minimized.

Contributor

mwhudson commented Sep 18, 2016

If I revert 569340e it fails with:

##### ../misc/cgo/testplugin
fatal error: runtime: no plugin module data

goroutine 1 [running]:
runtime.throw(0x520f77, 0x1e)

do you know what's going on there?

@crawshaw

This comment has been minimized.

Contributor

crawshaw commented Sep 19, 2016

Nope, I'd have to spend some time with an arm64 machine, and I don't think I'll get to it in 1.8. I'd rather just say we haven't implemented -buildmode=plugin there yet and deal with it in 1.9.

@quentinmit quentinmit added this to the Go1.8Maybe milestone Oct 3, 2016

@quentinmit

This comment has been minimized.

Contributor

quentinmit commented Oct 3, 2016

We haven't made a Go1.9 milestone yet, so I'll tag this 1.8Maybe with the expectation that it's likely going to get punted.

@gopherbot

This comment has been minimized.

gopherbot commented Apr 27, 2018

Change https://golang.org/cl/109917 mentions this issue: cmd/link: fix plugin on linux/arm64

@cherrymui

This comment has been minimized.

Contributor

cherrymui commented Apr 27, 2018

With CL https://go-review.googlesource.com/c/go/+/109917, testplugin passes locally. It still fails on the builder with an internal error in gold.

##### ../misc/cgo/testplugin
# host
/workdir/go/pkg/tool/linux_arm64/link: running gcc failed: exit status 1
/usr/bin/ld.gold: internal error in global, at ../../gold/aarch64.cc:4973
collect2: error: ld returned 1 exit status

Seems the gold linker on the builder is rather old:

$ gomote run $VM /usr/bin/gold --version
GNU gold (GNU Binutils for Debian 2.25) 1.11
Copyright (C) 2014 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

On the machine where the test passes:

$ gold --version
GNU gold (GNU Binutils for Ubuntu 2.26.1) 1.11
Copyright (C) 2015 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

I wonder, could we update gold on the builder, and require a newer gold for using plugin on linux/arm64? cc @bradfitz

gopherbot pushed a commit that referenced this issue Apr 27, 2018

cmd/link: fix plugin on linux/arm64
The init function and runtime.addmoduledata were not added when
building plugin, which caused the runtime could not find the
module.

Testplugin is still not enabled on linux/arm64
(https://go.googlesource.com/go/+/master/src/cmd/dist/test.go#948)
because the gold linker on the builder is too old, which fails
with an internal error (see issue #17138). I tested locally and
it passes.

Fixes #24940.
Updates #17138.

Change-Id: I26aebca6c38a3443af0949471fa12b6d550e8c6c
Reviewed-on: https://go-review.googlesource.com/109917
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>

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

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