Open
Description
I'm trying to compile the kernel code from japaric/nvptx to PTX. This requires cross-compiling the core
crate. When I run the command to do this, rustc
crashes with a segfault. I'm using cargo-xbuild
because xargo
doesn't seem to work anymore.
cargo xbuild --target nvptx64-nvidia-cuda.json --verbose
Output:
Compiling core v0.0.0 (file:///home/brook/.rustup/toolchains/nightly-2018-04-10-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore)
Running `rustc --crate-name core /home/brook/.rustup/toolchains/nightly-2018-04-10-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 --sysroot /mnt/c/Users/Brook/workspace/nvptx/kernel/target/sysroot -Z force-unstable-if-unmarked -C metadata=4bb3cbb45694acfc -C extra-filename=-4bb3cbb45694acfc --out-dir /tmp/xargo.pCW5tJxxVfmO/target/nvptx64-nvidia-cuda/release/deps --target /mnt/c/Users/Brook/workspace/nvptx/kernel/nvptx64-nvidia-cuda.json -C incremental=/tmp/xargo.pCW5tJxxVfmO/target/nvptx64-nvidia-cuda/release/incremental -L dependency=/tmp/xargo.pCW5tJxxVfmO/target/nvptx64-nvidia-cuda/release/deps -L dependency=/tmp/xargo.pCW5tJxxVfmO/target/release/deps`
error: Could not compile `core`.
Caused by:
process didn't exit successfully: `rustc --crate-name core /home/brook/.rustup/toolchains/nightly-2018-04-10-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 --sysroot /mnt/c/Users/Brook/workspace/nvptx/kernel/target/sysroot -Z force-unstable-if-unmarked -C metadata=4bb3cbb45694acfc -C extra-filename=-4bb3cbb45694acfc --out-dir /tmp/xargo.pCW5tJxxVfmO/target/nvptx64-nvidia-cuda/release/deps --target /mnt/c/Users/Brook/workspace/nvptx/kernel/nvptx64-nvidia-cuda.json -C incremental=/tmp/xargo.pCW5tJxxVfmO/target/nvptx64-nvidia-cuda/release/incremental -L dependency=/tmp/xargo.pCW5tJxxVfmO/target/nvptx64-nvidia-cuda/release/deps -L dependency=/tmp/xargo.pCW5tJxxVfmO/target/release/deps` (signal: 11, SIGSEGV: invalid memory reference)
error: `"cargo" "rustc" "-p" "core" "--release" "--manifest-path" "/tmp/xargo.pCW5tJxxVfmO/Cargo.toml" "--target" "nvptx64-nvidia-cuda.json" "-v" "--" "--sysroot" "/mnt/c/Users/Brook/workspace/nvptx/kernel/target/sysroot" "-Z" "force-unstable-if-unmarked"` failed with exit code: Some(101)
note: run with `RUST_BACKTRACE=1` for a backtrace
The important bit is: (signal: 11, SIGSEGV: invalid memory reference)
. I've tried this under Windows, WSL and MINGW (as well as a second machine running Arch Linux), it's completely consistent.
Version: cargo 1.29.0-nightly (15433e8cc 2018-08-02)
(I have also seen a similar crash with 2018-04-04).
I've tried to build a version of rustc with debug symbols so that I could collect more information, but have been unable to get a working build.