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

build for mipsle failed #715

Closed
hongjinlin opened this issue May 9, 2019 · 5 comments
Closed

build for mipsle failed #715

hongjinlin opened this issue May 9, 2019 · 5 comments

Comments

@hongjinlin
Copy link

CC=mips-linux-musl-gcc CXX=mips-linux-musl-g++ CGO_ENABLED=1 GOOS=linux GOARCH=mipsle GOMIPS=softfloat go build -ldflags="-s -w" main.go

How can i build for little endian?Thank you!
If i change "GOARCH=mipsle" To "GOARCH=mips" is ok, but my target is little endian~

Originally posted by @hongjinlin in #384 (comment)

command-line-arguments

/usr/local/Cellar/go/1.11.2/libexec/pkg/tool/darwin_amd64/link: running mips-linux-musl-gcc failed: exit status 1
/usr/local/Cellar/musl-cross/0.9.7_1/libexec/bin/../lib/gcc/mips-linux-musl/6.3.0/../../../../mips-linux-musl/bin/ld: /var/folders/1q/3d6q6x2s6057s6fgwdxr7ffw0000gn/T/go-link-651072203/go.o: compiled for a little endian system and target is big endian
/usr/local/Cellar/musl-cross/0.9.7_1/libexec/bin/../lib/gcc/mips-linux-musl/6.3.0/../../../../mips-linux-musl/bin/ld: /var/folders/1q/3d6q6x2s6057s6fgwdxr7ffw0000gn/T/go-link-651072203/go.o: endianness incompatible with that of the selected emulation
/usr/local/Cellar/musl-cross/0.9.7_1/libexec/bin/../lib/gcc/mips-linux-musl/6.3.0/../../../../mips-linux-musl/bin/ld: failed to merge target specific data of file /var/folders/1q/3d6q6x2s6057s6fgwdxr7ffw0000gn/T/go-link-651072203/go.o
collect2: error: ld returned 1 exit status

@hongjinlin
Copy link
Author

MacOS Majove 0.14.4 (18E226)

go version go1.11.2 darwin/amd64

go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/hongjinlin/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/hongjinlin/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11.2/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/1q/3d6q6x2s6057s6fgwdxr7ffw0000gn/T/go-build079041265=/tmp/go-build -gno-record-gcc-switches -fno-common"

@rittneje
Copy link
Collaborator

I'm not very familiar with mips, but are you sure you are using the right C compiler? From what I can find it sounds like you are supposed to be using mipsel-linux-musl-gcc instead.

@hongjinlin
Copy link
Author

I'm not very familiar with mips, but are you sure you are using the right C compiler? From what I can find it sounds like you are supposed to be using mipsel-linux-musl-gcc instead.

#384 (comment)
I use this tool , i also can not found, it is my also my question
brew install FiloSottile/musl-cross/musl-cross --with-mipsel

@rittneje
Copy link
Collaborator

rittneje commented May 26, 2019

@hongjinlin Please do CC=mipsel-linux-musl-gcc instead. (You don't actually have to set CXX so that part can be removed.)

I'm not sure that the homebrew script you are using actually supports installing that particular compiler. If not, you will have to manually install it from https://github.com/richfelker/musl-cross-make by running TARGET=mipsel-linux-musl make && TARGET=mipsel-linux-musl make install.

@hongjinlin
Copy link
Author

@rittneje I have tried "https://github.com/richfelker/musl-cross-make" this tool before,but build failed on my mac ,i have used ql database instead.Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants