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

cmd/compile: illegal Instruction on POWER7 with go 1.13 #43229

Closed
moria7757 opened this issue Dec 16, 2020 · 12 comments
Closed

cmd/compile: illegal Instruction on POWER7 with go 1.13 #43229

moria7757 opened this issue Dec 16, 2020 · 12 comments

Comments

@moria7757
Copy link

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

$ go version
1.13

Does this issue reproduce with the latest release?

with 1.15 & 1,14, I ran into another error in earlier steps.
when i executed 'env GOOS=linux GOARCH=ppc64 ./bootstrap.bash', 'unsupported GOARCH ppc64' was shown in logs.

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

go env Output
$ go env
uname -a
Linux ppclinux 3.10.0-1160.el7.ppc64 #1 SMP Wed Sep 30 02:20:51 UTC 2020 ppc64 ppc64 ppc64 GNU/Linux
cat /etc/redhat-release
CentOS Linux release 7.9.2009 (AltArch)
lscpu
Architecture:          ppc64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Big Endian
CPU(s):                32
On-line CPU(s) list:   0-31
Thread(s) per core:    4
Core(s) per socket:    1
Socket(s):             8
NUMA node(s):          1
Model:                 2.3 (pvr 003f 0203)
Model name:            POWER7 (architected), altivec supported
Hypervisor vendor:     pHyp
Virtualization type:   para
L1d cache:             32K
L1i cache:             32K
NUMA node0 CPU(s):     0-31

What did you do?

Build Go 1.4 on linux/amd64:
git clone https://go.googlesource.com/go $HOME/go1.4
cd $HOME/go1.4/src
git checkout release-branch.go1.4
./make.bash

Build Go 1.13 on linux/amd64:
git clone https://go.googlesource.com/go $HOME/go
cd $HOME/go/src
git checkout release-branch.go1.15
env GOROOT_BOOTSTRAP=$HOME/go1.4 ./make.bash

Build a bootstrap distribution for linux/ppc64 on linux/amd64
cd $HOME/go/src
env GOOS=linux GOARCH=ppc64 ./bootstrap.bash
scp .tbz file to linux/ppc64 $HOME

Build Go 1.13 on linux/ppc64:
tar -xvjf go-linux-ppc64-bootstrap.tbz
git clone https://go.googlesource.com/go $HOME/go
cd $HOME/go/src
git checkout release-branch.go1.13
env GOROOT_BOOTSTRAP=$HOME/go-linux-ppc64-bootstrap ./all.bash

What did you expect to see?

ALL TESTS PASSED


Installed Go for linux/ppc64 in $HOME/go.
Installed commands in $HOME/go/bin.
*** You need to add $HOME/go/bin to your $PATH. ***

What did you see instead?

Building Go bootstrap tool.

cmd/dist
./make.bash: line 121: 24013 Illegal instruction GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist

@randall77
Copy link
Contributor

From https://github.com/golang/go/wiki/MinimumRequirements#ppc64-big-endian

ppc64 (big endian)
POWER5 and above. Starting with Go 1.9, only POWER8 and above are supported.

ppc64le (little endian)
POWER8 and above.

So go 1.13 doesn't support POWER7.

@moria7757
Copy link
Author

From https://github.com/golang/go/wiki/MinimumRequirements#ppc64-big-endian

ppc64 (big endian)
POWER5 and above. Starting with Go 1.9, only POWER8 and above are supported.

ppc64le (little endian)
POWER8 and above.

So go 1.13 doesn't support POWER7.

It means that i should build go 1.8?

@randall77
Copy link
Contributor

