This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: best practices on gcc building host tool for cross arch


Hi Michael,
Thanks for the suggestion, which I had considered and tried already.
The problem is that while I can directly include the top-level file,
say elfcore.h, the files it includes will come from the host kernel
and not the target kernel.

Certainly one of the approaches I can take is to maintain a second
copy of the target kernel header files that I need access to for this
tool, and make sure they include from the target area.

I was hoping there was a more 'elegant' solution.
You may be right about gcc-help not being the best mailing list,
I will pose the question on the gdb list as well.
Cheers,
T.mike

> -----Original Message-----
> From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org]On
> Behalf Of Michael Eager
> Sent: Sunday, January 14, 2007 11:13 AM
> To: tmike@recipes4linux.com
> Cc: gcc-help@gcc.gnu.org
> Subject: Re: best practices on gcc building host tool for cross arch
> 
> 
> tmike@recipes4linux.com wrote:
> > 
> > Folks,
> > 
> > I am trying to build a simple elf file parsing tool.
> > Tool runs on a host, but wants to be able to parse core files
> > from embedded architectures.
> > host = x86
> > embedded = arm
> > 
> > In order to parse the embedded core file, the tool needs to see
> > and read the embedded kernel header files.
> > 
> > I would guess a version of gdb that runs on a host and debugs
> > a different target has similar issues.
> > 
> > Are there any "best-practices" for configuring/building/using gcc
> > in this manner?
> > 
> > This isn't strictly a "cross-compilation" build of gcc.
> > Cheers,
> > T.mike
> 
> Hi --
> 
> I don't see why you believe that this has anything to do
> with building gcc.
> 
> If your program which parses core files needs headers from
> the target kernel, you can reference them in your source.
> Rather than "#include <stdio.h>" which would get the host
> definitions, put "#include "<target>/usr/include/stdio.h"" in
> the source for your parser, where <target> is the path to a
> copy of the target's root directory tree.
> 
> -- 
> Michael Eager	 eager@eagercon.com
> 1960 Park Blvd., Palo Alto, CA 94306  650-325-8077
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]