aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitaly Kuznetsov <vkuznets@redhat.com>2020-06-17 17:21:24 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-06-22 13:22:01 -0400
commite743729c1861570e680a44facfdf1b96da416856 (patch)
tree11277ebb5a7a5a9e5b49b60ebb5e3b7faa199456
parent3d4f48f950c2b7ec4610548e1d7dc3cb3ef9c42d (diff)
downloadkvm-unit-tests-e743729c1861570e680a44facfdf1b96da416856.tar.gz
x86: fix build with GCC10
kvm-unit-tests fail to build with GCC10: /usr/bin/ld: lib/libcflat.a(usermode.o): ./kvm-unit-tests/lib/x86/usermode.c:17: multiple definition of `jmpbuf'; lib/libcflat.a(fault_test.o): ./kvm-unit-tests/lib/x86/fault_test.c:3: first defined here It seems that 'jmpbuf' doesn't need to be global in either of these files, make it static in both. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Message-Id: <20200617152124.402765-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--lib/x86/fault_test.c2
-rw-r--r--lib/x86/usermode.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/x86/fault_test.c b/lib/x86/fault_test.c
index 078dae3..e15a218 100644
--- a/lib/x86/fault_test.c
+++ b/lib/x86/fault_test.c
@@ -1,6 +1,6 @@
#include "fault_test.h"
-jmp_buf jmpbuf;
+static jmp_buf jmpbuf;
static void restore_exec_to_jmpbuf(void)
{
diff --git a/lib/x86/usermode.c b/lib/x86/usermode.c
index f01ad9b..f032523 100644
--- a/lib/x86/usermode.c
+++ b/lib/x86/usermode.c
@@ -14,7 +14,7 @@
#define USERMODE_STACK_SIZE 0x2000
#define RET_TO_KERNEL_IRQ 0x20
-jmp_buf jmpbuf;
+static jmp_buf jmpbuf;
static void restore_exec_to_jmpbuf(void)
{