Okay, I moved the multiline definitions into one line respectively, which solved some of the errors. So this seems to be in fact related to how the file is being handled by the assembler. Now I still need to fix the following errors: root@llvmbuilder-successful-s-1vcpu-2gb-fra1-s-1vcpu-2gb-fra1-01:~/compile# go build -tags gofuzz -buildmode=c-shared -o ./geth-runtime-gollvm.so ./main.go # github.com/ethereum/go-ethereum/crypto/bn256/cloudflare ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s: Assembler messages: ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:13: Error: no such instruction: `text ·gfpNeg(SB),0,$0-16' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:14: Error: junk `(SB)' after expression ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:14: Error: too many memory references for `movq' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:15: Error: junk `(SB)' after expression ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:15: Error: too many memory references for `movq' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:16: Error: junk `(SB)' after expression ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:16: Error: too many memory references for `movq' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:17: Error: junk `(SB)' after expression ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:17: Error: too many memory references for `movq' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:19: Error: junk `(FP)' after expression ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:19: Error: too many memory references for `movq' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:20: Error: junk `(DI)' after expression ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:20: Error: too many memory references for `sub' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:21: Error: junk `(DI)' after expression ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:21: Error: too many memory references for `sbb' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:22: Error: junk `(DI)' after expression ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:22: Error: too many memory references for `sbb' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:23: Error: junk `(DI)' after expression ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:23: Error: too many memory references for `sbb' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:26: Error: invalid character '(' in mnemonic ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:28: Error: junk `(FP)' after expression ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:28: Error: too many memory references for `movq' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:29: Error: invalid character '(' in mnemonic ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:32: Error: no such instruction: `text ·gfpAdd(SB),0,$0-24' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:33: Error: junk `(FP)' after expression ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:33: Error: too many memory references for `movq' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:34: Error: junk `(FP)' after expression ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:34: Error: too many memory references for `movq' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:36: Error: invalid character '(' in mnemonic ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:39: Error: junk `(SI)' after expression ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:39: Error: too many memory references for `add' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:40: Error: junk `(SI)' after expression ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:40: Error: too many memory references for `adc' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:41: Error: junk `(SI)' after expression [...] ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:68: Error: no such instruction: `cmovqcc AX,R12' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:69: Error: no such instruction: `cmovqcc AX,R13' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:70: Error: no such instruction: `cmovqcc AX,R14' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:71: Error: no such instruction: `cmovqcc AX,R15' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:73: Error: too many memory references for `add' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:74: Error: too many memory references for `adc' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:75: Error: too many memory references for `adc' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:76: Error: too many memory references for `adc' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:78: Error: junk `(FP)' after expression ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:78: Error: too many memory references for `movq' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:79: Error: invalid character '(' in mnemonic ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:82: Error: no such instruction: `text ·gfpMul(SB),0,$160-24' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:83: Error: junk `(FP)' after expression ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:83: Error: too many memory references for `movq' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:84: Error: junk `(FP)' after expression ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:84: Error: too many memory references for `movq' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:87: Error: junk `(SB)' after expression ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:87: Error: operand size mismatch for `cmp' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:90: Error: invalid character '(' in mnemonic ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:91: Error: invalid character '(' in mnemonic ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:92: Error: invalid character '(' in mnemonic ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:93: Error: invalid character '(' in mnemonic ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:97: Error: invalid character '(' in mnemonic ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:98: Error: invalid character '(' in mnemonic ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:101: Error: junk `(FP)' after expression ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:101: Error: too many memory references for `movq' ../go/src/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:102: Error: invalid character '(' in mnemonic
On Wednesday, December 19, 2018 at 2:36:44 PM UTC+1, Benedikt T wrote: > > Hi! > > I'm trying to compile a part of the geth-client with the current gollvm > build. But it fails in this file: > > https://github.com/ethereum/go-ethereum/blob/master/crypto/bn256/cloudflare/gfp_amd64.s > > Here is an exempt from the error: > root@llvmbuilder-successful-s-1vcpu-2gb-fra1-s-1vcpu-2gb-fra1-01:~/compile# > go build -tags gofuzz -buildmode=c-shared -o ./geth-runtime-gollvm.so > ./main.go > # github.com/ethereum/go-ethereum/crypto/bn256/cloudflare > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s: > Assembler messages: > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:4: > Warning: stray `\' > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:4: > Error: invalid character '\' in operand 2 > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:5: > Warning: stray `\' > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:5: > Error: invalid character '\' in operand 2 > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:6: > Warning: stray `\' > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:6: > Error: invalid character '\' in operand 2 > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:7: > Error: too many memory references for `movq' > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:10: > Warning: stray `\' > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:10: > Error: invalid character '\' in operand 2 > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:11: > Warning: stray `\' > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:11: > Error: invalid character '\' in operand 2 > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:12: > Warning: stray `\' > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:12: > Error: invalid character '\' in operand 2 > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:13: > Error: too many memory references for `movq' > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:16: > Error: junk at end of line, first unrecognized character is `\' > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:17: > Warning: stray `\' > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:17: > Error: invalid character '\' in operand 2 > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:18: > Warning: stray `\' > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:18: > Error: invalid character '\' in operand 2 > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:19: > Warning: stray `\' > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:19: > Error: invalid character '\' in operand 2 > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:20: > Warning: stray `\' > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:20: > Error: invalid character '\' in operand 2 > ../go/src/ > github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_amd64.s:21: > Warning: stray `\' > [...] > > When I compile this with the regular go build command it works without > issue. It seems the compilation fails due to the multiline definitions. > Does someone have an idea how I can fix this? I guess there is something > missing in the gollvm implementation that handles this? > > If you want to try it yourself do this: > go get github.com/ethereum/go-ethereum/ > printf "package main\nimport \"C\"\nimport \" > github.com/ethereum/go-ethereum/core/vm/runtime\ > <http://github.com/ethereum/go-ethereum/core/vm/runtime%5C>"\nfunc > main(){}//export Fuzz\nfunc Fuzz(data []byte){\nruntime.Fuzz(data)\n}\n" > > ./main.go > go build -tags gofuzz -buildmode=c-shared -o ./geth-runtime-gollvm.so > ./main.go > > This will create a main.go file in the current directory with the > necessary stub for compilation in c-shared mode. > > Cheers, > Benedikt > > -- 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. For more options, visit https://groups.google.com/d/optout.