Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

got error in go run #254

Closed
K-tang-mkv opened this issue Jun 30, 2024 · 3 comments · May be fixed by #258
Closed

got error in go run #254

K-tang-mkv opened this issue Jun 30, 2024 · 3 comments · May be fixed by #258

Comments

@K-tang-mkv
Copy link

When I run

CGO_LDFLAGS="-L/root/ceremonyclient/target/release -lvdf -ldl -lm"     CGO_ENABLED=1     GOEXPERIMENT=arenas     go run ./... --signature-check=false

But failed with these error:

# source.quilibrium.com/quilibrium/monorepo/node
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-3463163796/000007.o: in function `_cgo_989782a52565_Cfunc_ffi_bls48581_rustbuffer_from_bytes':
/tmp/go-build/cgo-gcc-prolog:68: undefined reference to `ffi_bls48581_rustbuffer_from_bytes'
/usr/bin/ld: /tmp/go-link-3463163796/000007.o: in function `_cgo_989782a52565_Cfunc_ffi_bls48581_uniffi_contract_version':
/tmp/go-build/cgo-gcc-prolog:87: undefined reference to `ffi_bls48581_uniffi_contract_version'
/usr/bin/ld: /tmp/go-link-3463163796/000007.o: in function `_cgo_989782a52565_Cfunc_uniffi_bls48581_checksum_func_commit_raw':
/tmp/go-build/cgo-gcc-prolog:106: undefined reference to `uniffi_bls48581_checksum_func_commit_raw'
/usr/bin/ld: /tmp/go-link-3463163796/000007.o: in function `_cgo_989782a52565_Cfunc_uniffi_bls48581_checksum_func_init':
/tmp/go-build/cgo-gcc-prolog:125: undefined reference to `uniffi_bls48581_checksum_func_init'
/usr/bin/ld: /tmp/go-link-3463163796/000007.o: in function `_cgo_989782a52565_Cfunc_uniffi_bls48581_checksum_func_prove_raw':
/tmp/go-build/cgo-gcc-prolog:144: undefined reference to `uniffi_bls48581_checksum_func_prove_raw'
/usr/bin/ld: /tmp/go-link-3463163796/000007.o: in function `_cgo_989782a52565_Cfunc_uniffi_bls48581_checksum_func_verify_raw':
/tmp/go-build/cgo-gcc-prolog:163: undefined reference to `uniffi_bls48581_checksum_func_verify_raw'
/usr/bin/ld: /tmp/go-link-3463163796/000007.o: in function `_cgo_989782a52565_Cfunc_uniffi_bls48581_fn_func_commit_raw':
/tmp/go-build/cgo-gcc-prolog:183: undefined reference to `uniffi_bls48581_fn_func_commit_raw'
/usr/bin/ld: /tmp/go-link-3463163796/000007.o: in function `_cgo_989782a52565_Cfunc_uniffi_bls48581_fn_func_prove_raw':
/tmp/go-build/cgo-gcc-prolog:216: undefined reference to `uniffi_bls48581_fn_func_prove_raw'
/usr/bin/ld: /tmp/go-link-3463163796/000007.o: in function `_cgo_989782a52565_Cfunc_uniffi_bls48581_fn_func_verify_raw':
/tmp/go-build/cgo-gcc-prolog:240: undefined reference to `uniffi_bls48581_fn_func_verify_raw'
/usr/bin/ld: /tmp/go-link-3463163796/000007.o: in function `_cgo_989782a52565_Cfunc_ffi_bls48581_rustbuffer_free':
/tmp/go-build/cgo-gcc-prolog:52: undefined reference to `ffi_bls48581_rustbuffer_free'
/usr/bin/ld: /tmp/go-link-3463163796/000007.o: in function `_cgo_989782a52565_Cfunc_uniffi_bls48581_fn_func_init':
/tmp/go-build/cgo-gcc-prolog:198: undefined reference to `uniffi_bls48581_fn_func_init'
collect2: error: ld returned 1 exit status
@K-tang-mkv
Copy link
Author

