This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: wrong bfd recognized
- From: Pedro Alves <palves at redhat dot com>
- To: Luca Pizzamiglio <luca dot pizzamiglio at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 07 Feb 2012 20:15:04 +0000
- Subject: Re: wrong bfd recognized
- References: <CAB88xy91dt7mOT4wjkaDCvDmj03LjZ_BAV7xTGsaeWe0ZdDe7Q@mail.gmail.com>
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 @@
> OLD_LDFLAGS=$LDFLAGS
> OLD_LIBS=$LIBS
> CFLAGS="$CFLAGS -I${srcdir}/../include -I../bfd -I${srcdir}/../bfd"
> -LDFLAGS="$LDFLAGS -L../bfd -L../libiberty"
> +LDFLAGS="-L../bfd -L../libiberty $LDFLAGS"
If you set LDFLAGS to -L/foo/lib , you presumably also set
CFLAGS to -I/foo/include . In 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. You 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="$CFLAGS -I${srcdir}/../include -I../bfd -I${srcdir}/../bfd"
+ CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS"
--
Pedro Alves