LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-25-2003, 04:25 AM   #1
dimm_coder
LQ Newbie
 
Registered: Oct 2003
Location: Minsk, Belarus
Distribution: Mandrake, FreeBSD
Posts: 28

Rep: Reputation: 15
Linking with different versions of glibc.


Presently, we provide our applications builded with glibc 2.2 and 2.3.
We build these 2 versions on different machines: one with 2.2, another with 2.3.
One client has an old distributive with glibc 2.0.
I wonder, is any clever way to have more than one glibc installed on the same machine and choose the version to link with, instead of installing the old distro or removing the current version for the old one; or the way to build an application with the new glibc, but to have compatibility with the old one?

Last edited by dimm_coder; 11-25-2003 at 04:26 AM.
 
Old 11-25-2003, 07:01 AM   #2
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 36
We do this with Oracle and other products. Create an environment variable
that points to the tree for the product. Plus, the product installs have to live in physcially different directories, strictly for linking.

Code:
# for ver 2.2, assuming the libraries are all in in /usr/glib/2.2/lib....
export GLIB_HOME=/usr/glib/2.2
# for version 2.3
export GLIB_HOME=/usr/glib/2.2
Then you have the unenviable task of changing the makefiles to use
the $GLIB_HOME variable to point to where the libraries live -
oversimplified:
Code:
# for example use the -L to search where you're aiming first
LIBS= -L $GLIB_HOME/lib
ld module.o -c  # will look in GLIB_HOME first
In reality you may need several different environment variables and have scripts that move you back and forth between versions and in our case Oracle instances. We do this. Note that the PATH variable will also have to change, and if you use SHLIB_PATH, etc. these will also have to change.
 
Old 11-25-2003, 07:25 AM   #3
dimm_coder
LQ Newbie
 
Registered: Oct 2003
Location: Minsk, Belarus
Distribution: Mandrake, FreeBSD
Posts: 28

Original Poster
Rep: Reputation: 15
Thanks, Jim. That is an obvious way.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
building glibc 2.3.5 for static linking. rekhakp Linux - Software 0 04-26-2005 01:17 PM
Compiling GLIBC, and linking it correctly Boudewijn Linux - Newbie 5 11-08-2004 12:11 PM
Why do we need so many versions of glibc? deanbrown3d Linux - Newbie 4 06-29-2004 12:17 PM
versions of Glibc elwis Linux - Software 3 12-12-2003 04:31 PM
running 2 versions of glibc ? ? need help coderx Linux - Software 1 07-02-2003 08:24 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration