veeam / veeamsnap

Veeam Agent for Linux kernel module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

compilation aborts with 2.6.34 kernel

sancelot opened this issue · comments

The module does not compile in the next distribution:

ubuntu 10.04
custom linux 2.6.34 kernel

make: Entering directory `/PACKAGES/XENOMAI/UBUNTU_LUCID/V2.4.10/V2.5.3/linux-2.6.34'
LD /var/lib/dkms/veeamsnap/3.0.0.865/build/built-in.o
CC [M] /var/lib/dkms/veeamsnap/3.0.0.865/build/log.o
CC [M] /var/lib/dkms/veeamsnap/3.0.0.865/build/mem_alloc.o
CC [M] /var/lib/dkms/veeamsnap/3.0.0.865/build/sparse_bitmap.o
/var/lib/dkms/veeamsnap/3.0.0.865/build/sparse_bitmap.c: In function ‘log_tr_format’:
/var/lib/dkms/veeamsnap/3.0.0.865/build/log_format.h:1: sorry, unimplemented: function ‘log_tr_format’ can never be inlined because it uses variable argument lists
make[1]: *** [/var/lib/dkms/veeamsnap/3.0.0.865/build/sparse_bitmap.o] Error 1
make: *** [module/var/lib/dkms/veeamsnap/3.0.0.865/build] Error 2

Thanks for the message.
I believe the problem is not with the kernel, but with the gcc version. Faced something similar to gcc 8.2.1.
Try to make the change in functions log_XX_format:

  • static inline void log_tr_format( const char* frm, ... )
    +static attribute((unused)) void log_tr_format(const char* frm, ...)
    This fix will be in nearest release.

I will wait for an answer with the result. Please also specify the GCC version.

gcc -v output :

Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) 

The provided suggestion has not worked :
gcc outputs :

Making all...
ccflags-y= -O2 -Wno-multichar
make -C /lib/modules/2.6.34-ipipe-uniproc256/build M=/usr/src/veeamsnap-3.0.0.865 modules
make[1]: Entering directory `/PACKAGES/XENOMAI/UBUNTU_LUCID/V2.4.10/V2.5.3/linux-2.6.34'
CC [M] /usr/src/veeamsnap-3.0.0.865/sparse_bitmap.o
In file included from /usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:7:
/usr/src/veeamsnap-3.0.0.865/log_format.h:1: error: expected declaration specifiers or ‘...’ before ‘(’ token
/usr/src/veeamsnap-3.0.0.865/log_format.h:1: warning: return type defaults to ‘int’
/usr/src/veeamsnap-3.0.0.865/log_format.h:1: warning: function declaration isn’t a prototype
/usr/src/veeamsnap-3.0.0.865/log_format.h: In function ‘attribute’:
/usr/src/veeamsnap-3.0.0.865/log_format.h:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/log_format.h:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/log_format.h:16: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:13: error: parameter ‘g_sparse_block_cache’ is initialized
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:16: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:28: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:38: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:54: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:66: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:82: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:92: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:98: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:128: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:150: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:212: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:222: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:245: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:312: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:320: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:347: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:358: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:369: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:375: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:391: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:401: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:408: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:432: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:443: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:460: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:488: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:496: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:457: error: declaration for parameter ‘_sparse_block_get_ranges’ but no such parameter
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:219: error: declaration for parameter ‘_sparse_block_set’ but no such parameter
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:125: error: declaration for parameter ‘_sparse_block_clear’ but no such parameter
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:13: error: declaration for parameter ‘g_sparse_block_cache’ but no such parameter
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c:507: error: expected ‘{’ at end of input
make[2]: *** [/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.o] Error 1
make[1]: *** [module/usr/src/veeamsnap-3.0.0.865] Error 2

So, I replaced attribute with __attribute__ (markdown issue ...) and had the next result :

root@SYS-UBUNTU-TF-HYBRID-V1:/usr/src/veeamsnap-3.0.0.865# make
Making all...
ccflags-y= -O2 -Wno-multichar
make -C /lib/modules/2.6.34-ipipe-uniproc256/build M=/usr/src/veeamsnap-3.0.0.865 modules
make[1]: Entering directory `/PACKAGES/XENOMAI/UBUNTU_LUCID/V2.4.10/V2.5.3/linux-2.6.34'
  CC [M]  /usr/src/veeamsnap-3.0.0.865/sparse_bitmap.o
/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.c: In function ‘log_tr_format’:
/usr/src/veeamsnap-3.0.0.865/log_format.h:1: sorry, unimplemented: function ‘log_tr_format’ can never be inlined because it uses variable argument lists
make[2]: *** [/usr/src/veeamsnap-3.0.0.865/sparse_bitmap.o] Error 1
make[1]: *** [_module_/usr/src/veeamsnap-3.0.0.865] Error 2
make[1]: Leaving directory `/PACKAGES/XENOMAI/UBUNTU_LUCID/V2.4.10/V2.5.3/linux-2.6.34'
make: *** [all] Error 2




I have managed to compile the module using this:

#if __GNUC__ == 4 && __GNUC_MINOR__ == 4
#define ATTRS  __attribute__((unused))
#else
#define ATTRS inline
#endif

static ATTRS  void  log_tr_format( const char* frm, ... )
{
    va_list args;
    va_start( args, frm );
    log_vformat( SECTION, LOGGING_LEVEL_TR, frm, args );
    va_end( args );
}


static ATTRS void  log_err_format( const char* frm, ... )
{
    va_list args;
    va_start( args, frm );
    log_vformat( SECTION, LOGGING_LEVEL_ERR, frm, args );
    va_end( args );
}
static ATTRS void  log_warn_format( const char* frm, ... )
{
    va_list args;
    va_start( args, frm );
    log_vformat( SECTION, LOGGING_LEVEL_WRN, frm, args );
    va_end( args );
}
commented

3.0.1-RTM ready!
fixed in 3.0.1.1046