Bug 482765

Summary: patch to fix epel compilation
Product: [Fedora] Fedora Reporter: Levente Farkas <lfarkas>
Component: qemuAssignee: David Woodhouse <dwmw2>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: dwmw2, gcosta, markmc, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-12 17:41:45 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Levente Farkas 2009-01-27 18:41:04 EST
hi,
please apply this patch to be able to build on epel too (the same tricjk used in kvm spec file):
------------------------------------------------------
--- qemu.spec	(revision 849)
+++ qemu.spec	(working copy)
@@ -65,6 +65,22 @@
 %patch8 -p1
 
 %build
+# systems like rhel build system does not have a recent enough linker so 
+# --build-id works. this option is used fedora 8 onwards for giving info
+# to the debug packages.
+
+build_id_available() {
+	echo "int main () { return 0; }" | gcc -x c -Wl,--build-id - 2>/dev/null
+}
+
+if build_id_available; then
+	extraldflags="--extra-ldflags=-Wl,--build-id";
+	buildldflags="VL_LDFLAGS=-Wl,--build-id"
+else
+	extraldflags="";
+	buildldflags=""
+fi
+
 # FIXME: add --extra-cflags="$RPM_OPT_FLAGS" when we drop gcc34
 ./configure \
     --prefix=%{_prefix} \
@@ -79,8 +95,8 @@
 %ifarch sparc64
     --sparc_cpu=v9 \
 %endif
-    --extra-ldflags="-Wl,--build-id"
-make %{?_smp_mflags} VL_LDFLAGS="-Wl,--build-id"
+    $extraldflags
+make %{?_smp_mflags} $buildldflags
 
 %install
 rm -rf $RPM_BUILD_ROOT
------------------------------------------------------
Comment 1 Glauber Costa 2009-02-04 10:34:47 EST
This makes sense, and kvm already has something like this.

However, we're in process of heavily changing qemu's spec file now (check fedora-virt list archives for more information), so this patch won't be directly necessary.
Comment 2 Levente Farkas 2009-02-18 16:20:22 EST
*** Bug 465277 has been marked as a duplicate of this bug. ***