On Mon, May 25, 2020 at 8:54 AM <siti...@gmail.com> wrote:
>
> I've been trying to make this project https://github.com/intel-go/nff-go 
> using a freshly built gollvm to get the code compiled into LLVM IR. The 
> project builds fine when using the regular go toolchain, but when trying to 
> build with gollvm, I get errors such as below:
>
> ../../asm/asm.s: Assembler messages:
> ../../asm/asm.s:6: Error: no such instruction: `text 
> ·RteCompilerRmb(SB),NOSPLIT,$0-0'
> ../../asm/asm.s:9: Error: no such instruction: `text 
> ·RteCompilerWmb(SB),NOSPLIT,$0-0'
> ../../asm/asm.s:12: Error: no such instruction: `text 
> ·Prefetcht0(SB),NOSPLIT,$0-8'
> ../../asm/asm.s:13: Error: junk `(FP)' after expression
> ../../asm/asm.s:13: Error: too many memory references for `movq'
> ../../asm/asm.s:16: Error: no such instruction: `text 
> ·GenerateMask(SB),NOSPLIT,$0-33'
> ../../asm/asm.s:17: Error: junk `(FP)' after expression
> ../../asm/asm.s:17: Error: too many memory references for `movq'
> ../../asm/asm.s:18: Error: junk `(FP)' after expression
> ../../asm/asm.s:18: Error: too many memory references for `movq'
> ../../asm/asm.s:19: Error: junk `(FP)' after expression
> ../../asm/asm.s:19: Error: too many memory references for `movq'
> ../../asm/asm.s:20: Error: junk `(FP)' after expression
> ../../asm/asm.s:20: Error: too many memory references for `movq'
> ../../asm/asm.s:21: Error: too many memory references for `vmovdqu'
> ../../asm/asm.s:22: Error: too many memory references for `vmovdqu'
> ../../asm/asm.s:23: Error: too many memory references for `vmovdqu'
> ../../asm/asm.s:24: Error: too many memory references for `vpcmpeqb'
> ../../asm/asm.s:25: Error: too many memory references for `vpand'
> ../../asm/asm.s:26: Error: too many memory references for `vptest'
> ../../asm/asm.s:27: Error: junk `(FP)' after expression
> ../../asm/asm.s:27: Error: invalid instruction suffix for `sete'
> ../../asm/asm.s:28: Error: too many memory references for `vmovdqu'

The assembler syntax used by the gc toolchain and the assembler syntax
used by GoLLVM are not compatible.  Here you are trying to assemble
code written for the gc assembler with the GoLLVM assembler.  That
won't work.

While the syntax differences are in some ways annoying, in other ways
they are good, because gc and GoLLVM use different calling
conventions.  That means that assembler code written for gc and GoLLVM
are not compatible (except for functions that take no arguments and
return no results).

What this means for your code is that you need to rewrite this code
into GoLLVM assembler (changing the calling convention as you go) or
you need to rewrite it into Go.  You can use build tags to select the
version to use for each compiler.

Sorry for these difficulties.  They are hard to avoid.

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/CAOyqgcVavB-C2k%2BBk7KcsDhcKGNJyVPQAssD74wV5PzFRpWKdw%40mail.gmail.com.

Reply via email to