tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Make go bootstrap with newer binutils.



I noticed that I cannot build lang/go on a system with binutils 2.27.
The build of lang/go14 fails with funny linker errors like this:

cannot load DWARF output from $WORK/net/_obj//_cgo_.o: decoding dwarf section info at offset 0x4: unsupported version 0

The official solution is: Build go14 without CGO by adding
CGO_ENABLED=0 to the environment. My local patch for that looks like this:

diff -ruN -x CVS pkgsrc-cvs/lang/go14/Makefile pkgsrc/lang/go14/Makefile
--- pkgsrc-cvs/lang/go14/Makefile       2017-08-28 16:11:08.373716527 +0200
+++ pkgsrc/lang/go14/Makefile   2017-08-31 16:08:03.128294226 +0200
@@ -75,8 +73,10 @@
 CHECK_INTERPRETER_SKIP+=       go14/src/make.rc
 CHECK_INTERPRETER_SKIP+=       go14/src/run.rc
 
+# disabling CGO as it's broken with newer binutils
+# not needed for bootstrapping modern go
 do-build:
-	cd ${WRKSRC}/src && env GOROOT_FINAL=${GOROOT_FINAL:Q} ${BASH} ./make.bash
+	cd ${WRKSRC}/src && env CGO_ENABLED=0 GOROOT_FINAL=${GOROOT_FINAL:Q} ${BASH} ./make.bash
 
 do-install:
 	cd ${WRKSRC} && rm -rf .hgignore .hgtags pkg/obj
diff -ruN -x CVS pkgsrc-cvs/lang/go14/PLIST pkgsrc/lang/go14/PLIST
--- pkgsrc-cvs/lang/go14/PLIST  2015-09-26 19:37:01.000000000 +0200
+++ pkgsrc/lang/go14/PLIST      2017-08-31 16:10:52.555329582 +0200
@@ -492,7 +492,6 @@
 go14/pkg/${GO_PLATFORM}/regexp/syntax.a
 go14/pkg/${GO_PLATFORM}/runtime.a
 go14/pkg/${GO_PLATFORM}/runtime.h
-go14/pkg/${GO_PLATFORM}/runtime/cgo.a
 go14/pkg/${GO_PLATFORM}/runtime/debug.a
 go14/pkg/${GO_PLATFORM}/runtime/pprof.a
 go14/pkg/${GO_PLATFORM}/runtime/race.a

(also under
http://src.rrz.uni-hamburg.de/extra/pkgsrc-patches/lang-go14-new-binutils-hack.patch,
next to all my other current patches for 2017Q2)

Now the question is: Do we want extra care to only do this for the case
of a fresh binutils being there or perhaps just generally, as this part
is not needed for a build of go14 for bootstrapping. Is anyone building
lang/go14 to actually install it? I imagine that every bit not strictly
necessary for that task will suffer massive bit rot over time and just
be a headache.


Alrighty then,

Thomas

-- 
Dr. Thomas Orgis
Universität Hamburg
RRZ / Basis-Infrastruktur / HPC
Schlüterstr. 70
20146 Hamburg
Tel.: 040/42838 8826
Fax: 040/428 38 6270

Attachment: smime.p7s
Description: S/MIME cryptographic signature



Home | Main Index | Thread Index | Old Index