Skip to contentSkip to conversation

Add go language support

PATCH New Geoff Levand 3 participants 25 messages Mar 2, 2016 – Mar 22, 2016

lore
Share & tools
lore
#0 lore raw

cover Add go language support

Hi,

This series add support for the go programming language. I tested the build of the included flannel package on i386, powerpc64, arm (32 bit) and arm64. I did runtime testing of the generated flannel binary on arm64.

Patch 1 adds a host only bootstrap compiler needed to build the latest go versions. The host and target support can be build independently, but either of the two need this bootstrap package.

Patch 2 adds support for a host cross compiler, libraries and tools.

Patch 3 adds support for a native compiler, libraries and tools for the target.

Patch 4 add a go language package flannel that can be used to test the go compiler.

Please consider for merege.

-Geoff

The following changes since commit aaf6c28a5c49251df31b82c48c971bc18183cf6b:

Update for 2016.02 (2016-03-01 21:47:30 +0100)

are available in the git repository at:

git at github.com:glevand/buildroot--buildroot.git for-merge-go

for you to fetch changes up to 1572d192abce3a19798cdfe75f3aef8f9e3e504c:

Add package flannel (2016-03-02 11:20:54 -0800)

----------------------------------------------------------------
Geoff Levand (4):
Add package go-bootstrap
Add go host support
Add go target support
Add package flannel

 package/Config.in                      |   2 +
 package/Config.in.host                 |   2 +
 package/flannel/Config.in              |   9 +++
 package/flannel/flannel.hash           |   3 +
 package/flannel/flannel.mk             |  37 ++++++++++++
 package/go-bootstrap/Config.in.host    |   6 ++
 package/go-bootstrap/go-bootstrap.hash |   2 +
 package/go-bootstrap/go-bootstrap.mk   |  36 +++++++++++
 package/go/Config.in                   |   9 +++
 package/go/Config.in.host              |  14 +++++
 package/go/go.hash                     |   2 +
 package/go/go.mk                       | 107 +++++++++++++++++++++++++++++++++
 12 files changed, 229 insertions(+)
 create mode 100644 package/flannel/Config.in
 create mode 100644 package/flannel/flannel.hash
 create mode 100644 package/flannel/flannel.mk
 create mode 100644 package/go-bootstrap/Config.in.host
 create mode 100644 package/go-bootstrap/go-bootstrap.hash
 create mode 100644 package/go-bootstrap/go-bootstrap.mk
 create mode 100644 package/go/Config.in
 create mode 100644 package/go/Config.in.host
 create mode 100644 package/go/go.hash
 create mode 100644 package/go/go.mk
Signature · 1 line
2.5.0
#1 lore raw

PATCH 1/4 Add package go-bootstrap

Add a new package go-bootstrap which builds a bootstrap compiler for the go programming language.

---
 package/Config.in.host                 |  1 +
 package/go-bootstrap/Config.in.host    |  6 ++++++
 package/go-bootstrap/go-bootstrap.hash |  2 ++
 package/go-bootstrap/go-bootstrap.mk   | 36 ++++++++++++++++++++++++++++++++++
 4 files changed, 45 insertions(+)
 create mode 100644 package/go-bootstrap/Config.in.host
 create mode 100644 package/go-bootstrap/go-bootstrap.hash
 create mode 100644 package/go-bootstrap/go-bootstrap.mk
package/Config.in.host +1 -0
index 1c691a3..7cacef9 100644
@@ -13,6 +13,7 @@ menu "Host utilities"
 	source "package/genext2fs/Config.in.host"
 	source "package/genimage/Config.in.host"
 	source "package/genpart/Config.in.host"
+	source "package/go-bootstrap/Config.in.host"
 	source "package/gptfdisk/Config.in.host"
 	source "package/imx-usb-loader/Config.in.host"
 	source "package/jq/Config.in.host"
