When do you need a cross compiler?

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
I'm going to be working on a PC/104 (x86) embedded single board computer for
an upcoming project.  I'll be running an embedded Linux distribution for the
target operating system.  I don't want to have to compile on the target, I'd
prefer to compile on a host development machine with more horsepower.  Under
what circumstances is a cross-compiler required?  The development host will
be running either a standard Linux distribution (probably Mandrake 9) or
possibly Cygwin.  If the host and target machines are running different
versions of the Linux kernel, or libC, is a cross-compiler required?  If so
can someone point me to some instructions on the web (or elsewhere) on how
to go about setting this up?

Thanks alot,

Mark



Re: When do you need a cross compiler?
: I'm going to be working on a PC/104 (x86) embedded single board computer for
: an upcoming project.  I'll be running an embedded Linux distribution for the
: target operating system.  I don't want to have to compile on the target, I'd

I have some advice for you, but you didn't leave a valid email address.

ttyl,

--buddy


Re: When do you need a cross compiler?
Hi Buddy, I'd like to hear your advice.  Can you post it to the group?  I
didn't put a valid email address because I want to avoid getting
automatically signed up for junk mail.

Thanks,
Mark

Quoted text here. Click to load it
for
the
I'd



OT: Spam (Was: Re: When do you need a cross compiler?)
: Hi Buddy, I'd like to hear your advice.  Can you post it to the group?  I
: didn't put a valid email address because I want to avoid getting
: automatically signed up for junk mail.
:

Use an address like ' snipped-for-privacy@foodeletethis.com', or
use spamgourmet.com

I think providing no return address is simply not professional, so i'd
rather not waste my time.

--buddy


Re: Spam (Was: Re: When do you need a cross compiler?)
"not professional"???  Come on...I asked a legitimate question.  Some other
people were nice enough to have provided me with some answers (thanks!).  I
doubt your attitude is welcome on this group.

Quoted text here. Click to load it
I



Re: When do you need a cross compiler?

Quoted text here. Click to load it

Yes, you would normally need a cross compiler in cases like this.
Assuming you are using GNU there are lots of people listening to this
group who would be able to help you.


Phil Smith, sometimes G8JSL

snipped-for-privacy@nexusrobotics.co.uk

Embedded software, Robotics, CAN and Consultancy.

Re: When do you need a cross compiler?
Quoted text here. Click to load it

Under those where an executable made for the build machine won't run
on the target, as-is.  E.g. if you want to run the compiler on
Windows+Cygwin, but the target is an embedded Linux, you need a
cross-compiler.  

If the target is running a rather complete Linux installation, you
might get away using the native GCC to compile for it.  If the target
doesn't use the same major release of the the GNU libc, forget it.
You might get away using a different kernel on the target than on the
development machine, but never a different libc.

But even if it would work, it's generally saner to set up a
cross-compiler, if only to avoid accidentally linking in libraries
that don't exist on the target.  Setting up the include and lib
directories for the target on the host system may feel awkward at
first, but it pays off in the longer term.

For instructions, just have a good look at the GCC and binutils (!)
installation instructions --- it's all there.

--
Hans-Bernhard Broeker ( snipped-for-privacy@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.

Re: When do you need a cross compiler?
Quoted text here. Click to load it

Some of the tools used by the Linux kernel build process use mmap()
which -I think- is not available in Cygwin, so building a Linux kernel
with Cygwin may be possible but will probably not work out of the box.


Quoted text here. Click to load it

Different versions of libc will cause a lot of trouble, so a cross-compiler
setup -while not strictly necessary- can make things considerably easier.

Quoted text here. Click to load it


FWIW, there are a number of embedded Linux offerings available
that are designed to spare users most of this trouble.
(<plug> Incidentally, my company sells one of those </plug>)
Its the old story: You can either learn to do it all by yourself
(and learn a lot in the process) or pay some amount and get an easy
start. Both ways have their pros and cons and at least with Linux,
you have a choice :-)


Rob

--
Robert Kaiser                     email: rkaiser AT sysgo DOT de
SYSGO AG                          http://www.elinos.com
We've slightly trimmed the long signature. Click to see the full one.
Re: When do you need a cross compiler?
Quoted text here. Click to load it

The term "cross compiler" usually refers to
compiling on a CPU architecture that
is different than the target. Since your target
is x86 and I suspect that your workstation is also x86, you should
not be looking for a cross compiler.

If you have a compiler version on the workstation
that is incompatible with the kernel version on the
target os, then you might get some incompatibility
errors, so you just need to be concerned about
compiler and library version vs. kernel version.

Tom


Re: When do you need a cross compiler?
:
: If you have a compiler version on the workstation
: that is incompatible with the kernel version on the
: target os, then you might get some incompatibility
: errors, so you just need to be concerned about
: compiler and library version vs. kernel version.
:

This shouldn't ever really matter (TM). By that, I mean that it shouldn't,
but it wouldn't surprise me if it did. Especially with a 2.2 dev platform
and a 2.4 linux kernel.

Something the OP should consider, is that, depending on the target, eCos or
netBSD might be a better fit. Linux is so big for an embedded system (caveat:
I've never used eCos, and i'm currently building an embedded system using
linux)

ttyl,

--buddy
 
: Tom
:

Site Timeline