Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

After reading the answers to my previous question I have come to the conclusion that an answer to the following question is what I was actually looking for:

Does a particular version of the kernel require a particular version of libc to run properly?

Basically my problem stems from building an application on my 12.04 ubuntu and trying to run it on 8.04. I have since learned from this and other stackexchange forums that it is backward compatibility of libc that causes these problems. Therefore what I am perhaps naively trying to do is build the same version of libc that exists on my target and then link against that on my host when I build the application. Then in an ideal world when I copy this to the host, having been linked to the "correct" libc it should work (in my head at least). I have been totally unable to find a way to install an older libc on my system, and wondered if each version is tightly bound to a kernel version, hence the above question.

share|improve this question
    
If you're building GCC yourself from source, you can configure the build to install in its own prefix (rather than /usr). from the answer to your other question should solve the problem. –  hbdgaf Jul 12 '12 at 8:51
    
Could you not statically link the libraries, thus avoiding libc issues altogether? –  Scott Severance Jul 12 '12 at 9:22
    
I did think of that but from the research I have done and questions I have asked, the general feeling I get is that this is a bad idea. –  mathematician1975 Jul 12 '12 at 9:23
    
I'm not a C programmer, but my understanding is that if you compile the libraries in, the main drawback is a larger executable. This, I believe, is how proprietary software vendors, such as Skype and Opera, often provide Linux packages. –  Scott Severance Jul 12 '12 at 10:41
add comment

2 Answers

up vote 2 down vote accepted

Does a particular version of the kernel require a particular version of libc to run properly?

Yes, unless you build the kernel yourself from source with your preferred libc version. The Ubuntu kernels are built on the LTS release prior to the target release, so the "latest" Ubuntu kernels compatible with 8.04 libc were those for Ubuntu 9.10.

share|improve this answer
add comment

They are tied to each other, in a way.

  • The kernel you're running on was compiled with a specific libc.
  • The libc you have was compiled to only support kernels above a specific version.

So if you are installing the kernel packages and libc packages from the Ubuntu repos, as opposed to compiling them yourself, you're stuck with the above dilemma.

As far as libc goes, one way to do what you propose is to compile the 12.04 kernel from source on 8.04, thus linking it against the 8.04 libc. Then you use that custom kernel to boot 12.04, upon which you compile the libc version that's on 8.04, also from source. You install that, and your applications should share the same old 8.04 libc.

I assume you are also aware that any other 12.04 libraries your application is linked against may not be available in 8.04, so you will have to compile them from source too...

To sum up, it's best to just compile on 8.04.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.