Closed alllexx88 closed 6 years ago
We have used gccgo a year ago - https://github.com/Entware-ng/Entware-ng/commit/52674535d1bd02820da75dd652db15251887361b#diff-a2940e5596906c384dcd1e882c6131fe I have switched development to google go compiler (it supports mip & mipsel now) and prefer to build entware for modern kernels - https://github.com/Entware-for-kernel-3x/Entware-ng-3x Old kernels give a lot of headache. We had a working gccgo syncting package for mipsel some time ago (2016) - http://forums.zyxmon.org/viewtopic.php?f=5&t=5376
Old kernels give a lot of headache.
Agree 100%. Unfortunately, some platforms are stuck with 2.6.22.19
on MIPS, like Broadcom platforms, which have some closed-source kernel modules.
I see no sense to add heavy packages (including GO packages) for relative weak MIPS devices, sorry.
@ryzhovau I don't quite agree that my RT-N66U with 600MHZ CPU and 256 MB RAM is weak. syncthing
is heavy on RAM, but adding swap makes it usable. But I respect your choice. Thanks
Hi, seeing some closed issues (at least #857), I understand you're already aware of the problem. MIPS TomatoUSB, for example, is running a
2.6.22.19
kernel, which is apparently too old for current Go. e.g., running Entware-ngsyncthing
produces this error:and trying to list files using
rclone
gives this:The pipe error has a workaround on Optware-ng: see mips_no_pipe2.patch at https://github.com/Optware/Optware-ng/tree/master/sources/golang
The
net.Listen
error (rclone
error from above) is trickier, I don't know of a workaround for it yet (see https://github.com/golang/go/issues/23446).Now, the (maybe) interesting part.
Optware-ng
syncthing
andrclone
MIPS packages are built usinggccgo
: though it's a bit hacky to achieve, the resulting packages work fine on2.6.22.19
kernel. In case you're interested in details, I'm using the following for this:1.10beta2
in my case, for MIPS softfloat support)gccgo
fromgcc-7.2.0
toolchaingcc-7.2.0
withgo
(gccgo
and gotools). I do a little patching to build gotools (add-lpthread
link flag) and use agccgo
wrapper that invokes$0.real "$@" -lpthread
, since (static)libgo
uses symbols fromlibpthread
, and compiling Go code fails without the flag (I use hostgccgo
to bootstrap Go)And this is how I build
rclone
andsyncthing
:.../vendor/golang.org/x/sys/unix
with ordinary Go with-compiler gccgo
switch: usinggo
fromgcc
gotools skips buildinggccgo_c.c
, which leads to multiple undefined references togccgoRealSyscall
go
fromgcc
gotools(With
syncthing
I'm patchingbuild.go
for this)See rclone.mk and syncthing.mk for the reference.
What do you think about this?