cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-build-reenable-local-builds-to-pass-enable-debug-RHE.patch

9ae3a8
From 984faac66812652082fc9aa46eceb21669c1131b Mon Sep 17 00:00:00 2001
9ae3a8
From: Laszlo Ersek <lersek@redhat.com>
9ae3a8
Date: Tue, 10 Feb 2015 19:41:34 +0100
9ae3a8
Subject: [PATCH 11/16] build: reenable local builds to pass --enable-debug
9ae3a8
 (RHEL only)
9ae3a8
9ae3a8
Message-id: <1423597294-16022-2-git-send-email-lersek@redhat.com>
9ae3a8
Patchwork-id: 63788
9ae3a8
O-Subject: [RHEL-7.2 qemu-kvm PATCH 1/1] build: reenable local builds to pass --enable-debug (RHEL only)
9ae3a8
Bugzilla:
9ae3a8
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
9ae3a8
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
RH-Acked-by: Max Reitz <mreitz@redhat.com>
9ae3a8
9ae3a8
RHEL-7 commit f6852e27 dropped the "isa-ide" device, and observed:
9ae3a8
9ae3a8
  Unresolved extern symbols pose no real danger, because they fail safely
9ae3a8
  at link time.  Note for the curious: the optimizer gets rid of the
9ae3a8
  reference to isa_ide_init() in hw/i386/pc_piix.c.
9ae3a8
9ae3a8
For local builds it is sometimes useful to pass --enable-debug to the
9ae3a8
configure script. However that flag disables the optimizer, and the
9ae3a8
isa_ide_init() call is not eliminated during compilation; it reaches the
9ae3a8
linker. The linker then barfs
9ae3a8
9ae3a8
    LINK  x86_64-softmmu/qemu-system-x86_64
9ae3a8
  hw/i386/pc_piix.o: In function `pc_init1':
9ae3a8
  .../hw/i386/pc_piix.c:221: undefined reference to `isa_ide_init'
9ae3a8
  collect2: error: ld returned 1 exit status
9ae3a8
9ae3a8
Provide a stub implementation for isa_ide_init(), reenabling local debug
9ae3a8
builds.
9ae3a8
9ae3a8
No copyright notice is added to the top of the new file, following the
9ae3a8
pattern set by other stub files.
9ae3a8
9ae3a8
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
---
9ae3a8
 stubs/Makefile.objs |  1 +
9ae3a8
 stubs/ide-isa.c     | 12 ++++++++++++
9ae3a8
 2 files changed, 13 insertions(+)
9ae3a8
 create mode 100644 stubs/ide-isa.c
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 stubs/Makefile.objs |  1 +
9ae3a8
 stubs/ide-isa.c     | 12 ++++++++++++
9ae3a8
 2 files changed, 13 insertions(+)
9ae3a8
 create mode 100644 stubs/ide-isa.c
9ae3a8
9ae3a8
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
9ae3a8
index 4b2cb7d..590008e 100644
9ae3a8
--- a/stubs/Makefile.objs
9ae3a8
+++ b/stubs/Makefile.objs
9ae3a8
@@ -26,3 +26,4 @@ stub-obj-y += vm-stop.o
9ae3a8
 stub-obj-y += vmstate.o
9ae3a8
 stub-obj-$(CONFIG_WIN32) += fd-register.o
9ae3a8
 stub-obj-y += cpus.o
9ae3a8
+stub-obj-y += ide-isa.o
9ae3a8
diff --git a/stubs/ide-isa.c b/stubs/ide-isa.c
9ae3a8
new file mode 100644
9ae3a8
index 0000000..4074aff
9ae3a8
--- /dev/null
9ae3a8
+++ b/stubs/ide-isa.c
9ae3a8
@@ -0,0 +1,12 @@
9ae3a8
+#include <hw/ide.h>
9ae3a8
+#include <stdlib.h>
9ae3a8
+
9ae3a8
+ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int isairq,
9ae3a8
+                        DriveInfo *hd0, DriveInfo *hd1)
9ae3a8
+{
9ae3a8
+    /*
9ae3a8
+     * In theory the real isa_ide_init() function can return NULL, but no
9ae3a8
+     * caller actually checks for that. Make sure we go out with a clear bang.
9ae3a8
+     */
9ae3a8
+    abort();
9ae3a8
+}
9ae3a8
-- 
9ae3a8
1.8.3.1
9ae3a8