Support for golang


I noticed LEDE has had zero support for golang in its current packages. There has been some discussion and hacky workarounds in OpenWRT, but I am interested in if someone has already started the process as I'd rather not reinvent the wheel?

I am quite competent packaging and working with OpenWRT as I've ported about three commercial boards.

1 Like

The main roadblock is that Go currently does not build on musl toolchains. Until this is solved, there will be no support for it.

You can build the Go compiler if you compile LEDE yourself with glibc instead of musl.

This article suggests it might be possible to build golang using static linking. True?

Any update regarding this topic ?

it would be better to ask on the go development forums, checking to see if they
can compile with musl yet.

It is best to statically build golang via an external toolchain. However, I hope your Golang version has been patched to work correctly as Fork and virtual memory are rather... obese. :wink:

Runtime shrinking should also be important to you as well on memory/storage constrained devices too.

At the end of the day what we did was create a local feed with a local package. Jenkins builds the binaries as a seperate project and inserts the build products into the local package. The LEDE package makefile has an empty, compile directive installs it into the rootfs/firmware. This works for us, but it is... less than ideal.

Go builds on musl (Alpine Linux).

By the way, will Openwrt continue to support uClibC, or will that be deprecated in favor of musl soon?

There is a pull request for Go lang:

1 Like