-
Notifications
You must be signed in to change notification settings - Fork 17.4k
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
runtime: cannot run cross compiled ARM binary on QEMU #20763
Comments
|
Working around QEMU bugs is not a priority for the Go team so I won't target this for any release, but we can keep it open for tracking. We test on real hardware. And QEMU in full system emulation mode works as well. But if somebody else wants to investigate this, it's all yours. |
Here is a patch for go which fixes the issue. It might even be correct but I don't really know! Maybe the issue should be re-opened? See also ubuntu bug tracker. diff --git a/src/runtime/os_linux.go b/src/runtime/os_linux.go
index a6efc0e3d1..64218e3f7e 100644
--- a/src/runtime/os_linux.go
+++ b/src/runtime/os_linux.go
@@ -132,7 +132,8 @@ const (
_CLONE_FS | /* share cwd, etc */
_CLONE_FILES | /* share fd table */
_CLONE_SIGHAND | /* share sig handler table */
- _CLONE_THREAD /* revisit - okay for now */
+ _CLONE_THREAD | /* revisit - okay for now */
+ _CLONE_SYSVSEM
)
//go:noescape |
Sure, I'll reopen given the renewed discussion and investigation in that Ubuntu bug. |
Yikes. Clone and SysV semaphores. Two of my favorite things. @ncw's patch is clearly safe and arguably even the right thing to do (though since Go never exits Go-created threads I don't think the difference is actually observable even if you tried, but I've got patches lined up that will change that). glibc passes I'll send this as a CL in a bit (unless you want to send it @ncw). |
CL https://golang.org/cl/48170 mentions this issue. |
There is an issue of QEMU v2.9.0 and Go so we can not use that version to build the binary (ref golang/go#20763)
What version of Go are you using (
go version
)?go version go1.8.3 linux/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
I'm try compile for ARMv* and test it on QEMU (qemu version 2.9.0)
Source
Build
GOARCH=arm64 go build -o hello_go hello.go
and runFor ARMv5
GOARCH=arm go build -o hello_go hello.go
I'm not sure that the error in the Go compiler, but
The text was updated successfully, but these errors were encountered: