Mail Archives: djgpp/2009/01/30/04:15:07
Hi,
On Jan 29, 6:04=A0pm, DJ Delorie <d DOT DOT DOT AT delorie DOT com> 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. =A0You have to build what is essentially a "sys-root" - all the
> headers, libraries, etc from the target linux system. =A0Then you build
> a cross-gcc, cross-binutils, etc. =A0*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. =A0For 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. =A0
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. =A0The 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.
- Raw text -