[Bug go/86535] FreeBSD/PowerPC64 - Building Go Frontend support for gcc 7.3.0 fails

clhamilto at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Aug 7 18:01:30 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86535

--- Comment #30 from Curtis Hamilton <clhamilto at gmail dot com> ---
Ian,

I've made progress with building the frontend but I have an issue with
implementing Syscall9 needed by libgo/go/os/wait_wait6.go.  I tried adding the
file  "syscall_freebsd_ppc64.go" containing the following:

func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2
uintptr, err Errno)

that gets me past the initial error.

But now I get the below error when linking gotools.

gmake[6]: Leaving directory
'/usr/ports/lang/gcc10/work/.build/powerpc64-portbld-freebsd12.1/libgo'
gmake[5]: Leaving directory
'/usr/ports/lang/gcc10/work/.build/powerpc64-portbld-freebsd12.1/libgo'
gmake[4]: Leaving directory
'/usr/ports/lang/gcc10/work/.build/powerpc64-portbld-freebsd12.1/libgo'
gmake[4]: Entering directory '/usr/ports/lang/gcc10/work/.build/gotools'
/usr/ports/lang/gcc10/work/.build/./gcc/gccgo
-B/usr/ports/lang/gcc10/work/.build/./gcc/
-B/usr/local/powerpc64-portbld-freebsd12.1/bin/
-B/usr/local/powerpc64-portbld-freebsd12.1/lib/ -isystem
/usr/local/powerpc64-portbld-freebsd12.1/include -isystem
/usr/local/powerpc64-portbld-freebsd12.1/sys-include   -g -O2 -pipe 
-DLIBICONV_PLUG -fno-strict-aliasing  -I ../powerpc64-portbld-freebsd12.1/libgo
-static-libstdc++ -static-libgcc  -L ../powerpc64-portbld-freebsd12.1/libgo -L
../powerpc64-portbld-freebsd12.1/libgo/.libs -o go
/usr/ports/lang/gcc10/work/gcc-10.1.0/gotools/../libgo/go/cmd/go/alldocs.go
/usr/ports/lang/gcc10/work/gcc-10.1.0/gotools/../libgo/go/cmd/go/go11.go
/usr/ports/lang/gcc10/work/gcc-10.1.0/gotools/../libgo/go/cmd/go/main.go
../powerpc64-portbld-freebsd12.1/libgo/libgotool.a  
/usr/ports/lang/gcc10/work/.build/./gcc/gccgo
-B/usr/ports/lang/gcc10/work/.build/./gcc/
-B/usr/local/powerpc64-portbld-freebsd12.1/bin/
-B/usr/local/powerpc64-portbld-freebsd12.1/lib/ -isystem
/usr/local/powerpc64-portbld-freebsd12.1/include -isystem
/usr/local/powerpc64-portbld-freebsd12.1/sys-include   -g -O2 -pipe 
-DLIBICONV_PLUG -fno-strict-aliasing  -I ../powerpc64-portbld-freebsd12.1/libgo
-static-libstdc++ -static-libgcc  -L ../powerpc64-portbld-freebsd12.1/libgo -L
../powerpc64-portbld-freebsd12.1/libgo/.libs -o gofmt
/usr/ports/lang/gcc10/work/gcc-10.1.0/gotools/../libgo/go/cmd/gofmt/doc.go
/usr/ports/lang/gcc10/work/gcc-10.1.0/gotools/../libgo/go/cmd/gofmt/gofmt.go
/usr/ports/lang/gcc10/work/gcc-10.1.0/gotools/../libgo/go/cmd/gofmt/internal.go
/usr/ports/lang/gcc10/work/gcc-10.1.0/gotools/../libgo/go/cmd/gofmt/rewrite.go
/usr/ports/lang/gcc10/work/gcc-10.1.0/gotools/../libgo/go/cmd/gofmt/simplify.go
../powerpc64-portbld-freebsd12.1/libgo/libgotool.a  
/usr/ports/lang/gcc10/work/.build/./gcc/gccgo
-B/usr/ports/lang/gcc10/work/.build/./gcc/
-B/usr/local/powerpc64-portbld-freebsd12.1/bin/
-B/usr/local/powerpc64-portbld-freebsd12.1/lib/ -isystem
/usr/local/powerpc64-portbld-freebsd12.1/include -isystem
/usr/local/powerpc64-portbld-freebsd12.1/sys-include   -g -O2 -pipe 
-DLIBICONV_PLUG -fno-strict-aliasing  -I ../powerpc64-portbld-freebsd12.1/libgo
-static-libstdc++ -static-libgcc  -L ../powerpc64-portbld-freebsd12.1/libgo -L
../powerpc64-portbld-freebsd12.1/libgo/.libs -o vet
/usr/ports/lang/gcc10/work/gcc-10.1.0/gotools/../libgo/go/cmd/vet/doc.go
/usr/ports/lang/gcc10/work/gcc-10.1.0/gotools/../libgo/go/cmd/vet/main.go
../powerpc64-portbld-freebsd12.1/libgo/libgotool.a  
/usr/ports/lang/gcc10/work/.build/./gcc/gccgo
-B/usr/ports/lang/gcc10/work/.build/./gcc/
-B/usr/local/powerpc64-portbld-freebsd12.1/bin/
-B/usr/local/powerpc64-portbld-freebsd12.1/lib/ -isystem
/usr/local/powerpc64-portbld-freebsd12.1/include -isystem
/usr/local/powerpc64-portbld-freebsd12.1/sys-include   -g -O2 -pipe 
-DLIBICONV_PLUG -fno-strict-aliasing  -I ../powerpc64-portbld-freebsd12.1/libgo
-static-libstdc++ -static-libgcc  -L ../powerpc64-portbld-freebsd12.1/libgo -L
../powerpc64-portbld-freebsd12.1/libgo/.libs -o buildid
/usr/ports/lang/gcc10/work/gcc-10.1.0/gotools/../libgo/go/cmd/buildid/buildid.go
/usr/ports/lang/gcc10/work/gcc-10.1.0/gotools/../libgo/go/cmd/buildid/doc.go
../powerpc64-portbld-freebsd12.1/libgo/libgotool.a  
/usr/ports/lang/gcc10/work/.build/./gcc/gccgo
-B/usr/ports/lang/gcc10/work/.build/./gcc/
-B/usr/local/powerpc64-portbld-freebsd12.1/bin/
-B/usr/local/powerpc64-portbld-freebsd12.1/lib/ -isystem
/usr/local/powerpc64-portbld-freebsd12.1/include -isystem
/usr/local/powerpc64-portbld-freebsd12.1/sys-include   -g -O2 -pipe 
-DLIBICONV_PLUG -fno-strict-aliasing  -I ../powerpc64-portbld-freebsd12.1/libgo
-static-libstdc++ -static-libgcc  -L ../powerpc64-portbld-freebsd12.1/libgo -L
../powerpc64-portbld-freebsd12.1/libgo/.libs -o test2json
/usr/ports/lang/gcc10/work/gcc-10.1.0/gotools/../libgo/go/cmd/test2json/main.go
../powerpc64-portbld-freebsd12.1/libgo/libgotool.a  
/usr/local/bin/ld: ../powerpc64-portbld-freebsd12.1/libgo/.libs/libgo.so:
undefined reference to `syscall.Syscall9'
/usr/local/bin/ld: ../powerpc64-portbld-freebsd12.1/libgo/.libs/libgo.so:
undefined reference to `syscall.Syscall9'
collect2: error: ld returned 1 exit status
gmake[4]: *** [Makefile:831: test2json] Error 1
gmake[4]: *** Waiting for unfinished jobs....
collect2: error: ld returned 1 exit status
gmake[4]: *** [Makefile:829: buildid] Error 1
/usr/local/bin/ld: ../powerpc64-portbld-freebsd12.1/libgo/.libs/libgo.so:
undefined reference to `syscall.Syscall9'
collect2: error: ld returned 1 exit status
gmake[4]: *** [Makefile:827: vet] Error 1
/usr/local/bin/ld: ../powerpc64-portbld-freebsd12.1/libgo/.libs/libgo.so:
undefined reference to `syscall.Syscall9'
/usr/local/bin/ld: ../powerpc64-portbld-freebsd12.1/libgo/.libs/libgo.so:
undefined reference to `syscall.Syscall9'
collect2: error: ld returned 1 exit status
gmake[4]: *** [Makefile:821: go] Error 1
collect2: error: ld returned 1 exit status
gmake[4]: *** [Makefile:823: gofmt] Error 1
gmake[4]: Leaving directory '/usr/ports/lang/gcc10/work/.build/gotools'
gmake[3]: *** [Makefile:14920: all-gotools] Error 2
gmake[3]: Leaving directory '/usr/ports/lang/gcc10/work/.build'
gmake[2]: *** [Makefile:24257: bootstrap-lean] Error 2
gmake[2]: Leaving directory '/usr/ports/lang/gcc10/work/.build'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1
(In reply to Curtis Hamilton from comment #28)
> (In reply to Ian Lance Taylor from comment #27)
> > What is the complete contents of your new file?  You showed just a
> > declaration; is there a function body there as well?
> 
> That's what I was missing. I now have it working, here's the complete
> contents of the file.
> 
> 
> package syscall
> 
> // We can't use the gc-syntax .s files for gccgo. On the plus side
> // much of the functionality can be written directly in Go.
> 
> func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2
> uintptr, err Errno) {
>         Entersyscall()
>         r, r2, errno := Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9)
>         Exitsyscall()
>         return r, 0, Errno(errno)
> }
> 
> func syscall9(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr,
> uintptr, uintptr, uintptr) (uintptr, uintptr, Errno)
> 
> 
> Also, there was an earlier error that I manually changed.  Any idea on how
> to fix the below:
> 
> runtime_sysinfo.go:580:6: error: invalid recursive type
>   580 | type _thread _thread
>       |

Testing the build using simple hello program 

root@blackbird:~ # ./a.out
runtime: len(sigtable)=33 _NSIG=32
fatal error: bad sigtable len

goroutine 1 [running, locked to thread]:
runtime.dopanic_m
        :0
runtime.throw
        :0
runtime.runtime..init4
        :0
runtime..import
        :0
__go_init_main
        /root/test.go:2
runtime.main
        :0
runtime.kickoff
        :0

        /usr/src/lib/libc/powerpc64/gen/_ctx_start.S:38

goroutine 2 [runnable]:

Any ideas?


More information about the Gcc-bugs mailing list