Created a test here:
https://github.com/johalun/llvm-test-bug
README:
llvm-test-bug
Tested with:
rustc 1.16.0-nightly (7821a9b99 2017-01-23)
Build with:
xargo build --target x86_64-kernel-freebsd
this code
lazy_static! {
pub static ref X: i32 = 0i32;
}
causes error:
Assertion failed: ((Args.size() == FTy->getNumParams() || (FTy->isVarArg() && Args.size() > FTy->getNumParams())) && "Calling a function with bad signature!"), function init, file /buildslave/rust-buildbot/slave/nightly-dist-rustc-cross-host-linux/build/src/llvm/lib/IR/Instructions.cpp, line 258.
Target configuration
{
"llvm-target": "x86_64-unknown-freebsd",
"target-endian": "little",
"target-pointer-width": "64",
"os": "none",
"arch": "x86_64",
"data-layout": "e-m:e-i64:64-f80:128-n8:16:32:64-S128",
"pre-link-args": [ "-m64" ],
"cpu": "x86-64",
"features": "+soft-float,-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2",
"disable-redzone": true,
"custom-unwind-resume": true,
"eliminate-frame-pointer": true,
"linker-is-gnu": true,
"no-compiler-rt": true,
"archive-format": "gnu",
"code-model": "kernel",
"relocation-model": "static"
}