This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: build error for mn10300-elf sim with your recent commit
On 06/15/2012 08:15 PM, Joel Brobecker wrote:
>>> 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).
I'm confused. Nothing outside of bfd should be including bfd/sysdep.h.
Is that what is happening?
>
> 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.
--
Pedro Alves