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

runtime: illegal instruction on mipsel (mipsle) platform #18880

Closed
Baozisoftware opened this issue Feb 1, 2017 · 3 comments
Closed

runtime: illegal instruction on mipsel (mipsle) platform #18880

Baozisoftware opened this issue Feb 1, 2017 · 3 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@Baozisoftware
Copy link

Baozisoftware commented Feb 1, 2017

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

go1.8rc3.linux-amd64
DL:https://storage.googleapis.com/golang/go1.8rc3.linux-amd64.tar.gz

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

All use default.

What did you do?

1.Create a test.go:

package main

import (
	"fmt"
)

func main() {
	fmt.Println("Hello world!")
}

2.Buid to mipsle:

GOARCH=mipsle go build test.go

3.use "file test" output:

test: ELF 32-bit LSB executable, MIPS, MIPS32 version 1 (SYSV), statically linked, not stripped

4.Copy the file to OpenWrt router(kernel:4.4.14):
---cat /proc/cpuinfo---

system type		: MediaTek MT7620A ver:2 eco:6
machine			: OY-0001
processor		: 0
cpu model		: MIPS 24KEc V5.0
BogoMIPS		: 398.13
wait instruction	: yes
microsecond timers	: yes
tlb_entries		: 32
extra interrupt vector	: yes




hardware watchpoint	: yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa			: mips1 mips2 mips32r1 mips32r2
ASEs implemented	: mips16 dsp
shadow register sets	: 1
kscratch registers	: 0
package			: 0
core			: 0
VCED exceptions		: not available
VCEI exceptions		: not available
system type		: MediaTek MT7620A ver:2 eco:6
machine			: OY-0001
processor		: 0
cpu model		: MIPS 24KEc V5.0
BogoMIPS		: 398.13
wait instruction	: yes
microsecond timers	: yes
tlb_entries		: 32
extra interrupt vector	: yes
hardware watchpoint	: yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa			: mips1 mips2 mips32r1 mips32r2
ASEs implemented	: mips16 dsp
shadow register sets	: 1
kscratch registers	: 0
package			: 0
core			: 0
VCED exceptions		: not available
VCEI exceptions		: not available

5.use "test" in router output:
Illegal instruction

What did you expect to see?

output:
Hello world!

What did you see instead?

output:
Illegal instruction

@Baozisoftware Baozisoftware changed the title illegal instruction on mipsel platform Illegal instruction on mipsel platform Feb 1, 2017
@Baozisoftware Baozisoftware changed the title Illegal instruction on mipsel platform Illegal instruction on mipsel(mipsle) platform Feb 1, 2017
@ALTree
Copy link
Member

ALTree commented Feb 1, 2017

Is kernel FPU emulation enabled on the target machine? That is required for running go1.8 on mipsle:

Go now supports 32-bit MIPS on Linux for both big-endian (linux/mips) and little-endian machines (linux/mipsle) that implement the MIPS32r1 instruction set with FPU or kernel FPU emulation. Note that many common MIPS-based routers lack an FPU and have firmware that doesn't enable kernel FPU emulation; Go won't run on such machines.

@ALTree ALTree changed the title Illegal instruction on mipsel(mipsle) platform runtime: illegal instruction on mipsel (mipsle) platform Feb 1, 2017
@ALTree ALTree added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Feb 1, 2017
@Baozisoftware
Copy link
Author

OpenWrt:
make kernel_menuconfig
--> Kernel type
---->set MIPS FPU Emulator = y

Build image.
enjoy,thanks very much!

@minux
Copy link
Member

minux commented Feb 1, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants