Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 463101

Summary: Unable to link agains bfd_openr in configure script
Product: [Fedora] Fedora Reporter: Jochen Schmitt <jochen>
Component: binutilsAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: jakub, jan.kratochvil, masaki.chikama
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: binutils-2.18.50.0.9-3.fc10 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-09-22 00:18:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 454462    
Attachments:
Description Flags
Patch posted to <ksplice@mit.edu>. none

Description Jochen Schmitt 2008-09-21 19:08:25 UTC
When I try to build ksplice agains rawhide, I will got the following error messages in the configure script (config.log):

configure:3509: checking for bfd_openr in -lbfd
configure:3544: gcc -o conftest -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic   conftest.c -lbfd  -liberty  >&5
/usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../lib64/libbfd.a(compress.o): In function `bfd_uncompress_section_contents':
(.text+0x129): undefined reference to `inflateInit_'
/usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../lib64/libbfd.a(compress.o): In function `bfd_uncompress_section_contents':
(.text+0x15c): undefined reference to `inflate'
/usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../lib64/libbfd.a(compress.o): In function `bfd_uncompress_section_contents':
(.text+0x169): undefined reference to `inflateReset'
/usr/lib/gcc/x86_64-redhat-linux/4.3.2/../../../../lib64/libbfd.a(compress.o): In function `bfd_uncompress_section_contents':
(.text+0x194): undefined reference to `inflateEnd'
collect2: ld returned 1 exit status

For reproduce the issue please download http://www.herr-schmitt.de/pub/ksplice-0.9.0-1.fc9.src.rpm and try to build it agains rawhide. On F-9 its works fine.

Comment 1 Jan Kratochvil 2008-09-22 00:16:20 UTC
Created attachment 317332 [details]
Patch posted to <ksplice@mit.edu>.

Fix of ksplice to explicitely check zlib.

Comment 2 Jan Kratochvil 2008-09-22 00:18:14 UTC
Thanks for the report, this workaround should fix it up for any 3rd party packages:
* Sun Sep 21 2008 Jan Kratochvil <jan.kratochvil@redhat.com> 2.18.50.0.9-3
- Provide libbfd.so and libopcodes.so for automatic dependencies (BZ 463101).

/usr/lib64/libbfd.so:
/* GNU ld script
   The libz dependency is unexpected by legacy build scripts.  */

INPUT ( /usr/lib64/libbfd.a -liberty -lz )

Comment 3 Jakub Jelinek 2008-09-22 07:11:50 UTC
When you use absolute paths in the script, please also add OUTPUT_FORMAT
directive, like e.g. /usr/lib*/libc.so uses:
OUTPUT_FORMAT(elf64-x86-64)
etc., so that things work well even if you build gcc -m64 -L/usr/lib/ -lbfd
or gcc -m32 -L/usr/lib64/ -lbfd.

Comment 4 Jan Kratochvil 2008-09-22 10:45:42 UTC
Jakub, thanks, I did not read it all in glibc as I see, fixed/imported.

* Mon Sep 22 2008 Jan Kratochvil <jan.kratochvil@redhat.com> 2.18.50.0.9-4
- Fix *.so scripts for multilib linking (BZ 463101, suggested by Jakub Jelinek).

Comment 5 CHIKAMA Masaki 2008-10-30 03:55:02 UTC
(In reply to comment #2)
> Thanks for the report, this workaround should fix it up for any 3rd party
> packages:
> * Sun Sep 21 2008 Jan Kratochvil <jan.kratochvil@redhat.com> 2.18.50.0.9-3
> - Provide libbfd.so and libopcodes.so for automatic dependencies (BZ 463101).
> 
> /usr/lib64/libbfd.so:
> /* GNU ld script
>    The libz dependency is unexpected by legacy build scripts.  */
> 
> INPUT ( /usr/lib64/libbfd.a -liberty -lz )

This breaks package which has 
 BuildRequires:  binutils-devel
but doesn't have
 BuildRequires:  zlib-devel
even if it doesn't really need libz.

One example is avarice.
Should I file a new Bug as avarice package ?

Comment 6 Jan Kratochvil 2008-10-30 08:10:23 UTC
Committed, built binutils-2.18.50.0.9-6.fc10, thanks:
* Thu Oct 30 2008 Jan Kratochvil <jan.kratochvil@redhat.com> 2.18.50.0.9-6
- binutils-devel now requires zlib-devel (BZ 463101 comment 5).

%package devel
Requires: zlib-devel