RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 848665 - qemu-kvm source code failed to compile after hack qemu-kvm.spec file
Summary: qemu-kvm source code failed to compile after hack qemu-kvm.spec file
Keywords:
Status: CLOSED DUPLICATE of bug 844627
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.4
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: rc
: ---
Assignee: Paolo Bonzini
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-16 07:30 UTC by juzhang
Modified: 2012-08-20 11:58 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-20 11:58:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description juzhang 2012-08-16 07:30:42 UTC
Description of problem:
download qemu-kvm-0.12.1.2-2.304.el6.src.rpm, hack qemu-kvm.spec file. qemu-kvm source code failed to compile 

#diff qemu-kvm.spec qemu-kvm.spec.bak
8177,8178c8177
< RPM_OPT_FLAGS="-fprofile-arcs -ftest-coverage -lgcov"
< extraldflags="-Wl,--build-id -fprofile-arcs -ftest-coverage -lgcov";
---
> extraldflags="-Wl,--build-id"; then 
#rpmbuild --bb /root/rpmbuild/SPECS/qemu-kvm.spec



Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.304.el6

How reproducible:
100%

Steps to Reproduce:
1.download qemu-kvm-0.12.1.2-2.304.el6.src.rpm
2.hack qemu-kvm.spec in order to do code coverage.
diff qemu-kvm.spec qemu-kvm.spec.bak
8177,8178c8177
< RPM_OPT_FLAGS="-fprofile-arcs -ftest-coverage -lgcov"
< extraldflags="-Wl,--build-id -fprofile-arcs -ftest-coverage -lgcov";
---
> extraldflags="-Wl,--build-id"; then 
#rpmbuild --bb /root/rpmbuild/SPECS/qemu-kvm.spec
3.compile the qemu-kvm
rpmbuild --bb /root/rpmbuild/SPECS/qemu-kvm.spec
  
