LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 08-27-2007, 10:27 AM   #1
jabeavers
LQ Newbie
 
Registered: Aug 2007
Posts: 3

Rep: Reputation: 0
How do I compile against different dependencies


Hello,

I just joined and I am impressed with the site. I am moderately experienced using linux, however not so experienced compiling on linux. I'm looking for information or a link to a tutorial about compiling against different versions of dependencies. Let me get specific. I am trying to compile clamav. I have an FC6 box which I am using for compiling, which has libc-2.5.so. I am wanting to make an rpm for an RHEL4 box, which has libc-2.3.4.so. I've successfully compiled and made the rpm package, but when I try to install it on the RHEL box, it says missing dependency: libc.so.6. The RHEL box has libc.so.6 pointing to the aforementioned libc-2.3.4 file. I have done searches on how to compile against different dependencies, but have not found what I need. Can anyone tell me how to do this, or point me to a tutorial/howto that explains how to do it?

Thanks,

John
 
Old 08-27-2007, 07:12 PM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Normally one keeps those dependencies in a separate directory and passes the linker a -L with the name of that directory. It isn't safe to link a program without the actual library in case the interfaces aren't compatible.
ta0kira
 
Old 08-28-2007, 10:27 AM   #3
jabeavers
LQ Newbie
 
Registered: Aug 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Do I need the header files from the library(s) as well?

John
 
Old 08-28-2007, 02:55 PM   #4
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Yes. You should put all of that in a parallel directory structure.
ta0kira
 
Old 08-29-2007, 03:15 PM   #5
jabeavers
LQ Newbie
 
Registered: Aug 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Ok, things complie but I can't get my rpm package to install on the other system. When I do an rpm -q --requires ..., it says that it requires libc.so.6(GLIBC_2.4) and rtld(GNU_HASH) among other things. The system ON which I am compiling has glibc-2.5 installed, while the system FOR which I am compiling has glibc-2.3.4. Also, it seems that rtld is provided with glibc2.4+. So, can I compile the code so that it does not require glibc2.4, but only requires the glibc2.3 that is installed on the target system, and if so how? Or am I missing something else?

John
 
Old 08-29-2007, 03:45 PM   #6
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
First of all, the library name has little to do with the glibc version. The library name is merely an expression of the API version it implements and doesn't correlate to the package version except for that the library version never decreases when the package number increases. I wish I could help you with the rpm, but I've never made one before.
ta0kira

Last edited by ta0kira; 08-29-2007 at 03:47 PM.
 
Old 08-29-2007, 04:24 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Maybe you could create a separate build chroot for your target by installing the whole toolchain into /some/dir? Or maybe take hints from DAG's site. He's one of those experienced RPM builders who makes RPM's for a variety of releases from RHEL-3 to F7 and he has some tools for doing that.
 
  


Reply



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
Using SCONS to make libraries, check for dependencies and compile an executable. Sslaxx Programming 0 03-07-2006 05:57 AM
Missing dependencies, can't compile BiPolar Linux - Software 3 08-17-2005 10:31 AM
kernel compile 2.6.12 Cannot determine dependencies of module piix biophysics Linux - Software 3 07-10-2005 12:34 PM
No compiler, support dependencies to compile winmodem driver t3gah Linux - Hardware 1 05-04-2005 12:04 AM
I recieve a failed dependencies error, but I have all required dependencies Laptop2250 Linux - Software 15 02-03-2004 07:58 PM

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

All times are GMT -5. The time now is 03:48 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