LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-14-2006, 10:07 AM   #1
mattengland
Member
 
Registered: Nov 2004
Location: Chicago, IL USA
Posts: 42

Rep: Reputation: 15
Build one Linux binary for many i386 platforms?


I would like to build one Linux binary set--binary apps and any associated dynamic libraries--for many Linux i386-based platforms (at least RHEL 3.x/4.x, Fedora Core 2,3,4,5, Debian 3.1, but would like sever more). I may still make multiple *package* distributions (eg, .rpm, .deb etc), but I would like to have one build process provide the binary-file-set input to these packages.

How does one effectively do this?

I see application distributions like these doing this:

http://dev.mysql.com/downloads/mysql/5.0.html
http://www.cmake.org/files/v2.2/cmak...6-linux.tar.gz

(I recall there being many others, I just don't have references to them at the moment.)

How is this done? Is it a careful management of std-library/kernel-library dependence? I'm sure it is, but I'm not sure exactly how to go about controlling this. Is there a reference I can read somewhere? Is it mostly a matter of constructing the "least common denominator" build systems from which to link the "most ubiquitous" library set? Do I need to build the libstdc-2.x/libstdc++-* on a Linux machine and compile to that?

I'm looking for more info besides "just find the dependencies and statically link" or "find the lowest-common-demoniator libraries". The question: how do I determine these libraries (I doubt that an ldd on a couple systems is going to tell me everything) and which revs (eg, what rev of these libs are going to work for most/all of these systems)? I'm also of the impression that it's best not to statically link kernel/libstdc* lib objects.

(I have posted a similar question before-- http://www.linuxquestions.org/questi...d.php?t=362514 --but haven't found sufficient info yet, so am trying this new thread.)

I suspect this is a faq that's been answered somewhere; I have yet to find the answer.

My project is a C++-based one. Does this have a bearing on my library depedence? (eg, libstdc++...so?)

Thanks for any help,
-Matt
 
Old 04-14-2006, 11:23 AM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
I generally just statically link, but that is for stand-alone binaries. If your packages come with their own shared libs, link everything to the .a versions of all standard libs they depend on, but dynamically link to the shared libs which you will distribute. You can't dynamically link something for distribution without building for every combination of dependency sonames out there.

Alternate choice; use a makefile.
ta0kira
 
Old 04-14-2006, 12:36 PM   #3
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Alternate choice: write the program in Java. Or Perl, Python, Ruby or some other interpreted language.
 
  


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
Question: Kernel build i386 vs i686 louisb Linux - Enterprise 5 02-11-2007 09:41 PM
Is kernel-source included in debian-31r1-i386-binary-1.iso? 0wl Debian 5 03-12-2006 01:22 AM
FC5-test1-binary-i386-exec of anaconda failed: no such file or directory, any ideas? frankj Fedora 1 01-02-2006 12:30 AM
How to build one binary for all Redhat systems? mattengland Linux - Software 3 09-11-2005 11:16 PM
Linux on multiple hardware platforms BobRobertson LinuxQuestions.org Member Success Stories 2 03-18-2003 12:19 AM

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

All times are GMT -5. The time now is 06:56 AM.

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