Closed
Description
Description
I am testing quanta, a high-speed timing library. Also tried another similar project minstant. They both utilize Time Stamp Counter (TSC)
.
Following code can pass compile, but will fail to run.
fn main() {
println!("{:?}", quanta::Instant::now());
// println!("{}", minstant::is_tsc_available());
}
error message: trap at Instance { def: Item(DefId(2:14264 ~ core[0e1d]::core_arch::x86::rdtsc::_rdtsc)), args: [] } (_ZN4core9core_arch3x865rdtsc6_rdtsc17h93aafcf1ca958dbeE): llvm.x86.rdtsc
.
If I compile it without cranelift
enabled, then everything is OK.
More information
readelf -p .comment target/debug/main
String dump of section '.comment':
[ 0] rustc version 1.80.0-nightly (bdbbb6c6a 2024-05-26)
[ 34] mold 2.31.0 (compatible with GNU ld)
[ 59] GCC: (GNU) 13.2.1 20240316 (Red Hat 13.2.1-7)
[ 87] rustc version 1.80.0-nightly (bdbbb6c6a 2024-05-26) with cranelift 0.107.0
[ d2] GCC: (GNU) 13.3.1 20240522 (Red Hat 13.3.1-1)
Operating System: Fedora 39
container
Host Kernel: 6.1.91