Can you build Rust for old (Redhat 5 vintage) Linux?

Redhat 5 has the required 2.6.18 kernel, but not the latest glibc, g ++, and of course not clang. The binary distribution fails to start complaining about the glibc version.

Has anyone tried to revert the port to old Linux? I could imagine that I have merged the frankensystem with the old kernel but with new compilers and try to compile against the old glibc or statically compile against some newer glibc, but that seems fraught.

Just wondering has anyone tried it and can suggest a guide?

I think there should be a distro install to create builds like this. Anaconda, for example, includes a lot of new technology, but works great on Redhat 5. I wonder how they built it?

Update. After you get a few new compilers running on RHEL5, it is still not possible to build Rust because it depends on the binary itself to be loaded. See: https://github.com/rust-lang/rust/issues/9545#issuecomment-54865031

+3


source to share


2 answers


I got into this issue this weekend because Skylight supports Linux 2.6.18 including CentOS 5.10 and we are using Rust in our agent.



Alex Crichton of the core Rust team was kind enough to get this working again , using a CentOS 5.10 square for a build that uses glibc 2.5 and Linux 2.6.18.

+1


source


Anaconda packages are built against CentOS 5 (equivalent to Redhat 5). It is important to compile against a fairly old glibc as it is strictly transition-compatible (as you saw). The glibc version is usually tied to the distribution version, so it is best to make a VM with CentOS 5 and build on it.



The version of the compiler used is not that important and in fact in some cases it is necessary to use a newer compiler than the old one that comes with the system in order to get it working. I have gcc 4.8 built for CentOS 5 which you can get with conda ( conda install -c asmeurer gcc

).

+3


source







All Articles