2

I want to run a C++ program on an older device, which only supports glibc 2.11.3. So I have to create a develloping enviroment using the same glibc version.

Currently it is running version 2.25 x86_64 for openSUSE Tumbleweed.

First of all, where do I find a valid *.rpm file of the old version. Also is it possible to install it?

Trying to unistall glibc tells me that will crash the operation system. :-)

Thank you all for your support.

4
  • 1
    Look for instructions on setting up a chroot environment for that version. A chroot is a completely independent set of user-space programs and libraries in which programs can run independent of your main system. You could do this with a cross-compiler, but I've always found a chroot to be easier to set up. Aug 7, 2017 at 13:29
  • You should not downgrade your system libc. Instead, install the older version in a seperate directory tree, and develop against that. It's not too difficult to compile glibc from source so I would suggest doing that.
    – davmac
    Aug 7, 2017 at 13:29
  • 1
    glibc 2.11.3 comes with OpenSUSE 11.4. You can get the distribution iso and individual rpms from gwdg.de (University of Goettingen Computing Centre) Aug 7, 2017 at 13:49
  • @DarkFalcon you wouldn't need to go as far as using a cross-compiler for this case, I think. It should just be a matter of linking against the older libc.
    – davmac
    Aug 7, 2017 at 14:07

2 Answers 2

2

Changing the system glibc will almost certainly result in a disaster. I think you have 2 solutions: multiple glibc on one system or link glibc statically

1
  • The first question you link is about running a program against another versions of libc; this question is about linking to one, IIUC. It's actually quite a different problem.
    – davmac
    Aug 7, 2017 at 14:06
2

Trying to unistall glibc tells me that will crash the operation system. :-)

I don't understand your smiley.

It will render your system unbootable, yes.

What you want to do is best achieved in one of several ways:

  1. Create a Linux-to-older-Linux cross-compiler
  2. Create a "older Linux" chroot environment (ChromeOS uses this approach)
  3. Create a "older Linux" virtual machine, and develop inside of it.

Approach 2 is likely easiest to set up, closely followed by approach 3.

Approach 1 gives you the best build performance, but requires thorough understanding of how to build cross-compilers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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