@kmj

chicken > egg > chicken > egg > chicken > egg > chicken > egg > chicken > egg >

@selea @kmj yes you need go, but you can bootstrap with either gcc-go or by using a go toolchain from before the self-hosting compiler.

it _on purpose_ isn't hard to build anything go.

go.dev/doc/install/source

@selea @kmj

relevant quote:

Install Go compiler binaries for bootstrap

The Go toolchain is written in Go. To build it, you need a Go compiler installed. The scripts that do the initial build of the tools look for a "go" command in $PATH, so as long as you have Go installed in your system and configured in your $PATH, you are ready to build Go from source. Or if you prefer you can set $GOROOT_BOOTSTRAP to the root of a Go installation to use to build the new Go toolchain; $GOROOT_BOOTSTRAP/bin/go should be the go command to use.

There are four possible ways to obtain a bootstrap toolchain:

Download a recent binary release of Go.
Cross-compile a toolchain using a system with a working Go installation.
Use gccgo.
Compile a toolchain from Go 1.4, the last Go release with a compiler written in C.

These approaches are detailed below.

@bonifartius @kmj

There is no binary release for my system, so I *think* that my approach in this case would be:

Build go 1.12 from the 1.8 binary that actually exist.

Use 1.12 to build 1.17

Use 1.17 to build 1.19

@selea @kmj
i'm not 100% sure the newer releases use no new features but in theory:

the last c release was 1.4, so you should be fine with using 1.8 to build 1.19. just make sure the tests are run as a sanity check, which happens automatically if you build with ./all.bash

otherwise you'd have to build multiple versions, which is quite fast though.

also you should be able to cross-compile as long as the architecture and os are supported, but i never done that :) it's usually done by just setting GOOS and GOARCH, but the whole compiler might need some extra flags.

Follow

@selea @kmj
TL;DR:

GOROOT_BOOTSTRAP=path/to/go1.8 ./all.bash

should be your first try.

@bonifartius @kmj

Yeah I tried it. But I got errors that it required go 1.17 and nog 1.8 :p

@selea @kmj
see how nice it is! it even tells you what it expects :P

joke aside, i never had trouble with compiling go for supported architectures. i think it's a very nice compiler compared to other languages. i'm a bit partial because of it's plan9 heritage though :)

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.