Skip to content

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

Closed

Description

@shownb

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

Activity

  1. cherrymui commented on Mar 16, 2019

    @cherrymui
    Member

    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.

  2. shownb commented on Mar 16, 2019

    @shownb
    Author

    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?

  3. katiehockman commented on Mar 19, 2019

    @katiehockman
    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.

  4. added this to the Unplanned milestone on Mar 19, 2019
  5. shownb commented on Mar 19, 2019

    @shownb
    Author

    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.

  6. cherrymui commented on Mar 19, 2019

    @cherrymui
    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.

  7. draganmladjenovic commented on Mar 20, 2019

    @draganmladjenovic

    @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?

  8. locked and limited conversation to collaborators on Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions