binutils prerequisites (recent zlib version - what else?)

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

binutils prerequisites (recent zlib version - what else?)

Steffen Dettmer-2
Hi,

I'm trying to build gcc-4.6.0 with binutils-2.21 in the same
source directory which fails with

cc1: warnings being treated as errors
../../../gcc-4.6.0/binutils/bfd/compress.c: In function
`bfd_compress_section_contents':
../../../gcc-4.6.0/binutils/bfd/compress.c:100: warning: implicit
declaration of function `compressBound'
make[7]: *** [compress.lo] Error 1

(I guess without -Werror it won't link).
Google told that this is a zlib symbol and my zlib would be too
old. Do I need more libraries and stuff?

  (Also I'm afraid I could be unable to compile zlib because my
  gcc-3.2 is too old...)

I looked http://gcc.gnu.org/install/prerequisites.html and
 ../gcc-4.6.0/binutils-2.21/configure --help|grep zlib
but did not find --disable-zlib or alike.

Why do I need zlib at all?

Do I have a conflict of ../gcc-4.6.0/zlib/ (which seems to have
strange subdirs only, there is no "unix" or so) and
/usr/include/zlib.h?

I think binutils has low prerequisites and wonder why it does
not compile on linux, probably I did something wrong.

I extracted binutils to extracted gcc src dir and symlinked it to
"binutils" and configured gcc:
../gcc-4.6.0/configure \
  --prefix=/usr/local/exp/gcc-4.6.0/ \
  --enable-languages=c,c++,go

Any hints how to progress or pointers to some documentation I
missed are appreciated.

oki,

Steffen
Reply | Threaded
Open this post in threaded view
|

Re: binutils prerequisites (recent zlib version - what else?)

Steffen Dettmer-2
On Wed, Apr 20, 2011 at 2:43 PM, <[hidden email]> wrote:
> ../../../gcc-4.6.0/binutils/bfd/compress.c:100: warning: implicit
> declaration of function `compressBound'
> [...]
> I looked http://gcc.gnu.org/install/prerequisites.html and
> ../gcc-4.6.0/binutils-2.21/configure --help|grep zlib
> but did not find --disable-zlib or alike.

Just in case someone else ever looks for the same, here a small update:

I found it here:
$ src/gcc-4.6.0/binutils/bfd/configure --help|grep zlib
  --with-zlib             include zlib support (auto/yes/no) default=auto

> Why do I need zlib at all?

It is explained in src/gcc-4.6.0/binutils/bfd/configure.in:
...
# Link in zlib if we can.  This allows us to read compressed debug sections.
# This is used only by compress.c.
AM_ZLIB
...

So for now the additional configure option `--with-zlib=no'
should avoid (or workaround?) my issue.

I assume that when zlib is installed, then at least some "recent"
version must be installed, because there is no
`--with-zlib=internal' or alike, is this correct?

I noticed that gcc has an option `--with-system-zlib', so in
total I would need --with-system-zlib=no, but if I understand
correctly this is not supported by binutil/bfd.
Did I understand correctly?

oki,

Steffen
Reply | Threaded
Open this post in threaded view
|

Re: binutils prerequisites (recent zlib version - what else?)

Ian Lance Taylor-3
Steffen Dettmer <[hidden email]> writes:

> So for now the additional configure option `--with-zlib=no'
> should avoid (or workaround?) my issue.

By the way, this can also be written as --without-zlib.

> I assume that when zlib is installed, then at least some "recent"
> version must be installed, because there is no
> `--with-zlib=internal' or alike, is this correct?

Yes.

> I noticed that gcc has an option `--with-system-zlib', so in
> total I would need --with-system-zlib=no, but if I understand
> correctly this is not supported by binutil/bfd.
> Did I understand correctly?

Unrecognized --with options are ignored.  The difference in the options
is because for gcc, zlib is not optional when building libjava.  For the
binutils zlib is always optional.

Ian
Reply | Threaded
Open this post in threaded view
|

Re: binutils prerequisites (recent zlib version - what else?)

Steffen Dettmer-2
ohh silly me, sorry, I sent my reply to the wrong list :-(

I'm trying again:

>> I noticed that gcc has an option `--with-system-zlib', so in
>> total I would need --with-system-zlib=no, but if I understand
>> correctly this is not supported by binutil/bfd.
>> Did I understand correctly?
>
> Unrecognized --with options are ignored.

Yes, I know this from autoconf.

> The difference in the options
> is because for gcc, zlib is not optional when building libjava.  For the
> binutils zlib is always optional.

so gcc can be built against its own zlib which is included in gcc source
but binutils cannot?
I though it could be possible to force to use the own zlib, which seems
to be impossible.
anyway, I don't need Java ATM.

Thanks for your quick replies and help,

Steffen

---------- End of Forwarded message from ----------
From: Steffen Dettmer <[hidden email]>
Date: Tue, Apr 26, 2011 at 6:32 PM
Subject: Re: binutils prerequisites (recent zlib version - what else?)
To: Ian Lance Taylor <[hidden email]>
Cc: gcc-help <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: binutils prerequisites (recent zlib version - what else?)

H.J. Lu-30
On Tue, Apr 26, 2011 at 9:34 AM, Steffen Dettmer
<[hidden email]> wrote:

> ohh silly me, sorry, I sent my reply to the wrong list :-(
>
> I'm trying again:
>
>>> I noticed that gcc has an option `--with-system-zlib', so in
>>> total I would need --with-system-zlib=no, but if I understand
>>> correctly this is not supported by binutil/bfd.
>>> Did I understand correctly?
>>
>> Unrecognized --with options are ignored.
>
> Yes, I know this from autoconf.
>
>> The difference in the options
>> is because for gcc, zlib is not optional when building libjava.  For the
>> binutils zlib is always optional.
>
> so gcc can be built against its own zlib which is included in gcc source
> but binutils cannot?
> I though it could be possible to force to use the own zlib, which seems
> to be impossible.
> anyway, I don't need Java ATM.
>

See:

http://sourceware.org/ml/binutils/2010-10/msg00539.html

--
H.J.
Reply | Threaded
Open this post in threaded view
|

Re: binutils prerequisites (recent zlib version - what else?)

kevin diggs-2
In reply to this post by Ian Lance Taylor-3
Hi,

On Tue, Apr 26, 2011 at 11:26 AM, Ian Lance Taylor <[hidden email]> wrote:
>
> Unrecognized --with options are ignored.  The difference in the
>
> Ian
>
Why? Wouldn't it be better to tell the poor, confused user that they
are configuring up the wrong tree? So that we can go RTFM and get the
right option (or whine and complain if the desired functionality does
not exist)?

As always, Thanks!!!

kevin
Reply | Threaded
Open this post in threaded view
|

Re: binutils prerequisites (recent zlib version - what else?)

kevin diggs-2
Hi,

And thanks. I was wondering what zlib was used for. The jar usage
should have been obvious. Compressed debug stuff. Is that new? I tried
searching in the 4.3.2 gcc manual for compress and zlib. The only
thing that came up was -feliminate-dwarf2-dumps. What should I search
for?

kevin
Reply | Threaded
Open this post in threaded view
|

Re: binutils prerequisites (recent zlib version - what else?)

Ian Lance Taylor-3
In reply to this post by kevin diggs-2
kevin diggs <[hidden email]> writes:

> On Tue, Apr 26, 2011 at 11:26 AM, Ian Lance Taylor <[hidden email]> wrote:
>>
>> Unrecognized --with options are ignored.  The difference in the
>>
>> Ian
>>
> Why? Wouldn't it be better to tell the poor, confused user that they
> are configuring up the wrong tree? So that we can go RTFM and get the
> right option (or whine and complain if the desired functionality does
> not exist)?

It would be better in some cases, yes.  However, the gcc and binutils
trees are examples where there is a master configure script at the top
which invokes a range of sub-configure scripts below.  To make that
work, the master configure script needs to pass all --with and --enable
options to the sub-configure scripts.  If configure scripts reject
unrecognized options, then it would be necessary for every configure
script to recognize every option.  Since the sub-projects are maintained
by different groups of people, that is infeasible.

To avoid the problem there is, yes, an option: --enable-option-checking.
It's sort of pathetic to have an option for option checking, since most
people aren't going to be aware of it, but it's the best we have at the
moment.

Ian
Reply | Threaded
Open this post in threaded view
|

Re: binutils prerequisites (recent zlib version - what else?)

Ian Lance Taylor-3
In reply to this post by kevin diggs-2
kevin diggs <[hidden email]> writes:

> And thanks. I was wondering what zlib was used for. The jar usage
> should have been obvious. Compressed debug stuff. Is that new? I tried
> searching in the 4.3.2 gcc manual for compress and zlib. The only
> thing that came up was -feliminate-dwarf2-dumps. What should I search
> for?

Compressing debug information is done in the binutils, not in gcc.  See
the --compress-debug-sections option to gas and gold.

Ian
Reply | Threaded
Open this post in threaded view
|

Re: binutils prerequisites (recent zlib version - what else?)

Steffen Dettmer-2
In reply to this post by H.J. Lu-30
On Tue, Apr 26, 2011 at 7:04 PM, H.J. Lu <[hidden email]> wrote:
>> so gcc can be built against its own zlib which is included in gcc source
>> but binutils cannot?
>> I though it could be possible to force to use the own zlib, which seems
>> to be impossible.
>> anyway, I don't need Java ATM.
>
> See:
> http://sourceware.org/ml/binutils/2010-10/msg00539.html

If I understand correctly, this describes the solution for exactly
my confusion, right?
So the issue is that this change is not included in the version
I'm using (binutils-2.21), right?

Regards,
Steffen
Reply | Threaded
Open this post in threaded view
|

Re: binutils prerequisites (recent zlib version - what else?)

Steffen Dettmer-2
In reply to this post by Ian Lance Taylor-3
On Tue, Apr 26, 2011 at 8:18 PM, Ian Lance Taylor <[hidden email]> wrote:

> kevin diggs <[hidden email]> writes:
>
>> On Tue, Apr 26, 2011 at 11:26 AM, Ian Lance Taylor <[hidden email]> wrote:
>>>
>>> Unrecognized --with options are ignored.  The difference in the
>>>
>>> Ian
>>>
>> Why? Wouldn't it be better to tell the poor, confused user that they
>> are configuring up the wrong tree?

Here I think the binutils/bfd/configure should check for ../../zlib,
which will be there in "gcc combined build", and use it, shouldn't it?
but of course then zlib needs to be built first etc.

maybe configure --help should have some support for AC_CONFIG_SUBDIRS?

However, in this case it would still be missleading, because
binutils have --with-zlib (but no support for --with-system-zlib),
gcc has only (?) --with-system-zlib, so it seems to be let's say "incompatible"
a bit.

Steffen
Reply | Threaded
Open this post in threaded view
|

Re: binutils prerequisites (recent zlib version - what else?)

Steffen Dettmer-2
On Tue, Apr 26, 2011 at 8:39 PM, Steffen Dettmer
<[hidden email]> wrote:
> maybe configure --help should have some support for AC_CONFIG_SUBDIRS?

ps:
I just noticed that there is such support:
configure --help=recursive

Steffen
Reply | Threaded
Open this post in threaded view
|

Re: binutils prerequisites (recent zlib version - what else?)

Ralf Wildenhues
In reply to this post by Ian Lance Taylor-3
Hello,

* Ian Lance Taylor wrote on Tue, Apr 26, 2011 at 08:18:58PM CEST:

> kevin diggs <[hidden email]> writes:
> > Why? Wouldn't it be better to tell the poor, confused user that they
> > are configuring up the wrong tree? So that we can go RTFM and get the
> > right option (or whine and complain if the desired functionality does
> > not exist)?
>
> It would be better in some cases, yes.  However, the gcc and binutils
> trees are examples where there is a master configure script at the top
> which invokes a range of sub-configure scripts below.  To make that
> work, the master configure script needs to pass all --with and --enable
> options to the sub-configure scripts.  If configure scripts reject
> unrecognized options, then it would be necessary for every configure
> script to recognize every option.  Since the sub-projects are maintained
> by different groups of people, that is infeasible.
>
> To avoid the problem there is, yes, an option: --enable-option-checking.
> It's sort of pathetic to have an option for option checking, since most
> people aren't going to be aware of it, but it's the best we have at the
> moment.

The option checking option is enabled by default unless the configure
script uses AC_CONFIG_SUBDIRS or AC_DISABLE_OPTION_CHECKING.  Which is
arguably a simple yet often encountered setup (and the disabling is
done to avoid false warnings as you described).

So, at least patheticness is sort of limited.  ;-)

Cheers,
Ralf
Reply | Threaded
Open this post in threaded view
|

[PATCH] Correct zlib checks [Was: binutils prerequisites (recent zlib version - what else?)]

Maciej W. Rozycki
In reply to this post by Steffen Dettmer-2
On Wed, 20 Apr 2011, Steffen Dettmer wrote:

> I'm trying to build gcc-4.6.0 with binutils-2.21 in the same
> source directory which fails with
>
> cc1: warnings being treated as errors
> ../../../gcc-4.6.0/binutils/bfd/compress.c: In function
> `bfd_compress_section_contents':
> ../../../gcc-4.6.0/binutils/bfd/compress.c:100: warning: implicit
> declaration of function `compressBound'
> make[7]: *** [compress.lo] Error 1
>
> (I guess without -Werror it won't link).
> Google told that this is a zlib symbol and my zlib would be too
> old. Do I need more libraries and stuff?

 Hmm, old topic...

 It looks to me we should be checking for this symbol then, rather than
meaningless for us zlibVersion.  I have updated comments respectively,
particularly for objdump.c that still needs to link against -lz if libz is
a static archive.  Any comments about this patch?

 No change for gold/ required as it doesn't use BFD.  Not sure why
binutils/ and ld/ use their own checks instead of AM_ZLIB, but there you
go.

2011-08-04  Maciej W. Rozycki  <[hidden email]>

        config/
        * zlib.m4 (AM_ZLIB): Check for compressBound instead of
        zlibVersion.

2011-08-04  Maciej W. Rozycki  <[hidden email]>

        bfd/
        * configure: Regenerate.

2011-08-04  Maciej W. Rozycki  <[hidden email]>

        binutils/
        * configure.in: Check for compressBound instead of zlibVersion.
        * configure: Regenerate.

2011-08-04  Maciej W. Rozycki  <[hidden email]>

        gas/
        * configure: Regenerate.

2011-08-04  Maciej W. Rozycki  <[hidden email]>

        ld/
        * configure.in: Check for compressBound instead of zlibVersion.
        * configure: Regenerate.

  Maciej

binutils-zlib-check.patch
Index: bfd/configure
===================================================================
RCS file: /cvs/src/src/bfd/configure,v
retrieving revision 1.353
diff -u -p -r1.353 configure
--- bfd/configure 28 Jul 2011 22:35:13 -0000 1.353
+++ bfd/configure 4 Aug 2011 21:54:36 -0000
@@ -13743,9 +13743,10 @@ fi
 
 
   if test "$with_zlib" != "no"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing zlibVersion" >&5
-$as_echo_n "checking for library containing zlibVersion... " >&6; }
-if test "${ac_cv_search_zlibVersion+set}" = set; then :
+    # BFD needs compressBound that is not present in older versions of zlib.
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing compressBound" >&5
+$as_echo_n "checking for library containing compressBound... " >&6; }
+if test "${ac_cv_search_compressBound+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
@@ -13758,11 +13759,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_
 #ifdef __cplusplus
 extern "C"
 #endif
-char zlibVersion ();
+char compressBound ();
 int
 main ()
 {
-return zlibVersion ();
+return compressBound ();
   ;
   return 0;
 }
@@ -13775,25 +13776,25 @@ for ac_lib in '' z; do
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
   fi
   if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_zlibVersion=$ac_res
+  ac_cv_search_compressBound=$ac_res
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext
-  if test "${ac_cv_search_zlibVersion+set}" = set; then :
+  if test "${ac_cv_search_compressBound+set}" = set; then :
   break
 fi
 done
-if test "${ac_cv_search_zlibVersion+set}" = set; then :
+if test "${ac_cv_search_compressBound+set}" = set; then :
 
 else
-  ac_cv_search_zlibVersion=no
+  ac_cv_search_compressBound=no
 fi
 rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_zlibVersion" >&5
-$as_echo "$ac_cv_search_zlibVersion" >&6; }
-ac_res=$ac_cv_search_zlibVersion
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_compressBound" >&5
+$as_echo "$ac_cv_search_compressBound" >&6; }
+ac_res=$ac_cv_search_compressBound
 if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
   for ac_header in zlib.h
Index: binutils/configure
===================================================================
RCS file: /cvs/src/src/binutils/configure,v
retrieving revision 1.139
diff -u -p -r1.139 configure
--- binutils/configure 31 May 2011 08:54:47 -0000 1.139
+++ binutils/configure 4 Aug 2011 21:54:49 -0000
@@ -12970,11 +12970,12 @@ _ACEOF
 
 
 # Link in zlib if we can.  This allows us to read compressed debug
-# sections.  This is used only by readelf.c (objdump uses bfd for
-# reading compressed sections).
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing zlibVersion" >&5
-$as_echo_n "checking for library containing zlibVersion... " >&6; }
-if test "${ac_cv_search_zlibVersion+set}" = set; then :
+# sections.  This is used explicitly by readelf.c, and implicitly
+# by objdump.c which uses bfd (that requires compressBound) for
+# reading compressed sections.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing compressBound" >&5
+$as_echo_n "checking for library containing compressBound... " >&6; }
+if test "${ac_cv_search_compressBound+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
@@ -12987,11 +12988,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_
 #ifdef __cplusplus
 extern "C"
 #endif
-char zlibVersion ();
+char compressBound ();
 int
 main ()
 {
-return zlibVersion ();
+return compressBound ();
   ;
   return 0;
 }
@@ -13004,25 +13005,25 @@ for ac_lib in '' z; do
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
   fi
   if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_zlibVersion=$ac_res
+  ac_cv_search_compressBound=$ac_res
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext
-  if test "${ac_cv_search_zlibVersion+set}" = set; then :
+  if test "${ac_cv_search_compressBound+set}" = set; then :
   break
 fi
 done
-if test "${ac_cv_search_zlibVersion+set}" = set; then :
+if test "${ac_cv_search_compressBound+set}" = set; then :
 
 else
-  ac_cv_search_zlibVersion=no
+  ac_cv_search_compressBound=no
 fi
 rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_zlibVersion" >&5
-$as_echo "$ac_cv_search_zlibVersion" >&6; }
-ac_res=$ac_cv_search_zlibVersion
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_compressBound" >&5
+$as_echo "$ac_cv_search_compressBound" >&6; }
+ac_res=$ac_cv_search_compressBound
 if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
   for ac_header in zlib.h
Index: binutils/configure.in
===================================================================
RCS file: /cvs/src/src/binutils/configure.in,v
retrieving revision 1.103
diff -u -p -r1.103 configure.in
--- binutils/configure.in 31 May 2011 08:54:46 -0000 1.103
+++ binutils/configure.in 4 Aug 2011 21:54:49 -0000
@@ -141,9 +141,10 @@ AC_CHECK_DECLS([fprintf, stpcpy, strstr,
  snprintf, vsnprintf])
 
 # Link in zlib if we can.  This allows us to read compressed debug
-# sections.  This is used only by readelf.c (objdump uses bfd for
-# reading compressed sections).
-AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
+# sections.  This is used explicitly by readelf.c, and implicitly
+# by objdump.c which uses bfd (that requires compressBound) for
+# reading compressed sections.
+AC_SEARCH_LIBS(compressBound, z, [AC_CHECK_HEADERS(zlib.h)])
 
 BFD_BINARY_FOPEN
 
Index: config/zlib.m4
===================================================================
RCS file: /cvs/src/src/config/zlib.m4,v
retrieving revision 1.1
diff -u -p -r1.1 zlib.m4
--- config/zlib.m4 24 Nov 2009 22:35:29 -0000 1.1
+++ config/zlib.m4 4 Aug 2011 21:54:50 -0000
@@ -9,7 +9,8 @@ AC_DEFUN([AM_ZLIB],
     [], [with_zlib=auto])
 
   if test "$with_zlib" != "no"; then
-    AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
+    # BFD needs compressBound that is not present in older versions of zlib.
+    AC_SEARCH_LIBS(compressBound, z, [AC_CHECK_HEADERS(zlib.h)])
     if test "$with_zlib" = "yes" -a "$ac_cv_header_zlib_h" != "yes"; then
       AC_MSG_ERROR([zlib (libz) library was explicitly requested but not found])
     fi
Index: gas/configure
===================================================================
RCS file: /cvs/src/src/gas/configure,v
retrieving revision 1.262
diff -u -p -r1.262 configure
--- gas/configure 18 May 2011 09:41:14 -0000 1.262
+++ gas/configure 4 Aug 2011 21:55:06 -0000
@@ -13997,9 +13997,10 @@ fi
 
 
   if test "$with_zlib" != "no"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing zlibVersion" >&5
-$as_echo_n "checking for library containing zlibVersion... " >&6; }
-if test "${ac_cv_search_zlibVersion+set}" = set; then :
+    # BFD needs compressBound that is not present in older versions of zlib.
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing compressBound" >&5
+$as_echo_n "checking for library containing compressBound... " >&6; }
+if test "${ac_cv_search_compressBound+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
@@ -14012,11 +14013,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_
 #ifdef __cplusplus
 extern "C"
 #endif
-char zlibVersion ();
+char compressBound ();
 int
 main ()
 {
-return zlibVersion ();
+return compressBound ();
   ;
   return 0;
 }
@@ -14029,25 +14030,25 @@ for ac_lib in '' z; do
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
   fi
   if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_zlibVersion=$ac_res
+  ac_cv_search_compressBound=$ac_res
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext
-  if test "${ac_cv_search_zlibVersion+set}" = set; then :
+  if test "${ac_cv_search_compressBound+set}" = set; then :
   break
 fi
 done
-if test "${ac_cv_search_zlibVersion+set}" = set; then :
+if test "${ac_cv_search_compressBound+set}" = set; then :
 
 else
-  ac_cv_search_zlibVersion=no
+  ac_cv_search_compressBound=no
 fi
 rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_zlibVersion" >&5
-$as_echo "$ac_cv_search_zlibVersion" >&6; }
-ac_res=$ac_cv_search_zlibVersion
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_compressBound" >&5
+$as_echo "$ac_cv_search_compressBound" >&6; }
+ac_res=$ac_cv_search_compressBound
 if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
   for ac_header in zlib.h
Index: ld/configure
===================================================================
RCS file: /cvs/src/src/ld/configure,v
retrieving revision 1.114
diff -u -p -r1.114 configure
--- ld/configure 28 Mar 2011 10:27:07 -0000 1.114
+++ ld/configure 4 Aug 2011 21:55:31 -0000
@@ -16616,10 +16616,11 @@ _ACEOF
 
 
 # Link in zlib if we can.  This is needed only for the bootstrap tests
-# right now, since those tests use libbfd, which depends on zlib.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing zlibVersion" >&5
-$as_echo_n "checking for library containing zlibVersion... " >&6; }
-if test "${ac_cv_search_zlibVersion+set}" = set; then :
+# right now, since those tests use libbfd, which depends on zlib (and
+# requires compressBound).
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing compressBound" >&5
+$as_echo_n "checking for library containing compressBound... " >&6; }
+if test "${ac_cv_search_compressBound+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
@@ -16632,11 +16633,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_
 #ifdef __cplusplus
 extern "C"
 #endif
-char zlibVersion ();
+char compressBound ();
 int
 main ()
 {
-return zlibVersion ();
+return compressBound ();
   ;
   return 0;
 }
@@ -16649,25 +16650,25 @@ for ac_lib in '' z; do
     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
   fi
   if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_zlibVersion=$ac_res
+  ac_cv_search_compressBound=$ac_res
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext
-  if test "${ac_cv_search_zlibVersion+set}" = set; then :
+  if test "${ac_cv_search_compressBound+set}" = set; then :
   break
 fi
 done
-if test "${ac_cv_search_zlibVersion+set}" = set; then :
+if test "${ac_cv_search_compressBound+set}" = set; then :
 
 else
-  ac_cv_search_zlibVersion=no
+  ac_cv_search_compressBound=no
 fi
 rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_zlibVersion" >&5
-$as_echo "$ac_cv_search_zlibVersion" >&6; }
-ac_res=$ac_cv_search_zlibVersion
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_compressBound" >&5
+$as_echo "$ac_cv_search_compressBound" >&6; }
+ac_res=$ac_cv_search_compressBound
 if test "$ac_res" != no; then :
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
   for ac_header in zlib.h
Index: ld/configure.in
===================================================================
RCS file: /cvs/src/src/ld/configure.in,v
retrieving revision 1.69
diff -u -p -r1.69 configure.in
--- ld/configure.in 28 Mar 2011 10:27:07 -0000 1.69
+++ ld/configure.in 4 Aug 2011 21:55:31 -0000
@@ -216,8 +216,9 @@ BFD_BINARY_FOPEN
 AC_CHECK_DECLS([strstr, free, sbrk, getenv, environ])
 
 # Link in zlib if we can.  This is needed only for the bootstrap tests
-# right now, since those tests use libbfd, which depends on zlib.
-AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
+# right now, since those tests use libbfd, which depends on zlib (and
+# requires compressBound).
+AC_SEARCH_LIBS(compressBound, z, [AC_CHECK_HEADERS(zlib.h)])
 
 # When converting linker scripts into strings for use in emulation
 # files, use astring.sed if the compiler supports ANSI string
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Correct zlib checks [Was: binutils prerequisites (recent zlib version - what else?)]

Paolo Bonzini-2
On 08/05/2011 12:07 AM, Maciej W. Rozycki wrote:
> 2011-08-04  Maciej W. Rozycki<[hidden email]>
>
> config/
> * zlib.m4 (AM_ZLIB): Check for compressBound instead of
> zlibVersion.

Ok.

Paolo