Skip to contentSkip to conversation

x86: avoid multiply defined symbol

PATCH In review Paolo Bonzini 2 participants 3 messages May 11, 2020 – May 12, 2020 KVM

lore
Share & tools
lore

Paolo Bonzini

author maintainer
#0 lore raw

PATCH 1/1 x86: avoid multiply defined symbol

Fedora 32 croaks about a symbol that is defined twice, fix it.

---
 lib/x86/fault_test.c |  2 +-
 lib/x86/usermode.c   |  2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
lib/x86/fault_test.c +1 -1
index 078dae3..e15a218 100644
@@ -1,6 +1,6 @@
 #include "fault_test.h"
 
-jmp_buf jmpbuf;
+static jmp_buf jmpbuf;
 
 static void restore_exec_to_jmpbuf(void)
 {
lib/x86/usermode.c +1 -1
index f01ad9b..f032523 100644
@@ -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)
 {
Signature · 1 line
2.25.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 26 lines · Paolo Bonzini

Fedora 32 croaks about a symbol that is defined twice, fix it.

---
 lib/x86/fault_test.c |  2 +-
 lib/x86/usermode.c   |  2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
lib/x86/fault_test.c +1 -1
index 078dae3..e15a218 100644
@@ -1,6 +1,6 @@
 #include "fault_test.h"
 
-jmp_buf jmpbuf;
+static jmp_buf jmpbuf;
 
 static void restore_exec_to_jmpbuf(void)
 {
lib/x86/usermode.c +0 -0
index f01ad9b..f032523 100644

lib/x86/usermode.c line 17

Quoted 5 lines
lib/x86/usermode.c +1 -1
@@ -14,7 +14,7 @@
 #define USERMODE_STACK_SIZE	0x2000
 #define RET_TO_KERNEL_IRQ	0x20
 
-jmp_buf jmpbuf;
+static jmp_buf jmpbuf;

Seems like GCC v10 defaults to -fno-common now? Maybe we should add this to the CFLAGS of the kvm-unit-tests, so that we get the same behavior with all versions of the compiler?

Thomas

author maintainer
#2 lore raw
Quoted 3 lines · Thomas Huth

Seems like GCC v10 defaults to -fno-common now? Maybe we should add this to the CFLAGS of the kvm-unit-tests, so that we get the same behavior with all versions of the compiler?

Yes, good idea.

Paolo