The problem
The println! and format! macros yield unexpected results for f32 primitive type values when cross compiling for powerpc64le-unknown-linux-gnu.
Configuration
- Toolchain:
stable-x86_64-apple-darwin (rustc 1.58.1 (db9d1b20b 2022-01-20))
- Target:
powerpc64le-unknown-linux-gnu
Example
fn main() {
println!("f32: {:.1}", 1.0f32);
println!("f64: {:.1}", 1.0f64);
}
Expected result:
Output of cross run --target powerpc64le-unknown-linux-gnu (note the incorrect value printed for f32):
Additional information
It appears that the version of QEMU used for powerpc64le-unknown-linux-gnu was pinned to 3.0.1 here as a fix for issue #313. The upstream issue has supposedly been fixed and released with QEMU 4.2.0, though I'm unable to confirm for certain if this is related to the issue above.