* wrong bfd recognized
@ 2011-12-13 15:29 Luca Pizzamiglio
2011-12-20 14:58 ` Tom Tromey
2012-02-07 20:15 ` Pedro Alves
0 siblings, 2 replies; 13+ messages in thread
From: Luca Pizzamiglio @ 2011-12-13 15:29 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 553 bytes --]
Hi!
I'm Luca, the maintainer of gdb7.x on FreeBSD ports.
I've found a strange situation where gdb's configure script fails to
use libbfd and disable ELF support.
the problem was that during configuration, the /usr/local/lib/libbfd.a
was used, instead of the gdb's one. This library was compiled with
libintl support, then the bfd's test program build failed.
This patch should solve this issue, building bfd's testing program
using the gdb's one.
Thanks in advance for the support
Luca
PS: please use my address in cc, I'm not in the mailing-list!
[-- Attachment #2: gdb-configure.ac.patch --]
[-- Type: application/octet-stream, Size: 479 bytes --]
--- gdb/configure.ac.orig 2011-12-13 15:33:27.616649109 +0100
+++ 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"
intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
# -ldl is provided by bfd/Makfile.am (LIBDL) <PLUGINS>.
if test "$plugins" = "yes"; then
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: wrong bfd recognized 2011-12-13 15:29 wrong bfd recognized Luca Pizzamiglio @ 2011-12-20 14:58 ` Tom Tromey 2011-12-21 12:24 ` Luca Pizzamiglio 2012-02-07 20:15 ` Pedro Alves 1 sibling, 1 reply; 13+ messages in thread From: Tom Tromey @ 2011-12-20 14:58 UTC (permalink / raw) To: Luca Pizzamiglio; +Cc: gdb-patches >>>>> "Luca" == Luca Pizzamiglio <luca.pizzamiglio@gmail.com> writes: Luca> I've found a strange situation where gdb's configure script fails to Luca> use libbfd and disable ELF support. Luca> the problem was that during configuration, the /usr/local/lib/libbfd.a Luca> was used, instead of the gdb's one. This library was compiled with Luca> libintl support, then the bfd's test program build failed. Are you adding -L/usr/local/lib to LDFLAGS? If so -- why? Luca> This patch should solve this issue, building bfd's testing program Luca> using the gdb's one. I wonder whether it would break something. If you can find another spot in the src configury that does it this way, I guess I'd be more inclined to just do it. This needs a ChangeLog entry. Tom ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: wrong bfd recognized 2011-12-20 14:58 ` Tom Tromey @ 2011-12-21 12:24 ` Luca Pizzamiglio 2011-12-21 18:50 ` Tom Tromey 0 siblings, 1 reply; 13+ messages in thread From: Luca Pizzamiglio @ 2011-12-21 12:24 UTC (permalink / raw) To: Tom Tromey; +Cc: gdb-patches Hi Tom, After a check, I've noticed that LDFLAGS is set -L/usr/local/lib in order to use libreadline installed there. It's possible to have several libreadline installed and LDFLAGS is the only way to specify which library to use. On details. FreeBSD could have a libreadline provided by the system and a libreadline provided by ports (different versions, license, ecc.) So, if LDFLAGS is set, then the gdb's libbfd is not used, but the /usr/local/lib one's. I'm not totally sure, but I guess that this behavior is not properly correct. Am I missing some contraindication or a way to point the right libreadline? thanks in advance for the help Luca On Tue, Dec 20, 2011 at 3:56 PM, Tom Tromey <tromey@redhat.com> wrote: >>>>>> "Luca" == Luca Pizzamiglio <luca.pizzamiglio@gmail.com> writes: > > Luca> I've found a strange situation where gdb's configure script fails to > Luca> use libbfd and disable ELF support. > Luca> the problem was that during configuration, the /usr/local/lib/libbfd.a > Luca> was used, instead of the gdb's one. This library was compiled with > Luca> libintl support, then the bfd's test program build failed. > > Are you adding -L/usr/local/lib to LDFLAGS? > If so -- why? > > Luca> This patch should solve this issue, building bfd's testing program > Luca> using the gdb's one. > > I wonder whether it would break something. > > If you can find another spot in the src configury that does it this way, > I guess I'd be more inclined to just do it. > > This needs a ChangeLog entry. > > Tom ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: wrong bfd recognized 2011-12-21 12:24 ` Luca Pizzamiglio @ 2011-12-21 18:50 ` Tom Tromey 2011-12-29 12:18 ` Luca Pizzamiglio 0 siblings, 1 reply; 13+ messages in thread From: Tom Tromey @ 2011-12-21 18:50 UTC (permalink / raw) To: Luca Pizzamiglio; +Cc: gdb-patches >>>>> "Luca" == Luca Pizzamiglio <luca.pizzamiglio@gmail.com> writes: Luca> Am I missing some contraindication or a way to point the right Luca> libreadline? I don't think there is. Luca> thanks in advance for the help Could you write a ChangeLog entry for your patch? I will put it in. Tom ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: wrong bfd recognized 2011-12-21 18:50 ` Tom Tromey @ 2011-12-29 12:18 ` Luca Pizzamiglio 2011-12-29 19:02 ` Joel Brobecker 0 siblings, 1 reply; 13+ messages in thread From: Luca Pizzamiglio @ 2011-12-29 12:18 UTC (permalink / raw) To: Tom Tromey; +Cc: gdb-patches Ok. A possible entry could be: improved bfd local static library detection in the configure script Luca PS Sorry for the delay, Xmas break ;) On Wed, Dec 21, 2011 at 6:28 PM, Tom Tromey <tromey@redhat.com> wrote: >>>>>> "Luca" == Luca Pizzamiglio <luca.pizzamiglio@gmail.com> writes: > > Luca> Am I missing some contraindication or a way to point the right > Luca> libreadline? > > I don't think there is. > > Luca> thanks in advance for the help > > Could you write a ChangeLog entry for your patch? > I will put it in. > > Tom ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: wrong bfd recognized 2011-12-29 12:18 ` Luca Pizzamiglio @ 2011-12-29 19:02 ` Joel Brobecker 2012-01-02 10:04 ` Luca Pizzamiglio 0 siblings, 1 reply; 13+ messages in thread From: Joel Brobecker @ 2011-12-29 19:02 UTC (permalink / raw) To: Luca Pizzamiglio; +Cc: Tom Tromey, gdb-patches Luca > > Could you write a ChangeLog entry for your patch? > > I will put it in. [...] > Ok. A possible entry could be: > > improved bfd local static library detection in the configure script Unfortunately, this is not what a ChangeLog entry should look like. I suspect you thought that we were asking for some text to be used as revision history? Here is what a ChangeLog entry looks like: 2011-12-27 Doug Evans <dje@google.com> * dwarf2read.c (struct dwarf2_cu): Delete members first_fn, last_fn, cached_fn. (struct function_range): Delete. (initialize_cu_func_list, add_to_cu_func_list): Delete. All callers updated. (check_cu_functions): Ditto. You can have a look at the couple of sections that explain ChangeLogs in the GNU Coding Standards (the link brings you directly to the relevant section): http://www.gnu.org/prep/standards/standards.html#Change-Logs Please let me know if you have any problems creating one and I will write it for you (this time!). -- Joel ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: wrong bfd recognized 2011-12-29 19:02 ` Joel Brobecker @ 2012-01-02 10:04 ` Luca Pizzamiglio 2012-02-06 19:33 ` Tom Tromey 0 siblings, 1 reply; 13+ messages in thread From: Luca Pizzamiglio @ 2012-01-02 10:04 UTC (permalink / raw) To: Joel Brobecker; +Cc: Tom Tromey, gdb-patches Hi Joel, sorry for the confusion, I'm not used to write this kind of ChangeLog entry. My fault. 2012-01-02 Luca Pizzamiglio <luca.pizzamiglio@gmail.com> * gdb/configure.ac (LDFLAGS in ELF support's check): changing path priority in LDFLAGS LDFLAGS is redefined putting an external-defined value at the end. I hope that works now! This rules doesn't fit well with autoconf files :) Feel free to modify it, if it's still wrong. thanks for the support Luca On Thu, Dec 29, 2011 at 1:17 PM, Joel Brobecker <brobecker@adacore.com> wrote: > Luca > >> > Could you write a ChangeLog entry for your patch? >> > I will put it in. > [...] >> Ok. A possible entry could be: >> >> improved bfd local static library detection in the configure script > > Unfortunately, this is not what a ChangeLog entry should look like. > I suspect you thought that we were asking for some text to be used > as revision history? Here is what a ChangeLog entry looks like: > > 2011-12-27 Doug Evans <dje@google.com> > > * dwarf2read.c (struct dwarf2_cu): Delete members first_fn, last_fn, > cached_fn. > (struct function_range): Delete. > (initialize_cu_func_list, add_to_cu_func_list): Delete. All callers > updated. > (check_cu_functions): Ditto. > > You can have a look at the couple of sections that explain ChangeLogs > in the GNU Coding Standards (the link brings you directly to the > relevant section): > > http://www.gnu.org/prep/standards/standards.html#Change-Logs > > Please let me know if you have any problems creating one and I will > write it for you (this time!). > > -- > Joel ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: wrong bfd recognized 2012-01-02 10:04 ` Luca Pizzamiglio @ 2012-02-06 19:33 ` Tom Tromey 2012-02-07 16:25 ` Luca Pizzamiglio 0 siblings, 1 reply; 13+ messages in thread From: Tom Tromey @ 2012-02-06 19:33 UTC (permalink / raw) To: Luca Pizzamiglio; +Cc: Joel Brobecker, gdb-patches >>>>> "Luca" == Luca Pizzamiglio <luca.pizzamiglio@gmail.com> writes: Luca> sorry for the confusion, I'm not used to write this kind of ChangeLog Luca> entry. My fault. No worries. I'm sorry about the delay on this. I'm finally checking it in, with this ChangeLog entry: 2012-02-06 Luca Pizzamiglio <luca.pizzamiglio@gmail.com> * configure: Rebuild. * configure.ac: Put -L../bfd and -L../libiberty at the front of LDFLAGS. Tom ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: wrong bfd recognized 2012-02-06 19:33 ` Tom Tromey @ 2012-02-07 16:25 ` Luca Pizzamiglio 0 siblings, 0 replies; 13+ messages in thread From: Luca Pizzamiglio @ 2012-02-07 16:25 UTC (permalink / raw) To: Tom Tromey; +Cc: Joel Brobecker, gdb-patches Thanks Tom! Best regards, Luca On Mon, Feb 6, 2012 at 8:32 PM, Tom Tromey <tromey@redhat.com> wrote: >>>>>> "Luca" == Luca Pizzamiglio <luca.pizzamiglio@gmail.com> writes: > > Luca> sorry for the confusion, I'm not used to write this kind of ChangeLog > Luca> entry. My fault. > > No worries. > > I'm sorry about the delay on this. I'm finally checking it in, with > this ChangeLog entry: > > 2012-02-06 Luca Pizzamiglio <luca.pizzamiglio@gmail.com> > > * configure: Rebuild. > * configure.ac: Put -L../bfd and -L../libiberty at the front of > LDFLAGS. > > Tom ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: wrong bfd recognized 2011-12-13 15:29 wrong bfd recognized Luca Pizzamiglio 2011-12-20 14:58 ` Tom Tromey @ 2012-02-07 20:15 ` Pedro Alves 2012-02-10 13:55 ` Pedro Alves 1 sibling, 1 reply; 13+ messages in thread From: Pedro Alves @ 2012-02-07 20:15 UTC (permalink / raw) To: Luca Pizzamiglio; +Cc: gdb-patches 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 ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: wrong bfd recognized 2012-02-07 20:15 ` Pedro Alves @ 2012-02-10 13:55 ` Pedro Alves 2012-02-10 13:59 ` Luca Pizzamiglio 0 siblings, 1 reply; 13+ messages in thread From: Pedro Alves @ 2012-02-10 13:55 UTC (permalink / raw) To: Luca Pizzamiglio; +Cc: gdb-patches 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 @@ >> 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" > I'm applying this. 2012-02-10 Pedro Alves <palves@redhat.com> * configure.ac (HAVE_ELF test): Put the old CFLAGS at the end of the test CFLAGS. * configure: Regenerate. --- gdb/configure | 5 ++++- gdb/configure.ac | 5 ++++- 2 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 OLD_CFLAGS=$CFLAGS OLD_LDFLAGS=$LDFLAGS OLD_LIBS=$LIBS -CFLAGS="$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. We +# always want our bfd. +CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS" LDFLAGS="-L../bfd -L../libiberty $LDFLAGS" intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'` # -ldl is provided by bfd/Makfile.am (LIBDL) <PLUGINS>. 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) OLD_CFLAGS=$CFLAGS OLD_LDFLAGS=$LDFLAGS OLD_LIBS=$LIBS -CFLAGS="$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. We +# always want our bfd. +CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS" LDFLAGS="-L../bfd -L../libiberty $LDFLAGS" intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'` # -ldl is provided by bfd/Makfile.am (LIBDL) <PLUGINS>. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: wrong bfd recognized 2012-02-10 13:55 ` Pedro Alves @ 2012-02-10 13:59 ` Luca Pizzamiglio 2012-02-10 14:02 ` Pedro Alves 0 siblings, 1 reply; 13+ messages in thread From: Luca Pizzamiglio @ 2012-02-10 13:59 UTC (permalink / raw) To: Pedro Alves; +Cc: gdb-patches 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 <palves@redhat.com> 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 @@ >>> 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" >> > > I'm applying this. > > 2012-02-10 Pedro Alves <palves@redhat.com> > > * configure.ac (HAVE_ELF test): Put the old CFLAGS at the end of > the test CFLAGS. > * configure: Regenerate. > > --- > > gdb/configure | 5 ++++- > gdb/configure.ac | 5 ++++- > 2 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 > OLD_CFLAGS=$CFLAGS > OLD_LDFLAGS=$LDFLAGS > OLD_LIBS=$LIBS > -CFLAGS="$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. We > +# always want our bfd. > +CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS" > LDFLAGS="-L../bfd -L../libiberty $LDFLAGS" > intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'` > # -ldl is provided by bfd/Makfile.am (LIBDL) <PLUGINS>. > 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) > OLD_CFLAGS=$CFLAGS > OLD_LDFLAGS=$LDFLAGS > OLD_LIBS=$LIBS > -CFLAGS="$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. We > +# always want our bfd. > +CFLAGS="-I${srcdir}/../include -I../bfd -I${srcdir}/../bfd $CFLAGS" > LDFLAGS="-L../bfd -L../libiberty $LDFLAGS" > intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'` > # -ldl is provided by bfd/Makfile.am (LIBDL) <PLUGINS>. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: wrong bfd recognized 2012-02-10 13:59 ` Luca Pizzamiglio @ 2012-02-10 14:02 ` Pedro Alves 0 siblings, 0 replies; 13+ messages in thread From: Pedro Alves @ 2012-02-10 14:02 UTC (permalink / raw) To: Luca Pizzamiglio; +Cc: gdb-patches On 02/10/2012 01:58 PM, Luca Pizzamiglio wrote: > Hi Pedro, > > sorry for the delay. No worries. > You're right. also CFLAG should be updated. > I didn't see it, because it has generated no problem. Yeah, because -I/usr/local/include gets special treatment by the compiler (it's ignored). Something like, say, -I/opt/tools/include would cause you trouble if you had put both readline and bfd there. Thanks, -- Pedro Alves ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2012-02-10 14:02 UTC | newest] Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2011-12-13 15:29 wrong bfd recognized Luca Pizzamiglio 2011-12-20 14:58 ` Tom Tromey 2011-12-21 12:24 ` Luca Pizzamiglio 2011-12-21 18:50 ` Tom Tromey 2011-12-29 12:18 ` Luca Pizzamiglio 2011-12-29 19:02 ` Joel Brobecker 2012-01-02 10:04 ` Luca Pizzamiglio 2012-02-06 19:33 ` Tom Tromey 2012-02-07 16:25 ` Luca Pizzamiglio 2012-02-07 20:15 ` Pedro Alves 2012-02-10 13:55 ` Pedro Alves 2012-02-10 13:59 ` Luca Pizzamiglio 2012-02-10 14:02 ` Pedro Alves
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox