Probabaly that such a "porting process" document should also include a description of the solution we had to take when porting golang to AIX, using the port of GCC Go.
Regards,
Cordialement,
Tony Reix
ATOS / Bull SAS
ATOS Expert
IBM Coop Architect & Technical Leader
Office : +33 (0) 4 76 29 72 67
1 rue de Provence - 38432 Ãchirolles - France
www.atos.net<https://mail.ad.bull.net/owa/redir.aspx?C=PvphmPvCZkGrAgHVnWGsdMcDKgzl_dEIsM6rX0g4u4v8V81YffzBGkWrtQeAXNovd3ttkJL8JIc.&URL=http%3a%2f%2fwww.atos.net%2f>
________________________________
De : golang-***@googlegroups.com <golang-***@googlegroups.com> de la part de Matt Layher <***@gmail.com>
Envoyé : mercredi 20 juin 2018 22:35:26
à : golang-dev
Objet : Re: [golang-dev] how to port golang to a new architecture
I apologize that I can't contribute more to the question at hand, but Aram, I would personally love to see an in-depth write-up of the porting process that could be later added to the project's official documentation.
On Wednesday, June 20, 2018 at 9:54:01 AM UTC-4, Aram Hãvãrneanu wrote:
I've done many ports now, so the strategy I use
is this (very simplified):
1. Add GOOS/GOARCH support to the toolchain
2. Add some support for GOARCH in cmd/internal/obj
3. Add some support for GOARCH in cmd/asm
4. Add some support for GOOS/GOARCH in cmd/link
5. Iterate through 2-3-4 until you can produse some kind
of binaries from assembly files. Depending on the specifics
of GOOS/GOARCH you might, or might not need to use external
linking.
6. Once you can produce binaries, thoroughly test them (link
just assembly programs, without runtime). Basically make
sure the low-level toolchain works.
7. Start working on the Go compiler for GOARCH.
8. Write a minimal alternative runtime for Go. The runtime
is much too complicated as a first test Go program. Basically
write your own runtime in assembly that is just stubbed
out, but can run a good bulk of the programs in go/test.
9. Once that works well enough, start using the real runtime.
This requires implementing a lot of assembly, but you can
use the lessons learned from #8.
10. Make all the tests in go/test work.
11. Make all the stdlib tests work. You are still working
amd64 now, and executing on GOARCH with go_GOOS_GOARCH_exec.
12. Run bootstrap.bash
13. Move over the artifacts on GOOS/GOARCH machine.
14. Make sure make.bash works. You will still likely have
to fix problems to make this N-generation compiler work.
15. Make sure all.bash works.
16. Done.
As you can see, steps 1-14 are done on amd64 (or some other supported
platform), and only step 15 is done on the target architecture.
--
Aram Hãvãrneanu
--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+***@googlegroups.com<mailto:golang-dev+***@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.