[Pkg-rust-maintainers] Bug#973414: rustc: produces non-baseline opcodes for compiler_builtins::int::udiv::__udivmoddi4 on i386

Fierelier OwO fierelier at gmail.com
Tue Mar 28 23:10:52 BST 2023


@jay - I hope this helps you:
- issue 1: i386, i486, i586, i686 are considered as Pentium 4 in LLVM,
which might be relevant if Rust is compiled with it:
https://github.com/llvm/llvm-project/issues/61347
- issue 2: Rust considers i686 as Pentium 4, and i586 as Pentium:
https://github.com/rust-lang/rust/issues/82435

So, what I'm thinking is:
- When building the Rust toolchain itself, if Debian uses LLVM for it,
it might be a good idea to set the CPU target explicitly to pentiumpro
in LLVM's flags (fix issue 1) (It could also be a good idea to set
this for LLVM in general if possible, if not already done so). -- Also
compile the i586 Rust toolchain, not the i686 one (fix issue 2).
- For Rust programs, I'd probably recommend setting the target for all
(?) of them to i586 (fix issue 2). One can also try to add "-C
target-cpu=pentiumpro -C target-feature=-mmx -C target-feature=-sse -C
target-feature=-sse2" to RUSTFLAGS, if the above doesn't work.

Most of this is assumptions, but I hope it brings some progress.

Best of luck and thank you.



More information about the Pkg-rust-maintainers mailing list