Bug 922705

Summary: Grub spec file does not specify that it requires 32-bit glibc-static to be linked even if building x86_64
Product: Red Hat Enterprise Linux 6 Reporter: Jirka Tesar <jtesar>
Component: grubAssignee: Václav Pavlín <vpavlin>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 6.4CC: jcpunk, jrieden, mbanas, pbokoc, pholica, tru
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: grub-0.97-82.el6 Doc Type: Bug Fix
Doc Text:
Cause: Grub requires glibc-static during boot, but really uses 32bit glibc-static Consequence: Grub does not inform user that he needs glibc-static.i686, but fails with error without clear explanation. Fix: Depend directly on file /usr/lib/libc.a, which can be provided by different packages in different environments. Result: Grub now informs about missing file during build.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-21 20:47:30 UTC Type: Bug
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: 960054    
Attachments:
Description Flags
Require file /usr/lib/libc.a none

Description Jirka Tesar 2013-03-18 10:31:24 UTC
Description of problem:

When building 64-bit version of grub from source package it fails to link executable during configure phase, unless glibc-static.i686 is installed.

Version-Release number of selected component (if applicable):
grub-0.97-77.el6.src.rpm

How reproducible:

Build 64-bit grub package from source rpm

Steps to Reproduce:
1. Make sure that glibc-static.i686 is NOT installed
2. Download grub-0.97-77.el6.src.rpm
3. rpmbuild --rebuild grub-0.97-77.el6.src.rpm
  
Actual results:
Build fails to link 64-bit libc.a

Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
configure:3227: $? = 0
configure:3234: gcc -V >&5
gcc: '-V' option must have argument
configure:3238: $? = 1
configure:3261: checking for C compiler default output file name
configure:3283: gcc -m32 -Os -g -fno-strict-aliasing -Wall -Werror -Wno-shadow -Wno-unused -Wno-pointer-sign -static   conftest.c  >&5
/usr/bin/ld: skipping incompatible /usr/lib64/libc.a when searching for -lc
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status


Expected results:
If glibc-static.i686 is not installed, rpmbuild should end with dependency error:

error: Failed build dependencies:
	glibc-static.i686 is needed by grub-1:0.97-77.el6.x86_64


Additional info:

Comment 5 Václav Pavlín 2013-05-31 12:33:08 UTC
Created attachment 755248 [details]
Require file /usr/lib/libc.a

Requiring glibc-static.i686 is not possible, because this package is not provided when doing mock build (ie. building in brew). Files from 32bit glibc (and other packages) are provided by glibc32 package there, which, on the other hand, is not available in rhel repositories. 

The simplest and most straightforward solution is to add file /usr/lib/libc.a to BuildRequires. This file is provided by both glibc-static.i686 and glibc32 packages.

Comment 10 Pavel Holica 2013-10-09 10:30:20 UTC
Reproduced on RHEL6.4 x86_64 Client.
Verified fix on RHEL6.5-20131004.5 x86_64 Client.

buildrequires now contains /usr/lib/libc.a instead of glibc-static.
This file is provided only by glibc-static.i686 so it should be now easy to find proper package.

Comment 12 errata-xmlrpc 2013-11-21 20:47:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1649.html