public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "T Michael Turney" <tmike@recipes4linux.com>
To: "Michael Eager" <eager@eagercon.com>
Cc: <gcc-help@gcc.gnu.org>
Subject: RE: best practices on gcc building host tool for cross arch
Date: Mon, 15 Jan 2007 18:15:00 -0000	[thread overview]
Message-ID: <FJEDKGFGNJDHFLFLPDCFKEMEDAAA.tmike@recipes4linux.com> (raw)
In-Reply-To: <45AA80B9.6030506@eagercon.com>


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
> 

  reply	other threads:[~2007-01-15 18:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-12 18:21 tmike
2007-01-14 19:13 ` Michael Eager
2007-01-15 18:15   ` T Michael Turney [this message]
2007-01-15 18:32     ` Michael Eager

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FJEDKGFGNJDHFLFLPDCFKEMEDAAA.tmike@recipes4linux.com \
    --to=tmike@recipes4linux.com \
    --cc=eager@eagercon.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).