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 no such instruction: error #76

Closed
akzi opened this issue Nov 21, 2019 · 6 comments
Closed

build no such instruction: error #76

akzi opened this issue Nov 21, 2019 · 6 comments

Comments

@akzi
Copy link

akzi commented Nov 21, 2019

Please answer these questions before submitting your issue. Thanks!

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

go version go1.13.4 linux/amd64

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

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go:/data/projects/go/"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build896654248=/tmp/go-build -gno-record-gcc-switches"

What did you do?

go build

If possible, provide a recipe for reproducing the error.
If you have issues building, please parse the output of go build -x

What did you expect to see?

github.com/DataDog/zstd

/tmp/cc4tDPwc.s: Assembler messages:
/tmp/cc4tDPwc.s:726: Error: no such instruction: shlx %r10,%r9,%r10' /tmp/cc4tDPwc.s:746: Error: no such instruction: shlx %r9,%rax,%rax'
/tmp/cc4tDPwc.s:797: Error: no such instruction: shrx %r9,%rax,%r9' /tmp/cc4tDPwc.s:901: Error: no such instruction: shlx %rcx,%r14,%rcx'
/tmp/cc4tDPwc.s:910: Error: no such instruction: shlx %rax,%r15,%rax' /tmp/cc4tDPwc.s:933: Error: no such instruction: shlx %rbx,%rcx,%rbx'
/tmp/cc4tDPwc.s:958: Error: no such instruction: shlx %r10,%rcx,%rcx' /tmp/cc4tDPwc.s:1030: Error: no such instruction: shrx %r9,%rax,%r9'
/tmp/cc4tDPwc.s:1046: Error: no such instruction: `shlx %rax,%rdx,%rax'
FAIL github.com/DataDog/zstd [build failed]

What did you see instead?

@JackWyj
Copy link

JackWyj commented Nov 21, 2019

hi, i got the same error, when i run go get go.mongodb.org/mongo-driver/mongo
the and my OS is CentOS release 6.8 (Final).
go env is

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/xxx/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/xxx/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build204113108=/tmp/go-build -gno-record-gcc-switches"

go build -x go.mongodb.org/mongo-driver/vendor/github.com/DataDog/zstd got output:

WORK=/tmp/go-build666743633
mkdir -p $WORK/b001/
cd /home/xxx/go/src/go.mongodb.org/mongo-driver/vendor/github.com/DataDog/zstd
CGO_LDFLAGS='"-g" "-O2"' /usr/local/go/pkg/tool/linux_amd64/cgo -objdir $WORK/b001/ -importpath go.mongodb.org/mongo-driver/vendor/github.com/DataDog/zstd -- -I $WORK/b001/ -g -O2 ./errors.go ./zstd.go ./zstd_stream.go
cd $WORK
gcc -fno-caret-diagnostics -c -x c - || true
gcc -Qunused-arguments -c -x c - || true
gcc -fdebug-prefix-map=a=b -c -x c - || true
gcc -gno-record-gcc-switches -c -x c - || true
cd $WORK/b001
gcc -I /home/xxx/go/src/go.mongodb.org/mongo-driver/vendor/github.com/DataDog/zstd -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -I ./ -g -O2 -o ./_x001.o -c _cgo_export.c
gcc -I /home/xxx/go/src/go.mongodb.org/mongo-driver/vendor/github.com/DataDog/zstd -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -I ./ -g -O2 -o ./_x002.o -c errors.cgo2.c
gcc -I /home/xxx/go/src/go.mongodb.org/mongo-driver/vendor/github.com/DataDog/zstd -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -I ./ -g -O2 -o ./_x003.o -c zstd.cgo2.c
gcc -I /home/xxx/go/src/go.mongodb.org/mongo-driver/vendor/github.com/DataDog/zstd -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -I ./ -g -O2 -o ./_x004.o -c zstd_stream.cgo2.c
cd /home/xxx/go/src/go.mongodb.org/mongo-driver/vendor/github.com/DataDog/zstd
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -I $WORK/b001/ -g -O2 -o $WORK/b001/_x005.o -c cover.c
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -I $WORK/b001/ -g -O2 -o $WORK/b001/_x006.o -c debug.c
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -I $WORK/b001/ -g -O2 -o $WORK/b001/_x007.o -c divsufsort.c
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -I $WORK/b001/ -g -O2 -o $WORK/b001/_x008.o -c entropy_common.c
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -I $WORK/b001/ -g -O2 -o $WORK/b001/_x009.o -c error_private.c
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -I $WORK/b001/ -g -O2 -o $WORK/b001/_x010.o -c fastcover.c
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -I $WORK/b001/ -g -O2 -o $WORK/b001/_x011.o -c fse_compress.c
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -I $WORK/b001/ -g -O2 -o $WORK/b001/_x012.o -c fse_decompress.c
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -I $WORK/b001/ -g -O2 -o $WORK/b001/_x013.o -c hist.c
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK/b001=/tmp/go-build -gno-record-gcc-switches -I $WORK/b001/ -g -O2 -o $WORK/b001/_x014.o -c huf_compress.c
# go.mongodb.org/mongo-driver/vendor/github.com/DataDog/zstd
/tmp/ccjaSIIg.s: Assembler messages:
/tmp/ccjaSIIg.s:726: Error: no such instruction: `shlx %r10,%r9,%r10'
/tmp/ccjaSIIg.s:746: Error: no such instruction: `shlx %r9,%rax,%rax'
/tmp/ccjaSIIg.s:797: Error: no such instruction: `shrx %r9,%rax,%r9'
/tmp/ccjaSIIg.s:901: Error: no such instruction: `shlx %rcx,%r14,%rcx'
/tmp/ccjaSIIg.s:910: Error: no such instruction: `shlx %rax,%r15,%rax'
/tmp/ccjaSIIg.s:933: Error: no such instruction: `shlx %rbx,%rcx,%rbx'
/tmp/ccjaSIIg.s:958: Error: no such instruction: `shlx %r10,%rcx,%rcx'
/tmp/ccjaSIIg.s:1030: Error: no such instruction: `shrx %r9,%rax,%r9'
/tmp/ccjaSIIg.s:1046: Error: no such instruction: `shlx %rax,%rdx,%rax'

Thanks for issues opened, need you help, thank you

@JackWyj
Copy link

JackWyj commented Nov 21, 2019

And i am using go version go1.10.3 linux/amd64

@Viq111
Copy link
Collaborator

Viq111 commented Dec 3, 2019

Hi both,

Sorry for the delayed answer.
This looks to be coming from the C code of zstd which is from facebook/zstd

It looks similar to facebook/zstd#1283
And for centos 6, same issue as CMU-Perceptual-Computing-Lab/caffe_rtpose#6.

Would you mind posting your gcc & g++ version you are compiling with ?

The answer to this is probably going to be similar to facebook/zstd#1283 (comment)

@JackWyj
Copy link

JackWyj commented Dec 4, 2019

well, they are g++ (GCC) 4.8.0 and gcc (GCC) 4.8.0

@JackWyj
Copy link

JackWyj commented Dec 4, 2019

Have read that, if it were CMU-Perceptual-Computing-Lab/caffe_rtpose#6 , but I built by golang tools and haven't find a way to pass options like -march=native, is there a way to do it? Any help will be appreciated, thankyou.

@zjkyz8
Copy link

zjkyz8 commented Oct 19, 2021

I have same issue when use docker library/golang:1.16.9-alpine image to build, anything i can do to resolve this issue?

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

4 participants