FS#30287 - [go] include support for crosscompiling
Attached to Project:
Community Packages
Opened by Kev (Kev) - Thursday, 14 June 2012, 09:54 GMT
Last edited by Alexander F. Rødseth (xyproto) - Thursday, 02 May 2013, 13:53 GMT
Opened by Kev (Kev) - Thursday, 14 June 2012, 09:54 GMT
Last edited by Alexander F. Rødseth (xyproto) - Thursday, 02 May 2013, 13:53 GMT
|
Details
Description:
go has great support for crosscompiling builtin but the archlinux package does not include the necessary tools for it. These are: * 5g * 5l * 5c * 5a (for ARM) * 8g * 8l * 8c * 8a (for 32 Bit) See [1] for reference. So please modify the PKGBUILD so that these tools are included in the package. Additional info: * package version(s): community/go 2:1.0.1-6 Steps to reproduce: 1. install go. 2. Create a helloworld.go example (from [2]) 3. Try to compile for ARMv5: export GOARCH=arm export GOARM=5 go build helloworld.go go build runtime: exec: "/usr/lib/go/pkg/tool/linux_amd64/5g": stat /usr/lib/go/pkg/tool/linux_amd64/5g: no such file or directory [1] http://golang.org/doc/install/source [2] http://golang.org/doc/install/source#testing |
This task depends upon
Closed by Alexander F. Rødseth (xyproto)
Thursday, 02 May 2013, 13:53 GMT
Reason for closing: Fixed
Additional comments about closing: 552MB is a bit too much for adding cross compilation for all platforms. Might split this package in the future. Uploading an alternative package to AUR for now.
Thursday, 02 May 2013, 13:53 GMT
Reason for closing: Fixed
Additional comments about closing: 552MB is a bit too much for adding cross compilation for all platforms. Might split this package in the future. Uploading an alternative package to AUR for now.
You may want to have a look at my tweaked PKGBUILD:
https://aur.archlinux.org/packages.php?ID=60051
It produces the compiler for 6G (AMD64) and 5G (ARM) or 8G (x86) and 5G (ARM).
There are some failed tests during the build sometimes(!) but the produced binaries are fine so far.
Maybe you need to compile the toolchain twice to get all three architectures and then merge them together during the package process. But maybe there is a better way.
export GOARCH=arm
bash make.bash
at the end of the build function, and it appears to work. I was able to successfully compile a Go program for ARM too.
Could this be re-enabled?
fork/exec /tmp/go-build457724733/unicode/utf16/_test/utf16.test: exec format error
FAIL unicode/utf16 0.002s
That is the background for the removal, since this happened after one of the later Go releases.
Do you get different output?
Any ideas or solutions are welcome, as I too want to include support for crosscompiling for ARM.
I just tried copying the "export GOARCH" test at the top of the build function into the check function, which seems to fix the issue.
Either way, even if the check function fails (because of the ARM binaries), the compilers for both x64 and arm seem to work well.
In the mean time, there is "go-full" on AUR, that I just uploaded: https://aur.archlinux.org/packages/go-full/