LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Why aren't ELF files used much? (https://www.linuxquestions.org/questions/linux-general-1/why-arent-elf-files-used-much-759309/)

bowserevilking 10-02-2009 07:50 PM

Why aren't ELF files used much?
 
Hello, this has really been bothering me. As I understand it ELF's are the counterpart to EXE's, so why do users normally have to compile software themselves? It seems like it would be so much easier for most people if open source programs would give the source separately. Is it because there is no ELF standard?

Matir 10-02-2009 10:00 PM

When a file is compiled, it becomes an ELF binary. I can't remember the last time I had to compile a production-quality program. You can read the details on ELF here: http://en.wikipedia.org/wiki/Executa...inkable_Format

bowserevilking 07-03-2010 04:22 PM

Sorry for responding after so long, but what I meant was: Why aren't there any Linux programs that are embedded in one executable? Windows and Mac have them, so why do we have to compile source or use packages rather than download a single ELF or archive, run or extract that, and start? Think of a Package Manager compatible with every Distro/ Package, wouldn't that be great? Of course, if there is already one, ignore my ramblings.

Please forgive the super-bump.:o

unSpawn 07-03-2010 04:40 PM

Quote:

Originally Posted by bowserevilking (Post 4023088)
Why aren't there any Linux programs that are embedded in one executable?

Any or all? How about static binaries? Also see statifier.sourceforge.net.


Quote:

Originally Posted by bowserevilking (Post 4023088)
Windows and Mac have them, so

Please don't compare the standard binary file format for Unix with what this particular vendor founded to develop and sell BASIC interpreters for the Altair 8800 has.


Quote:

Originally Posted by bowserevilking (Post 4023088)
Think of a Package Manager compatible with every Distro/ Package, wouldn't that be great?

I'm thinking... thinking... No Sir, I don't like that.

bowserevilking 07-04-2010 08:49 AM

Quote:

Originally Posted by unSpawn (Post 4023097)
Any or all? How about static binaries? Also see statifier.sourceforge.net.

I didn't know about that, thanks. And I meant most.



Quote:

Originally Posted by unSpawn (Post 4023097)
Please don't compare the standard binary file format for Unix with what this particular vendor founded to develop and sell BASIC interpreters for the Altair 8800 has.

Why not?



Quote:

Originally Posted by unSpawn (Post 4023097)
I'm thinking... thinking... No Sir, I don't like that.

Why not?

knudfl 07-04-2010 08:59 AM

You mean one 'Package Manager' for all Linux ?

Linux is about choice.
Some prefer the Debian package method / system.
Others rpm. Etc. etc.
..

bowserevilking 07-04-2010 09:12 AM

Quote:

Originally Posted by knudfl (Post 4023488)
You mean one 'Package Manager' for all Linux ?

Linux is about choice.
Some prefer the Debian package method / system.
Others rpm. Etc. etc.
..

If there was a 'Universal' Package Manager, couldn't you choose that? I mean, if you'd think another one was better, what would stop you from choosing it? The option is what I'm proposing here. A 'jack-of-all-trades' Manager, able to use any package/Distro, not necessarily best at any of them. Is there anything wrong with that?

pixellany 07-04-2010 10:58 AM

Quote:

Originally Posted by bowserevilking (Post 4023492)
....A 'jack-of-all-trades' Manager, able to use any package/Distro, not necessarily best at any of them. Is there anything wrong with that?

Yes. Who would maintain it? I think it takes significant effort to maintain a package management setup for ONE distro-----given the diffuse and diverse nature of the open source community, I doubt if would even be **possible** to do what you are suggesting.

More to the point: Why would you even want such a thing? Most mainstream distros include > 90% of the software that you ever need. If something is not there, then installing it manually is not all that difficult.

b0uncer 07-04-2010 11:21 AM

Quote:

Originally Posted by bowserevilking (Post 4023088)
Why aren't there any Linux programs that are embedded in one executable? Windows and Mac have them, so why do we have to compile source or use packages rather than download a single ELF or archive, run or extract that, and start?

As I understand it, all of those operating systems have stand-alone single binary files you can execute to start a program (given that it was designed to do so), and software that is distributed as a "package" (or installer, archive, folder, whatever you want to call the wrapped-up thing as) and depends on multiple files. For example consider the .dll files on Windows; a lot of programs installs those, and will not run without them, just by clicking on the exe file. Actually most modern Windows programs I'm aware of don't come as single executables but as installers that put multiple files on the system; only the simplest, smallest utilies tend to do that. One of the reasons is that coding the software is easier if it's split into parts. Even if it was (as a "final step") merged into one file when distributed, a lot of software would then produce huge executable files, which might not be desireable. And if there's code to share between different software pieces, it might be wise to put that someplace else than the executable file itself (libraries) -- though this is a matter that is argued over and over again.

PTrenholme 07-04-2010 11:42 AM

You could move to the smart package manager which does support many different distribution formats. But, for any specific distribution, you're (usually) better off just getting your programs from the distribution's repositories. (I only use smart when there is a problem that the distribution repository tool can't resolve, since smart is, usually, much better about finding and fixing problems than most distribution-specific installers.)

But to return to your original question, almost every distribution maintains, and makes available, a repository of ELF programs, dynamically linked to the current version(s) of that distribution's libraries. Since those ELF executables (unless they include actual copies of the libraries they use - i.e., are "statically linked") need those libraries, they are specific for the distribution you're using.

The only time you need to compile a program from the source code is when either:
  • It's not available in your distribution's repositories.
  • You want to change the program to satisfy some need not covered by the program's author(s).
  • You are using one of the distributions that's "source only:" (e.g, LFS, etc.)

Note that Windows "exe" programs distributions often rely on a specific Window's version of the the dll files, and that they will only work with that specific version of Windows. While Macintosh programs are in ELF format (since Macintosh operating systems are, mostly, "enhanced" BSD-based Unix systems) they are distributed for specific versions of a Mac OS, and, of course, won't usually work on a different version.

My point is that you are, in essence, asking "Why are there so many different Linux distributions? If there was only one distribution, then any Linux program would run on it." To which question you will receive the answer: "Well, duh! That's certainly correct, but different people want different things from their computer systems, and there's no reason to force everyone to "fit in Procrustes' bed" if they don't want to do so."

bowserevilking 07-04-2010 01:16 PM

I apologize if I asked a stupid question. I suppose I didn't bother researching how complex Linux is. I didn't know my question basically boiled down to "why is there too much choice"?

To be honest, I think what really annoys me is compiling. I feel Linux programs are normally released as either source or as source and only one kind of package, which got me thinking about this. I'm sorry that I made you all rant about how I was ignoring something integral to Linux, and how my examples were flawed. I am not trying to be sarcastic or anything. I just thought that there was a possibility my idea could improve Linux and make it easier to use. I didn't consider how complicated it would be.

Telengard 07-04-2010 01:50 PM

I don't think your question was stupid and I don't think you should feel sorry for asking it. It does seem to suggest that you are thinking in the mindset of a long time Windows user, but that's just my guess. The only way around it is for you to actively seek out knowledge and experience from which you can glean new insight about why Linux distros do things the way they do.

Quote:

Originally Posted by bowserevilking (Post 4023654)
To be honest, I think what really annoys me is compiling. I feel Linux programs are normally released as either source or as source and only one kind of package, which got me thinking about this.

This is puzzling me. Why are you doing so much compiling if you don't like it? Just use your distro's package management system to install software and you won't need to worry about compiling. For the rare cases when there is not a pre-compiled binary in your distro's repositories you might have to resort to compiling, but there may be other options too. For example in Ubuntu we have PPAs where pre-compiled binaries are offered for software which is not in the repositories.

I don't know what distro you are using, but spend some time investigating the package manager and software sources provided with the system. You may be able to add new repos which contain the software you want.

AlucardZero 07-04-2010 01:54 PM

I don't get why you have this notion that you have to compile everything. You don't have to compile nearly anything unless you want to. And you don't want to, so don't!

Software writers often release not only their source, but precompiled packages in the most popular formats: deb, rpm, and generic. In addition, distro maintainers will compile and package for their particular distro so you don't even have to seek out each software's site (this isn't Windows!). Use your package manager!

pixellany 07-04-2010 07:52 PM

bowser*;
Ditto the comment about not apologizing.....There's a classic line in someone's sig here: "The only stupid question is the one you don't ask." (or something like that....)

The problem of "too much choice / too many options" is endemic to OpenSource. There's no way to stop it...

rkelsen 07-04-2010 08:19 PM

Quote:

Originally Posted by bowserevilking (Post 3705648)
Is it because there is no ELF standard?

There is an "ELF standard," but there is no "standard" Linux installation.

Most binaries on any given Linux distro will be dynamically compiled, which is not entirely unlike Windows... but under Linux, there are several different types and versions of libraries that they could be compiled against.

Static compiling adds portability, but also significantly to the size of binary files, so that is why it is rarely done.


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