Discussion:
[go-nuts] Cross compile question for Go version 1.5 beta3
Tad Vi
2015-07-30 16:36:19 UTC
Permalink
I am cross compiling binary from Windows to Linux/arm (WD My Cloud version
4).
Version 4 is unusual since it uses 64k page size.

set GOARM=7
set GOOS=linux
set GOARCH=arm

go build -ldflags "-R 65536"

Build runs and binary seems to work fine on WD My Cloud. Awesome.

Question: Is this enough? My binary is pretty small and does not do much at
this point. No file I/O or concurrency yet.
Is -ldflags "-R 65536" enough? Does Go 1.5 fully support 64 page sizes?
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dave Cheney
2015-07-30 20:24:17 UTC
Permalink
You might need to change the page size in runtime/arch_linux_arm.go (sic) to reflect this.

On systems with 64k page sizes the kernel will round up mmap operations to 64k boundaries, specifically munmap used by the scavenger, this will likely corrupt your heap as the scavenger thinks it is returning 4k to the OS, but the OS will free 64k around it.

Thanks

Dave
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...