This is the mail archive of the mailing list for the GDB 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: build error for mn10300-elf sim with your recent commit

> > 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);

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

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.


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