[Buildroot] [PATCH v3 5/6] package/flannel: Add BR2_TOOLCHAIN_HAS_THREADS

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Tue May 31 20:56:42 UTC 2016


Hello,

On Tue, 31 May 2016 13:47:52 -0700, Geoff Levand wrote:

> Looking at the go sources, they force -pie when compiling cgo support
> for ARM.  See line number 3188 in https://golang.org/src/cmd/go/build.go.

Can you get more details than the "get accurate imported sym" the code
has?

> I think the only solution is to not build go packages that use cgo
> when BR2_arm && BR2_TOOLCHAIN_USES_UCLIBC, so something like this:
> 
> +# cgo on ARM requires PIE linkage, which is not compatable with uClibc.
> +comment "flannel is not available with uClibc-based toolchain on ARM architecture"
> +       depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
> +       depends on BR2_TOOLCHAIN_HAS_THREADS
> +       depends on BR2_arm && BR2_TOOLCHAIN_USES_UCLIBC
> +
>  config BR2_PACKAGE_FLANNEL
>         bool "flannel"
>         depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
>         depends on BR2_TOOLCHAIN_HAS_THREADS
> +       depends on !(BR2_arm && BR2_TOOLCHAIN_USES_UCLIBC)
>         help
> 
> If this looks OK, I'll submit a patch.

This is really annoying, as all Go packages that need cgo support will
not work in what is probably Buildroot's most widely used
configuration: ARM with uClibc.

So I'd really like to push things a bit further, and either fix uClibc
so that static+PIE works, or understand why Go wants PIE on ARM.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com



More information about the buildroot mailing list