This is the mail archive of the gdb-patches@sourceware.org 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: wrong bfd recognized


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


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