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: mips: running error SIGILL: illegal instruction #30879

Closed
shownb opened this issue Mar 16, 2019 · 6 comments
Closed

cmd/compile: mips: running error SIGILL: illegal instruction #30879

shownb opened this issue Mar 16, 2019 · 6 comments

Comments

@shownb
Copy link

shownb commented Mar 16, 2019

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

$ go version
go version go1.12 linux/amd64

Does this issue reproduce with the latest release?

yes

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

$ go env
build on : amd64 linux,
runing on:mips16 Linux version 2.6.30.9

What did you do?

file

package main
import (
	"fmt"
)
func main() {
	fmt.Printf("see me you win")
}

build command:
i have tried
GOOS=linux GOARCH=mips GOMIPS=softfloat go build -a test.go
GOOS=linux GOARCH=mipsle GOMIPS=softfloat go build -a test.go

i run in the target:
mips output like

Illegal instruction

mipsle output like that

./test: line 1: syntax error: "(" unexpected

it seems like that the softfloat don't work.
but i tested the ./test in other openwrt router(closed fpu) it works.

What did you expect to see?

i expect i can see "see me you win" in the target router.

What did you see instead?

Illegal instruction

@cherrymui
Copy link
Member

cherrymui commented Mar 16, 2019

runing on:mips16 Linux version 2.6.30.9

Does your machine support MIPS32R1 instruction set? We don't generate mips16 instructions.

Is your machine big-endian or little-endian? What is uname -a output? /proc/cpuinfo would be also helpful.

@shownb
Copy link
Author

shownb commented Mar 16, 2019

runing on:mips16 Linux version 2.6.30.9

Does your machine support MIPS32R1 instruction set? We don't generate mips16 instructions.

Is your machine big-endian or little-endian? What is uname -a output? /proc/cpuinfo would be also helpful.

i think i find the reason.
uname -a like that:

Linux version 2.6.30.9 (vic@sw3-hudson-server) (gcc version 4.4.6 (Realtek RSDK-1.5.6p2) ) #1 Tue Apr 26 09:13:29 CST 2016
/proc/cpuinfo like that:

system type             : RTL9600_MSTC
processor               : 0
cpu model               : 56322
BogoMIPS                : 499.71
tlb_entries             : 64
mips16 implemented      : yes

the rtl seems like that not the really mips

and you don't generate mips16 instructions.what's your suggestion?

@katiehockman
Copy link
Contributor

It sounds like this isn't a bug, just a configuration problem, but please correct me if I'm wrong. For questions about Go, see https://golang.org/wiki/Questions.

I'll leave this issue open for now, but this may be closed later if everything is Working As Intended.

@katiehockman katiehockman added this to the Unplanned milestone Mar 19, 2019
@shownb
Copy link
Author

shownb commented Mar 19, 2019

I can build a elf from a cross compile toolchain for the target linux.
The cross comiler is from Realtek (RSDK Release 1.5 . It is the software
development kit for Realtek's in-house processor cores.)
The elf info is like that:
ELF 32-bit MSB executable, MIPS, MIPS-I version 1 (SYSV), statically linked, stripped

I think @cherrymui may be right. may be the target's CPU is not really the mips.

@cherrymui
Copy link
Member

ELF 32-bit MSB executable, MIPS, MIPS-I version 1 (SYSV), statically linked, stripped

This looks like that the system is actually MIPS, big-endian. But MIPS-I is too old. It doesn't support newer instructions that we generate (not only floating point so softfloat doesn't help).

Maybe you could try gccgo.

@draganmladjenovic
Copy link

@shownb This might be one of those Lexra cores that should be almost full mips32 sans [L|S]WL/[L|S]WR support. Can you tray https://godbolt.org/z/VQLGir on your device to see if it crashes the same way?

@golang golang locked and limited conversation to collaborators Mar 19, 2020
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

5 participants