package/go-bootstrap/Config.in.host new file +6 -0
new file mode 100644
index 0000000..99cca79
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_HOST_GO_BOOTSTRAP
+	bool
+	help
+	  Bootstrap compiler needed to build go1.5 and later versions.
+
+	  https://golang.org
package/go-bootstrap/go-bootstrap.hash new file +2 -0
new file mode 100644
index 0000000..1d0566a
@@ -0,0 +1,2 @@
+# Locally computed:
+sha256 299a6fd8f8adfdce15bc06bde926e7b252ae8e24dd5b16b7d8791ed79e7b5e9b go1.4.2.src.tar.gz
package/go-bootstrap/go-bootstrap.mk new file +36 -0
new file mode 100644
index 0000000..464f95e
@@ -0,0 +1,36 @@
+################################################################################
+#
+# go-bootstrap
+#
+################################################################################
+
+GO_BOOTSTRAP_VERSION = 1.4.2
+GO_BOOTSTRAP_SITE = https://storage.googleapis.com/golang
+GO_BOOTSTRAP_SOURCE = go$(GO_BOOTSTRAP_VERSION).src.tar.gz
+
+GO_BOOTSTRAP_LICENSE = BSD-3c
+GO_BOOTSTRAP_LICENSE_FILES = LICENSE
+
+GO_BOOTSTRAP_FINAL = $(HOST_DIR)/usr/lib/go-$(GO_BOOTSTRAP_VERSION)
+
+GO_BOOTSTRAP_MAKE_ENV = \
+	GOOS=linux \
+	GOROOT_FINAL="$(GO_BOOTSTRAP_FINAL)" \
+	GOROOT="$(@D)" \
+	GOBIN="$(@D)/bin"
+
+define HOST_GO_BOOTSTRAP_BUILD_CMDS
+	cd $(@D)/src && $(GO_BOOTSTRAP_MAKE_ENV) ./make.bash
+endef
+
+define HOST_GO_BOOTSTRAP_INSTALL_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/bin/go $(GO_BOOTSTRAP_FINAL)/bin/go
+	$(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(GO_BOOTSTRAP_FINAL)/bin/gofmt
+
+	cp -a $(@D)/lib $(GO_BOOTSTRAP_FINAL)/
+	cp -a $(@D)/src $(GO_BOOTSTRAP_FINAL)/
+	cp -a $(@D)/pkg $(GO_BOOTSTRAP_FINAL)/
+	chmod -R +x $(GO_BOOTSTRAP_FINAL)/pkg/tool
+endef
+
+$(eval $(host-generic-package))
Signature · 1 line
2.5.0
#2 lore raw

PATCH 1/4 Add package go-bootstrap

Geoff,

The commit title should be:

go-bootstrap: new host package

package/Config.in.host menu "Host utilities" · line 16

Quoted 9 lines · Geoff Levand
package/Config.in.host +1 -0
index 1c691a3..7cacef9 100644
@@ -13,6 +13,7 @@ menu "Host utilities"
 	source "package/genext2fs/Config.in.host"
 	source "package/genimage/Config.in.host"
 	source "package/genpart/Config.in.host"
+	source "package/go-bootstrap/Config.in.host"

There is no need for a Config.in.host file for this package, it is just a build dependency for the go compiler, it doesn't need to be exposed in menuconfig.

package/go-bootstrap/Config.in.host line 6

Quoted 12 lines
package/go-bootstrap/Config.in.host new file +6 -0
new file mode 100644
index 0000000..99cca79
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_HOST_GO_BOOTSTRAP
+	bool
+	help
+	  Bootstrap compiler needed to build go1.5 and later versions.
+
+	  https://golang.org

So, this is not needed.

Quoted 6 lines
package/go-bootstrap/go-bootstrap.mk new file +0 -0
new file mode 100644
index 0000000..464f95e

package/go-bootstrap/go-bootstrap.mk line 9

Quoted 9 lines
package/go-bootstrap/go-bootstrap.mk new file +9 -0
@@ -0,0 +1,36 @@
+################################################################################
+#
+# go-bootstrap
+#
+################################################################################
+
+GO_BOOTSTRAP_VERSION = 1.4.2
+GO_BOOTSTRAP_SITE = https://storage.googleapis.com/golang
+GO_BOOTSTRAP_SOURCE = go$(GO_BOOTSTRAP_VERSION).src.tar.gz

Will Go 1.4.x always be capable of building newer Go compilers ?

Quoted 12 lines
package/go-bootstrap/go-bootstrap.mk new file +12 -0
+
+GO_BOOTSTRAP_LICENSE = BSD-3c
+GO_BOOTSTRAP_LICENSE_FILES = LICENSE
+
+GO_BOOTSTRAP_FINAL = $(HOST_DIR)/usr/lib/go-$(GO_BOOTSTRAP_VERSION)
+
+GO_BOOTSTRAP_MAKE_ENV = \
+	GOOS=linux \
+	GOROOT_FINAL="$(GO_BOOTSTRAP_FINAL)" \
+	GOROOT="$(@D)" \
+	GOBIN="$(@D)/bin"
+

package/go-bootstrap/go-bootstrap.mk line 31

Quoted 10 lines
package/go-bootstrap/go-bootstrap.mk new file +10 -0
+define HOST_GO_BOOTSTRAP_BUILD_CMDS
+	cd $(@D)/src && $(GO_BOOTSTRAP_MAKE_ENV) ./make.bash
+endef
+
+define HOST_GO_BOOTSTRAP_INSTALL_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/bin/go $(GO_BOOTSTRAP_FINAL)/bin/go
+	$(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(GO_BOOTSTRAP_FINAL)/bin/gofmt
+
+	cp -a $(@D)/lib $(GO_BOOTSTRAP_FINAL)/
+	cp -a $(@D)/src $(GO_BOOTSTRAP_FINAL)/

Is it normal to copy source code to HOST_DIR ?

package/go-bootstrap/go-bootstrap.mk line 33

Quoted 2 lines
package/go-bootstrap/go-bootstrap.mk new file +2 -0
+	cp -a $(@D)/pkg $(GO_BOOTSTRAP_FINAL)/
+	chmod -R +x $(GO_BOOTSTRAP_FINAL)/pkg/tool

Why aren't those tools already installed +x by the build process ?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 1/4 Add package go-bootstrap

Quoted 3 lines · Thomas Petazzoni

The commit title should be:

> go-bootstrap: new host package

OK.

Quoted 11 lines

--- a/package/Config.in.host

Review menu "Host utilities" · line 16

Quoted 6 lines

+++ b/package/Config.in.host

(quoted diff) +1 -0
@@ -13,6 +13,7 @@ menu "Host utilities"
 > > 	> > source "package/genext2fs/Config.in.host"
 > > 	> > source "package/genimage/Config.in.host"
 > > 	> > source "package/genpart/Config.in.host"
+> > 	> > source "package/go-bootstrap/Config.in.host"

There is no need for a Config.in.host file for this package, it is just a build dependency for the go compiler, it doesn't need to be exposed in menuconfig.

OK.

Quoted 8 lines
Quoted 8 lines

new file mode 100644
index 0000000..464f95e

package/go-bootstrap/go-bootstrap.mk new file +3 -0
@@ -0,0 +1,36 @@
+################################################################################
+#
+# go-bootstrap
Quoted 8 lines

package/go-bootstrap/go-bootstrap.mk line 9

Quoted 6 lines
package/go-bootstrap/go-bootstrap.mk new file +6 -0
+#
+################################################################################
+
+GO_BOOTSTRAP_VERSION = 1.4.2
+GO_BOOTSTRAP_SITE = https://storage.googleapis.com/golang
+GO_BOOTSTRAP_SOURCE = go$(GO_BOOTSTRAP_VERSION).src.tar.gz

Will Go 1.4.x always be capable of building newer Go compilers ?

Yes, at least that is the current situation. FYI, the go bootstrap plan is documented here:

https://docs.google.com/document/d/1OaatvGhEAq7VseQ9kkavxKNAfepWy2yhPUBs96FGV28

Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line

+define HOST_GO_BOOTSTRAP_INSTALL_CMDS

+> > > > $(INSTALL) -D -m 0755 $(@D)/bin/go $(GO_BOOTSTRAP_FINAL)/bin/go
+> > > > $(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(GO_BOOTSTRAP_FINAL)/bin/gofmt
+
+> > > > cp -a $(@D)/lib $(GO_BOOTSTRAP_FINAL)/
+> > > > cp -a $(@D)/src $(GO_BOOTSTRAP_FINAL)/

Is it normal to copy source code to HOST_DIR ?

There is a known issue which requires the source tree to be installed:

https://golang.org/issue/2775

I'll add a comment to the .mk file.

Quoted 4 lines
Quoted 2 lines

+> > > > cp -a $(@D)/pkg $(GO_BOOTSTRAP_FINAL)/
+> > > > chmod -R +x $(GO_BOOTSTRAP_FINAL)/pkg/tool

Why aren't those tools already installed +x by the build process ?

This is not needed I'll remove the line here and in go.mk.

-Geoff

#4 lore raw

PATCH 1/4 Add package go-bootstrap

Hello,

Quoted 6 lines · Geoff Levand
Quoted 1 line

Will Go 1.4.x always be capable of building newer Go compilers ?

Yes, at least that is the current situation. FYI, the go bootstrap plan is documented here:

https://docs.google.com/document/d/1OaatvGhEAq7VseQ9kkavxKNAfepWy2yhPUBs96FGV28

OK, thanks for the pointer.

Quoted 7 lines
Quoted 1 line

Is it normal to copy source code to HOST_DIR ?

There is a known issue which requires the source tree to be installed:

https://golang.org/issue/2775

I'll add a comment to the .mk file.

Yes good idea.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

+> > > > cp -a $(@D)/pkg $(GO_BOOTSTRAP_FINAL)/
+> > > > chmod -R +x $(GO_BOOTSTRAP_FINAL)/pkg/tool

Why aren't those tools already installed +x by the build process ?

This is not needed I'll remove the line here and in go.mk.

Great, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 2/4 Add go host support

In reply to Geoff Levand

Add a new package 'go' which builds the host cross compiler and libraries for the go programming language.

---
 package/Config.in.host    |  1 +
 package/go/Config.in.host | 14 +++++++++
 package/go/go.hash        |  2 ++
 package/go/go.mk          | 73 +++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 90 insertions(+)
 create mode 100644 package/go/Config.in.host
 create mode 100644 package/go/go.hash
 create mode 100644 package/go/go.mk
package/Config.in.host +1 -0
index 7cacef9..158fbca 100644
@@ -13,6 +13,7 @@ menu "Host utilities"
 	source "package/genext2fs/Config.in.host"
 	source "package/genimage/Config.in.host"
 	source "package/genpart/Config.in.host"
+	source "package/go/Config.in.host"
 	source "package/go-bootstrap/Config.in.host"
 	source "package/gptfdisk/Config.in.host"
 	source "package/imx-usb-loader/Config.in.host"
package/go/Config.in.host new file +14 -0
new file mode 100644
index 0000000..928944b
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_GO_ARCH_SUPPORTS
+	bool
+	default y
+	depends on BR2_arm || BR2_aarch64 || BR2_i386 || BR2_x86_64 || BR2_powerpc
+	depends on !BR2_ARM_CPU_ARMV4
+
+config BR2_PACKAGE_HOST_GO
+	bool "host go"
+	depends on BR2_PACKAGE_GO_ARCH_SUPPORTS
+	select BR2_PACKAGE_HOST_GO_BOOTSTRAP
+	help
+	  The Go Programming Language.
+
+	  https://golang.org
package/go/go.hash new file +2 -0
new file mode 100644
index 0000000..e7c72de
@@ -0,0 +1,2 @@
+# Locally computed:
+sha256  754e06dab1c31ab168fc9db9e32596734015ea9e24bc44cae7f237f417ce4efe  go1.5.3.src.tar.gz
package/go/go.mk new file +73 -0

73 lines not on this page · raw message

Signature · 1 line
2.5.0
#6 lore raw

PATCH 2/4 Add go host support

Geoff,

Quoted 4 lines · Geoff Levand

Add a new package 'go' which builds the host cross compiler and libraries for the go programming language.

Like the previous commit, the title should be:

go: new host package

Quoted 18 lines
package/Config.in.host +1 -0
index 7cacef9..158fbca 100644
@@ -13,6 +13,7 @@ menu "Host utilities"
 	source "package/genext2fs/Config.in.host"
 	source "package/genimage/Config.in.host"
 	source "package/genpart/Config.in.host"
+	source "package/go/Config.in.host"
 	source "package/go-bootstrap/Config.in.host"
 	source "package/gptfdisk/Config.in.host"
 	source "package/imx-usb-loader/Config.in.host"
package/go/Config.in.host new file +0 -0
new file mode 100644
index 0000000..928944b

package/go/Config.in.host line 10

Quoted 10 lines
package/go/Config.in.host new file +10 -0
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_GO_ARCH_SUPPORTS
+	bool
+	default y
+	depends on BR2_arm || BR2_aarch64 || BR2_i386 || BR2_x86_64 || BR2_powerpc
+	depends on !BR2_ARM_CPU_ARMV4
+
+config BR2_PACKAGE_HOST_GO
+	bool "host go"
+	depends on BR2_PACKAGE_GO_ARCH_SUPPORTS
+	select BR2_PACKAGE_HOST_GO_BOOTSTRAP

Due to the removal of Config.in.host for the go-bootstrap package, this line has become useless.

package/go/Config.in.host line 14

Quoted 4 lines
package/go/Config.in.host new file +4 -0
+	help
+	  The Go Programming Language.
+
+	  https://golang.org

We normally don't have Config.in for host packages, as they are just build dependencies. In this case, we could also decide to not have any package/go/Config.in.host, and simply have the flannel package use "host-go" in its <pkg>_DEPENDENCIES variable.

However, we may consider that some users may want to build the host Go compiler even if they don't have a package that uses it, so maybe it's acceptable.

I'm still a bit bothered by the fact that a Config.in option describing a *host* package depends on BR2_PACKAGE_GO_ARCH_SUPPORTS. But I guess it's fine since the Go compiler is really going to be a cross-compiler.

Quoted 10 lines
package/go/go.mk new file +4 -0
new file mode 100644
index 0000000..95168a7
@@ -0,0 +1,73 @@
+################################################################################
+#
+# golang
+#

package/go/go.mk line 14

Quoted 10 lines
package/go/go.mk new file +10 -0
+################################################################################
+
+GO_VERSION = 1.5.3
+GO_SITE = https://storage.googleapis.com/golang
+GO_SOURCE = go$(GO_VERSION).src.tar.gz
+
+GO_LICENSE = BSD-3c
+GO_LICENSE_FILES = LICENSE
+
+GO_BOOTSTRAP = $(HOST_DIR)/usr/lib/go-1.4.2

Why don't you use $(GO_BOOTSTRAP_FINAL) instead ?

package/go/go.mk line 17

Quoted 3 lines
package/go/go.mk new file +3 -0
+
+ifeq ($(BR2_arm),y)
+	GO_GOARCH = arm

Please don't indent such variable definitions.

Quoted 9 lines
package/go/go.mk new file +9 -0
+else ifeq ($(BR2_aarch64),y)
+	GO_GOARCH = arm64
+else ifeq ($(BR2_i386),y)
+	GO_GOARCH = 386
+else ifeq ($(BR2_x86_64),y)
+	GO_GOARCH = amd64
+else ifeq ($(BR2_powerpc),y)
+	GO_GOARCH = ppc64
+else

package/go/go.mk line 36

Quoted 10 lines
package/go/go.mk new file +10 -0
+	GO_GOARCH = unknown
+endif
+
+ifeq ($(BR2_arm)$(BR2_ARM_CPU_HAS_VFPV3),yy)
+	GO_GOARM = 7
+else ifeq ($(BR2_arm)$(BR2_ARM_CPU_HAS_VFPV2),yy)
+	GO_GOARM = 6
+else ifeq ($(BR2_arm),y)
+	GO_GOARM = 5
+endif

You should use BR2_ARM_CPU_ARMV5, BR2_ARM_CPU_ARMV6 and BR2_ARM_CPU_ARMV7 here.

Quoted 1 line

GO_HOST_DEPENDENCIES = host-go-bootstrap

Wrong variable name, it should be HOST_GO_DEPENDENCIES.

Quoted 1 line

GO_HOST_FINAL = $(HOST_DIR)/usr/lib/go

Ditto: HOST_GO_<...>

Quoted 1 line

GO_HOST_MAKE_ENV = \

Same.

package/go/go.mk line 65

Quoted 9 lines
package/go/go.mk new file +9 -0
+define HOST_GO_INSTALL_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/bin/go $(GO_HOST_FINAL)/bin/go
+	$(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(GO_HOST_FINAL)/bin/gofmt
+
+	ln -sf ../lib/go/bin/go $(HOST_DIR)/usr/bin/
+	ln -sf ../lib/go/bin/gofmt $(HOST_DIR)/usr/bin/
+
+	cp -a $(@D)/lib $(GO_HOST_FINAL)/
+	cp -a $(@D)/src $(GO_HOST_FINAL)/

Same question: why do we install source code ?

package/go/go.mk line 70

Quoted 5 lines
package/go/go.mk new file +5 -0
+
+	mkdir -p $(GO_HOST_FINAL)/pkg
+	cp -a $(@D)/pkg/include $(@D)/pkg/linux_* $(GO_HOST_FINAL)/pkg/
+	cp -a $(@D)/pkg/tool $(GO_HOST_FINAL)/pkg/
+	chmod -R +x $(GO_HOST_FINAL)/pkg/tool

Same question :-)

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#7 lore raw

PATCH 2/4 Add go host support

Quoted 16 lines · Thomas Petazzoni

--- /dev/null

Review line 10

Quoted 12 lines

+++ b/package/go/Config.in.host

(quoted diff) +10 -0
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_GO_ARCH_SUPPORTS
+> > 	> > bool
+> > 	> > default y
+> > 	> > depends on BR2_arm || BR2_aarch64 || BR2_i386 || BR2_x86_64 || BR2_powerpc
+> > 	> > depends on !BR2_ARM_CPU_ARMV4
+
+config BR2_PACKAGE_HOST_GO
+> > 	> > bool "host go"
+> > 	> > depends on BR2_PACKAGE_GO_ARCH_SUPPORTS
+> > 	> > select BR2_PACKAGE_HOST_GO_BOOTSTRAP

Due to the removal of Config.in.host for the go-bootstrap package, this line has become useless.

OK.

Quoted 6 lines

Review line 14

Quoted 5 lines
(quoted diff) +4 -0
+> > 	> > help
+> > 	> >   The Go Programming Language.
+
+> > 	> >   https://golang.org
Quoted 8 lines

We normally don't have Config.in for host packages, as they are just build dependencies. In this case, we could also decide to not have any package/go/Config.in.host, and simply have the flannel package use "host-go" in its _DEPENDENCIES variable.

However, we may consider that some users may want to build the host Go compiler even if they don't have a package that uses it, so maybe it's acceptable.

Either way seems fine, but having the option seems more flexible for users.

Quoted 3 lines

I'm still a bit bothered by the fact that a Config.in option describing a *host* package depends on BR2_PACKAGE_GO_ARCH_SUPPORTS. But I guess it's fine since the Go compiler is really going to be a cross-compiler.

Yes, my thinking was that if you try to build go for a target arch that is not supported the build will blow up. For the package maintainer they can use BR2_PACKAGE_GO_ARCH_SUPPORTS to only build for targets that the compiler supports.

Quoted 10 lines

package/go/go.mk line 14

Quoted 8 lines
package/go/go.mk new file +8 -0
+GO_VERSION = 1.5.3
+GO_SITE = https://storage.googleapis.com/golang
+GO_SOURCE = go$(GO_VERSION).src.tar.gz
+
+GO_LICENSE = BSD-3c
+GO_LICENSE_FILES = LICENSE
+
+GO_BOOTSTRAP = $(HOST_DIR)/usr/lib/go-1.4.2

Why don't you use $(GO_BOOTSTRAP_FINAL) instead ?

Yes, should work better.

Quoted 6 lines

package/go/go.mk

Quoted 4 lines
package/go/go.mk new file +3 -0
+
+ifeq ($(BR2_arm),y)
+> > 	> > GO_GOARCH = arm

Please don't indent such variable definitions.

OK.

Quoted 15 lines
Quoted 15 lines
package/go/go.mk new file +14 -0
+else ifeq ($(BR2_aarch64),y)
+> > 	> > GO_GOARCH = arm64
+else ifeq ($(BR2_i386),y)
+> > 	> > GO_GOARCH = 386
+else ifeq ($(BR2_x86_64),y)
+> > 	> > GO_GOARCH = amd64
+else ifeq ($(BR2_powerpc),y)
+> > 	> > GO_GOARCH = ppc64
+else
+> > 	> > GO_GOARCH = unknown
+endif
+
+ifeq ($(BR2_arm)$(BR2_ARM_CPU_HAS_VFPV3),yy)
+> > 	> > GO_GOARM = 7
Quoted 8 lines

package/go/go.mk line 36

Quoted 5 lines
package/go/go.mk new file +5 -0
+else ifeq ($(BR2_arm)$(BR2_ARM_CPU_HAS_VFPV2),yy)
+> > 	> > GO_GOARM = 6
+else ifeq ($(BR2_arm),y)
+> > 	> > GO_GOARM = 5
+endif

You should use BR2_ARM_CPU_ARMV5, BR2_ARM_CPU_ARMV6 and BR2_ARM_CPU_ARMV7 here.

OK. I re-did the logic here a little.

Quoted 5 lines
Quoted 2 lines

GO_HOST_DEPENDENCIES = host-go-bootstrap

Wrong variable name, it should be HOST_GO_DEPENDENCIES.

Quoted 7 lines
Quoted 1 line

GO_HOST_FINAL = $(HOST_DIR)/usr/lib/go

Ditto: HOST_GO_<...>

Quoted 1 line

GO_HOST_MAKE_ENV = \

Same.

I think I got them all...

Quoted 12 lines

Review

Quoted 10 lines
(quoted diff) +9 -0
+define HOST_GO_INSTALL_CMDS
+> > 	> > $(INSTALL) -D -m 0755 $(@D)/bin/go $(GO_HOST_FINAL)/bin/go
+> > 	> > $(INSTALL) -D -m 0755 $(@D)/bin/gofmt $(GO_HOST_FINAL)/bin/gofmt
+
+> > 	> > ln -sf ../lib/go/bin/go $(HOST_DIR)/usr/bin/
+> > 	> > ln -sf ../lib/go/bin/gofmt $(HOST_DIR)/usr/bin/
+
+> > 	> > cp -a $(@D)/lib $(GO_HOST_FINAL)/
+> > 	> > cp -a $(@D)/src $(GO_HOST_FINAL)/

Same question: why do we install source code ?

As before, to work-around a know issue. I'll add the comment here.

Quoted 7 lines
Quoted 5 lines

+
+> > > > mkdir -p $(GO_HOST_FINAL)/pkg
+> > > > cp -a $(@D)/pkg/include $(@D)/pkg/linux_* $(GO_HOST_FINAL)/pkg/
+> > > > cp -a $(@D)/pkg/tool $(GO_HOST_FINAL)/pkg/
+> > > > chmod -R +x $(GO_HOST_FINAL)/pkg/tool

Same question :-)

Removed it.

-Geoff

#8 lore raw

PATCH 3/4 Add go target support

In reply to Geoff Levand

Add the needed bits to build a go compiler for the target.

---
 package/Config.in    |  1 +
 package/go/Config.in |  9 +++++++++
 package/go/go.mk     | 34 ++++++++++++++++++++++++++++++++++
 3 files changed, 44 insertions(+)
 create mode 100644 package/go/Config.in
package/Config.in +1 -0
index 529ad33..b9905cf 100644
@@ -484,6 +484,7 @@ menu "Erlang libraries/modules"
 endmenu
 endif
 	source "package/gauche/Config.in"
+	source "package/go/Config.in"
 	source "package/guile/Config.in"
 	source "package/haserl/Config.in"
 	source "package/jamvm/Config.in"
package/go/Config.in new file +9 -0
new file mode 100644
index 0000000..69c4644
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_GO
+	bool "go"
+	depends on BR2_PACKAGE_GO_ARCH_SUPPORTS
+	select BR2_PACKAGE_HOST_GO_BOOTSTRAP
+	help
+	  The Go Programming Language.
+
+	  https://golang.org
+
package/go/go.mk +34 -0
index 95168a7..aa354dd 100644
@@ -70,4 +70,38 @@ define HOST_GO_INSTALL_CMDS
 	chmod -R +x $(GO_HOST_FINAL)/pkg/tool
 endef
 
+GO_DEPENDENCIES = host-go-bootstrap
+GO_FINAL = /usr/lib/go
+
+GO_MAKE_ENV = \
+	GOROOT_BOOTSTRAP=$(GO_BOOTSTRAP) \
+	GOROOT_FINAL=$(GO_FINAL) \
+	GOROOT="$(@D)" \
+	GOBIN="$(@D)/bin" \
+	GOARCH=$(GO_GOARCH) \
+	GOARM=$(GO_GOARM) \
+	GOOS=linux \
+	CGO_ENABLED=0
+
+define GO_BUILD_CMDS
+	cd $(@D)/src && $(GO_MAKE_ENV) ./make.bash
+endef
+
+define GO_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/bin/linux_$(GO_GOARCH)/go $(TARGET_DIR)/$(GO_FINAL)/bin/go
+	$(INSTALL) -D -m 0755 $(@D)/bin/linux_$(GO_GOARCH)/gofmt $(TARGET_DIR)/$(GO_FINAL)/bin/gofmt
+
+	ln -sf $(GO_FINAL)/bin/go $(TARGET_DIR)/usr/bin/
+	ln -sf $(GO_FINAL)/bin/gofmt $(TARGET_DIR)/usr/bin/
+
+	cp -a $(@D)/lib $(TARGET_DIR)/$(GO_FINAL)/
+	cp -a $(@D)/src $(TARGET_DIR)/$(GO_FINAL)/
+
+	mkdir -p $(TARGET_DIR)/$(GO_FINAL)/pkg/tool
+	cp -a $(@D)/pkg/include $(@D)/pkg/linux_$(GO_GOARCH) $(TARGET_DIR)/$(GO_FINAL)/pkg/
+	cp -a $(@D)/pkg/tool/linux_$(GO_GOARCH) $(TARGET_DIR)/$(GO_FINAL)/pkg/tool/
+	chmod -R +x $(TARGET_DIR)/$(GO_FINAL)/pkg/tool
+endef
+
 $(eval $(host-generic-package))
+$(eval $(generic-package))
Signature · 1 line
2.5.0
#9 lore raw

PATCH 3/4 Add go target support

Dear Geoff Levand,

Quoted 3 lines · Geoff Levand

Add the needed bits to build a go compiler for the target.

We don't support or want to support doing development on the target, so I think the target variant of the go compiler is not needed.

See
https://buildroot.org/downloads/manual/manual.html#faq-no-compiler-on-target
for more details.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#10 lore raw

PATCH 3/4 Add go target support

Hi,

Quoted 11 lines · Thomas Petazzoni
Quoted 3 lines · Geoff Levand

Add the needed bits to build a go compiler for the target.

We don't support or want to support doing development on the target, so I think the target variant of the go compiler is not needed.

See
https://buildroot.org/downloads/manual/manual.html#faq-no-compiler-on-target
for more details.

If I have read the above document correctly the primary reason for not having a target side toolchain was concerns of complexity and maintanence. I don't think that is the case with this go package.

My motovation for having a target go is to include the go tools that can be used for debugging go programs, etc. Also, for minimal systems it is common to have a Linux container with the just the go compiler in it, and then only loading that container when installing a go program from source. By having a target go compiler such a container can be build from buildroot.

See https://hub.docker.com/_/golang/

-Geoff

#11 lore raw

PATCH 4/4 Add package flannel

In reply to Geoff Levand

Flannel is a virtual network that gives a subnet to each host for use with container runtimes.

---
 package/Config.in            |  1 +
 package/flannel/Config.in    |  9 +++++++++
 package/flannel/flannel.hash |  3 +++
 package/flannel/flannel.mk   | 37 +++++++++++++++++++++++++++++++++++++
 4 files changed, 50 insertions(+)
 create mode 100644 package/flannel/Config.in
 create mode 100644 package/flannel/flannel.hash
 create mode 100644 package/flannel/flannel.mk
package/Config.in +1 -0
index b9905cf..bb917f0 100644
@@ -1332,6 +1332,7 @@ endif
 	source "package/faifa/Config.in"
 	source "package/fastd/Config.in"
 	source "package/fcgiwrap/Config.in"
+	source "package/flannel/Config.in"
 	source "package/fmc/Config.in"
 	source "package/foomatic-filters/Config.in"
 	source "package/fping/Config.in"
package/flannel/Config.in new file +9 -0
new file mode 100644
index 0000000..0da356d
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_FLANNEL
+	bool "flannel"
+	depends on BR2_PACKAGE_GO_ARCH_SUPPORTS
+	select BR2_PACKAGE_HOST_GO
+	help
+	  Flannel is a virtual network that gives a subnet to each host for use
+	  with container runtimes.
+
+	  https://github.com/coreos/flannel
package/flannel/flannel.hash new file +3 -0
new file mode 100644
index 0000000..7459298
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 c09a76e80647282687b8db36f28dd3aede650f8f71dad0cf9f453f2ae3a0635d flannel-v0.5.5.tar.gz
+
package/flannel/flannel.mk new file +37 -0
new file mode 100644
index 0000000..93347af
@@ -0,0 +1,37 @@
+################################################################################
+#
+# flannel
+#
+################################################################################
+
+FLANNEL_VERSION = v0.5.5
+FLANNEL_SITE = https://github.com/coreos/flannel.git
+FLANNEL_SITE_METHOD = git
+
+FLANNEL_LICENSE = Apache-2.0
+FLANNEL_LICENSE_FILES = LICENSE
+
+FLANNEL_DEPENDENCIES = host-go
+
+FLANNEL_MAKE_ENV = \
+	GOBIN="$(@D)/bin" \
+	GOPATH="$(@D)/gopath" \
+	GOARCH=$(GO_GOARCH) \
+	CGO_ENABLED=1
+
+define FLANNEL_CONFIGURE_CMDS
+	mkdir -p $(@D)/gopath/src/github.com/coreos
+	ln -s $(@D) $(@D)/gopath/src/github.com/coreos/flannel
+endef
+
+define FLANNEL_BUILD_CMDS
+	cd $(@D) && $(FLANNEL_MAKE_ENV) $(HOST_DIR)/usr/bin/go \
+		build -v -o $(@D)/bin/flanneld .
+endef
+
+define FLANNEL_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/bin/flanneld $(TARGET_DIR)/opt/bin/flanneld
+	$(INSTALL) -D -m 0755 $(@D)/dist/mk-docker-opts.sh $(TARGET_DIR)/opt/bin/mk-docker-opts.sh
+endef
+
+$(eval $(generic-package))
Signature · 1 line
2.5.0
#12 lore raw

PATCH 4/4 Add package flannel

Dear Geoff Levand,

The commit title should be:

flannel: new package

package/flannel/flannel.hash line 3

Quoted 9 lines · Geoff Levand
package/flannel/flannel.hash new file +3 -0
new file mode 100644
index 0000000..7459298
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 c09a76e80647282687b8db36f28dd3aede650f8f71dad0cf9f453f2ae3a0635d flannel-v0.5.5.tar.gz
+

Unneeded empty new line.

package/flannel/flannel.hash

Quoted 3 lines
package/flannel/flannel.hash new file +3 -0
+FLANNEL_VERSION = v0.5.5
+FLANNEL_SITE = https://github.com/coreos/flannel.git
+FLANNEL_SITE_METHOD = git

Please use the github helper function.

Quoted 5 lines
package/flannel/flannel.hash new file +5 -0
+
+FLANNEL_LICENSE = Apache-2.0
+FLANNEL_LICENSE_FILES = LICENSE
+
+FLANNEL_DEPENDENCIES = host-go

package/flannel/flannel.hash

Quoted 10 lines
package/flannel/flannel.hash new file +10 -0
+
+FLANNEL_MAKE_ENV = \
+	GOBIN="$(@D)/bin" \
+	GOPATH="$(@D)/gopath" \
+	GOARCH=$(GO_GOARCH) \
+	CGO_ENABLED=1
+
+define FLANNEL_CONFIGURE_CMDS
+	mkdir -p $(@D)/gopath/src/github.com/coreos
+	ln -s $(@D) $(@D)/gopath/src/github.com/coreos/flannel

This probably warrants a comment above to explain why this is needed.

package/flannel/flannel.hash

Quoted 13 lines
package/flannel/flannel.hash new file +13 -0
+endef
+
+define FLANNEL_BUILD_CMDS
+	cd $(@D) && $(FLANNEL_MAKE_ENV) $(HOST_DIR)/usr/bin/go \
+		build -v -o $(@D)/bin/flanneld .
+endef
+
+define FLANNEL_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/bin/flanneld $(TARGET_DIR)/opt/bin/flanneld
+	$(INSTALL) -D -m 0755 $(@D)/dist/mk-docker-opts.sh $(TARGET_DIR)/opt/bin/mk-docker-opts.sh
+endef
+
+$(eval $(generic-package))

Other than that, looks good to me.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#13 lore raw

PATCH 4/4 Add package flannel

Quoted 6 lines · Thomas Petazzoni

The commit title should be:

flannel: new package

On Wed, 02 Mar 2016 19:23:33 +0000, Geoff Levand wrote:

Quoted 14 lines
Quoted 9 lines
package/flannel/flannel.hash new file +2 -0
new file mode 100644
index 0000000..7459298
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256
Quoted 3 lines

c09a76e80647282687b8db36f28dd3aede650f8f71dad0cf9f453f2ae3a0635d flannel-v0.5.5.tar.gz
+

Unneeded empty new line.

OK.

Quoted 6 lines

package/flannel/flannel.hash

Quoted 4 lines
package/flannel/flannel.hash new file +3 -0
+FLANNEL_VERSION = v0.5.5
+FLANNEL_SITE = https://github.com/coreos/flannel.git
+FLANNEL_SITE_METHOD = git

Please use the github helper function.

OK.

Quoted 10 lines
Quoted 10 lines
package/flannel/flannel.hash new file +9 -0
+
+FLANNEL_LICENSE = Apache-2.0
+FLANNEL_LICENSE_FILES = LICENSE
+
+FLANNEL_DEPENDENCIES = host-go
+
+FLANNEL_MAKE_ENV = \
+	GOBIN="$(@D)/bin" \
+	GOPATH="$(@D)/gopath" \
Quoted 8 lines

package/flannel/flannel.hash

Quoted 6 lines
package/flannel/flannel.hash new file +6 -0
+	GOARCH=$(GO_GOARCH) \
+	CGO_ENABLED=1
+
+define FLANNEL_CONFIGURE_CMDS
+	mkdir -p $(@D)/gopath/src/github.com/coreos
+	ln -s $(@D) $(@D)/gopath/src/github.com/coreos/flannel

This probably warrants a comment above to explain why this is needed.

OK.

#14 lore raw

cover Add go language support

In reply to Geoff Levand

Hello Geoff,

Quoted 8 lines · Geoff Levand

This series add support for the go programming language. I tested the build of the included flannel package on i386, powerpc64, arm (32 bit) and arm64. I did runtime testing of the generated flannel binary on arm64.

Patch 1 adds a host only bootstrap compiler needed to build the latest go versions. The host and target support can be build independently, but either of the two need this bootstrap package.

Quoted 6 lines

Patch 2 adds support for a host cross compiler, libraries and tools.

Patch 3 adds support for a native compiler, libraries and tools for the target.

Patch 4 add a go language package flannel that can be used to test the go compiler.

Thanks a lot for this submission!

However, we already have some pending Go-related packages in our patch queue. What I would like to see is a single patch series adding Go support, which is approved by the different developers interested in Go support in Buildroot.

The other Go patch series are:

http://lists.busybox.net/pipermail/buildroot/2016-February/151550.html
(from Ludovic Guegan)

http://patchwork.ozlabs.org/patch/542108/
(from Christian Stewart)

I have Cc'ed Ludovic and Christian. It would be good if you could sync with them.

Thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#15 lore raw

cover Add go language support

Hi All,

Quoted 5 lines · Thomas Petazzoni

However, we already have some pending Go-related packages in our patch
queue. What I would like to see is a single patch series adding Go support, which is approved by the different developers interested in Go support in Buildroot.

Thanks for trying to coordinating things.

Quoted 4 lines

The other Go patch series are:

http://lists.busybox.net/pipermail/buildroot/2016-February/151550.html
(from Ludovic Guegan)

I took a quick look at this. Patch 1, which builds the go complier, has the bootstrap and final compiler built in the same package. I think it better to split the bootstrap out into its own package as I have done since then the two packages are each then simpler and I think easier to maintain.

Also, this implementation does not build cross compilers correctly, nor does it install the go pkg and tools, nor does it enable CGO_ENABLED for C language linkage support.

All in all, think my patches seem more complete in adding go compiler support.

I think the other patches in Ludovic's series can be considered independent of the go compiler. Patch 4 which adds pkg-golang.mk is something needed. I had planned to look into this.

Quoted 2 lines

http://patchwork.ozlabs.org/patch/542108//
(from Christian Stewart)

I did see this is now out of date, building go compiler version 1.4.2. It also doesn't seem to install the go tools. To bring these up to date would need almost a complete re-write since the current compiler now requires a bootstrap compiler. I think my patches superseed this series.

My proposal is to use my patches to provide the basic go compiler support. Ludovic's other patches provide additional language support, and seem as though they could be useful, but they are additions to the basic compiler support, and I think can be considered independently.

Is my proposal acceptable? Let's work to move forward.

-Geoff

#16 lore raw

cover Add go language support

All,
On Wed, Mar 2, 2016 at 4:47 PM Geoff Levand <[email protected]> wrote: >> http://patchwork.ozlabs.org/patch/542108//

Quoted 7 lines
Quoted 1 line

(from Christian Stewart)

I did see this is now out of date, building go compiler version 1.4.2. It also doesn't seem to install the go tools. To bring these up to date would need almost a complete re-write since the current compiler now requires a bootstrap compiler. I think my patches superseed this series.

This is correct. I built the original series with Yann as a solution to
implement Docker under Buildroot, which worked fine for our project. If there is some other better series that implements the Go compiler as well as the ?go? tools installed into the target, I can adapt the other packages in my series (Docker, Aufs-Utils, etc) to support the superseeding packages.
I'm fine with going ahead with this.
Best, Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160302/2113e9a3/attachment.html>

#17 lore raw

cover Add go language support

Hi Christian,

Quoted 3 lines · Christian Stewart

I can
adapt the other packages in my series (Docker, Aufs-Utils, etc) to support the superseeding packages. I'm fine with going ahead with this.

As Thomas requested, could you please review my three patches that add the compiler support and either give comments or your Acked-by. Thanks.

-Geoff

#18 lore raw

cover Add go language support

Geoff,
On Wed, Mar 2, 2016 at 5:31 PM Geoff Levand <[email protected]> wrote: > As Thomas requested, could you please review my three > patches that add the compiler support and either give

Quoted 1 line

comments or your Acked-by. Thanks.

I will adjust my Docker setup to use your Go package as the base runtime, test, and ack it when everything works fine on my end.
Should be within the next day or so.
Best, Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160302/20f2e6b7/attachment.html>

#19 lore raw

cover Add go language support

Hi Christian,

Quoted 6 lines · Christian Stewart
Quoted 2 lines · Geoff Levand

As Thomas requested, could you please review my three> patches that add the compiler support and either give comments or your Acked-by. Thanks.

I will adjust my Docker setup to use your Go package as the base runtime, test, and ack it when everything works fine on my end. Should be within the next day or so.

And thing to report yet about getting your packages to build with my new go language patches? If I can help in any way, please let me know.

-Geoff

#20 lore raw

cover Add go language support

Hey Geoff,
On Mon, Mar 21, 2016 at 12:32 PM Geoff Levand <[email protected]> wrote: > And thing to report yet about getting your packages

Quoted 4 lines

to build with my new go language patches? If I
can help in any way, please let me know.

-Geoff

I've been out of the country for the past week and haven't had a chance to work on the Docker stuff yet. I'm sorry if this has been blocking your work in any way.
Starting around the week of May 18th my primary focus will shift back to the Docker under Buildroot work, and I should be far more active with patches / improvements / fixes at that time. In the meantime I will attempt to get the packages to build on top of your series, but I'm not entirely sure what time
this week I'll be able to do that.
Best, Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160322/a174a07d/attachment.html>

#21 lore raw

cover Add go language support

In reply to Geoff Levand

Geoff,

Quoted 8 lines · Geoff Levand
Quoted 2 lines

http://lists.busybox.net/pipermail/buildroot/2016-February/151550.html
(from Ludovic Guegan)

I took a quick look at this. Patch 1, which builds the go complier, has the bootstrap and final compiler built in the same package. I think it better to split the bootstrap out into its own package as I have done since then the two packages are each then simpler and I think easier to maintain.

I'll have a look at this specific aspect. Having two packages that use the same source is not always the best solution, but I'll have a look.

Quoted 10 lines

Also, this implementation does not build cross compilers correctly, nor does it install the go pkg and tools, nor does it enable CGO_ENABLED for C language linkage support.

All in all, think my patches seem more complete in adding go compiler support.

I think the other patches in Ludovic's series can be considered independent of the go compiler. Patch 4 which adds pkg-golang.mk is something needed. I had planned to look into this.

OK. As I said, what I would like to see is one single patch series that contains the full support, and that is approved by the interested parties (you, Ludovic and Christian). The Buildroot maintainers cannot be expert in all topics, and diving into the Go topic would require quite some time. So I'd like to see a single patch series acknowledged by all parties so that we can have some good confidence that it does things the right way.

Of course, it can also be two separate patch series: one from you with the core Go stuff (acknowledged by Christian and Ludovic), and another from Ludovic with the Go package infrastructure (acknowledged by you and Christian).

Quoted 5 lines

I did see this is now out of date, building go compiler version 1.4.2. It also doesn't seem to install the go tools. To bring these up to date would need almost a complete re-write since the current compiler now requires a bootstrap compiler. I think my patches superseed this series.

OK. I'll mark Christian's patch as Superseded then.

Quoted 7 lines

My proposal is to use my patches to provide the basic go compiler support. Ludovic's other patches provide additional language support, and seem as though they could be useful, but they are additions to the basic compiler support, and I think can be considered independently.

Is my proposal acceptable? Let's work to move forward.

It is acceptable to me, but please work with Ludovic and Christian to get to a point where they can give their Acked-by to your patches.

Thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#22 lore raw

cover Add go language support

Hi,

Quoted 8 lines · Thomas Petazzoni

I took a quick look at this. Patch 1, which builds the go

Quoted 4 lines

complier, has the bootstrap and final compiler built in the same package. I think it better to split the bootstrap out into its own package as I have done since then the two packages are each then simpler and I think easier to maintain.

I'll have a look at this specific aspect. Having two packages that use the same source is not always the best solution, but I'll have a look.

Just to mention it, the two use different source versions, 1.4.3 for the bootstrap, and 1.5.3 (currently) for the final compiler.

Quoted 8 lines
Quoted 1 line

OK. As I said, what I would like to see is one single patch series that

contains the full support, and that is approved by the interested parties (you, Ludovic and Christian). The Buildroot maintainers cannot be expert in all topics, and diving into the Go topic would require quite some time. So I'd like to see a single patch series acknowledged by all parties so that we can have some good confidence that it does things the right way.

Quoted 4 lines

Of course, it can also be two separate patch series: one from you with the core Go stuff (acknowledged by Christian and Ludovic), and another from Ludovic with the Go package infrastructure (acknowledged by you and Christian).

I understand your need to have these things reviewed by the interested parties. I will work towards the consensus.

-Geoff

#23 lore raw

cover Add go language support

Geoff,

Quoted 7 lines · Geoff Levand
Quoted 6 lines · Thomas Petazzoni

I took a quick look at this. Patch 1, which builds the go

Quoted 4 lines

complier, has the bootstrap and final compiler built in the same package. I think it better to split the bootstrap out into its own package as I have done since then the two packages are each then simpler and I think easier to maintain.

Quoted 5 lines
Quoted 2 lines

I'll have a look at this specific aspect. Having two packages that use the same source is not always the best solution, but I'll have a look.

Just to mention it, the two use different source versions, 1.4.3 for the bootstrap, and 1.5.3 (currently) for the final compiler.

Yeah, I just discovered this while reviewing your patches. In this case, it definitely makes sense. I forgot that the 1.5 Go compiler had some parts of it in Go, and therefore needed a previous Go compiler.

Quoted 8 lines
Quoted 8 lines
Quoted 1 line

OK. As I said, what I would like to see is one single patch series that

contains the full support, and that is approved by the interested parties (you, Ludovic and Christian). The Buildroot maintainers cannot be expert in all topics, and diving into the Go topic would require quite some time. So I'd like to see a single patch series acknowledged by all parties so that we can have some good confidence that it does things the right way.

Quoted 7 lines
Quoted 4 lines

Of course, it can also be two separate patch series: one from you with the core Go stuff (acknowledged by Christian and Ludovic), and another from Ludovic with the Go package infrastructure (acknowledged by you and Christian).

I understand your need to have these things reviewed by the interested parties. I will work towards the consensus.

Thanks a lot!

On my side, I reviewed your patches. There are a few comments/issues, but nothing major. Overall it looks fairly simple and straightforward.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#24 lore raw

cover Add go language support

Quoted 3 lines · Thomas Petazzoni

On my side, I reviewed your patches. There are a few comments/issues, but nothing major. Overall it looks fairly simple and straightforward.

I made the mentioned fixes. I'll repost the series after testing.

-Geoff