Link kvm with Xed library: Unknown symbol error
Hi,
I'm a student working on a monitoring application on top of KVM in which I need to disassemble some VM instructions from the hypervisor level. To do so (disassemble instructions), I want to use Xed library from the code I added to KVM.
The problem is that Xed library comes with header files and a static library file. When I compile kvm-kmod with Xed (with some changes in the Kbuild file to include Xed).
I get the following input:
compilation OK with some warnings:
WARNING: "xed_encode_order_limit" [/home/yacine/vmi/kvm-kmod/x86/kvm-intel] is COMMON symbol
.... // omitted
WARNING: "xed_chip_features2" [/home/yacine/vmi/kvm-kmod/x86/kvm-intel] is COMMON symbol
WARNING: "stderr" [/home/yacine/vmi/kvm-kmod/x86/kvm-intel.ko] undefined!
WARNING: "fprintf" [/home/yacine/vmi/kvm-kmod/x86/kvm-intel.ko] undefined!
WARNING: "abort" [/home/yacine/vmi/kvm-kmod/x86/kvm-intel.ko] undefined!
WARNING: "__umoddi3" [/home/yacine/vmi/kvm-kmod/x86/kvm-intel.ko] undefined!
insmod: error inserting 'kvm-intel.ko': -1 Invalid module format
when running dmesg:
[17591.101368] kvm_intel: please compile with -fno-common ... // omitted [17591.101527] kvm_intel: Unknown symbol __umoddi3 (err 0) [17591.101553] kvm_intel: Unknown symbol abort (err 0) ... // omitted [17591.101763] kvm_intel: please compile with -fno-common
If anyone has an idea how to solve this, I would be very grateful :)