On Sun, Aug 10, 2008 at 03:51:53PM -0700, [EMAIL PROTECTED] wrote:

With a gcc ARM cross compiler I successfully built months ago from God knows
where.  There are various half baked scripts floating around the net to
automate this very tedious process.  I can rebuilt it if you think there is a
better source I should use.

The compiler is of surprisingly little concern.

But, what distribution are you running?  I can get a pretty full cross
development environemnt in gentoo just with

  emerge sys-devel/crossdev
  crossdev -s4 --target arm-something-linux-ulibc

but that's going to build ulibc intended for running on Linux.

Are you thinking my cross compiler may be converting my C code into ARM
instructions for a *later* ARM chip than my GDB supports?  Perhaps I'd have
better luck writing toy ARM assembly rather than toy C??  Can GDB step through
raw binary (assembly) rather than ELF?

Read the docs, and you'll find that gcc can generate for pretty much any
arm version there is.

A built ARM/linux executable isn't going
to work very well.

Even if I don't pull in any standard libraries?

You wouldn't make anything without any standard libraries.  What does
your code do?  You might try the final link in gcc with '-v' to get an
idea of what libraries are being pulled in.  There is at least a linker
script needed to set the memory layout the program expects, this at
least appears to not match.

If you're trying to run a fuller system, such as ARM-linux, I suggest
one of the fuller systems.  qemu does a decent job of just running Linux
like a target would.

Do you know of any prebuilt QEMU/Arm-Linux images?  The reason I ask is the
process to install Debian ARM Linux in QEMU is tricky and tedious just like
building a cross compiler is.

The qemu download page <http://bellard.org/qemu/download.html> has
several you can try.

In other words, unless you're just doing tiny little test executables,
you're probably going to need something other than the environment
provided in gdb.

Just running tiny test executables successfully would be much appreciated.
Even just stepping through toy assembly code with GDB would be adequate.
I'll try my "cross-assembler" if you think I may have better luck getting GDB
to like that output.

What matters isn't C or assembly, but what runtime is being linked in.

David


--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to