Re: 1] UNIX/LINUX Compilation 2] IDE



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.
.



Relevant Pages

  • Re: Coldfire development on Linux host
    ... My preferred development host is a i586 PC running SUSE 10.0. ... The target CPU is a Coldfire MCF5407 or similar running raw ... I downloaded the CodeWarrior Linux Platform Evaluation suite from Freescale ... As for gcc, you can simply download the latest gcc source and compile it for cross development. ...
    (comp.arch.embedded)
  • Re: Why ./configure?
    ... > gcc knows how to create executables, I know that my gcc can do so, only ... > target platform and other conditions, which the author can not anticipate. ... > compile and link the project. ... > system is represented by the target specific libraries, ...
    (comp.os.linux.development.apps)
  • Need help - Cant run a simple C++ application
    ... I'm quite new at Linux but I have been developing for Win32 for many ... runs fine on the target computer. ... It complains about certain libraries that were missing. ... To find out the dependencies of the program, I ran on the workstation: ...
    (comp.os.linux.development.apps)
  • Re: gfortran 4.5 trunk - `GLIBC_2.11 not found
    ... $ gfortran --version ... Linux the currently best builds are ... which work, e.g., with the GLIBC 2.5 libraries which I happen to have at ... The reason for my confusion is that that last trunk required gcc ...
    (comp.lang.fortran)
  • Re: Re: Tcl and C++
    ... First of them concerns gcc 2.95/2.96 down, ... The syntax of function mangling in gcc 3.0 is generic enough so ... "universal dynamic-loaded libraries" (unless they will be linked into ... I don't tell about problems like it was in Opera 6 for Linux: ...
    (comp.lang.tcl)