Project

General

Profile

Bug #350

batman-adv 2018.0 fails to build with Debian 3.16 kernel modifications (3.16.36-1)

Added by R J over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
03/10/2018
Due date:
% Done:

0%

Estimated time:

Description

I started installing batman_adv 2018.0 on our machines, and while that worked fine on one machine (Debian stretch) with kernel 4.9.0-6, it failed on another one (Debian jessie) with kernel 3.16.0-5. Here's the build log:

DKMS make.log for batman-adv-2018.0 for kernel 3.16.0-5-amd64 (x86_64)
Sat Mar 10 23:19:12 CET 2018
/var/lib/dkms/batman-adv/2018.0/build/gen-compat-autoconf.sh /var/lib/dkms/batman-adv/2018.0/build/compat-autoconf.h
mkdir -p /var/lib/dkms/batman-adv/2018.0/build/build/net/batman-adv/
compat-patches/replacements.sh
touch /var/lib/dkms/batman-adv/2018.0/build/build/net/batman-adv/.compat-prepared
make -C /lib/modules/3.16.0-5-amd64/build M=/var/lib/dkms/batman-adv/2018.0/build/build PWD=/var/lib/dkms/batman-adv/2018.0/build/build REVISION=2018.0 CONFIG_BATMAN_ADV=m CONFIG_BATMAN_ADV_DEBUG=n CONFIG_BATMAN_ADV_DEBUGFS=y CONFIG_BATMAN_ADV_BLA=y CONFIG_BATMAN_ADV_DAT=y CONFIG_BATMAN_ADV_NC=n CONFIG_BATMAN_ADV_MCAST=y CONFIG_BATMAN_ADV_BATMAN_V=n INSTALL_MOD_DIR=updates/    modules
make[1]: Entering directory '/usr/src/linux-headers-3.16.0-5-amd64'
make[1]: Entering directory `/usr/src/linux-headers-3.16.0-5-amd64'
  CC [M]  /var/lib/dkms/batman-adv/2018.0/build/build/net/batman-adv/../../../compat-sources/net/core/skbuff.o
In file included from /usr/src/linux-headers-3.16.0-5-common/include/uapi/linux/stddef.h:1:0,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/stddef.h:4,
                 from /usr/src/linux-headers-3.16.0-5-common/include/uapi/linux/posix_types.h:4,
                 from /usr/src/linux-headers-3.16.0-5-common/include/uapi/linux/types.h:13,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/types.h:5,
                 from /var/lib/dkms/batman-adv/2018.0/build/build/../compat-include/linux/types.h:26,
                 from /usr/src/linux-headers-3.16.0-5-common/include/uapi/linux/in6.h:24,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/in6.h:23,
                 from /var/lib/dkms/batman-adv/2018.0/build/build/net/batman-adv/../../../compat-sources/net/core/skbuff.c:36:
/var/lib/dkms/batman-adv/2018.0/build/build/../compat-include/linux/compiler.h:29:0: warning: "READ_ONCE" redefined [enabled by default]
 #define READ_ONCE(x) ACCESS_ONCE(x)
 ^
In file included from /var/lib/dkms/batman-adv/2018.0/build/build/../compat-include/linux/compiler.h:25:0,
                 from /usr/src/linux-headers-3.16.0-5-common/include/uapi/linux/stddef.h:1,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/stddef.h:4,
                 from /usr/src/linux-headers-3.16.0-5-common/include/uapi/linux/posix_types.h:4,
                 from /usr/src/linux-headers-3.16.0-5-common/include/uapi/linux/types.h:13,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/types.h:5,
                 from /var/lib/dkms/batman-adv/2018.0/build/build/../compat-include/linux/types.h:26,
                 from /usr/src/linux-headers-3.16.0-5-common/include/uapi/linux/in6.h:24,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/in6.h:23,
                 from /var/lib/dkms/batman-adv/2018.0/build/build/net/batman-adv/../../../compat-sources/net/core/skbuff.c:36:
/usr/src/linux-headers-3.16.0-5-common/include/linux/compiler.h:257:0: note: this is the location of the previous definition
 #define READ_ONCE(x) \
 ^
In file included from /usr/src/linux-headers-3.16.0-5-common/include/uapi/linux/stddef.h:1:0,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/stddef.h:4,
                 from /usr/src/linux-headers-3.16.0-5-common/include/uapi/linux/posix_types.h:4,
                 from /usr/src/linux-headers-3.16.0-5-common/include/uapi/linux/types.h:13,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/types.h:5,
                 from /var/lib/dkms/batman-adv/2018.0/build/build/../compat-include/linux/types.h:26,
                 from /usr/src/linux-headers-3.16.0-5-common/include/uapi/linux/in6.h:24,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/in6.h:23,
                 from /var/lib/dkms/batman-adv/2018.0/build/build/net/batman-adv/../../../compat-sources/net/core/skbuff.c:36:
/var/lib/dkms/batman-adv/2018.0/build/build/../compat-include/linux/compiler.h:31:0: warning: "WRITE_ONCE" redefined [enabled by default]
 #define WRITE_ONCE(x, val) ({ \
 ^
In file included from /var/lib/dkms/batman-adv/2018.0/build/build/../compat-include/linux/compiler.h:25:0,
                 from /usr/src/linux-headers-3.16.0-5-common/include/uapi/linux/stddef.h:1,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/stddef.h:4,
                 from /usr/src/linux-headers-3.16.0-5-common/include/uapi/linux/posix_types.h:4,
                 from /usr/src/linux-headers-3.16.0-5-common/include/uapi/linux/types.h:13,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/types.h:5,
                 from /var/lib/dkms/batman-adv/2018.0/build/build/../compat-include/linux/types.h:26,
                 from /usr/src/linux-headers-3.16.0-5-common/include/uapi/linux/in6.h:24,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/in6.h:23,
                 from /var/lib/dkms/batman-adv/2018.0/build/build/net/batman-adv/../../../compat-sources/net/core/skbuff.c:36:
/usr/src/linux-headers-3.16.0-5-common/include/linux/compiler.h:260:0: note: this is the location of the previous definition
 #define WRITE_ONCE(x, val) \
 ^
In file included from /usr/src/linux-headers-3.16.0-5-common/include/linux/spinlock.h:87:0,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/mm_types.h:8,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/kmemcheck.h:4,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/skbuff.h:18,
                 from /var/lib/dkms/batman-adv/2018.0/build/build/../compat-include/linux/skbuff.h:26,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/icmpv6.h:4,
                 from /usr/src/linux-headers-3.16.0-5-common/include/linux/ipv6.h:62,
                 from /var/lib/dkms/batman-adv/2018.0/build/build/net/batman-adv/../../../compat-sources/net/core/skbuff.c:37:
/usr/src/linux-headers-3.16.0-5-common/arch/x86/include/asm/spinlock.h: In function 'arch_spin_trylock':
/usr/src/linux-headers-3.16.0-5-common/arch/x86/include/asm/spinlock.h:108:2: error: invalid initializer
  old.tickets = READ_ONCE(lock->tickets);
  ^
/usr/src/linux-headers-3.16.0-5-common/arch/x86/include/asm/spinlock.h: In function 'arch_spin_is_locked':
/usr/src/linux-headers-3.16.0-5-common/arch/x86/include/asm/spinlock.h:165:9: error: invalid initializer
  struct __raw_tickets tmp = READ_ONCE(lock->tickets);
         ^
/usr/src/linux-headers-3.16.0-5-common/arch/x86/include/asm/spinlock.h:165:9: error: (near initialization for 'tmp')
/usr/src/linux-headers-3.16.0-5-common/arch/x86/include/asm/spinlock.h: In function 'arch_spin_is_contended':
/usr/src/linux-headers-3.16.0-5-common/arch/x86/include/asm/spinlock.h:172:9: error: invalid initializer
  struct __raw_tickets tmp = READ_ONCE(lock->tickets);
         ^
/usr/src/linux-headers-3.16.0-5-common/arch/x86/include/asm/spinlock.h:172:9: error: (near initialization for 'tmp')
/usr/src/linux-headers-3.16.0-5-common/scripts/Makefile.build:262: recipe for target '/var/lib/dkms/batman-adv/2018.0/build/build/net/batman-adv/../../../compat-sources/net/core/skbuff.o' failed
make[5]: *** [/var/lib/dkms/batman-adv/2018.0/build/build/net/batman-adv/../../../compat-sources/net/core/skbuff.o] Error 1
/usr/src/linux-headers-3.16.0-5-common/scripts/Makefile.build:409: recipe for target '/var/lib/dkms/batman-adv/2018.0/build/build/net/batman-adv' failed
make[4]: *** [/var/lib/dkms/batman-adv/2018.0/build/build/net/batman-adv] Error 2
/usr/src/linux-headers-3.16.0-5-common/Makefile:1355: recipe for target '_module_/var/lib/dkms/batman-adv/2018.0/build/build' failed
make[3]: *** [_module_/var/lib/dkms/batman-adv/2018.0/build/build] Error 2
Makefile:181: recipe for target 'sub-make' failed
make[2]: *** [sub-make] Error 2
Makefile:8: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-3.16.0-5-amd64'
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2

History

#1

Updated by Sven Eckelmann over 3 years ago

It seems like this special downstream kernel is using API changing patches which are not part of the official kernel tree. The latest released version from kernel.org is 3.16.55 and doesn't have these macro definitions:

$ git grep -e READ_ONCE -e WRITE_ONCE  v3.16.55 -- include/linux/compiler.h|tee

$ git grep -e READ_ONCE -e WRITE_ONCE  v3.19 -- include/linux/compiler.h|tee
v3.19:include/linux/compiler.h: * READ_ONCE, WRITE_ONCE and ACCESS_ONCE (see below), but only when the
v3.19:include/linux/compiler.h: * compiler aware of ordering is to put the two invocations of READ_ONCE,
v3.19:include/linux/compiler.h: * WRITE_ONCE or ACCESS_ONCE() in different C statements.
v3.19:include/linux/compiler.h: * READ_ONCE() and WRITE_ONCE()  will fall back to memcpy and print a
v3.19:include/linux/compiler.h:#define READ_ONCE(x) \
v3.19:include/linux/compiler.h:#define WRITE_ONCE(x, val) \

You have to thank the person who modified the API in the downstream kernel. But maybe I will check later what we can do to help you with your problem.

#2

Updated by Sven Eckelmann over 3 years ago

  • Subject changed from batman_adv 2018.0 fails to build with 3.16 kernel to batman-adv 2018.0 fails to build with Debian 3.16 kernel modifications (3.16.36-1)
#3

Updated by Sven Eckelmann over 3 years ago

  • Target version set to 2018.1
  • Assignee changed from batman-adv developers to R J
  • Status changed from New to Feedback
#4

Updated by R J over 3 years ago

With that patch applied, the module compiles successfully.

Thanks a lot for the quick fix. :)

#5

Updated by Sven Eckelmann over 3 years ago

  • Assignee changed from R J to Sven Eckelmann
  • Status changed from Feedback to Resolved

Thanks for the test. The patch is now applied in the maint branch

#6

Updated by Sven Eckelmann over 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF