Thank you. The explanation really makes sense. I think I should modify the source code of etcd, or change to another project that is not so hackful.
On Thursday, July 18, 2019 at 10:55:39 PM UTC+8, Ian Lance Taylor wrote: > > On Thu, Jul 18, 2019 at 6:50 AM Yuan Ting <yuan...@ict.ac.cn <javascript:>> > wrote: > > > > Thank you for your fix. I have some curious about the difference between > the main Go compiler and gollvm. I read gollvm's readme and know that the > main difference comes from the efficiency of GC. Is the other difference > causes the symbol undefined reference as you mentioned above? Or some bugs > (or library version skew) that will be fixed in the future. > > The gc toolchain has a different assembler that does not use the same > syntax as standard assembler for a platform > (https://golang.org/cmd/asm). GoLLVM uses the standard assembler for > whatever platform it is being used on. So Go packages that use > assembler code, like golang.org/x/sys, have to use different code to > support gc and GoLLVM. That is part of your problem. (That code does > exist in current versions of golang.org/x/sys; the build above is > showing an older version of the package; it's quite possible that > current versions would work). > > The gc toolchain has a special approach for unifying type descriptors > that uses a runtime-specific symbol runtime.typelinks. GoLLVM does > not have that symbol. I don't know what github.com/modern-go/reflect2 > is, but it seems to be using unsafe mechanisms to reach into the > runtime to examine that symbol. That won't work with GoLLVM. The > reflect package in general is closely tied to the compiler, so it's > possible that whatever modern-go/reflect2 is, it will not work with > GoLLVM. > > Ian > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/b8cdf106-750e-46c7-99c8-11999ee63d0d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.