suft icon indicating copy to clipboard operation
suft copied to clipboard

assembly code fails the build

Open chrislusf opened this issue 3 years ago • 1 comments

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

chrislusf avatar Mar 13 '21 20:03 chrislusf

I am facing the same error.

shyamjesal avatar Dec 27 '22 20:12 shyamjesal