[pkg-golang-devel] Bug#815998: golang: add mips64/mips64el support

Tianon Gravi tianon at debian.org
Sun Aug 28 15:12:27 UTC 2016


Given that upstream officially supports bootstrapping via gccgo, I'd
rather keep the discussion of "fix cross build" to a separate issue if
we can.  I am interested in updating the packaging to properly support
cross-building, but consider it a secondary concern to adding more
architectures.

That being said, I attempted to build src:golang-1.7 on mips64el and
ran into the following build failure:

(sid_mips64el-dchroot)tianon at eller:~/golang-1.7-1.7$ dpkg-buildpackage -uc -us
dpkg-buildpackage: info: source package golang-1.7
dpkg-buildpackage: info: source version 1.7-3
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by Tianon Gravi <tianon at debian.org>
dpkg-buildpackage: info: host architecture mips64el
 dpkg-source --before-build golang-1.7-1.7
 fakeroot debian/rules clean
dh --parallel  clean
   dh_testdir
   debian/rules override_dh_auto_clean
make[1]: Entering directory '/home/tianon/golang-1.7-1.7'
for file in control gbp.conf source/lintian-overrides watch; do \
{ \
echo '#'; \
echo '# WARNING: "debian/'$file'" is generated via "debian/rules
gencontrol" (sourced from "debian/'$file'.in")'; \
echo '#'; \
echo; \
sed -e 's/X.Y/1.7/g' debian/$file.in; \
} > debian/$file; \
done
# remove autogenerated files
rm -f \
src/cmd/cgo/zdefaultcc.go \
src/cmd/go/zdefaultcc.go \
src/cmd/internal/obj/zbootstrap.go \
src/runtime/internal/sys/zversion.go
# remove built objects
rm -rf bin pkg
make[1]: Leaving directory '/home/tianon/golang-1.7-1.7'
   dh_clean
 dpkg-source -b golang-1.7-1.7
dpkg-source: info: using source format '3.0 (quilt)'
dpkg-source: info: building golang-1.7 using existing
./golang-1.7_1.7.orig.tar.gz
dpkg-source: info: building golang-1.7 in golang-1.7_1.7-3.debian.tar.xz
dpkg-source: info: building golang-1.7 in golang-1.7_1.7-3.dsc
 debian/rules build
dh --parallel  build
   dh_testdir
   dh_update_autotools_config
   dh_auto_configure
   debian/rules override_dh_auto_build-arch
make[1]: Entering directory '/home/tianon/golang-1.7-1.7'
[ -f VERSION ] || echo "debian snapshot +$(dpkg-parsechangelog
-SVersion)" > VERSION
export GOROOT_BOOTSTRAP=$(env -i go env GOROOT) \
&& cd src \
&& /home/tianon/golang-1.7-1.7/debian/helpers/goenv.sh \
bash ./make.bash --no-banner
##### Building Go bootstrap tool.
cmd/dist
# _/home/tianon/golang-1.7-1.7/src/cmd/dist
cmd/dist/build.go:130:6: error: reference to undefined name 'cansse2'
   if cansse2() {
      ^
cmd/dist/util.go:488:3: error: reference to undefined name 'useVFPv1'
   useVFPv1() // might fail with SIGILL
   ^
cmd/dist/util.go:490:3: error: reference to undefined name 'useVFPv3'
   useVFPv3() // might fail with SIGILL
   ^
debian/rules:100: recipe for target 'override_dh_auto_build-arch' failed
make[1]: *** [override_dh_auto_build-arch] Error 2
make[1]: Leaving directory '/home/tianon/golang-1.7-1.7'
debian/rules:23: recipe for target 'build' failed
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

I found https://groups.google.com/d/topic/golang-nuts/waTy56I_KWQ/discussion,
which is discussing this same failure, but with the unsatisfactory
conclusion that gccgo appears to disagree about the correct GOARCH
value for mips64, and I find that unsettling given gccgo's status as a
valid bootstrapper.

So in conclusion, perhaps I was wrong and we do have to consider
cross-build in order to unblock mips64. :(

On the patch provided in #828982, shouldn't it be using
"bootstrap.bash" somewhere?
(https://github.com/golang/go/blob/go1.7/src/bootstrap.bash)

Does it need to specify in d/control somehow that "cross" is an
acceptable build profile, or is that automatic?

What's the easiest way for me to test this? (I have access to the
misp64el porterbox)

♥,
- Tianon
  4096R / B42F 6819 007F 00F8 8E36  4FD4 036A 9C25 BF35 7DD4



More information about the pkg-golang-devel mailing list