Yes, if you want to build for POWER7 big endian then 1.8 should work.
(You'll need it for building the bootstrap as well as building natively.)

@moria7757
Copy link
Author

Yes, if you want to build for POWER7 big endian then 1.8 should work.
(You'll need it for building the bootstrap as well as building natively.)

thank you, now it's working, but i ran into new error:
when run '+ go build -buildmode=pie -ldflags=-linkmode=external -o /usr/local/bin/docker-proxy github.com/docker/libnetwork/cmd/proxy' this error appear : '-buildmode=pie not supported on linux/ppc64'

@randall77
Copy link
Contributor

That error is pretty self-explanatory. That mode isn't supported on that platform.
That's still the case at tip.

@moria7757
Copy link
Author

That error is pretty self-explanatory. That mode isn't supported on that platform.
That's still the case at tip.

you mean it's not supported in any version of go?
what should i do now?
is it helpful to create new issue?
i really need to install docker on ppc64

@randall77
Copy link
Contributor

you mean it's not supported in any version of go?

Correct.

what should i do now?

Does docker need PIE? Try building it without PIE.
You could also try using gccgo.

is it helpful to create new issue?

If you're requesting that we add PIE support to tip, yes. See #27144 for an example.
We won't be adding anything to 1.8, so PIE POWER7 support isn't possible.

i really need to install docker on ppc64

Someone has successfully built docker, see https://developer.ibm.com/devpractices/devops/tutorials/d-docker-on-power-linux-platform/

@moria7757
Copy link
Author

you mean it's not supported in any version of go?

Correct.
yes

what should i do now?

Does docker need PIE? Try building it without PIE.
You could also try using gccgo.

is it helpful to create new issue?

If you're requesting that we add PIE support to tip, yes. See #27144 for an example.
We won't be adding anything to 1.8, so PIE POWER7 support isn't possible.

i really need to install docker on ppc64

Someone has successfully built docker, see https://developer.ibm.com/devpractices/devops/tutorials/d-docker-on-power-linux-platform/

i am using docker srpm: docker-ce-19.03.9-3.el7.src.rpm
when i am trying to rebuild package for ppc64, (executing rpmbuild -bb /root/rpmbuild/SPECS/docker-ce.spec), some where in one of spec file, it execute 'go build -buildmode=pie -ldflags=-linkmode=external -o /usr/local/bin/docker-proxy github.com/docker/libnetwork/cmd/proxy', i can edit that command and remove buildmode, but i think it maybe disrupt process of rebuilding.
i have seen that ibm link, but it uses non-official package and installation is not on centos.

do you think someone can help me about this?
is it completely impossible to add PIE POWER7 support to go 1.8? or maybe is it possible to add power7 and pie support to go 1.15?

@randall77
Copy link
Contributor

do you think someone can help me about this?

The issue tracker isn't the right place for getting help. You might look into these forums:

is it completely impossible to add PIE POWER7 support to go 1.8?

It may be possible to do yourself, but the Go project will not be doing that. 1.8 is unsupported and will not be receiving updates of any kind.

or maybe is it possible to add power7 and pie support to go 1.15?

Same answer for power7, we already decided to not support that architecture any more.
We may add pie support to ppc64 at tip at some point, but I don't think that would help you. (And that would be 1.17 at the earliest.)

@moria7757
Copy link
Author

do you think someone can help me about this?

The issue tracker isn't the right place for getting help. You might look into these forums:

is it completely impossible to add PIE POWER7 support to go 1.8?

It may be possible to do yourself, but the Go project will not be doing that. 1.8 is unsupported and will not be receiving updates of any kind.

or maybe is it possible to add power7 and pie support to go 1.15?

Same answer for power7, we already decided to not support that architecture any more.
We may add pie support to ppc64 at tip at some point, but I don't think that would help you. (And that would be 1.17 at the earliest.)

i am very thankful to you
is there any manual or instruction about how to add buildmode to go 1.8?

@moria7757
Copy link
Author

@randall77 do you know how can i convert go command with it's flags to gccgo command?

@laboger
Copy link
Contributor

laboger commented Jan 12, 2021 via email

@golang golang locked and limited conversation to collaborators Jan 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants