Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 08-22-2014, 09:39 PM   #1
LQ Newbie
Registered: May 2014
Posts: 13

Rep: Reputation: Disabled
Witch condition to guarantee a binary file to work on a linux platform ?


Because there is many Distrib with different architectures, a binary file witch is compiled on a specific Linux distribution may or may not work on other distribution depending on the architecture, for example a binary compiled in a 64 bit machine won't work on a 32 bit machine. So what condition should be validated in order to guarantee that a binary will work ? For example if the binary was compiled for architecture i686, it will work for all Linux distributions with the same architecture ? and if yes what are the most used architectures in today distributions ?

Thank you.
Old 08-23-2014, 12:47 AM   #2
LQ Guru
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
There's no need to bring the supernatural into it (sorry, I couldn't resist). It sounds like you're interested in cross compiling. For starters, I'd suggest reading the Wiki on cross compiling. That should answer most of your questions.
Old 08-23-2014, 11:04 AM   #3
LQ Veteran
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Salix
Posts: 6,155

Rep: Reputation: 2318Reputation: 2318Reputation: 2318Reputation: 2318Reputation: 2318Reputation: 2318Reputation: 2318Reputation: 2318Reputation: 2318Reputation: 2318Reputation: 2318
Cross-compiling is nothing to do with the question: that's about compiling on one architecture for use on another.

As you've noticed, Linux programs are seldom self-contained, like Windows ones: they have dependencies. That means that a program is going to look for those library files and it has to know what they're called. If you have a number of programs that use different versions of a library, some distros will provide the different versions and label them, so one program will be compiled to look for and another to use Other distros will just use and stick with an older version of the program whose latest one wants thingy5. You can sometimes get round that by putting a symbolic link in /usr/lib, so that the program that was compiled to use will be redirected to plain old thingy.

Another problem is that the same library may be differently packaged in different distros. Debian based distros use the same names, so a deb package will install on most distros of that type. On the other hand, an rpm package made on OpenSUSE may not install on a Fedora system because it tells rpm to check for package X when Fedora has put the library it needs in package Y. You can get round that by finding the correct libraries, installing them, and then installing the package with dependency checking turned off.

So the answer is that it's not always possible to produce a binary that automatically installs and works on every distro, even without the problem that they use different packaging schemes like rpm, deb, etc.

As for the architectures in use, 64 and 32 bit Intel are going to be the usual ones. Arm is getting to be more common, while things like ppc are declining.
Old 08-23-2014, 03:29 PM   #4
Registered: Mar 2008
Posts: 22,027

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
Binaries tend to work if they are complete and require little from their host. They tend to work if no gui is involved. They tend to work if they are easy and small.


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
Linux utility to combine two or more binary files into a single binary file mageshvan Programming 7 05-05-2011 08:06 AM
[SOLVED] x86 binary file not work on x86_64 mahmoodn Ubuntu 3 10-25-2010 03:03 AM
Help: Opening GenICs binary file, writing to binary file for GADGET-2 (in C) parallax147 Programming 0 10-05-2010 11:06 AM
[SOLVED] How would I convert an arbitrary binary file into a Linux executable file? ootawata Programming 8 02-21-2010 11:21 PM
C++ Cross Platform Compatible Binary File Open Read Problem MatrixNAN Programming 6 09-18-2009 02:37 AM > Forums > Linux Forums > Linux - Software

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

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