Description
Hopefully I'm doing something really obviously wrong, but I'm having trouble getting avr-rust/blink to compile.
- Check out avr-rust/rust#avr-support-1.39.0-4560ea788c
- Follow the compilation instructions, install, toolchain link, blah blah
- Check out
avr-rust/blink
and run:RUST_TARGET_PATH=`pwd` RUST_BACKTRACE=1 XARGO_RUST_SRC=$HOME/src/avr-rust/rust/src cargo xbuild --target avr-atmega328p --release
Get the SIGSEGV while compiling core:
Updating crates.io index Compiling core v0.0.0 (/Users/andre/src/avr-rust/rust/src/libcore) Compiling compiler_builtins v0.1.21 Compiling rustc-std-workspace-core v1.99.0 (/Users/andre/src/avr-rust/rust/src/tools/rustc-std-workspace-core) error: could not compile `core`.Caused by:
process didn't exit successfully:rustc --edition=2018 --crate-name core /Users/andre/src/avr-rust/rust/src/libcore/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=c4eee7f38a624e7b -C extra-filename=-c4eee7f38a624e7b --out-dir /var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/xargo.Hw4H4cAozToc/target/avr-atmega328p/release/deps --target avr-atmega328p -L dependency=/var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/xargo.Hw4H4cAozToc/target/avr-atmega328p/release/deps -L dependency=/var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/xargo.Hw4H4cAozToc/target/release/deps
(signal: 11, SIGSEGV: invalid memory reference)
The output with xargo is slightly different, but reports the same SIGSEGV
$ RUST_TARGET_PATH=`pwd` RUST_BACKTRACE=1 XARGO_RUST_SRC=$HOME/src/avr-rust/rust/src xargo build --target avr-atmega328p --releasewarning: Patch
rustc-std-workspace-alloc v1.99.0 (/Users/andre/src/avr-rust/rust/src/tools/rustc-std-workspace-alloc)
was not used in the crate graph.
Patchrustc-std-workspace-core v1.99.0 (/Users/andre/src/avr-rust/rust/src/tools/rustc-std-workspace-core)
was not used in the crate graph.
Patchrustc-std-workspace-std v1.99.0 (/Users/andre/src/avr-rust/rust/src/tools/rustc-std-workspace-std)
was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, runcargo update
to use the new
version. This may also occur with an optional dependency that is not enabled.
Compiling core v0.0.0 (/Users/andre/src/avr-rust/rust/src/libcore)
error: could not compilecore
.Caused by:
process didn't exit successfully:rustc --edition=2018 --crate-name core /Users/andre/src/avr-rust/rust/src/libcore/lib.rs --color always --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=9ca9a62c0f5debaf -C extra-filename=-9ca9a62c0f5debaf --out-dir /var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/xargo.8EIsUXh7kaSi/target/avr-atmega328p/release/deps --target avr-atmega328p -L dependency=/var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/xargo.8EIsUXh7kaSi/target/avr-atmega328p/release/deps -L dependency=/var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/xargo.8EIsUXh7kaSi/target/release/deps --sysroot /Users/andre/.xargo -Z force-unstable-if-unmarked
(signal: 11, SIGSEGV: invalid memory reference)
error:"cargo" "build" "--release" "--manifest-path" "/var/folders/qc/x0j95x2d6tgb4686by93p4b00000gn/T/xargo.8EIsUXh7kaSi/Cargo.toml" "--target" "avr-atmega328p" "-p" "core"
failed with exit code: Some(101)
stack backtrace:
0: backtrace::backtrace::trace
1: backtrace::capture::Backtrace::new
2: error_chain::make_backtrace
3: <error_chain::State as core::default::Default>::default
4: <std::process::Command as xargo::extensions::CommandExt>::run
5: xargo::sysroot::build
6: xargo::sysroot::update
7: xargo::main
8: std::rt::lang_start::{{closure}}
9: std::panicking::try::do_call
10: __rust_maybe_catch_panic
11: std::rt::lang_start_internal
12: main
Can anyone tell me what I'm doing wrong, or how to get more information about how exactly the SIGSEGV is happening?