We are on arch linux and have been compiling the substrate node template just fine. Then with a recent rolling update of the OS we cannot compile the substrate template node. Some warnings about wasm-opt-sys

The following warnings were emitted during compilation:

warning: In file included from /home/...myuser/.cargo/registry/src/github.com-1ecc6299db9ec823/wasm-opt-sys-0.111.0/binaryen/src/wasm/wat-lexer.cpp:25:
warning: /home/.../.cargo/registry/src/github.com-1ecc6299db9ec823/wasm-opt-sys-0.111.0/binaryen/src/wat-lexer.h:62:3: error: ‘uint64_t’ does not name a type
warning:    62 |   uint64_t n;
warning:       |   ^~~~~~~~

after a lot of warnings then the error

error: failed to run custom build command for `wasm-opt-sys v0.111.0`

Caused by:
  process didn't exit successfully: `/home/.../code/target/release/build/wasm-opt-sys-100767d7e9b2317c/build-script-build` (exit status: 1)
  --- stdout
  TARGET = Some("x86_64-unknown-linux-gnu")
 running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "/home/.../code/target/release/build/wasm-opt-sys-9d165c4dcf677b01/out/cxxbridge/include" "-I" "/home/.../code/target/release/build/wasm-opt-sys-9d165c4dcf677b01/out/cxxbridge/crate" "-I" "/home/.../.cargo/registry/src/github.com-1ecc6299db9ec823/wasm-opt-sys-0.111.0/binaryen/src" "-I" "/home/.../.cargo/registry/src/github.com-1ecc6299db9ec823/wasm-opt-sys-0.111.0/binaryen/src/tools" "-I" "/home/.../code/target/release/build/wasm-opt-sys-9d165c4dcf677b01/out" "-Wall" "-Wextra" "-std=c++17" "-Wno-unused-parameter" "-DTHROW_ON_FATAL" "-o" "/home/.../code/target/release/build/wasm-opt-sys-9d165c4dcf677b01/out/a309b73c06d115a2-lib.rs.o" "-c" "/home/.../code/target/release/build/wasm-opt-sys-9d165c4dcf677b01/out/cxxbridge/sources/wasm-opt-sys/src/lib.rs.cc"
  exit status: 0

and it also fails on building rocksdb

error: failed to run custom build command for `librocksdb-sys v0.8.3+7.4.4`


1 Answer 1


Actually, this is not a Substrate or Rust question.

There is a change in GCC 13.

I'm an ArchLinux user. I always keep the dependencies on the latest version.

I have to use GCC 12 now.


CC=gcc-12 CXX=g++-12 cargo build --release

If you don't have gcc-12 or g++-12 you need to install it yourself. If you are an ArchLinux user, when your upgrade your system, these packages will be kept for you.

Linking issue: https://github.com/brson/wasm-opt-rs/issues/147.

  • Kachow!! thank you. and we're back to work. i wonder how to keep updated on the status of this going forward. May 17, 2023 at 17:01
  • Thanks Xavier, as an archlinux user I confirm this works. I installed the downgrade package and downgraded gcc, gcc-libs and gcc-objc to version 12.2.1-2. Should we create an issue on the substrate repo to support gcc13 ? May 25, 2023 at 7:18
  • I had this same issue too and I am on manjaro, this was super helpful!.
    – Kaioh33
    Jun 24, 2023 at 7:35
  • 1
    @DylanVerstraete Please check the update.
    – AurevoirXavier
    Jul 4, 2023 at 8:08

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.