Open
Description
STR
$ cargo new --lib kernel && cd $_
$ edit src/lib.rs && cat $_
#![feature(lang_items)]
#![feature(no_core)]
#![no_core] // Just to avoid using Xargo
fn foo() {}
#[lang = "copy"]
trait Copy {}
#[lang = "sized"]
trait Sized {}
$ edit nvptx64-nvidia-cuda.json && cat $_
{
"arch": "nvptx64",
"cpu": "sm_20",
"data-layout": "e-i64:64-v16:16-v32:32-n16:32:64",
"llvm-target": "nvptx64-nvidia-cuda",
"max-atomic-width": 0,
"os": "cuda",
"panic-strategy": "abort",
"target-endian": "little",
"target-pointer-width": "64"
}
$ cargo rustc --target nvptx64-nvidia-cuda -- --emit=asm
Compiling kernel v0.1.0 (file:///home/japaric/tmp/kernel)
warning: function is never used: `foo`, #[warn(dead_code)] on by default
--> src/lib.rs:5:1
|
5 | fn foo() {}
| ^^^^^^^^^^^
All DICompileUnits must be listed in llvm.dbg.cu
LLVM ERROR: Broken module found, compilation aborted!
error: Could not compile `kernel`.
Workaround
Don't try to emit debuginfo:
# Cargo.toml
[profile.dev]
debug = false