Understand cross compiling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a basic question that I can't seem to find the
answer to on the internet.

I am under the impression that gcc ONLY compiles for
the host system you have installed gcc on (by default
gcc installations on linux machines). To compile gcc
for a different processor you need to cross compile
gcc for the particular target (in my case m68k).

How come I can still specify -m68030 on my i386
system? I would expect compilation to fail, but it
doesn't. Did it really compile for the i386 processor
or the m68k? (I can't tell since it's supposed to run
on the m68k - but I have other problems so I can't run
it just yet). My confusion is the fact that it *looks*
like I can compile for the m68k processor on my
default gcc installation (Suse 9.1). I *think* I
instead have to set up a full cross compiler tool
chain. Note the program I am attempting to compile is
a small program meant to be run on a Motorola mvme147
PowerPC.

I also do not understand the -b option from the gcc
man page. How does gcc know to use a different gcc
compiler installed somewhere else.

Also, I have a gcc binary file on a Sun machine (where
the original code was created). Is there a way to get
the original configuration that it was built with? For
example, what it was configured to be cross compiled
with (host and target system). The gcc binary was
simply re-created and I can't recreate the full
installation.

Sorry for the basic questions, but I need to fully
understand this before continuing...

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux