I want to build my app on Redhat5 with glibc 2.5, but I downgrade my rustc to 1.0 ,and it dose not work.
the errors below when run ~/.cargo/bin/rustc :
./rustc: /lib64/libc.so.6: version GLIBC_2.14' not found (required by ./rustc) ./rustc: /lib64/libc.so.6: version GLIBC_2.15' not found (required by ./rustc)
./rustc: /lib64/libc.so.6: version GLIBC_2.17' not found (required by ./rustc) ./rustc: /lib64/libc.so.6: version GLIBC_2.7' not found (required by ./rustc)
./rustc: /lib64/libc.so.6: version `GLIBC_2.9' not found (required by ./rustc)
The mini requiremet is glibc 2.7.
Is there any way to build rust app with glibc 2.5 or make rustc & cargo running on redhat 5 with glibc 2.5 ?
The binaries in ~/.cargo/bin are actually rustup shims, where the real compilers live in ~/.rustup/toolchains. But rustup is built with the same baseline as everything else, so its current versions will be too new for RHEL5.
You should be able to use up to Rust 1.46 on your system, as 1.47 increased the minimum to glibc 2.11. I wouldn't recommend going older because crate compatibility will be more and more difficult to manage.
You can use the standalone installers to avoid rustup -- those tarballs are linked to the current stable 1.67.1, but you can change the link to 1.46.0.
I have made rustc to 1.0 via rustup, but it didn't work.
rustup default 1.0
and I copy ~/.cargo to my RHEL5 ~/.cargo , then I run ~/.cargo/bin/rustc , it needs at least GLIBC_2.7 exists. In RHEL5, Glibc 2.5 is the default.
I have tried from 1.5x to 1.0 and it does not work with Rust 1.46 in RHEL5.
~/.cargo/bin/rustc is not the compiler you want; this is literally a hardlink to ~/.cargo/bin/rustup, which will not be compatible with older systems, and if it ran it would try to exec to the real toolchain installed in ~/.rustup/toolchains.
If you already have it installed on a newer system, you can copy ~/.rustup/toolchains/1.46.0-x86_64-unknown-linux-gnu/ to your RHEL5 system. Then add the bin from there to your PATH to run that version directly, without rustup.