mini-os icon indicating copy to clipboard operation
mini-os copied to clipboard

Can't compile following LightVM instructions

Open hfingler opened this issue 6 years ago • 0 comments

Hi,

When compiling as the LightVM (http://sysml.neclab.eu/projects/lightvm/download/) readme says to, I get a few errors. This is from the noxs (master doesn't work either) branch, placed two levels below the xen folder so I don't have to modify XEN_ROOT in the Makefile. No modifications at all, just clone and make. This is in a new debian installation, x86_64.

In file included from /home/hfingler/lightvm/xen/mini-os/mini-os/include/rte_memcpy.h:43:0,                                                                                            
                 from netfront.c:23:                                                                                                                                                   
/usr/include/stdio.h:90:17: error: conflicting types for ‘off_t’                           
 typedef __off_t off_t;
                 ^~~~~
In file included from /home/hfingler/lightvm/xen/mini-os/mini-os/include/x86/os.h:20:0,
                 from netfront.c:8:
/home/hfingler/lightvm/xen/mini-os/mini-os/include/types.h:76:18: note: previous declaration of ‘off_t’ was here
 typedef uint64_t off_t;
                  ^~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/select.h:47:0,
                 from /usr/include/x86_64-linux-gnu/sys/types.h:219,
                 from /usr/include/stdlib.h:275,
                 from /usr/lib/gcc/x86_64-linux-gnu/6/include/mm_malloc.h:27,
                 from /usr/lib/gcc/x86_64-linux-gnu/6/include/xmmintrin.h:34,
                 from /usr/lib/gcc/x86_64-linux-gnu/6/include/x86intrin.h:33,
                 from /home/hfingler/lightvm/xen/mini-os/mini-os/include/rte_vect.h:67,
                 from /home/hfingler/lightvm/xen/mini-os/mini-os/include/rte_memcpy.h:46,
                 from netfront.c:23:
/usr/include/x86_64-linux-gnu/bits/time.h:30:8: error: redefinition of ‘struct timeval’
 struct timeval
        ^~~~~~~
In file included from /home/hfingler/lightvm/xen/mini-os/mini-os/include/time.h:49:0,
                 from netfront.c:16:
/home/hfingler/lightvm/xen/mini-os/mini-os/include/sys/time.h:35:8: note: originally defined here
 struct timeval {
        ^~~~~~~
In file included from netfront.c:8:0:
netfront.c: In function ‘netfront_get_responses’:
netfront.c:551:17: error: ‘struct netfront_dev’ has no member named ‘netif_rx_pbuf’; did you mean ‘netif_rx_arg’?
   if (likely(dev->netif_rx_pbuf && (!drop))) {
                 ^
netfront.c:553:4: error: ‘p’ undeclared (first use in this function)
    p->tot_len = realsize;

netfront.c:553:4: note: each undeclared identifier is reported only once for each functionit appears in
netfront.c:556:34: error: ‘struct net_rxbuffer’ has no member named ‘cpbuf’
    p->next = &dev->rx_buffers[id]->cpbuf.pbuf;
                                  ^~
netfront.c: In function ‘netfront_rx_handler’:
netfront.c:701:29: error: ‘struct netfront_dev’ has no member named ‘fd’
  int fd __maybe_unused = dev->fd;
                             ^~
minios.mk:74: recipe for target '/home/hfingler/lightvm/xen/mini-os/mini-os/netfront.o' failed
make: *** [/home/hfingler/lightvm/xen/mini-os/mini-os/netfront.o] Error 1

After fixing these errors by renaming types (off_t and struct timeval) by appending an underscore, putting netif_rx_pbuf under #ifdef HAVE_LWIP and removing unused variables (int fd __maybe_unused = dev->fd; and struct netfront_dev *dev = data;), I still get more errors:

/home/hfingler/lightvm/xen/mini-os/mini-os/include/rte_memcpy.h:625:2: error: ‘__builtin_ia32_palignr128’ needs isa option -m32 -mssse3
  MOVEUNALIGNED_LEFT47(dst, src, n, srcofs);

This gets repeated many times. Seems like arch/x86/arch.mk is not setting the right flags. In the hope of just making this work, adding the line below to the Makefile makes this error go away:

CFLAGS += -m32 -mssse3

But then I get:

gcc -DCONFIG_START_NETWORK -DCONFIG_SPARSE_BSS -DCONFIG_BLKFRONT -DCONFIG_NETFRONT -DCONFIG_KBDFRONT -DCONFIG_FBFRONT -DCONFIG_CONSFRONT -DCONFIG_XENBUS -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wno-redundant-decls -fno-stack-protector -fgnu89-inline -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline -g -DCONFIG_PVH -D__INSIDE_MINIOS__ -m64 -m32 -mssse3 -mno-red-zone -fno-reorder-blocks -fno-asynchronous-unwind-tables -isystem /home/hfingler/lightvm/xen/mini-os/2mini-os/include -D__MINIOS__ -D__XEN_INTERFACE_VERSION__=0x00030205  -isystem /home/hfingler/lightvm/xen/mini-os/2mini-os/include/x86 -isystem /home/hfingler/lightvm/xen/mini-os/2mini-os/include/x86/x86_64 -c blkfront.c -o /home/hfingler/lightvm/xen/mini-os/2mini-os/blkfront.o
In file included from /home/hfingler/lightvm/xen/mini-os/2mini-os/include/x86/os.h:21:0,
                 from blkfront.c:7:
/home/hfingler/lightvm/xen/mini-os/2mini-os/include/hypervisor.h:18:30: fatal error: hypercall-x86_32.h: No such file or directory
 #include <hypercall-x86_32.h>

And I can't seem to find where in the Makefile the directory include/mini-os/x86/x86_32/ is being included.

edit: found it and it is included in the include path wrongly, added the GCC command above the error. The directory -isystem /home/hfingler/lightvm/xen/mini-os/2mini-os/include/x86/x86_64 is included, but the file is adding the 32 bit one. Something is defining i386 when it shouldn't.

Am I doing something wrong?

Thank you.

hfingler avatar Nov 26 '18 22:11 hfingler