diff mbox

[v3,0/3] Add go language support

Message ID 1462207070.27026.20.camel@infradead.org
State Not Applicable
Headers show

Commit Message

Geoff Levand May 2, 2016, 4:37 p.m. UTC
On Sun, 2016-05-01 at 03:43 +0000, Christian Stewart wrote:
> Indeed, the cross compiler toolchain is NOT compiled before Go. I
> think a dependency needs to be added for this.

I have the patch below that adds BR2_TOOLCHAIN_HAS_THREADS.  Is
it enough to pull in the toolchain?

-Geoff

From b461b3a39f5ce64641006845157748295568151c Mon Sep 17 00:00:00 2001
From: Geoff Levand <geoff@infradead.org>
Date: Mon, 25 Apr 2016 12:59:04 -0700
Subject: [PATCH 1/9] package/go: Add BR2_TOOLCHAIN_HAS_THREADS

CGO needs thread support.  Fixes build errors like these:

  warning requested reentrant code, but thread support was disabled

Signed-off-by: Geoff Levand <geoff@infradead.org>
---
 package/go/Config.in.host | 1 +
 1 file changed, 1 insertion(+)

Comments

Thomas Petazzoni May 3, 2016, 7:08 a.m. UTC | #1
Hello,

On Mon, 02 May 2016 09:37:50 -0700, Geoff Levand wrote:

> I have the patch below that adds BR2_TOOLCHAIN_HAS_THREADS.  Is
> it enough to pull in the toolchain?

No, adding dependencies at the Config.in level doesn't change anything
in terms of build order.

Thomas
Geoff Levand May 6, 2016, 7:57 p.m. UTC | #2
On Tue, 2016-05-03 at 09:08 +0200, Thomas Petazzoni wrote:
> On Mon, 02 May 2016 09:37:50 -0700, Geoff Levand wrote:
> 
> > I have the patch below that adds BR2_TOOLCHAIN_HAS_THREADS.  Is
> > it enough to pull in the toolchain?
> 
> No, adding dependencies at the Config.in level doesn't change anything
> in terms of build order.

It seems one of these in go-bootstrap.mk should work, is either
one prefered?

 +HOST_GO_BOOTSTRAP_DEPENDENCIES = host-go-bootstrap

 +HOST_GO_BOOTSTRAP_ADD_TOOLCHAIN_DEPENDENCY = YES

-Geoff
Geoff Levand May 6, 2016, 7:58 p.m. UTC | #3
On Fri, 2016-05-06 at 12:57 -0700, Geoff Levand wrote:
> On Tue, 2016-05-03 at 09:08 +0200, Thomas Petazzoni wrote:
> > On Mon, 02 May 2016 09:37:50 -0700, Geoff Levand wrote:
> > 
> > > I have the patch below that adds BR2_TOOLCHAIN_HAS_THREADS.  Is
> > > it enough to pull in the toolchain?
> > 
> > No, adding dependencies at the Config.in level doesn't change
> > anything
> > in terms of build order.
> 
> It seems one of these in go-bootstrap.mk should work, is either
> one prefered?
> 
>  +HOST_GO_BOOTSTRAP_DEPENDENCIES = host-go-bootstrap

+HOST_GO_BOOTSTRAP_DEPENDENCIES = host-toolchain

> 
>  +HOST_GO_BOOTSTRAP_ADD_TOOLCHAIN_DEPENDENCY = YES
Arnout Vandecappelle May 7, 2016, 11:48 p.m. UTC | #4
On 05/06/16 21:58, Geoff Levand wrote:
> On Fri, 2016-05-06 at 12:57 -0700, Geoff Levand wrote:
>> On Tue, 2016-05-03 at 09:08 +0200, Thomas Petazzoni wrote:
>>> On Mon, 02 May 2016 09:37:50 -0700, Geoff Levand wrote:
>>>
>>>> I have the patch below that adds BR2_TOOLCHAIN_HAS_THREADS.  Is
>>>> it enough to pull in the toolchain?
>>>
>>> No, adding dependencies at the Config.in level doesn't change
>>> anything
>>> in terms of build order.
>>
>> It seems one of these in go-bootstrap.mk should work, is either
>> one prefered?
>>
>>  +HOST_GO_BOOTSTRAP_DEPENDENCIES = host-go-bootstrap
>
> +HOST_GO_BOOTSTRAP_DEPENDENCIES = host-toolchain
>
>>
>>  +HOST_GO_BOOTSTRAP_ADD_TOOLCHAIN_DEPENDENCY = YES

  I don't see how either of these could work... AFAICS, host-toolchain doesn't 
exist, and _ADD_TOOLCHAIN_DEPENDENCY is only checked for target packages.

  What should work however:

HOST_GO_BOOTSTRAP_DEPENDENCIES = toolchain


  Regards,
  Arnout
diff mbox

Patch

diff --git a/package/go/Config.in.host b/package/go/Config.in.host
index 094e402..e988483 100644
--- a/package/go/Config.in.host
+++ b/package/go/Config.in.host
@@ -1,5 +1,6 @@ 
 config BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
 	bool
 	default y
+	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on BR2_arm || BR2_aarch64 || BR2_i386 || BR2_x86_64 || BR2_powerpc
 	depends on !BR2_ARM_CPU_ARMV4