Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Hans-Peter Nilsson <hans-peter.nilsson@axis.com>
Cc: gdb-patches@sourceware.org
Subject: Re: build error for mn10300-elf sim with your recent commit
Date: Fri, 15 Jun 2012 19:15:00 -0000	[thread overview]
Message-ID: <20120615191516.GA18729@adacore.com> (raw)
In-Reply-To: <20120615185559.GZ18729@adacore.com>

> > My autotester complains that the sim build for mn10300-elf is
> > broken, and your entry was the only one at the top of
> > sim/mn10300/ChangeLog.  There was a working build 5-6 hours
> > earlier:
> 
> Yeah, I think that might be me. I'll try to reproduce and fix.
> If it's an easy fix, I won't be offdended if you send a patch :-).

I think this one is really going to hurt. Amazing how a little change
in bfd can have ripple effects everywhere.

Basically: BFD changed the inclusion rules, now causing a build error
if you include "bfd.h" without having included "config.h" before.
We were including "config.h", but BFD failed to notice because of
the fact that the PACKAGE macro was missing. I added it, and now
we trip another requirement: Either we include "config.h", or we
include "sysdep.h" (which in turn includes "config.h" for you).

sysdep.h provides some definitions for the system that might be
missing some features, like:

    #if !HAVE_DECL_FFS
    extern int ffs (int);
    #endif

So, my first suggestion is to replace all includes of "config.h"
by includes of "sysdep.h". Or rather, I'd create a file similar
to GDB's defs.h, and add a rule that every file should include
that file first.

I'm copying Mike for guidance.  Right now, there are exactly
100 files that include "config.h", for 8 files that include
sysdep.h.

I am also wondering why BFD has this requirement at all. Looking
at the code, there wouldn't be any harm that I could think of if
config.h was included first, and then sysdep.h, since the first
thing sysdep.h does is include config.h.  And if someone includes
sysdep.h first, and then config.h, the second include will be a noop.
Perhaps we should ask the binutils folks as well? Or maybe I should
do some archeology, but I am running out of time for today.

-- 
Joel


  reply	other threads:[~2012-06-15 19:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-15 18:46 Hans-Peter Nilsson
2012-06-15 18:56 ` Joel Brobecker
2012-06-15 19:15   ` Joel Brobecker [this message]
2012-06-15 19:39     ` Pedro Alves
2012-06-15 19:52       ` Joel Brobecker
2012-06-15 21:15         ` Pedro Alves
2012-06-16  4:56           ` Mike Frysinger
2012-06-16  5:09             ` Hans-Peter Nilsson
2012-06-17 18:57               ` Hans-Peter Nilsson
2012-06-17 23:34             ` Mike Frysinger
2012-06-18 18:39           ` Joel Brobecker
2012-06-15 20:37     ` Hans-Peter Nilsson

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=20120615191516.GA18729@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=hans-peter.nilsson@axis.com \
    /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