From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28796 invoked by alias); 10 Feb 2012 13:59:09 -0000 Received: (qmail 28765 invoked by uid 22791); 10 Feb 2012 13:59:07 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-gy0-f169.google.com (HELO mail-gy0-f169.google.com) (209.85.160.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Feb 2012 13:58:42 +0000 Received: by ghrr18 with SMTP id r18so1786560ghr.0 for ; Fri, 10 Feb 2012 05:58:41 -0800 (PST) Received: by 10.50.194.170 with SMTP id hx10mr3905167igc.6.1328882321220; Fri, 10 Feb 2012 05:58:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.140.88 with HTTP; Fri, 10 Feb 2012 05:58:21 -0800 (PST) In-Reply-To: <4F35219F.401@redhat.com> References: <4F318648.8@redhat.com> <4F35219F.401@redhat.com> From: Luca Pizzamiglio Date: Fri, 10 Feb 2012 13:59:00 -0000 Message-ID: Subject: Re: wrong bfd recognized To: Pedro Alves Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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-02/txt/msg00189.txt.bz2 Hi Pedro, sorry for the delay. You're right. also CFLAG should be updated. I didn't see it, because it has generated no problem. Thanks Best regards, Luca On Fri, Feb 10, 2012 at 2:54 PM, Pedro Alves wrote: > On 02/07/2012 08:15 PM, Pedro Alves wrote: >> On 12/13/2011 03:13 PM, Luca Pizzamiglio wrote: >>> +++ gdb/configure.ac 2011-12-13 15:34:08.559285673 +0100 >>> @@ -1854,7 +1854,7 @@ >>> =A0OLD_LDFLAGS=3D$LDFLAGS >>> =A0OLD_LIBS=3D$LIBS >>> =A0CFLAGS=3D"$CFLAGS -I${srcdir}/../include -I../bfd -I${srcdir}/../bfd" >>> -LDFLAGS=3D"$LDFLAGS -L../bfd -L../libiberty" >>> +LDFLAGS=3D"-L../bfd -L../libiberty $LDFLAGS" >> >> If you set LDFLAGS to -L/foo/lib , you presumably also set >> CFLAGS to -I/foo/include . =A0In that case, after the patch, if there's = a libbfd >> in /foo/, you'll run the test with gdb's bfd, but compile it against e.g= ., the >> bfd.h from /foo/include. =A0You may not see this happen with /usr/local/= include >> because gcc usually ignores -I/usr/local/include as being a duplicate of= a >> system header path. >> >> IOW, it'd make sense to also do: >> >> - CFLAGS=3D"$CFLAGS -I${srcdir}/../include -I../bfd -I${srcdir}/../bfd" >> + CFLAGS=3D"-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS" >> > > I'm applying this. > > 2012-02-10 =A0Pedro Alves =A0 > > =A0 =A0 =A0 =A0* configure.ac (HAVE_ELF test): Put the old CFLAGS at the = end of > =A0 =A0 =A0 =A0the test CFLAGS. > =A0 =A0 =A0 =A0* configure: Regenerate. > > --- > > =A0gdb/configure =A0 =A0| =A0 =A05 ++++- > =A0gdb/configure.ac | =A0 =A05 ++++- > =A02 files changed, 8 insertions(+), 2 deletions(-) > > diff --git a/gdb/configure b/gdb/configure > index 11c044c..2566410 100755 > --- a/gdb/configure > +++ b/gdb/configure > @@ -15320,7 +15320,10 @@ esac > =A0OLD_CFLAGS=3D$CFLAGS > =A0OLD_LDFLAGS=3D$LDFLAGS > =A0OLD_LIBS=3D$LIBS > -CFLAGS=3D"$CFLAGS -I${srcdir}/../include -I../bfd -I${srcdir}/../bfd" > +# Put the old CFLAGS/LDFLAGS last, in case the user's (C|LD)FLAGS > +# points somewhere with bfd, with -I/foo/lib and -L/foo/lib. =A0We > +# always want our bfd. > +CFLAGS=3D"-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS" > =A0LDFLAGS=3D"-L../bfd -L../libiberty $LDFLAGS" > =A0intl=3D`echo $LIBINTL | sed 's,${top_builddir}/,,g'` > =A0# -ldl is provided by bfd/Makfile.am (LIBDL) . > diff --git a/gdb/configure.ac b/gdb/configure.ac > index 36da463..1b11adb 100644 > --- a/gdb/configure.ac > +++ b/gdb/configure.ac > @@ -1908,7 +1908,10 @@ AC_SUBST(WIN32LIBS) > =A0OLD_CFLAGS=3D$CFLAGS > =A0OLD_LDFLAGS=3D$LDFLAGS > =A0OLD_LIBS=3D$LIBS > -CFLAGS=3D"$CFLAGS -I${srcdir}/../include -I../bfd -I${srcdir}/../bfd" > +# Put the old CFLAGS/LDFLAGS last, in case the user's (C|LD)FLAGS > +# points somewhere with bfd, with -I/foo/lib and -L/foo/lib. =A0We > +# always want our bfd. > +CFLAGS=3D"-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS" > =A0LDFLAGS=3D"-L../bfd -L../libiberty $LDFLAGS" > =A0intl=3D`echo $LIBINTL | sed 's,${top_builddir}/,,g'` > =A0# -ldl is provided by bfd/Makfile.am (LIBDL) .