Bug 6741 - Linker test is broken
Summary: Linker test is broken
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.19
: P3 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-12 18:21 UTC by H.J. Lu
Modified: 2008-07-12 21:48 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2008-07-12 18:21:41 UTC
As of Sat Jul 12 11:21:06 PDT 2008, linker is broken on
Linux/x86-64:

FAIL: bootstrap
FAIL: bootstrap with strip
FAIL: bootstrap with --static
FAIL: bootstrap with --traditional-format
FAIL: bootstrap with --no-keep-memory
FAIL: bootstrap with --relax
Comment 1 H.J. Lu 2008-07-12 18:25:57 UTC
On Fedora 9/x86-64, I got

../bfd/.libs/libbfd.a(compress.o): In function `bfd_uncompress_section_contents':
/export/gnu/src/binutils/src/bfd/compress.c:96: undefined reference to
`inflateInit_'
/export/gnu/src/binutils/src/bfd/compress.c:103: undefined reference to `inflate'
/export/gnu/src/binutils/src/bfd/compress.c:106: undefined reference to
`inflateReset'
/export/gnu/src/binutils/src/bfd/compress.c:108: undefined reference to `inflateEnd'
...
FAIL: bootstrap

Craig, could you please update ld testsuite? Thanks.
Comment 2 Craig 2008-07-12 20:55:21 UTC
Subject: Re:  Linker is broken

} Craig, could you please update ld testsuite? Thanks.

I'm looking into it but having trouble reproducing the exact problem
you're seeing (I think -- I'm no dejagnu expert).  Can you reproduce
the exact command you ran that got this effort, and the full output?

Thanks,
craig
Comment 3 Craig 2008-07-12 21:41:05 UTC
Subject:  PATCH COMMITTED: use libz for ld

The ld directory testsuite was failing because the boostrap tests
needed to use libbfd, and now need zlib to go along with that.  I
fixed the test by adding libz to the ld configure.in script, which is
similar to the solution used in the sims directory.

I committed this as an 'obvious' patch.  If that was the wrong thing
to do, please let me know.

craig

--cut here--

2008-07-12  Craig Silverstein  <csilvers@google.com>

	* configure.in: Check for, and include, libz.a if it is present.
	* configure: Regenerate.
	* config.in: Regenerate.

Index: configure.in
===================================================================
RCS file: /cvs/src/src/ld/configure.in,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- configure.in        21 May 2008 12:01:35 -0000      1.52
+++ configure.in        12 Jul 2008 21:36:53 -0000      1.53
@@ -148,6 +148,10 @@
 
 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)])
+
 # When converting linker scripts into strings for use in emulation
 # files, use astring.sed if the compiler supports ANSI string
 # concatenation, or ostring.sed otherwise.  This is to support the

Comment 4 Craig 2008-07-12 21:48:12 UTC
I've committed the following patch to configure.in to fix this problem:
---
Index: configure.in
===================================================================
RCS file: /cvs/src/src/ld/configure.in,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- configure.in        21 May 2008 12:01:35 -0000      1.52
+++ configure.in        12 Jul 2008 21:36:53 -0000      1.53
@@ -148,6 +148,10 @@

 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)])
+
 # When converting linker scripts into strings for use in emulation
 # files, use astring.sed if the compiler supports ANSI string
 # concatenation, or ostring.sed otherwise.  This is to support the