dcavalca / rpms / qemu

Forked from rpms/qemu 11 months ago
Clone

Blame qemu-fix-broken-elf-coredump-build-on-ppc.patch

Mark McLoughlin 98d891
From 028b1596140ca9f0965808ed8cbd599659ded728 Mon Sep 17 00:00:00 2001
Mark McLoughlin 98d891
From: Mark McLoughlin <markmc@redhat.com>
Mark McLoughlin 98d891
Date: Mon, 29 Jun 2009 14:49:03 +0100
Mark McLoughlin 98d891
Subject: [PATCH] Fix broken ELF coredump build on ppc
Mark McLoughlin 98d891
Mark McLoughlin 98d891
kvm-87 build fails on ppc:
Mark McLoughlin 98d891
Mark McLoughlin 98d891
  https://koji.fedoraproject.org/koji/getfile?taskID=1441042&name=build.log
Mark McLoughlin 98d891
Mark McLoughlin 98d891
  gcc -I. -I.. -I/builddir/build/BUILD/qemu-kvm-devel-87/target-i386
Mark McLoughlin 98d891
  -I/builddir/build/BUILD/qemu-kvm-devel-87 -MMD -MT elfload.o -MP
Mark McLoughlin 98d891
  -DNEED_CPU_H -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
Mark McLoughlin 98d891
  -D__user= -I/builddir/build/BUILD/qemu-kvm-devel-87/tcg
Mark McLoughlin 98d891
  -I/builddir/build/BUILD/qemu-kvm-devel-87/tcg/ppc64
Mark McLoughlin 98d891
  -I/builddir/build/BUILD/qemu-kvm-devel-87/fpu
Mark McLoughlin 98d891
  -I/builddir/build/BUILD/qemu-kvm-devel-87/linux-user
Mark McLoughlin 98d891
  -I/builddir/build/BUILD/qemu-kvm-devel-87/linux-user/i386 -O2 -g -pipe
Mark McLoughlin 98d891
  -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
Mark McLoughlin 98d891
  --param=ssp-buffer-size=4 -m64 -mminimal-toc -g -fno-strict-aliasing
Mark McLoughlin 98d891
  -O2 -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes
Mark McLoughlin 98d891
  -Wstrict-prototypes -Wredundant-decls    -c -o elfload.o
Mark McLoughlin 98d891
  /builddir/build/BUILD/qemu-kvm-devel-87/linux-user/elfload.c
Mark McLoughlin 98d891
  /builddir/build/BUILD/qemu-kvm-devel-87/linux-user/elfload.c:214: error: conflicting types for 'elf_greg_t'
Mark McLoughlin 98d891
  /usr/include/asm/elf.h:123: note: previous declaration of 'elf_greg_t' was here
Mark McLoughlin 98d891
  /builddir/build/BUILD/qemu-kvm-devel-87/linux-user/elfload.c:220: error: conflicting types for 'elf_gregset_t'
Mark McLoughlin 98d891
  /usr/include/asm/elf.h:124: note: previous declaration of 'elf_gregset_t' was here
Mark McLoughlin 98d891
  In file included from /builddir/build/BUILD/qemu-kvm-devel-87/linux-user/elfload.c:697:
Mark McLoughlin 98d891
  ../elf.h:457:1: warning: "R_PPC_NUM" redefined
Mark McLoughlin 98d891
  In file included from /usr/include/asm/sigcontext.h:13,
Mark McLoughlin 98d891
                   from /usr/include/bits/sigcontext.h:28,
Mark McLoughlin 98d891
                   from /usr/include/signal.h:339,
Mark McLoughlin 98d891
                   from /builddir/build/BUILD/qemu-kvm-devel-87/linux-user/qemu.h:4,
Mark McLoughlin 98d891
                   from /builddir/build/BUILD/qemu-kvm-devel-87/linux-user/elfload.c:16:
Mark McLoughlin 98d891
  /usr/include/asm/elf.h:81:1: warning: this is the location of the previous definition
Mark McLoughlin 98d891
Mark McLoughlin 98d891
Code was introduced in kvm-87 by:
Mark McLoughlin 98d891
Mark McLoughlin 98d891
  9edc5d7966 linux-user: added x86 and x86_64 support for ELF coredump
Mark McLoughlin 98d891
  edf8e2af14 linux-user: implemented ELF coredump support for ARM target
Mark McLoughlin 98d891
Mark McLoughlin 98d891
It seems ppc kernel-headers is unusual in exposing elf_greg_t
Mark McLoughlin 98d891
definitions. Other arches seem to avoid doing that.
Mark McLoughlin 98d891
Mark McLoughlin 98d891
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Mark McLoughlin 98d891
---
Mark McLoughlin 98d891
 linux-user/elfload.c |    6 ++++++
Mark McLoughlin 98d891
 1 files changed, 6 insertions(+), 0 deletions(-)
Mark McLoughlin 98d891
Mark McLoughlin 98d891
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
Mark McLoughlin 98d891
index d31cca7..1b3fbe4 100644
Mark McLoughlin 98d891
--- a/linux-user/elfload.c
Mark McLoughlin 98d891
+++ b/linux-user/elfload.c
Mark McLoughlin 98d891
@@ -134,6 +134,7 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
Mark McLoughlin 98d891
     regs->rip = infop->entry;
Mark McLoughlin 98d891
 }
Mark McLoughlin 98d891
 
Mark McLoughlin 98d891
+#ifdef FIX_BROKEN_PPC_BUILD
Mark McLoughlin 98d891
 typedef target_ulong    elf_greg_t;
Mark McLoughlin 98d891
 typedef uint32_t        target_uid_t;
Mark McLoughlin 98d891
 typedef uint32_t        target_gid_t;
Mark McLoughlin 98d891
@@ -179,6 +180,7 @@ static void elf_core_copy_regs(elf_gregset_t *regs, const CPUState *env)
Mark McLoughlin 98d891
     (*regs)[25] = env->segs[R_FS].selector & 0xffff;
Mark McLoughlin 98d891
     (*regs)[26] = env->segs[R_GS].selector & 0xffff;
Mark McLoughlin 98d891
 }
Mark McLoughlin 98d891
+#endif /* FIX_BROKEN_PPC_BUILD */
Mark McLoughlin 98d891
 
Mark McLoughlin 98d891
 #else
Mark McLoughlin 98d891
 
Mark McLoughlin 98d891
@@ -211,6 +213,7 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
Mark McLoughlin 98d891
     regs->edx = 0;
Mark McLoughlin 98d891
 }
Mark McLoughlin 98d891
 
Mark McLoughlin 98d891
+#ifdef FIX_BROKEN_PPC_BUILD
Mark McLoughlin 98d891
 typedef target_ulong    elf_greg_t;
Mark McLoughlin 98d891
 typedef uint16_t        target_uid_t;
Mark McLoughlin 98d891
 typedef uint16_t        target_gid_t;
Mark McLoughlin 98d891
@@ -249,6 +252,7 @@ static void elf_core_copy_regs(elf_gregset_t *regs, const CPUState *env)
Mark McLoughlin 98d891
 #endif
Mark McLoughlin 98d891
 
Mark McLoughlin 98d891
 #define USE_ELF_CORE_DUMP
Mark McLoughlin 98d891
+#endif /* FIX_BROKEN_PPC_BUILD */
Mark McLoughlin 98d891
 #define ELF_EXEC_PAGESIZE	4096
Mark McLoughlin 98d891
 
Mark McLoughlin 98d891
 #endif
Mark McLoughlin 98d891
@@ -286,6 +290,7 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
Mark McLoughlin 98d891
     regs->ARM_r10 = infop->start_data;
Mark McLoughlin 98d891
 }
Mark McLoughlin 98d891
 
Mark McLoughlin 98d891
+#ifdef FIX_BROKEN_PPC_BUILD
Mark McLoughlin 98d891
 typedef uint32_t elf_greg_t;
Mark McLoughlin 98d891
 typedef uint16_t target_uid_t;
Mark McLoughlin 98d891
 typedef uint16_t target_gid_t;
Mark McLoughlin 98d891
@@ -318,6 +323,7 @@ static void elf_core_copy_regs(elf_gregset_t *regs, const CPUState *env)
Mark McLoughlin 98d891
 }
Mark McLoughlin 98d891
 
Mark McLoughlin 98d891
 #define USE_ELF_CORE_DUMP
Mark McLoughlin 98d891
+#endif /* FIX_BROKEN_PPC_BUILD */
Mark McLoughlin 98d891
 #define ELF_EXEC_PAGESIZE	4096
Mark McLoughlin 98d891
 
Mark McLoughlin 98d891
 enum
Mark McLoughlin 98d891
-- 
Mark McLoughlin 98d891
1.6.2.5
Mark McLoughlin 98d891