linux/tools
Peter Xu 67a5c3104d KVM: selftests: Fix build for evmcs.h
[ Upstream commit 8ffdaf9155 ]

I got this error when building kvm selftests:

/usr/bin/ld: /home/xz/git/linux/tools/testing/selftests/kvm/libkvm.a(vmx.o):/home/xz/git/linux/tools/testing/selftests/kvm/include/evmcs.h:222: multiple definition of `current_evmcs'; /tmp/cco1G48P.o:/home/xz/git/linux/tools/testing/selftests/kvm/include/evmcs.h:222: first defined here
/usr/bin/ld: /home/xz/git/linux/tools/testing/selftests/kvm/libkvm.a(vmx.o):/home/xz/git/linux/tools/testing/selftests/kvm/include/evmcs.h:223: multiple definition of `current_vp_assist'; /tmp/cco1G48P.o:/home/xz/git/linux/tools/testing/selftests/kvm/include/evmcs.h:223: first defined here

I think it's because evmcs.h is included both in a test file and a lib file so
the structs have multiple declarations when linking.  After all it's not a good
habit to declare structs in the header files.

Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20200504220607.99627-1-peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-05-27 17:46:36 +02:00
..
accounting
arch tools headers UAPI: Sync copy of arm64's asm/unistd.h with the kernel sources 2020-05-10 10:31:33 +02:00
bpf
build
cgroup iocost: protect iocg->abs_vdebt with iocg->waitq.lock 2020-05-14 07:58:27 +02:00
debugging
firewire
firmware
gpio tools: gpio: Fix out-of-tree build regression 2020-04-17 10:50:17 +02:00
hv
iio
include
io_uring
kvm/kvm_stat
laptop
leds
lib libbpf: Extract and generalize CPU mask parsing logic 2020-05-20 08:20:40 +02:00
memory-model
nfsd
objtool objtool: Fix stack offset tracking for indirect CFAs 2020-05-14 07:58:29 +02:00
pci
pcmcia
perf perf report: Fix no branch type statistics report issue 2020-04-21 09:04:52 +02:00
power
scripts
spi
testing KVM: selftests: Fix build for evmcs.h 2020-05-27 17:46:36 +02:00
thermal/tmon
time
usb
virtio
vm tools/vm: fix cross-compile build 2020-04-29 16:33:15 +02:00
wmi
Makefile