Gccgo for hppa

From Linux PARISC Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "matoro <matoro_mailinglist_kernel@matoro.tk> Ian Lance Taylor <iant@golang.org> Problem: Crashes without GOGC=off Env variable: GOMAXPROCS=1 Patch: https://dpaste.com/AV7NX8...")
 
m
 
Line 17: Line 17:
 
The other is the "go" command which mirrors the syntax of the official go compiler.
 
The other is the "go" command which mirrors the syntax of the official go compiler.
 
It appends the gcc major version at the end (to distinguish it if you have both official go and gccgo installed), so the actual binary name is go-12.
 
It appends the gcc major version at the end (to distinguish it if you have both official go and gccgo installed), so the actual binary name is go-12.
I just symlinked /usr/local/bin/go to it.  For a sample project I am using my favorite file manager tool, which you would normally install like this: go install github.com/gokcehan/lf
+
I just symlinked /usr/local/bin/go to it.  For a sample project I am using my favorite file manager tool, which you would normally install like this:
This is the command that's crashing without GOGC=off.
+
  go install github.com/gokcehan/lf
 +
This is the command that's crashing without  
 +
  GOGC=off.
 
My system is SMP so you can also set GOMAXPROCS=1 environment variable to force it serially for reproducible results.
 
My system is SMP so you can also set GOMAXPROCS=1 environment variable to force it serially for reproducible results.
  
 
/x/sys/unix is technically not required, you can get quite far with golang without needing to talk to C at all because they implement everything in-house - direct syscalls, dns resolver, etc etc, a good chunk of glibc functionality is implemented in the runtime (included in the compiler).
 
/x/sys/unix is technically not required, you can get quite far with golang without needing to talk to C at all because they implement everything in-house - direct syscalls, dns resolver, etc etc, a good chunk of glibc functionality is implemented in the runtime (included in the compiler).

Latest revision as of 22:36, 1 December 2022

matoro <matoro_mailinglist_kernel@matoro.tk> Ian Lance Taylor <iant@golang.org>

Problem: Crashes without GOGC=off Env variable: GOMAXPROCS=1

Patch: https://dpaste.com/AV7NX8ZV6.txt

Problem is probably here: https://github.com/gcc-mirror/gcc/blob/releases/gcc-12/libgo/runtime/stack.c

build is simple - just add "go" to the list of languages in your gcc configure line, like: --enable-languages=c,c++,go

gccgo exposes two interfaces, one "gccgo" command that uses traditional gcc syntax for compiling like: gccgo -O2 -c somefile.go -o somefile.o The other is the "go" command which mirrors the syntax of the official go compiler. It appends the gcc major version at the end (to distinguish it if you have both official go and gccgo installed), so the actual binary name is go-12. I just symlinked /usr/local/bin/go to it. For a sample project I am using my favorite file manager tool, which you would normally install like this:

 go install github.com/gokcehan/lf

This is the command that's crashing without

 GOGC=off.

My system is SMP so you can also set GOMAXPROCS=1 environment variable to force it serially for reproducible results.

/x/sys/unix is technically not required, you can get quite far with golang without needing to talk to C at all because they implement everything in-house - direct syscalls, dns resolver, etc etc, a good chunk of glibc functionality is implemented in the runtime (included in the compiler).

Personal tools