modern-go / reflect2

reflect api without runtime reflect.Value cost
Apache License 2.0
758 stars 73 forks source link

Can not use gccgo to compile .go file. #6

Closed zhangckid closed 5 years ago

zhangckid commented 5 years ago

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 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

Any idea to fix it?

Thanks Zhang Chen

hcornelis commented 5 years ago

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

advancedwebdeveloper commented 4 years ago

Same error here, while building crio-o, using gollvm

CC @thanm

Ivan