Open dstark1993 opened 1 year ago
This happens to me also.
Same here, is there a fix for it?
First option: Install gcc
on Windows, set CGO_ENABLED=1
environment variable before compilation so that it compiles the C part during go build:
CGO_ENABLED=1 go build -v -tags netgo,osusergo -o ./bin/ . ./cmd/...
Optionally you can also set CC
environment variable if multiple gcc
installation exists.
Second option: Cross compile on Linux for Windows:
CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -v -tags netgo,osusergo -o ./bin/ . ./cmd/...
If needed extend both with -s
and -w
for striping to get smaller binaries and -extldflags=-static
for static linking.
First option: Install
gcc
on Windows, setCGO_ENABLED=1
environment variable before compilation so that it compiles the C part during go build:第一个选项:在 Windows 上安装gcc
,在编译前设置CGO_ENABLED=1
环境变量,以便在 go 构建期间编译 C 部分:CGO_ENABLED=1 go build -v -tags netgo,osusergo -o ./bin/ . ./cmd/...
Optionally you can also set
CC
environment variable if multiplegcc
installation exists.(可选)如果存在多个gcc
安装,您还可以设置CC
环境变量。Second option: Cross compile on Linux for Windows:
CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -v -tags netgo,osusergo -o ./bin/ . ./cmd/...
If needed extend both with
-s
and-w
for striping to get smaller binaries and-extldflags=-static
for static linking.如果需要,可以扩展 with-s
和-w
for striping,以获得较小的二进制文件和-extldflags=-static
静态链接。
GOOS=linux GOARCH=arm64 CGO_ENABLED=1 go build -ldflags="-s -w" -tags="netgo osusergo" -o output_fil ename
gcc_arm64.S: Assembler messages:
gcc_arm64.S:30: 错误: no such instruction: stp x29,x30,[sp,' gcc_arm64.S:34: 错误: operand size mismatch for
mov'
gcc_arm64.S:36: 错误: no such instruction: stp x19,x20,[sp,' gcc_arm64.S:39: 错误: no such instruction:
stp x21,x22,[sp,'
gcc_arm64.S:42: 错误: no such instruction: stp x23,x24,[sp,' gcc_arm64.S:45: 错误: no such instruction:
stp x25,x26,[sp,'
gcc_arm64.S:48: 错误: no such instruction: stp x27,x28,[sp,' gcc_arm64.S:52: 错误: operand size mismatch for
mov'
gcc_arm64.S:53: 错误: operand size mismatch for mov' gcc_arm64.S:54: 错误: operand size mismatch for
mov'
gcc_arm64.S:56: 错误: no such instruction: blr x20' gcc_arm64.S:57: 错误: no such instruction:
blr x19'
gcc_arm64.S:59: 错误: no such instruction: ldp x27,x28,[sp,' gcc_arm64.S:62: 错误: no such instruction:
ldp x25,x26,[sp,'
gcc_arm64.S:65: 错误: no such instruction: ldp x23,x24,[sp,' gcc_arm64.S:68: 错误: no such instruction:
ldp x21,x22,[sp,'
gcc_arm64.S:71: 错误: no such instruction: ldp x19,x20,[sp,' gcc_arm64.S:74: 错误: no such instruction:
ldp x29,x30,[sp],'
After cloning https://github.com/kaspanet/kaspad and running '''install . ./cmd/...''' from the kaspad directory, there are several errors because of muhash (I presume is the type declaration?).
OS: Windows 10 64bit Golang: version go1.20.2 windows/amd64