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
cmd/compile: It seems go:linkname gopark runtime.gopark and go:linkname goready runtime.goready on arm not work #23080
Comments
Thank you for raising this issue. It looks like you are compiling go
netstack in a way that is not expected.
Can you please try the getting started instructions
https://github.com/google/netstack#getting-started
And post the _complete_ output you see.
…On Mon, Dec 11, 2017 at 1:27 PM, 浮生 ***@***.***> wrote:
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
go 1.8.1 and 1.9.2
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env)?
darwin with golang 1.9.2
archlinux with golang 1.9.2
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/yy/dev/go"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build997705220=/tmp/go-build -gno-record-gcc-switches"
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"
also Raspberry Pi 3 Model B arm structure with golang 1.8.1
What did you do?
I am crossing compiling google/netstack
<https://github.com/google/netstack/blob/master/sleep/sleep_unsafe.go#L78-L81>.
It worked fine on linux, darwin and windows.
But failed on arm(eg: android, raspberry pi3).
What did you expect to see?
build success
What did you see instead?
The error log is
GOOS=linux GOARM=7 GOARCH=arm go build -o main main.go
../../netstack/sleep/sleep_unsafe.go:78:6: missing function body
../../netstack/sleep/sleep_unsafe.go:81:6: missing function body
This line
<https://github.com/google/netstack/blob/master/sleep/sleep_unsafe.go#L78-L81>
And then, I try it on raspberry pi3 in real device with go build -o main
main.go. The same error log.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#23080>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAcAw7CulEB_Q__r_5HHcev-HJxMV7Pks5s_JMlgaJpZM4Q8ySO>
.
|
Command Output
And error in
The only question is go:linkname gopark runtime.gopark and go:linkname goready runtime.goready on arm not work.
|
I think there are a few bugs here.
# github.com/google/netstack/sleep
sleep/sleep_unsafe.go:78:6
<http://github.com/google/netstack/sleepsleep/sleep_unsafe.go:78:6>:
missing function body
sleep/sleep_unsafe.go:81:6: missing function body
This looks like -complete is bing passed to the compiler, which is a
mistake, this package is not complete. Can you please try
GOOS=linux GOARCH=arm GOARM=7 go build -x
github.com/google/netstack/tcpip/sample/tun_tcp_echo
And post the full output.
The rest of the errors
And error in # github.com/google/netstack/tcpip/link/rawfile, I have solved.
# github.com/google/netstack/tcpip/link/rawfile
tcpip/link/rawfile/rawfile_unsafe.go:20:6
<http://github.com/google/netstack/tcpip/link/rawfiletcpip/link/rawfile/rawfile_unsafe.go:20:6>:
missing function body
tcpip/link/rawfile/rawfile_unsafe.go:75:7: cannot use uint64(len(b1))
(type uint64) as type uint32 in field value
tcpip/link/rawfile/rawfile_unsafe.go:79:7: cannot use uint64(len(b2))
(type uint64) as type uint32 in field value
Are no a go problem, they are a limitation of the package, it looks
like the arm support is not complete. You should report the lack of
arm support on the https://github.com/google/netstack project.
…On Mon, Dec 11, 2017 at 1:56 PM, 浮生 ***@***.***> wrote:
Command GOOS=linux GOARCH=arm GOARM=7 go install
github.com/google/netstack/tcpip/sample/tun_tcp_echo
Output
# github.com/google/netstack/sleep
sleep/sleep_unsafe.go:78:6 <http://github.com/google/netstack/sleepsleep/sleep_unsafe.go:78:6>: missing function body
sleep/sleep_unsafe.go:81:6: missing function body
# github.com/google/netstack/tcpip/link/rawfile
tcpip/link/rawfile/rawfile_unsafe.go:20:6 <http://github.com/google/netstack/tcpip/link/rawfiletcpip/link/rawfile/rawfile_unsafe.go:20:6>: missing function body
tcpip/link/rawfile/rawfile_unsafe.go:75:7: cannot use uint64(len(b1)) (type uint64) as type uint32 in field value
tcpip/link/rawfile/rawfile_unsafe.go:79:7: cannot use uint64(len(b2)) (type uint64) as type uint32 in field value
And error in # github.com/google/netstack/tcpip/link/rawfile, I have
solved.
# github.com/google/netstack/tcpip/link/rawfile
tcpip/link/rawfile/rawfile_unsafe.go:20:6 <http://github.com/google/netstack/tcpip/link/rawfiletcpip/link/rawfile/rawfile_unsafe.go:20:6>: missing function body
tcpip/link/rawfile/rawfile_unsafe.go:75:7: cannot use uint64(len(b1)) (type uint64) as type uint32 in field value
tcpip/link/rawfile/rawfile_unsafe.go:79:7: cannot use uint64(len(b2)) (type uint64) as type uint32 in field value
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#23080 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAcA3O6zfYvu9S_IY5VLcDmuGbvGXzHks5s_JnggaJpZM4Q8ySO>
.
|
command
|
I think the problem is there is no .s file visible in the set of files to
compile for the sleep package so -complete is being passed to the compiler.
If you copy this file
https://github.com/google/netstack/blob/master/sleep/commit_arm64.s
To commit_arm.s
Then that should solve this problem.
…On Mon, Dec 11, 2017 at 2:12 PM, 浮生 ***@***.***> wrote:
command GOOS=linux GOARCH=arm GOARM=7 go build -x
github.com/google/netstack/tcpip/sample/tun_tcp_echo
Output
WORK=/var/folders/zz/3gn7zjp91vdd3dxwgq4b089w0000gn/T/go-build007862576
mkdir -p $WORK/github.com/google/netstack/tcpip/link/rawfile/_obj/
mkdir -p $WORK/github.com/google/netstack/tcpip/link/
mkdir -p $WORK/github.com/google/netstack/sleep/_obj/
cd /Users/kingyang/go/src/github.com/google/netstack/tcpip/link/rawfile
/usr/local/opt/go/libexec/pkg/tool/darwin_amd64/compile <http://github.com/google/netstack/tcpip/link/rawfile/usr/local/opt/go/libexec/pkg/tool/darwin_amd64/compile> -o $WORK/github.com/google/netstack/tcpip/link/rawfile.a -trimpath $WORK -goversion go1.9.2 -p github.com/google/netstack/tcpip/link/rawfile -complete -buildid a98b2111a45a16511e8469fa66450690c48db39b -D _/Users/kingyang/go/src/github.com/google/netstack/tcpip/link/rawfile -I $WORK -I /Users/kingyang/go/pkg/linux_arm -pack ./errors.go ./rawfile_unsafe.go
mkdir -p $WORK/github.com/google/netstack/
cd /Users/kingyang/go/src/github.com/google/netstack/sleep
/usr/local/opt/go/libexec/pkg/tool/darwin_amd64/compile <http://github.com/google/netstack/sleep/usr/local/opt/go/libexec/pkg/tool/darwin_amd64/compile> -o $WORK/github.com/google/netstack/sleep.a -trimpath $WORK -goversion go1.9.2 -p github.com/google/netstack/sleep -complete -buildid 91e2d39e252c9958acba4ce484c3bf8be1d6088b -D _/Users/kingyang/go/src/github.com/google/netstack/sleep -I $WORK -pack ./commit_noasm.go ./sleep_unsafe.go
# github.com/google/netstack/sleep
../../../sleep/sleep_unsafe.go:78:6: missing function body
../../../sleep/sleep_unsafe.go:81:6: missing function body
# github.com/google/netstack/tcpip/link/rawfile
../../link/rawfile/rawfile_unsafe.go:20:6: missing function body
../../link/rawfile/rawfile_unsafe.go:75:7: cannot use uint64(len(b1)) (type uint64) as type uint32 in field value
../../link/rawfile/rawfile_unsafe.go:79:7: cannot use uint64(len(b2)) (type uint64) as type uint32 in field value
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#23080 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAcA5h4Vgm6Gg2IrTgvf5vz80IKzvJjks5s_J2MgaJpZM4Q8ySO>
.
|
Thanks very much, it is my fault. |
How did you judge there is missing commit_arm.s?Experience? |
@FlowerWrong sadly yes, you need to know the magic of how Because the function isn't implemented in Go, there has to be a 'stub' function, a forward declaration that tells the compiler that something else will provide the code for that function -- this is usually done by an assembly function in the same package, but in the case of This is what the Anyway, the compiler can't figure out complete status on its own, so it relies on the |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go 1.8.1 and 1.9.2
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?darwin with golang 1.9.2
archlinux with golang 1.9.2
also
Raspberry Pi 3 Model B arm structure
with golang 1.8.1What did you do?
I am crossing compiling google/netstack. It worked fine on linux, darwin and windows.
But failed on arm(eg: android, raspberry pi3).
What did you expect to see?
build success
What did you see instead?
The error log is
This line
And then, I try it on raspberry pi3 in real device with
go build -o main main.go
. The same error log.The text was updated successfully, but these errors were encountered: