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: stop requiring gold on arm64 when GNU ld is fixed #22040

Open
jcajka opened this Issue Sep 26, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@jcajka
Contributor

jcajka commented Sep 26, 2017

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

Any, more specifically 1.8, 1.9, master, most probably all versions supporting AArch64/arm64 target

Does this issue reproduce with the latest release?

Yes

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

linux/arm64

What did you do?

GC on linux/arm64 assumes gold linker availability see src/cmd/link/internal/ld/lib.go:1182
When gold is not available gcc fails due to it missing, when it tries to invoke it. All in shared_test.
When gold flag is remove by removing sys.ARM64 from codition on src/cmd/link/internal/ld/lib.go:1173, build/test fail with

--- FAIL: TestTrivialExecutable (0.29s)
	shared_test.go:66: executing go install -installsuffix=5577006791947779410 -linkshared trivial failed exit status 2:
		# trivial
		/root/go/pkg/tool/linux_arm64/link: running gcc failed: exit status 1
		/usr/bin/ld: /tmp/go-link-151650837/go.o(.data.rel.ro+0x2c0): unresolvable R_AARCH64_ABS64 relocation against symbol `go.link.abihash.libruntime,sync-atomic.so'
		/usr/bin/ld: final link failed: Nonrepresentable section on output
		collect2: error: ld returned 1 exit status

And so one for most of the cases shared_test.

What did you expect to see?

All tests pass. GC working with default binutils ld.

What did you see instead?

GC failing to build some binaries with binutils ld.

@ianlancetaylor ianlancetaylor changed the title from GC works only with gold on AArch64 in some cases to cmd/link: compiler works only with gold on AArch64 in some cases Sep 26, 2017

@ianlancetaylor

This comment has been minimized.

Contributor

ianlancetaylor commented Sep 26, 2017

For background see #15696 and https://sourceware.org/bugzilla/show_bug.cgi?id=19962. I think that we have to require gold until the GNU ld bug is fixed.

I'm going to close this issue since I don't see anything we can do. Please comment if you disagree.

@jcajka

This comment has been minimized.

Contributor

jcajka commented Sep 26, 2017

@ianlancetaylor AFAIK SWBZ is related only to ARM32, my issues is on ARM64. I could be easily wrong though or there is same issues on ARM64, I'm not that familiar with binutils\s ld code base.

Also I would like to keep this opened, even if this turns out to be fully binutils bug. As I think that the workaround code should be reverted when the issue is fixed in ld(whatever for ARM32/64 or both).

@ianlancetaylor ianlancetaylor changed the title from cmd/link: compiler works only with gold on AArch64 in some cases to cmd/link: stop requiring gold on arm64 when GNU ld is fixed Sep 26, 2017

@ianlancetaylor

This comment has been minimized.

Contributor

ianlancetaylor commented Sep 26, 2017

OK, I guess.

@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Sep 26, 2017

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