From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29303 invoked by alias); 15 Jun 2012 19:39:25 -0000 Received: (qmail 29223 invoked by uid 22791); 15 Jun 2012 19:39:24 -0000 X-SWARE-Spam-Status: No, hits=-7.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 Jun 2012 19:39:09 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5FJcspH021131 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 15 Jun 2012 15:38:54 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q5FJcqGj019214; Fri, 15 Jun 2012 15:38:53 -0400 Message-ID: <4FDB8F4C.8070404@redhat.com> Date: Fri, 15 Jun 2012 19:39:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: Joel Brobecker CC: Hans-Peter Nilsson , gdb-patches@sourceware.org Subject: Re: build error for mn10300-elf sim with your recent commit References: <201206151846.q5FIkL3Z026410@ignucius.se.axis.com> <20120615185559.GZ18729@adacore.com> <20120615191516.GA18729@adacore.com> In-Reply-To: <20120615191516.GA18729@adacore.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-06/txt/msg00527.txt.bz2 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