0

I am getting this error always when I try building a counter-kernel.

Command:

cargo build --release --target wasm32-unknown-unknown

Error:

error: failed to build archive: section too large

The following warnings were emitted during compilation:

warning: In file included from /Users/sanket/.cargo/registry/src/github.com-1ecc6299db9ec823/blst-0.3.10/blst/src/server.c:22:
warning: In file included from /Users/sanket/.cargo/registry/src/github.com-1ecc6299db9ec823/blst-0.3.10/blst/src/vect.c:10:
warning: /Users/sanket/.cargo/registry/src/github.com-1ecc6299db9ec823/blst-0.3.10/blst/src/no_asm.h:943:1: warning: argument 'ret' of type 'vec256' (aka 'unsigned int[8]') with mismatched bound [-Warray-parameter]
warning: CT_INVERSE_MOD_IMPL(256)
warning: ^
warning: /Users/sanket/.cargo/registry/src/github.com-1ecc6299db9ec823/blst-0.3.10/blst/src/no_asm.h:939:45: note: expanded from macro 'CT_INVERSE_MOD_IMPL'
warning: inline void ct_inverse_mod_##bits(vec##bits ret, const vec##bits inp, \
warning:                                             ^
warning: /Users/sanket/.cargo/registry/src/github.com-1ecc6299db9ec823/blst-0.3.10/blst/src/vect.h:142:32: note: previously declared as 'vec512' (aka 'unsigned int[16]') here
warning: void ct_inverse_mod_256(vec512 ret, const vec256 inp, const vec256 mod,
warning:                                ^
warning: In file included from /Users/sanket/.cargo/registry/src/github.com-1ecc6299db9ec823/blst-0.3.10/blst/src/server.c:22:
warning: In file included from /Users/sanket/.cargo/registry/src/github.com-1ecc6299db9ec823/blst-0.3.10/blst/src/vect.c:10:
warning: /Users/sanket/.cargo/registry/src/github.com-1ecc6299db9ec823/blst-0.3.10/blst/src/no_asm.h:944:1: warning: argument 'ret' of type 'vec384' (aka 'unsigned int[12]') with mismatched bound [-Warray-parameter]
warning: CT_INVERSE_MOD_IMPL(384)
warning: ^
warning: /Users/sanket/.cargo/registry/src/github.com-1ecc6299db9ec823/blst-0.3.10/blst/src/no_asm.h:939:45: note: expanded from macro 'CT_INVERSE_MOD_IMPL'
warning: inline void ct_inverse_mod_##bits(vec##bits ret, const vec##bits inp, \
warning:                                             ^
warning: /Users/sanket/.cargo/registry/src/github.com-1ecc6299db9ec823/blst-0.3.10/blst/src/vect.h:140:32: note: previously declared as 'vec768' (aka 'unsigned int[24]') here
warning: void ct_inverse_mod_383(vec768 ret, const vec384 inp, const vec384 mod,
warning:                                ^
warning: 2 warnings generated.
warning: warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: archive library: /Users/sanket/Personal-Projects/TezsoSORU/counter-kernel/target/wasm32-unknown-unknown/release/build/blst-2d660fbff66913b1/out/libblst.a the table of contents is empty (no object file members in the library define global symbols)

error: could not compile `blst` due to previous error
warning: build failed, waiting for other jobs to finish...

Can someone explain me where I am going wrong?

Update: Now I am getting this error

sanket@SANKETs-MacBook-Air 06_counter_kernel % cargo build --release --target wasm32-unknown-unknown
   Compiling tezos-smart-rollup v0.1.0 (https://gitlab.com/tezos/tezos#4a89056e)
error: couldn't read /Users/sanket/.cargo/git/checkouts/tezos-c5ed5e9e8d02562c/4a89056/src/kernel_sdk/sdk/src/../README.md: No such file or directory (os error 2)
 --> /Users/sanket/.cargo/git/checkouts/tezos-c5ed5e9e8d02562c/4a89056/src/kernel_sdk/sdk/src/lib.rs:5:10
  |
5 | #![doc = include_str!("../README.md")]
  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: this error originates in the macro `include_str` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `tezos-smart-rollup` due to previous error

2 Answers 2

2

There are a couple of additional build requirements when on MacOS.

The steps are mentioned in the tezos-smart-rollup sdk docs, but to summarise:

You need to install LLVM through homebrew, rather than using the default version. The specific 'section too large' error can then be fixed by using the llvm_ar that is installed alongside:

brew install llvm
LLVM_PATH=$(brew --prefix llvm)
export AR="${LLVM_PATH}/bin/llvm-ar"
export CC="${LLVM_PATH}/bin/clang"

After which point you should be able to build successfully.

1
  • I already tried this. Still I am getting same error Commented Apr 27, 2023 at 17:11
0

In cargo.toml file I had crate tezos-smart-rollup = { git = "https://gitlab.com/tezos/tezos" , features = ["testing"] }.

Replacing this with tezos-smart-rollup = { git = "https://gitlab.com/marigold/tezos", rev = "046281d4494560ed96796bd7ffe9053e573654f3" } worked for me.

Alternatively, you can also use tezos-smart-rollup = {version = "0.1.0", features = ["testing"]}

2
  • 1
    You can use direct from crates.io instead: tezos-smart-rollup = { version = "0.1.0", features = [" testing"]} Commented Apr 28, 2023 at 7:44
  • Yess, this helped. Commented Apr 28, 2023 at 7:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.