substrate-node-template: Build error
Question
when I used command cargo build --release, there was a compile error.
LIB_x86_64-apple-darwin = None
CXXSTDLIB_x86_64_apple_darwin = None
HOST_CXXSTDLIB = None
CXXSTDLIB = None
cargo:rustc-link-lib=c++
cargo:rerun-if-changed=snappy/
TARGET = Some("x86_64-apple-darwin")
OPT_LEVEL = Some("3")
HOST = Some("x86_64-apple-darwin")
CXX_x86_64-apple-darwin = None
CXX_x86_64_apple_darwin = None
HOST_CXX = None
CXX = None
CXXFLAGS_x86_64-apple-darwin = None
CXXFLAGS_x86_64_apple_darwin = None
HOST_CXXFLAGS = None
CXXFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2,sse3,ssse3")
running: "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-arch" "x86_64" "-I" "snappy/" "-I" "." "-Wall" "-std=c++11" "-DNDEBUG=1" "-o" "/Users/lizhen/Code/substrate/tutorials-1-first-substrate-chain/substrate-node-template/target/release/build/librocksdb-sys-7f7d33f4548d89f8/out/snappy/snappy.o" "-c" "snappy/snappy.cc"
running: "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-arch" "x86_64" "-I" "snappy/" "-I" "." "-Wall" "-std=c++11" "-DNDEBUG=1" "-o" "/Users/lizhen/Code/substrate/tutorials-1-first-substrate-chain/substrate-node-template/target/release/build/librocksdb-sys-7f7d33f4548d89f8/out/snappy/snappy-sinksource.o" "-c" "snappy/snappy-sinksource.cc"
running: "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-arch" "x86_64" "-I" "snappy/" "-I" "." "-Wall" "-std=c++11" "-DNDEBUG=1" "-o" "/Users/lizhen/Code/substrate/tutorials-1-first-substrate-chain/substrate-node-template/target/release/build/librocksdb-sys-7f7d33f4548d89f8/out/snappy/snappy-c.o" "-c" "snappy/snappy-c.cc"
exit status: 0
exit status: 0
cargo:warning=snappy/snappy.cc:1033:36: error: invalid output constraint '=@ccz' in asm
cargo:warning= : [tag_type] "+r"(tag_type), "=@ccz"(is_literal));
cargo:warning= ^
cargo:warning=1 error generated.
exit status: 1
--- stderr
error occurred: Command "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-arch" "x86_64" "-I" "snappy/" "-I" "." "-Wall" "-std=c++11" "-DNDEBUG=1" "-o" "/Users/lizhen/Code/substrate/tutorials-1-first-substrate-chain/substrate-node-template/target/release/build/librocksdb-sys-7f7d33f4548d89f8/out/snappy/snappy.o" "-c" "snappy/snappy.cc" with args "c++" did not execute successfully (status code exit status: 1).
My Rust version
default host: x86_64-apple-darwin
rustup home: /Users/lizhen/.rustup
installed toolchains
--------------------
stable-x86_64-apple-darwin (default)
nightly-x86_64-apple-darwin
active toolchain
----------------
stable-x86_64-apple-darwin (default)
rustc 1.60.0 (7737e0b5c 2022-04-04)
followed Create your first Substrate blockchain Version3
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 33 (12 by maintainers)
I believe this should be solved in a release of snappy https://github.com/google/snappy/releases/tag/1.1.9 that will be included in https://github.com/facebook/rocksdb/releases/ perhaps 7.2.3…
And finally upstream in substrate. Keep a lookout for a next release of Polkadot that includes a fix 🙏
Same issue here too. I agree with you @NukeManDan, I think it’s: google/snappy@8dd58a5
Also, maybe this can help solve it out: invalid output constraint ‘=@ccz’ in asm
More info: Everything works fine until polkadot-v0.9.17, which includes:
the compiling error starts with the following updated version:
Agree with closed but may need to update Tutorial content to help newbies. I tried to leave website comment but did not work.
Still getting
Tried with new clones of substrate repo but didn’t work. I have no idea about what to do now.
I have the same issue on my M1 machine as well - tried everything suggested by folks here and StackExchange
Or perhaps this is the reason. https://github.com/google/snappy/commit/8dd58a519f79f0742d4c68fbccb2aed2ddb651e8
snappy is a dependency of rocksdb