I found if I use any reflect2 function in my app, I can't use go build --compiler=gccgo to compile it.
It will return error like that:
go build --compiler=gccgo map_1.go
command-line-arguments
/tmp/go-build467403193/b023/pkg.a(go.o): In function github_com_modern_go_reflect2.loadGo15Types': /usr/lib/go-1.10/src/github.com/modern-go/reflect2/type_map.go:42: undefined reference toreflect.typelinks'
/tmp/go-build467403193/b023/pkg.a(go.o): In function github_com_modern_go_reflect2.loadGo17Types': /usr/lib/go-1.10/src/github.com/modern-go/reflect2/type_map.go:74: undefined reference toreflect.typelinks'
/usr/lib/go-1.10/src/github.com/modern-go/reflect2/type_map.go:78: undefined reference to `reflect.resolveTypeOff'
collect2: error: ld returned 1 exit status
Hi Zhang Chen, I have ran into the same problem as you report here.
I am trying to compile Docker for powerpc 32 bit using the gccgo compiler.
Did you manage to solve this problem?
Thanks, Hugo
Hi All,
I found if I use any reflect2 function in my app, I can't use go build --compiler=gccgo to compile it. It will return error like that:
go build --compiler=gccgo map_1.go
command-line-arguments
/tmp/go-build467403193/b023/pkg.a(go.o): In function
github_com_modern_go_reflect2.loadGo15Types': /usr/lib/go-1.10/src/github.com/modern-go/reflect2/type_map.go:42: undefined reference to
reflect.typelinks' /tmp/go-build467403193/b023/pkg.a(go.o): In functiongithub_com_modern_go_reflect2.loadGo17Types': /usr/lib/go-1.10/src/github.com/modern-go/reflect2/type_map.go:74: undefined reference to
reflect.typelinks' /usr/lib/go-1.10/src/github.com/modern-go/reflect2/type_map.go:78: undefined reference to `reflect.resolveTypeOff' collect2: error: ld returned 1 exit statusAny idea to fix it?
Thanks Zhang Chen