Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 4/9] package/go: Add BR2_TOOLCHAIN_HAS_THREADS
Date: Fri, 13 May 2016 15:35:02 +0200	[thread overview]
Message-ID: <20160513153502.47b944fe@free-electrons.com> (raw)
In-Reply-To: <1463077924.23824.35.camel@infradead.org>

Hello,

On Thu, 12 May 2016 11:32:04 -0700, Geoff Levand wrote:

> OK, so a Config.host.in like this?
> 
> config BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
> 	bool
> 	default y
> 	depends on BR2_arm || BR2_aarch64 || BR2_i386 || BR2_x86_64 || BR2_powerpc64 || BR2_powerpc64le || BR2_mips64 || BR2_mips64el
> 	depends on !BR2_ARM_CPU_ARMV4
> 
> comment "go needs a toolchain w/ threads"
> 	depends on !BR2_TOOLCHAIN_HAS_THREADS
> 	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS

No, because we don't show comments for host packages (since most of
them are not selectable in menuconfig).

Unfortunately, the only solution that I see now is that *target* go
packages (such as flannel) should have this dependency on
BR2_TOOLCHAIN_HAS_THREADS + the comment.

All in all, I am in fact not super happy with how we're handling this,
but I don't really see how to do it better. One option would be to make
the go package a target package rather than a host package. But it's
also weird because it basically installs nothing to the target.

> > When you say "CGO needs thread support", is CGO the go runtime on the
> > target? Does this means that any Go program needs threads?  
> 
> cgo is the C language call support and has a runtime component (the
> cgo package).

Are all Go packages going to use "cgo" ? Or are pure Go software
potentially not using cgo ?

> The host go compiler and some host tools use pthreads, and so are
> linked with libpthread.

The fact that the host go compiler uses threads is irrelevant. The
BR2_TOOLCHAIN_HAS_THREADS boolean indicate whether there is thread
support or not on the *target*. You can basically assume that thread
support is always available on the host.

> If a target go program uses the cgo package, it will need to be
> linked with libpthread.

So if I understand correctly, it's only a subset of target Go programs
that need thread support?

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

  reply	other threads:[~2016-05-13 13:35 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-12  0:08 [Buildroot] [PATCH 0/9] Fixes for go language support Geoff Levand
2016-05-12  0:08 ` [Buildroot] [PATCH 2/9] package/go-bootstrap: Set CGO_ENABLED=0 Geoff Levand
2016-05-12 14:11   ` Thomas Petazzoni
2016-05-13 11:56   ` Peter Korsgaard
2016-05-13 16:05     ` Geoff Levand
2016-05-13 17:12       ` Peter Korsgaard
2016-05-13 18:40         ` Geoff Levand
2016-05-12  0:08 ` [Buildroot] [PATCH 3/9] package/go-bootstrap: Set CC to host CC Geoff Levand
2016-05-12 13:28   ` Thomas Petazzoni
2016-05-12 16:53     ` Geoff Levand
2016-05-13 13:30       ` Thomas Petazzoni
2016-05-12  0:08 ` [Buildroot] [PATCH 4/9] package/go: Add BR2_TOOLCHAIN_HAS_THREADS Geoff Levand
2016-05-12 13:30   ` Thomas Petazzoni
2016-05-12 14:12   ` Thomas Petazzoni
2016-05-12 18:32     ` Geoff Levand
2016-05-13 13:35       ` Thomas Petazzoni [this message]
2016-05-13 16:21         ` Geoff Levand
2016-05-12  0:08 ` [Buildroot] [PATCH 1/9] package/go-bootstrap: Add toolchain dependency Geoff Levand
2016-05-12 14:11   ` Thomas Petazzoni
2016-05-12  0:08 ` [Buildroot] [PATCH 6/9] package/go: Enable MIPS support Geoff Levand
2016-05-12  0:08 ` [Buildroot] [PATCH 7/9] package/go: Add HOST_GO_TOOLDIR Geoff Levand
2016-05-12  0:08 ` [Buildroot] [PATCH 5/9] package/go: Fix powerpc64 config typo Geoff Levand
2016-05-12 14:26   ` Thomas Petazzoni
2016-05-12  0:08 ` [Buildroot] [PATCH 9/9] package/flannel: Set go env variables Geoff Levand
2016-05-12  0:08 ` [Buildroot] [PATCH 8/9] package/go: Build special host binaries Geoff Levand
2016-05-12 14:34   ` Thomas Petazzoni
2016-05-12 17:12     ` Geoff Levand
2016-05-12  0:15 ` [Buildroot] [PATCH 0/9] Fixes for go language support Christian Stewart
2016-05-12 14:29 ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160513153502.47b944fe@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox