Skip to content
This repository has been archived by the owner on Mar 17, 2018. It is now read-only.

make tools go-src issue in macOS Sierra, needs special go-bootstrap source #728

Closed
yicong2007 opened this issue Aug 4, 2017 · 3 comments

Comments

@yicong2007
Copy link

yicong2007 commented Aug 4, 2017

Package: go-src, go-bootstrap

  • expected behavior: go-bootstrap and go-src should be compiled just fine.
  • actual behavior: go-src got "failed MSpanList_Insert" and fails to complete the compilation.

Platform: armv7 macOS Sierra 10.12.6

A previous issue of go-src tool compilation in macOS was mentioned in #554 . The go-bootstrap Makefile was updated in #558 in order to support macOS.
Unfortunately, the go-bootstrap binary used under this solution in macOS, go1.4.3.darwin-amd64.tar.gz , had issue in macOS Sierra, this results in further failure during the compilation of the go-src tool (see golang/go#16352 ).
The solution has been provided by the go team, see Install Go compiler binaries:

To build a bootstrap tool chain from source, use either the git branch release-branch.go1.4 or go1.4-bootstrap-20170531.tar.gz, which contains the Go 1.4 source code plus accumulated fixes to keep the tools running on newer operating systems. (Go 1.4 was the last distribution in which the tool chain was written in C.) After unpacking the Go 1.4 source, cd to the src subdirectory and run make.bash (or, on Windows, make.bat).

The go-bootstrap Makefile needs further update according to this. I applied the following patch in go-bootstrap/Makefile and it works fine in macOS Sierra:

@@ -14,7 +14,7 @@
         -e 's/x86_64/amd64/' \
 )
 
-PKG_SOURCE:=go$(PKG_VERSION).$(OS)-$(bintype).tar.gz
+PKG_SOURCE:=go1.4-bootstrap-20170531.tar.gz
 PKG_SOURCE_URL:=https://storage.googleapis.com/golang
 HOST_BUILD_DIR:=$(STAGING_DIR_HOST)/go1.4
 HOST_UNPACK:=gzip -dc $(DL_DIR)/$(PKG_SOURCE) | tar -C $(HOST_BUILD_DIR) --strip-components=1 -xf -
@@ -24,6 +24,9 @@
 #build go for all architetures - in case gccgo does not work
 
 define Host/Compile
+	(cd $(STAGING_DIR_HOST)/go1.4/src ; \
+		./make.bash --no-clean ; \
+	)
 endef
 
 define Host/Install
@zyxmon
Copy link
Member

zyxmon commented Aug 5, 2017

We do not support macOS as a host build system. Please use Debian. You can install it in VirtualBox on macOS.

@zyxmon zyxmon closed this as completed Aug 5, 2017
@yicong2007
Copy link
Author

yicong2007 commented Aug 5, 2017

So that's my misunderstanding, the change made in #558 didn't meant to support macOS.
It's mentioned in the wiki Compile packages from sources that Entware-ng use OpenWrt buildroot, and OpenWrt buildroot, with some additional configures, supports macOS as a host build system. Most of Entware-ng packages come from and keep synchronizing with the corresponding packages in OpenWrt. According to this, I thought it would be natural for Entware-ng to support macOS as a host build system when we compile packages from sources.
I actually followed the above guidelines to cross compile several packages in Entware-ng from source (since the Entware-ng binaries have not been updated for a while and I really need them, for instance see #701 ) in macOS and they work fine in my ASUS RT-AC68U.
So, why does Entware-ng not support macOS as a host build system? Are there crucial technical difficulties ( besides the need of a case-sensitive filesystem, which can be workarounded ) or it's a strategy for now since the support of macOS is of low priority?
BTW, I have Fedora installed in my PC, if the compilation didn't work in macOS, switch to Fedora to do the compilation would be my plan B.

Nevertheless, the guideline I mentioned before by the go team about building a bootstrap tool chain from source may not be specific for macOS Sierra (it says "newer operating systems"). We still need to evaluate whether it's necessary to use go1.4-bootstrap-20170531.tar.gz instead of the go1.4.3 binary packages to avoid further potential issues, even if we don't need to support macOS as a host build system.

@zyxmon
Copy link
Member

zyxmon commented Aug 5, 2017

So, why does Entware-ng not support macOS as a host build system?

The main reason is - entware developers do еще use macOSand cannot check if entware is built correctly. We will keep an eye on the change you propose in case it is needed in other cases.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants