UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » C
  • » Using different libc in Linux

#1 2009-12-16 02:53 PM

jacquesdirac
Member
Registered: 2009-02-06
Posts: 15

Re: Using different libc in Linux

Dear,

On my system there are running different programs, most of them using an older version of libc.so.6. Now I want to run a program that requires a newer version of libc.

Can I specify (run-time) which libc-file has to be used for each program?

I'm sorry if this question is 'superfluous', but this shared library stuff is still magic to me.

Offline

#2 2009-12-16 04:55 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: Using different libc in Linux

If this newer version is still the same major version# as the older version, then any
older apps compiled against the older libc should still work fine with the newer version...
That's how things are supposed to work, anyway: no breakage of established APIs
within a major version, so backwards compatability is maintained...  So, you shouldn't
need to keep around the older libc at all...

And, in the case of a major version# change, things should just work properly,
anyway...  Because, the others would be linked against "libc.so.<oldmajor>", so
that's what they'd load, while the new apps would be linked agasint "libc.so.<newmajor>",
which could be installed alongside the old version just fine, and would be loaded by
the appropriately aware apps...

So, the only problem case is breaking of an old API during a minor version update
within the same major version#...  And, that's just something no one should do, so
you should berate whoever did it, if that's the case...  But, in that case, probably the
only solution would be to install either the old or new libc in a completely separate
directory somewhere, and use $LD_LIBRARY_PATH or something to point either
the old or new apps at the alternate libc when running them...

Offline

#3 2009-12-18 09:20 AM

jacquesdirac
Member
Registered: 2009-02-06
Posts: 15

Re: Using different libc in Linux

Thanks for this explanation!
I will give it a try.

Offline

  • Index
  • » C
  • » Using different libc in Linux

Board footer

Powered by FluxBB