98d891 Work around broken linux-user build on ppc

Authored and Committed by Mark McLoughlin 15 years ago
    Work around broken linux-user build on ppc
    
        
qemu-fix-broken-elf-coredump-build-on-ppc.patch ADDED
@@ -0,0 +1,103 @@
1
+ From 028b1596140ca9f0965808ed8cbd599659ded728 Mon Sep 17 00:00:00 2001
2
+ From: Mark McLoughlin <markmc@redhat.com>
3
+ Date: Mon, 29 Jun 2009 14:49:03 +0100
4
+ Subject: [PATCH] Fix broken ELF coredump build on ppc
5
+
6
+ kvm-87 build fails on ppc:
7
+
8
+ https://koji.fedoraproject.org/koji/getfile?taskID=1441042&name=build.log
9
+
10
+ gcc -I. -I.. -I/builddir/build/BUILD/qemu-kvm-devel-87/target-i386
11
+ -I/builddir/build/BUILD/qemu-kvm-devel-87 -MMD -MT elfload.o -MP
12
+ -DNEED_CPU_H -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
13
+ -D__user= -I/builddir/build/BUILD/qemu-kvm-devel-87/tcg
14
+ -I/builddir/build/BUILD/qemu-kvm-devel-87/tcg/ppc64
15
+ -I/builddir/build/BUILD/qemu-kvm-devel-87/fpu
16
+ -I/builddir/build/BUILD/qemu-kvm-devel-87/linux-user
17
+ -I/builddir/build/BUILD/qemu-kvm-devel-87/linux-user/i386 -O2 -g -pipe
18
+ -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
19
+ --param=ssp-buffer-size=4 -m64 -mminimal-toc -g -fno-strict-aliasing
20
+ -O2 -Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes
21
+ -Wstrict-prototypes -Wredundant-decls -c -o elfload.o
22
+ /builddir/build/BUILD/qemu-kvm-devel-87/linux-user/elfload.c
23
+ /builddir/build/BUILD/qemu-kvm-devel-87/linux-user/elfload.c:214: error: conflicting types for 'elf_greg_t'
24
+ /usr/include/asm/elf.h:123: note: previous declaration of 'elf_greg_t' was here
25
+ /builddir/build/BUILD/qemu-kvm-devel-87/linux-user/elfload.c:220: error: conflicting types for 'elf_gregset_t'
26
+ /usr/include/asm/elf.h:124: note: previous declaration of 'elf_gregset_t' was here
27
+ In file included from /builddir/build/BUILD/qemu-kvm-devel-87/linux-user/elfload.c:697:
28
+ ../elf.h:457:1: warning: "R_PPC_NUM" redefined
29
+ In file included from /usr/include/asm/sigcontext.h:13,
30
+ from /usr/include/bits/sigcontext.h:28,
31
+ from /usr/include/signal.h:339,
32
+ from /builddir/build/BUILD/qemu-kvm-devel-87/linux-user/qemu.h:4,
33
+ from /builddir/build/BUILD/qemu-kvm-devel-87/linux-user/elfload.c:16:
34
+ /usr/include/asm/elf.h:81:1: warning: this is the location of the previous definition
35
+
36
+ Code was introduced in kvm-87 by:
37
+
38
+ 9edc5d7966 linux-user: added x86 and x86_64 support for ELF coredump
39
+ edf8e2af14 linux-user: implemented ELF coredump support for ARM target
40
+
41
+ It seems ppc kernel-headers is unusual in exposing elf_greg_t
42
+ definitions. Other arches seem to avoid doing that.
43
+
44
+ Signed-off-by: Mark McLoughlin <markmc@redhat.com>
45
+ ---
46
+ linux-user/elfload.c | 6 ++++++
47
+ 1 files changed, 6 insertions(+), 0 deletions(-)
48
+
49
+ diff --git a/linux-user/elfload.c b/linux-user/elfload.c
50
+ index d31cca7..1b3fbe4 100644
51
+ --- a/linux-user/elfload.c
52
+ +++ b/linux-user/elfload.c
53
+ @@ -134,6 +134,7 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
54
+ regs->rip = infop->entry;
55
+ }
56
+
57
+ +#ifdef FIX_BROKEN_PPC_BUILD
58
+ typedef target_ulong elf_greg_t;
59
+ typedef uint32_t target_uid_t;
60
+ typedef uint32_t target_gid_t;
61
+ @@ -179,6 +180,7 @@ static void elf_core_copy_regs(elf_gregset_t *regs, const CPUState *env)
62
+ (*regs)[25] = env->segs[R_FS].selector & 0xffff;
63
+ (*regs)[26] = env->segs[R_GS].selector & 0xffff;
64
+ }
65
+ +#endif /* FIX_BROKEN_PPC_BUILD */
66
+
67
+ #else
68
+
69
+ @@ -211,6 +213,7 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
70
+ regs->edx = 0;
71
+ }
72
+
73
+ +#ifdef FIX_BROKEN_PPC_BUILD
74
+ typedef target_ulong elf_greg_t;
75
+ typedef uint16_t target_uid_t;
76
+ typedef uint16_t target_gid_t;
77
+ @@ -249,6 +252,7 @@ static void elf_core_copy_regs(elf_gregset_t *regs, const CPUState *env)
78
+ #endif
79
+
80
+ #define USE_ELF_CORE_DUMP
81
+ +#endif /* FIX_BROKEN_PPC_BUILD */
82
+ #define ELF_EXEC_PAGESIZE 4096
83
+
84
+ #endif
85
+ @@ -286,6 +290,7 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i
86
+ regs->ARM_r10 = infop->start_data;
87
+ }
88
+
89
+ +#ifdef FIX_BROKEN_PPC_BUILD
90
+ typedef uint32_t elf_greg_t;
91
+ typedef uint16_t target_uid_t;
92
+ typedef uint16_t target_gid_t;
93
+ @@ -318,6 +323,7 @@ static void elf_core_copy_regs(elf_gregset_t *regs, const CPUState *env)
94
+ }
95
+
96
+ #define USE_ELF_CORE_DUMP
97
+ +#endif /* FIX_BROKEN_PPC_BUILD */
98
+ #define ELF_EXEC_PAGESIZE 4096
99
+
100
+ enum
101
+ --
102
+ 1.6.2.5
103
+
file modified
+6 -1
qemu.spec CHANGED
@@ -19,9 +19,12 @@ Source2: kvm.modules
19
19
# Not upstream, why?
20
20
Patch01: qemu-bios-bigger-roms.patch
21
21
22
- # Fixes ppc build, cherry-picked from upstream
22
+ # Fixes ppc-softmmu target build, cherry-picked from upstream
23
23
Patch02: qemu-fix-ppc-softmmu-kvm-disabled-build.patch
24
24
25
+ # Works around broken linux-user build on ppc
26
+ Patch03: qemu-fix-broken-elf-coredump-build-on-ppc.patch
27
+
25
28
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
26
29
BuildRequires: SDL-devel zlib-devel which texi2html gnutls-devel cyrus-sasl-devel
27
30
BuildRequires: rsync dev86 iasl
@@ -204,6 +207,7 @@ such as kvmtrace and kvm_stat.
204
207
205
208
%patch01 -p1
206
209
%patch02 -p1
210
+ %patch03 -p1
207
211
208
212
%build
209
213
# systems like rhel build system does not have a recent enough linker so
@@ -451,6 +455,7 @@ fi
451
455
- Update to kvm-87
452
456
- Drop upstreamed patches
453
457
- Cherry-pick new ppc build fix from upstream
458
+ - Work around broken linux-user build on ppc
454
459
- Re-enable preadv()/pwritev() since #497429 is long since fixed
455
460
456
461
* Fri Jun 5 2009 Mark McLoughlin <markmc@redhat.com> - 2:0.10.50-6.kvm86