suft
suft copied to clipboard
assembly code fails the build
There are some assembly code related to poll deadline. Can they be changed to pure Go?
$ go version
go version go1.16 darwin/amd64
$ go install
/usr/local/go/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
Undefined symbols for architecture x86_64:
"_net.runtime_pollSetDeadline", referenced from:
_github.com/spance/suft/protocol.net_pollSetDeadline in go.o
"_time.runtimeNano", referenced from:
_github.com/spance/suft/protocol.runtimeNano in go.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$ CGO=0 go install
/usr/local/go/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
Undefined symbols for architecture x86_64:
"_net.runtime_pollSetDeadline", referenced from:
_github.com/spance/suft/protocol.net_pollSetDeadline in go.o
"_time.runtimeNano", referenced from:
_github.com/spance/suft/protocol.runtimeNano in go.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$ GOOS=linux go build
github.com/spance/suft/protocol.runtimeNano: relocation target time.runtimeNano not defined
github.com/spance/suft/protocol.net_pollSetDeadline: relocation target net.runtime_pollSetDeadline not defined
I am facing the same error.