Skip to content
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

bootstrap: illumos go binary uses wrong interpreter #47765

Closed
jclulow opened this issue Aug 17, 2021 · 4 comments
Closed

bootstrap: illumos go binary uses wrong interpreter #47765

jclulow opened this issue Aug 17, 2021 · 4 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@jclulow
Copy link
Contributor

jclulow commented Aug 17, 2021

I was attempting to cross-build a Go bootstrap archive on my Linux workstation, for use on an illumos/amd64 system:

jclulow@leftstation /var/tmp/goboot/src
$ GOROOT_BOOTSTRAP=/opt/go/1.17 GOOS=illumos GOARCH=amd64 ./bootstrap.bash
#### Copying to ../../go-illumos-amd64-bootstrap

#### Cleaning ../../go-illumos-amd64-bootstrap

#### Building ../../go-illumos-amd64-bootstrap

Building Go cmd/dist using /opt/go/1.17. (go1.17 linux/amd64)
Building Go toolchain1 using /opt/go/1.17.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for host, linux/amd64.
Building packages and commands for target, illumos/amd64.
----
Bootstrap toolchain for illumos/amd64 installed in /var/tmp/go-illumos-amd64-bootstrap.
Building tbz.
-rw-r--r-- 1 jclulow nfsusers 135561186 Aug 17 15:26 /var/tmp/go-illumos-amd64-bootstrap.tbz

This built successfully, and I transferred it to an illumos machine to run it. Unfortunately it appears to have built with the wrong ELF interpreter:

$ ./bin/go version
go: Cannot find /lib64/ld-linux-x86-64.so.2
Killed

The binary is otherwise as we would expect for illumos; e.g.,

$ elfdump bin/go 2>/dev/null | grep NEEDED
      [10]  NEEDED            0x14                libsendfile.so
      [11]  NEEDED            0x23                libsocket.so
      [12]  NEEDED            0x3c                libc.so
$ nm bin/go | grep illumos
[1524]  |             4603968|                   5|FUNC |GLOB |0    |1      |_rt0_amd64_illumos

It seems like this may be related to the fix for #45034. I tried running bootstrap.sh with GO_LDSO set:

GO_LDSO=/lib/64/ld.so.1 GOROOT_BOOTSTRAP=/opt/go/1.17 GOOS=illumos GOARCH=amd64 ./bootstrap.bash

This produced a binary which works on the target system:

$ ./go-illumos-amd64-bootstrap/bin/go version
go version devel go1.18-a2a9a7b513 Tue Aug 17 21:34:32 2021 +0000 illumos/amd64
@ianlancetaylor
Copy link
Contributor

Probably a dup of #47760.

@mknyszek
Copy link
Contributor

I think so, too. @jclulow can you please try at tip, which should now include https://golang.org/cl/343010?

@mknyszek
Copy link
Contributor

Closing for now, if that doesn't help, I'll reopen.

@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 18, 2021
@mknyszek mknyszek added this to the Go1.17.1 milestone Aug 18, 2021
@jclulow
Copy link
Contributor Author

jclulow commented Aug 18, 2021

Thanks @mknyszek it does indeed work now!

@dmitshur dmitshur modified the milestones: Go1.17.1, Go1.18 Sep 1, 2021
@golang golang locked and limited conversation to collaborators Sep 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants