From 7f3a22af4c328b9ff8d75b6ad852ebda6801dbe37a7c57e9c06538c2e760f7cc Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 29 May 2012 15:35:15 +0000 Subject: [PATCH] - add patch to fix building of go (swi in thumb ignores imm) OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=72 --- ...-linux-user-ARM-Ignore-immediate-val.patch | 30 +++++++++++++++++++ qemu.changes | 5 ++++ qemu.spec | 2 ++ 3 files changed, 37 insertions(+) create mode 100644 0019-linux-user-ARM-Ignore-immediate-val.patch diff --git a/0019-linux-user-ARM-Ignore-immediate-val.patch b/0019-linux-user-ARM-Ignore-immediate-val.patch new file mode 100644 index 00000000..b860b26b --- /dev/null +++ b/0019-linux-user-ARM-Ignore-immediate-val.patch @@ -0,0 +1,30 @@ +From af0dbc540b4acc54ec9f4d1064402f75edb5a7ca Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Tue, 29 May 2012 17:28:07 +0200 +Subject: [PATCH] linux-user: ARM: Ignore immediate value for svc in thumb mode + +When running in thumb mode, Linux doesn't evaluate the immediate value +of the svc instruction, but instead just always assumes the syscall number +to be in r7. + +This fixes executing go_bootstrap while building go for me. + +Signed-off-by: Alexander Graf +--- + linux-user/main.c | 3 +-- + 1 files changed, 1 insertions(+), 2 deletions(-) + +diff --git a/linux-user/main.c b/linux-user/main.c +index 503ecfa..ed48276 100644 +--- a/linux-user/main.c ++++ b/linux-user/main.c +@@ -823,8 +823,7 @@ void cpu_loop(CPUARMState *env) + } else if (n == ARM_NR_semihosting + || n == ARM_NR_thumb_semihosting) { + env->regs[0] = do_arm_semihosting (env); +- } else if (n == 0 || n >= ARM_SYSCALL_BASE +- || (env->thumb && n == ARM_THUMB_SYSCALL)) { ++ } else if (n == 0 || n >= ARM_SYSCALL_BASE || env->thumb) { + /* linux syscall */ + if (env->thumb || n == 0) { + n = env->regs[7]; diff --git a/qemu.changes b/qemu.changes index 8804a23e..652a4b37 100644 --- a/qemu.changes +++ b/qemu.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue May 29 15:34:55 UTC 2012 - agraf@suse.com + +- add patch to fix building of go (swi in thumb ignores imm) + ------------------------------------------------------------------- Tue May 22 16:39:24 UTC 2012 - afaerber@suse.de diff --git a/qemu.spec b/qemu.spec index fdb248ce..13008963 100644 --- a/qemu.spec +++ b/qemu.spec @@ -42,6 +42,7 @@ Patch0015: 0015-linux-user-be-silent-about-capget-f.patch Patch0016: 0016-PPC-KVM-Disable-mmu-notifier-check..patch Patch0017: 0017-linux-user-fix-segfault-deadlock.pa.patch Patch0018: 0018-linux-user-binfmt-support-host-bina.patch +Patch0019: 0019-linux-user-ARM-Ignore-immediate-val.patch # this is to make lint happy Source300: rpmlintrc Source400: update_git.sh @@ -130,6 +131,7 @@ run cross architectures builds %patch0016 -p1 %patch0017 -p1 %patch0018 -p1 +%patch0019 -p1 %build # build QEMU