6016dad5cf
Even when configured for cross-compilation, the go compiler is always able to build natively as well, and this is was we use in Buildroot to build host go packages. This implies that when the target has limitations, those limitations thus also apply to the host builds. This means that, when there is no CGO linking support for the target, the compiler is built without CGO linking support, and thus CGO linking is also not available for the host builds. Of course, when there is no go support for the target, the CGO linking support only depends on the host architecture. Add a new Kconfig symbol that repesent whether CGO linking is available for the host; host packages can then depend on that symbol, like the target variants do on the corresponding target symbol. The dependencies of this symbol are a bit complicated. Fortunately, because it is a blind symbol, we can write it with a combination of "default y" and "depends on" statements. As mentioned, CGO for the host is available if CGO is available for the target, but also if Go is not available for the target at all. In addition, Go must of course be available for the host. There are also the toolchain constraints of CGO. We exclude MIPS64 explicitly based on BR2_HOSTARCH. For the host, we always assume that dynamic library and threads are available so we don't have conditions for that. Signed-off-by: Yann E. MORIN <yann.morin@orange.com> Cc: Thomas Perale <thomas.perale@mind.be> Cc: Christian Stewart <christian@aperture.us> Cc: Anisse Astier <anisse@astier.eu> Signed-off-by: Arnout Vandecappelle <arnout@mind.be>