* Re: Invalid use of $zlibdir within GDB_AC_CHECK_BFD
[not found] <CAK1sNPC8GUwc4HUvb+WUm85OYKe+G2AmDduzAB-0St5hdKXJNA@mail.gmail.com>
@ 2015-04-09 11:47 ` H.J. Lu
0 siblings, 0 replies; 3+ messages in thread
From: H.J. Lu @ 2015-04-09 11:47 UTC (permalink / raw)
To: Ilya Malakhov; +Cc: GDB
On Thu, Apr 9, 2015 at 1:14 AM, Ilya Malakhov
<ilmalakhovthefirst@gmail.com> wrote:
> Hi,
>
> The use of $zlibdir when setting LDFLAGS within GDB_AC_CHECK_BFD in
> gdb/acinclude.m4 seems to be incorrect unless gdb is configured
> `--with-system
> -zlib'. At configure time it becomes (see config/zlib.m4)
>
> -L$(top_builddir)/../zlib
>
> with $(top_builddir) being a make(!) variable. This makes a number of
> gdb/configure
> tests fail unless a user has got an installed system zlib for the host of
> GDB. As a result,
> one may quite unexpectedly obtain GDB without ELF support.
>
I checked in this patch to fix it.
--
H.J.
---
From 5a2d4533e2b9cc9c069d47071013cb30f1e0fc7e Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Thu, 9 Apr 2015 04:43:57 -0700
Subject: [PATCH] Replace $zlibdir with $ZLIBDIR in LDFLAGS
* acinclude.m4: (GDB_AC_CHECK_BFD): Set ZLIBDIR with $zlibdir.
Replace $zlibdir with $ZLIBDIR in LDFLAGS.
* configure: Regenerated.
---
gdb/ChangeLog | 6 ++++++
gdb/acinclude.m4 | 3 ++-
gdb/configure | 6 ++++--
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 73a32a9..84d437f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2015-04-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ * acinclude.m4: (GDB_AC_CHECK_BFD): Set ZLIBDIR with $zlibdir.
+ Replace $zlibdir with $ZLIBDIR in LDFLAGS.
+ * configure: Regenerated.
+
2015-04-09 Pedro Alves <palves@redhat.com>
* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add strtok_r.
diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
index 98ae85f..845e65f 100644
--- a/gdb/acinclude.m4
+++ b/gdb/acinclude.m4
@@ -465,7 +465,8 @@ AC_DEFUN([GDB_AC_CHECK_BFD], [
# 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 $zlibdir $LDFLAGS"
+ ZLIBDIR=`echo $zlibdir | sed 's,\$(top_builddir)/,,g'`
+ LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS"
intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
LIBS="-lbfd -liberty -lz $intl $LIBS"
AC_CACHE_CHECK([$1], [$2],
diff --git a/gdb/configure b/gdb/configure
index f835157..2baf6dd 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -13526,7 +13526,8 @@ esac
# 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 $zlibdir $LDFLAGS"
+ ZLIBDIR=`echo $zlibdir | sed 's,\$(top_builddir)/,,g'`
+ LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS"
intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
LIBS="-lbfd -liberty -lz $intl $LIBS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELF support in BFD" >&5
@@ -13636,7 +13637,8 @@ fi
# 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 $zlibdir $LDFLAGS"
+ ZLIBDIR=`echo $zlibdir | sed 's,\$(top_builddir)/,,g'`
+ LDFLAGS="-L../bfd -L../libiberty $ZLIBDIR $LDFLAGS"
intl=`echo $LIBINTL | sed 's,${top_builddir}/,,g'`
LIBS="-lbfd -liberty -lz $intl $LIBS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mach-O
support in BFD" >&5
--
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Invalid use of $zlibdir within GDB_AC_CHECK_BFD
@ 2015-04-09 8:49 Ilya Malakhov
0 siblings, 0 replies; 3+ messages in thread
From: Ilya Malakhov @ 2015-04-09 8:49 UTC (permalink / raw)
To: gdb
On Thu, Apr 9, 2015 at 11:32 AM, Ilya Malakhov
<ilmalakhovthefirst@gmail.com> wrote:
. . .
> The use of $zlibdir when setting LDFLAGS within GDB_AC_CHECK_BFD in
> gdb/acinclude.m4 seems to be incorrect unless gdb is configured `--with-system
> -zlib'. . .
. . .
This applies to the current state of master branch in binutils-gdb.git.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Invalid use of $zlibdir within GDB_AC_CHECK_BFD
@ 2015-04-09 8:32 Ilya Malakhov
0 siblings, 0 replies; 3+ messages in thread
From: Ilya Malakhov @ 2015-04-09 8:32 UTC (permalink / raw)
To: gdb
Hi,
The use of $zlibdir when setting LDFLAGS within GDB_AC_CHECK_BFD in
gdb/acinclude.m4 seems to be incorrect unless gdb is configured `--with-system
-zlib'. At configure time it becomes (see config/zlib.m4)
-L$(top_builddir)/../zlib
with $(top_builddir) being a make(!) variable. This makes a number of
gdb/configure
tests fail unless a user has got an installed system zlib for the host
of GDB. As a result,
one may quite unexpectedly obtain GDB without ELF support.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-04-09 11:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CAK1sNPC8GUwc4HUvb+WUm85OYKe+G2AmDduzAB-0St5hdKXJNA@mail.gmail.com>
2015-04-09 11:47 ` Invalid use of $zlibdir within GDB_AC_CHECK_BFD H.J. Lu
2015-04-09 8:49 Ilya Malakhov
-- strict thread matches above, loose matches on Subject: below --
2015-04-09 8:32 Ilya Malakhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).