Re: 1] UNIX/LINUX Compilation 2] IDE
- From: Rugxulo <rugxulo@xxxxxxxxx>
- Date: Fri, 30 Jan 2009 01:07:47 -0800 (PST)
Hi,
On Jan 29, 6:04 pm, DJ Delorie <d...@xxxxxxxxxxx> wrote:
Yes, you can cross-compile to ELF, but I guess DJ means the
difficult part is linking, esp. shared libraries or more complex
stuff like that.
Yes. You have to build what is essentially a "sys-root" - all the
headers, libraries, etc from the target linux system. Then you build
a cross-gcc, cross-binutils, etc. *Then* you start building your own
programs.
Ethan should try here for more GCC-specific help:
"gcc-help is a relatively high volume list for people searching for
help in building or using GCC."
http://gcc.gnu.org/ml/gcc-help/
http://gcc.gnu.org/lists.html (subscribe here)
Rebuilding GCC and BinUtils isn't really for the faint of heart. At
least I still feel like I have a ton of questions (maybe I'll
subscribe, heh).
Of course, the only ELF-based tools I know of were Daniel Borca's
DJGPP/ELF,
That's a native ELF. For cross-ELF it's a lot simpler (in theory),
just build gcc+binutils for whatever target you want; the gcc
executables themselves remain plain DJGPP programs, they just
*produce* non-djgpp programs.
DJGPP/ELF can compile to ELF objects or DOS ELF .EXEs, but the objects
should be compatible with Linux (I think, never tested). Of course,
that toolset actually supports either COFF or ELF.
And yes, obviously it can be done. Two weeks ago me and Rod P. were
discussing / rebuilding a MOSS DOS-ELF host (via DJGPP). This meant
rebuilding both GCC and BinUtils as well as using the native headers
and libraries from the original (very old) Linux host cross-compiler.
In fact, MOSS turns 13 tomorrow (or at least 13 years since last
updated, heh). :-)
As far as Linux distros, DJ should've been more specific (or else
maybe you can tell us what you want?).
I don't have to be specific, pretty much all Linux distros these days
are at least mostly LSB compliant, which means they all have about the
same degree of difficulty cross-compiling.
Uh, I've seen some projects release like nine different builds for
nine different Linuxes. Others just have one for .deb and one
for .rpm. Or 2.4 and 2.6 kernel compiles. Still others don't bother
and make you compile it yourself. Equally messy, no good solution for
any. Especially since even "-static" won't save you from C++ ABI
changes (ugh).
Of course, I'm talking
about mainstream distros, like Fedora or Debian. The custom tiny ones
(like OpenWRT) usually come with their own development sys-root.
I wish there was a live CD *only* for developers (no Firefox, Mplayer,
XMMS, Gnumeric, AbiWord) with a billion GCCs for a billion targets. In
this way, OpenWatcom is to be admired for its cross-platform support
from almost any host.
.
- References:
- 1] UNIX/LINUX Compilation 2] IDE
- From: Ethan Rosenberg
- Re: 1] UNIX/LINUX Compilation 2] IDE
- From: DJ Delorie
- Re: 1] UNIX/LINUX Compilation 2] IDE
- From: Rugxulo
- Re: 1] UNIX/LINUX Compilation 2] IDE
- From: DJ Delorie
- 1] UNIX/LINUX Compilation 2] IDE
- Prev by Date: Re: errors using C++ libraries
- Previous by thread: Re: 1] UNIX/LINUX Compilation 2] IDE
- Index(es):
Relevant Pages
|