Hello,

I'm working with Xen to develop new communication modules to improve data
transfer between xen domains. As I had a really old version of Xen
(installed in 2012 !!) and some functionnalities didn't work (sharing
already allocated pages with grant references), I reinstalled my entire
system (new linux, new xen). Therefore, I installed Ubuntu LTS 14.04 and
the xen hypervisor coming with its packages (xen 4.4). I had no problem to
create a virtual machine, but when I tried to compile the test program
which uses my modules, the battle began. Here is my compilation line :

gcc gntring3_read_async.c
/home/fremals/GVirtus9/modules/gntring/libgntring4.o -lxenctrl -o
ring3_read_async -lm -I /home/fremals/GVirtus9/modules/

libgntring4.o contains the code using libxenctrl : xc_interface_open,
xc_map_foreign_pages and xc_interface_close. With Xen 4.4, I had no problem
to compile libgntring.o, but when I tried to compile ring3_read_async, I
got the message error :
libgntring4.c:(.text+0x328): undefined reference to «
xc_interface_open(xentoollog_logger*, xentoollog_logger*, unsigned int) »
libgntring4.c:(.text+0x328): undefined reference to «
xc_map_foreign_pages(arg list) »
libgntring4.c:(.text+0x365): undefined reference to «
xc_interface_close(xc_interface_core*) »

I checked libxenctrl.so with nm and it was empty. However, libxenctrl.a had
all needed symbols. I tried again with the following command line :
gcc gntring3_read_async.c
/home/fremals/GVirtus9/modules/gntring/libgntring4.o
/usr/local/lib/libxenctrl.a -o ring3_read_async -lm -I
/home/fremals/GVirtus9/modules/
and the compilation fails with only two errors :
libgntring4.c:(.text+0x328): undefined reference to «
xc_interface_open(xentoollog_logger*, xentoollog_logger*, unsigned int) »
libgntring4.c:(.text+0x365): undefined reference to «
xc_interface_close(xc_interface_core*) »
It found the xc_map_foreign_pages ! But not the other two functions. I
thought that there could be a problem with libxenctrl, I therefore
downloaded the xen source code and tried to compile the code of this tool
but I had errors with xen headers (I didn't kept the errors).

At this point, I wanted to do things right and reinstall Xen from source
code, not with an ubuntu package. I removed Xen 4.4 and took Xen 4.5.1. As
I rapidly got an error with this code (I don't remind which one), I used
Xen 4.5 instead. Once I succesfully installed xen, I tried to run my
compilation again. This time with -lxenctrl. I had the same problem than
before :
libgntring4.c:(.text+0x328): undefined reference to «
xc_interface_open(xentoollog_logger*, xentoollog_logger*, unsigned int) »
libgntring4.c:(.text+0x365): undefined reference to «
xc_interface_close(xc_interface_core*) »

To check that previous steps were all right, I tried to recompile
libgntring4.o and it lead to new errors :
g++ -c -O3 -fPIC ../modules/gntring/libgntring4.c -o
../modules/gntring/libgntring4.o
In file included from /usr/local/include/xenctrl.h:50:0,
                 from ../modules/gntring/libgntring4.c:12:
/usr/local/include/xen/platform.h:156:31: error: field ‘set_time’ has
incomplete type
         struct xenpf_efi_time set_time;
                               ^
/usr/local/include/xen/platform.h:160:31: error: field ‘get_wakeup_time’
has incomplete type
         struct xenpf_efi_time get_wakeup_time;
                               ^
/usr/local/include/xen/platform.h:164:31: error: field ‘set_wakeup_time’
has incomplete type
         struct xenpf_efi_time set_wakeup_time;
                               ^
/usr/local/include/xen/platform.h:184:35: error: field ‘vendor_guid’ has
incomplete type
             struct xenpf_efi_guid vendor_guid;
                                   ^
make: *** [libgntring4.o] Erreur 1

I talked to some members of my team about the "unefined reference"
problems, but no one knows what's the problem. Can I ask if someone have an
idea of what's wrong here please ?

Best regards,

Sebastien Fremal
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to