public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Joseph S. Myers" <joseph@codesourcery.com>
To: Andi Kleen <ak@linux.intel.com>
Cc: Andi Kleen <andi@firstfloor.org>,
	gcc-patches@gcc.gnu.org, hubicka@ucw.cz
Subject: Re: [PATCH 1/3] Add native ELF and LTO support in collect2
Date: Mon, 11 Oct 2010 15:10:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.1010111504420.30928@digraph.polyomino.org.uk> (raw)
In-Reply-To: <20101011145646.GA9269@gargoyle.fritz.box>

On Mon, 11 Oct 2010, Andi Kleen wrote:

> On Mon, Oct 11, 2010 at 02:33:07PM +0000, Joseph S. Myers wrote:
> > On Mon, 11 Oct 2010, Andi Kleen wrote:
> > 
> > > Controlled by a define in the OS specific config file.
> > > I only enabled this on x86 Linux for now.
> > 
> > OBJECT_FORMAT_ELF is already defined in elfos.h where it belongs (and in 
> > several target-specific headers where it doesn't belong - some duplicating 
> > the definition in elfos.h, others ELF targets that don't use elfos.h for 
> > whatever reason).
> 
> What do you suggest? Use a different name?

No.  Just allow this code to apply for all ELF targets like it should, 
rather than trying to enable it specially only for one particular target.

> > > +#if  !defined (HAVE_LIBELF_H) || !defined (HAVE_GELF_H)  \
> > > +  || !defined (HAVE_UNISTD_H) || !defined (HAVE_FCNTL_H) \
> > > +  || defined (CROSS_DIRECTORY_STRUCTURE)
> > 
> > Why the CROSS_DIRECTORY_STRUCTURE conditional?
> 
> I wasn't sure if the host libelf works from cross compilation.

libelf should work for all targets for any host.

> Also some of the other elf format code had checks for it so
> I thought it was safer to exclude.

What code are you talking about?  The compiler should never behave 
differently for a particular target depending on the host unless you have 
a properly understood reason for it; such a difference certainly isn't 
"safer", it's dangerous.  If it's a matter of non-GNU native linkers, the 
conditional should be on the choice of linker, not on whether it's a cross 
compiler.  If it's a matter of native system headers describing an object 
file format, that won't apply with libelf (and in any case, adding 
equivalent GNU headers describing the format is the correct approach).  
CROSS_DIRECTORY_STRUCTURE should only ever be used when it is genuinely 
the *directory structure* - the locations of various files - that is 
relevant.

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2010-10-11 15:09 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-11 10:19 Andi Kleen
2010-10-11 10:17 ` [PATCH 2/3] Add bootstrap-lto-slim build config Andi Kleen
2010-10-11 10:17   ` [PATCH 3/3] Implement -flto-slim Andi Kleen
2010-10-11 10:42     ` Richard Guenther
2010-10-11 10:43       ` Andi Kleen
2010-10-17 17:04   ` [PATCH 2/3] Add bootstrap-lto-slim build config Gerald Pfeifer
2010-10-17 18:30     ` Andi Kleen
2010-10-17 23:19       ` Jan Hubicka
2010-10-18  0:01         ` Andi Kleen
2010-10-11 14:49 ` [PATCH 1/3] Add native ELF and LTO support in collect2 Joseph S. Myers
2010-10-11 14:54   ` Andi Kleen
2010-10-11 15:10     ` Joseph S. Myers [this message]
2010-10-11 15:31       ` Andi Kleen
2010-10-11 15:34 ` Dave Korn
2010-10-11 15:36   ` Andi Kleen
2010-10-11 15:53     ` Dave Korn
2010-10-11 15:56       ` Andi Kleen
2010-10-11 16:25         ` Dave Korn
2010-10-11 16:37           ` Andi Kleen
2010-10-11 16:49             ` Dave Korn
2010-10-11 17:35               ` Andi Kleen
2010-10-16 15:09 Updated slim-lto patchkit Andi Kleen
2010-10-16 16:07 ` [PATCH 1/3] Add native ELF and LTO support in collect2 Andi Kleen
2010-11-02 11:06   ` Diego Novillo
2010-11-02 11:07     ` Richard Guenther
2010-11-02 11:41       ` Andi Kleen
2010-11-02 21:26         ` Dave Korn
2010-11-02 11:42     ` Andi Kleen

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=Pine.LNX.4.64.1010111504420.30928@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    /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).