Actual results:
make[1]: Leaving directory `/root/rpmbuild/BUILD/qemu-kvm-0.12.1.2/libhw64'
rm extboot.img vapic.o multiboot.o extboot.o linuxboot.raw linuxboot.img vapic.raw vapic.img multiboot.raw extboot.raw multiboot.img linuxboot.o
make[1]: Leaving directory `/root/rpmbuild/BUILD/qemu-kvm-0.12.1.2/pc-bios/optionrom'
error: Bad exit status from /var/tmp/rpm-tmp.860tjg (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.860tjg (%build)

#cat /var/tmp/rpm-tmp.860tjg
#!/bin/sh

  RPM_SOURCE_DIR="/root/rpmbuild/SOURCES"
  RPM_BUILD_DIR="/root/rpmbuild/BUILD"
  RPM_OPT_FLAGS="-O2 -g"
  RPM_ARCH="x86_64"
  RPM_OS="linux"
  export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS
  RPM_DOC_DIR="/usr/share/doc"
  export RPM_DOC_DIR
  RPM_PACKAGE_NAME="qemu-kvm"
  RPM_PACKAGE_VERSION="0.12.1.2"
  RPM_PACKAGE_RELEASE="2.304.el6"
  export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
  LANG=C
  export LANG
  unset CDPATH DISPLAY ||:
  RPM_BUILD_ROOT="/root/rpmbuild/BUILDROOT/qemu-kvm-0.12.1.2-2.304.el6.x86_64"
  export RPM_BUILD_ROOT
  
  PKG_CONFIG_PATH="/usr/lib64/pkgconfig:/usr/share/pkgconfig"
  export PKG_CONFIG_PATH
  
  set -x
  umask 022
  cd "/root/rpmbuild/BUILD"
cd 'qemu-kvm-0.12.1.2'
# --build-id option is used fedora 8 onwards for giving info to the debug packages.
RPM_OPT_FLAGS="-fprofile-arcs -ftest-coverage -lgcov"
extraldflags="-Wl,--build-id -fprofile-arcs -ftest-coverage -lgcov";
buildldflags="VL_LDFLAGS=-Wl,--build-id"



# sdl outputs to alsa or pulseaudio depending on system config, but it's broken (#495964)
# alsa works, but causes huge CPU load due to bugs
# oss works, but is very problematic because it grabs exclusive control of the device causing other apps to go haywire
./configure --target-list=x86_64-softmmu \
            --prefix=/usr \
            --sysconfdir=/etc \
            --cpuconfdir=/usr/share/qemu-kvm/cpu-model \
            --audio-drv-list=pa,alsa \
            --audio-card-list=ac97,es1370 \
            --disable-strip \
            --extra-ldflags="$extraldflags -pie -Wl,-z,relro -Wl,-z,now" \
            --extra-cflags="$RPM_OPT_FLAGS -fPIE -DPIE" \
            --disable-xen \
            --block-drv-whitelist=qcow2,raw,file,host_device,host_cdrom,qed \
            --disable-debug-tcg \
            --disable-sparse \
            --enable-werror \
            --disable-sdl \
            --disable-curses \
            --disable-curl \
            --disable-check-utests \
            --enable-vnc-tls \
            --enable-vnc-sasl \
            --disable-brlapi \
            --disable-bluez \
            --enable-docs \
            --disable-vde \
            --enable-linux-aio \
            --enable-kvm \
            --enable-spice \
            --enable-kvm-cap-pit \
            --enable-kvm-cap-device-assignment \
            --trace-backend=dtrace \
            --enable-smartcard \
            --disable-smartcard-nss \
            --enable-usb-redir \
             \
            --disable-rhev-features

echo "config-host.mak contents:"
echo "==="
cat config-host.mak
echo "==="


# generate the default config:
make x86_64-softmmu/config-devices.mak

# disable vmware_vga on the config:
sed -i -e '/CONFIG_VMWARE_VGA=y/d' x86_64-softmmu/config-devices.mak

make V=1 QEMU_PROG=qemu-kvm QEMU_BINDIR="/usr/libexec" \
     -j16 $buildldflags

Expected results:
qemu-kvm can be complied successfully

Additional info:
1.I tried qemu-kvm-0.12.1.2-2.265.src.rpm with the same steps and can be compiled successfully.
2. the configure command with lcov
#./configure' '--target-list=x86_64-softmmu' '--prefix=/usr' '--sysconfdir=/etc' '--cpuconfdir=/usr/share/qemu-kvm/cpu-model' '--audio-drv-list=pa,alsa' '--audio-card-list=ac97,es1370' '--disable-strip' '--extra-ldflags=-Wl,--build-id -fprofile-arcs -ftest-coverage -lgcov -pie -Wl,-z,relro -Wl,-z,now' '--extra-cflags=-fprofile-arcs -ftest-coverage -lgcov -fPIE -DPIE' '--disable-xen' '--block-drv-whitelist=qcow2,raw,file,host_device,host_cdrom,qed' '--disable-debug-tcg' '--disable-sparse' '--enable-werror' '--disable-sdl' '--disable-curses' '--disable-curl' '--disable-check-utests' '--enable-vnc-tls' '--enable-vnc-sasl' '--disable-brlapi' '--disable-bluez' '--enable-docs' '--disable-vde' '--enable-linux-aio' '--enable-kvm' '--enable-spice' '--enable-kvm-cap-pit' '--enable-kvm-cap-device-assignment' '--trace-backend=dtrace' '--enable-smartcard' '--disable-smartcard-nss' '--enable-usb-redir' '--disable-rhev-features

Comment 1 juzhang 2012-08-16 07:44:24 UTC
Update the error message
-g  -c -o console.o console.c
cc1: warnings being treated as errors
block/mirror.c: In function 'mirror_run':
block/mirror.c:89: error: 'ret' may be used uninitialized in this function
block/mirror.c:89: note: 'ret' was declared here
gcc -I/root/rpmbuild/BUILD/qemu-kvm-0.12.1.2/slirp -Werror -m64 -Wold-style-definition -Wold-style-declaration -I. -I/root/rpmbuild/BUILD/qemu-kvm-0.12.1.2 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fprofile-arcs -ftest-coverage -lgcov -fPIE -DPIE  -I/usr/include/spice-server -I/usr/include/pixman-1 -I/usr/include/spice-1     -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include    -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -MMD -MP -MT cursor.o -O2 -g  -c -o cursor.o cursor.c
make: *** [block/mirror.o] Error 1
make: *** Waiting for unfinished jobs....
+ exit 0

Comment 2 juzhang 2012-08-16 08:15:44 UTC
additional infos.
If remove --enable-werror from spec file, compile successful

Comment 3 Paolo Bonzini 2012-08-20 11:58:59 UTC
I think I looked at it in the past and it is a false positive.  It will be fixed by the patches for bug 844627, I'll close it as a dup.

*** This bug has been marked as a duplicate of bug 844627 ***


Note You need to log in before you can comment on or make changes to this bug.