I'm in Ubuntu 22.04 os with gcc, rust, and go.

@creativebluecat
Copy link

source.quilibrium.com/quilibrium/monorepo/node

/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-1637099852/000007.o: in function _cgo_989782a52565_Cfunc_ffi_bls48581_rustbuffer_from_bytes': /tmp/go-build/cgo-gcc-prolog:68: undefined reference to ffi_bls48581_rustbuffer_from_bytes'
/usr/bin/ld: /tmp/go-link-1637099852/000007.o: in function _cgo_989782a52565_Cfunc_ffi_bls48581_uniffi_contract_version': /tmp/go-build/cgo-gcc-prolog:87: undefined reference to ffi_bls48581_uniffi_contract_version'
/usr/bin/ld: /tmp/go-link-1637099852/000007.o: in function _cgo_989782a52565_Cfunc_uniffi_bls48581_checksum_func_commit_raw': /tmp/go-build/cgo-gcc-prolog:106: undefined reference to uniffi_bls48581_checksum_func_commit_raw'
/usr/bin/ld: /tmp/go-link-1637099852/000007.o: in function _cgo_989782a52565_Cfunc_uniffi_bls48581_checksum_func_init': /tmp/go-build/cgo-gcc-prolog:125: undefined reference to uniffi_bls48581_checksum_func_init'
/usr/bin/ld: /tmp/go-link-1637099852/000007.o: in function _cgo_989782a52565_Cfunc_uniffi_bls48581_checksum_func_prove_raw': /tmp/go-build/cgo-gcc-prolog:144: undefined reference to uniffi_bls48581_checksum_func_prove_raw'
/usr/bin/ld: /tmp/go-link-1637099852/000007.o: in function _cgo_989782a52565_Cfunc_uniffi_bls48581_checksum_func_verify_raw': /tmp/go-build/cgo-gcc-prolog:163: undefined reference to uniffi_bls48581_checksum_func_verify_raw'
/usr/bin/ld: /tmp/go-link-1637099852/000007.o: in function _cgo_989782a52565_Cfunc_uniffi_bls48581_fn_func_commit_raw': /tmp/go-build/cgo-gcc-prolog:183: undefined reference to uniffi_bls48581_fn_func_commit_raw'
/usr/bin/ld: /tmp/go-link-1637099852/000007.o: in function _cgo_989782a52565_Cfunc_uniffi_bls48581_fn_func_prove_raw': /tmp/go-build/cgo-gcc-prolog:216: undefined reference to uniffi_bls48581_fn_func_prove_raw'
/usr/bin/ld: /tmp/go-link-1637099852/000007.o: in function _cgo_989782a52565_Cfunc_uniffi_bls48581_fn_func_verify_raw': /tmp/go-build/cgo-gcc-prolog:240: undefined reference to uniffi_bls48581_fn_func_verify_raw'
/usr/bin/ld: /tmp/go-link-1637099852/000007.o: in function _cgo_989782a52565_Cfunc_ffi_bls48581_rustbuffer_free': /tmp/go-build/cgo-gcc-prolog:52: undefined reference to ffi_bls48581_rustbuffer_free'
/usr/bin/ld: /tmp/go-link-1637099852/000007.o: in function _cgo_989782a52565_Cfunc_uniffi_bls48581_fn_func_init': /tmp/go-build/cgo-gcc-prolog:198: undefined reference to uniffi_bls48581_fn_func_init'
collect2: error: ld returned 1 exit status

i got the same error , is any method to solve it ?

@PalanQu
Copy link

PalanQu commented Jul 7, 2024

@K-tang-mkv @creativebluecat

Run generate.sh in bls48581, and run following script, add bls48581 link for CGO_LDFLAGS

CGO_LDFLAGS="-L/path/to/ceremonyclient/target/release -lvdf -lbls48581 -ldl -lm" \
        CGO_ENABLED=1 \
        GOEXPERIMENT=arenas \
        go run ./... --signature-check=false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants