Is the error similar to this?
rustc[3007] trap invalid opcode ip:aff76daa sp:bfe0c170 error:0 in libllvm-13.so[aff30000+1a07000]
Illegal instruction
I have a Pentium II so I searched about which flags to use to compile a version of rustc and cargo to match my CPU.
You'll probably need these
export CFLAGS="-march=pentium"
export CXXFLAGS="-march=pentium"
export RUST_BACKTRACE=full
You can look here to see how I use them to compile rust for my Pentium II
https://github.com/linic/rust-i586/blob/main/Dockerfile#L15If it's not enough, maybe you'll need a rust compiler that has been compiled with these flags (and actually more flags than these). I generated a docker image that has a rust compiled this way and which has the various tar.gz files in it. There's one rust-nightly-i586-unknown-linux-gnu.tar.gz which has all the executables (rustc, cargo, etc... + documentation). It's the one I use.
The code to generate the image is here
https://github.com/linic/rust-i586/The images are here
https://hub.docker.com/repository/docker/linichotmailca/rust-i586/generalI remember testing the rust 1.75.0 executables from linichotmailca/rust-i586:1.75.0 on my Pentium II (you can docker cp them out of the image) see the usage
https://github.com/linic/rust-i586?tab=readme-ov-file#usage. I generated 1.76.0 recently, but I haven't had the time to test it yet on my physical Pentium II. It was generated the same way as 1.75.0 so it should work too probably.
I also have a tcl core image with a rust-1.75.0-i586.tcz ready to use here
https://hub.docker.com/repository/docker/linichotmailca/tcl-core-rust-i586/generalThe source code to generate that image and the tcz inside of it is here
https://github.com/linic/tcl-core-rust-i586. Check the Dockerfile. You can essentially run mostly the same commands (although you'll have to docker cp the resource files from the resource images or compile your own by following what the Dockerfiles for those image do) to generate your own tcz on a real machine.
With the linichotmailca/tcl-core-rust-i586 image, you can docker run it with
sudo docker run --name tcl-core-x86-test --interactive <replace-with-your-image-id> /bin/sh
(I suggest doing a docker exec -it tcl-core-x86 /bin/sh afterwards in another terminal to get a fully working console you'll see what I mean). Once you have a console, I think you should be able to use that rust version and it should compile programs without the illegal instructions. It's possible to retrieve them from the running container again with docker cp. Maybe you'll still need to set the flags
export CFLAGS="-march=pentium"
export CXXFLAGS="-march=pentium"
export RUST_BACKTRACE=full