compat-patches/0002-genl-const.cocci fails with a 4.8-rc7 kernel
I'm getting the following error when trying to compile the current batman-adv master branch for a 4.8-rc7 kernel:
EXTRA_CFLAGS="-Werror -D__CHECK_ENDIAN__ -DDEBUG -g -O0" /usr/bin/make CONFIG_BATMAN_ADV_DEBUG=y CHECK="sparse -Wsparse-all -Wno-ptr-subtraction-blows -Werror -D__CHECK_ENDIAN__ -DDEBUG" CC=cgcc KERNELPATH=/home/tux/mesh-node/usr/src/linux-headers-4.8.0-rc7+ CONFIG_BATMAN_ADV_BATMAN_V=y CONFIG_BATMAN_ADV_DAT=y CONFIG_BATMAN_ADV_MCAST=y /home/tux/dev/batman-adv-t_x/gen-compat-autoconf.sh /home/tux/dev/batman-adv-t_x/compat-autoconf.h mkdir -p /home/tux/dev/batman-adv-t_x/build/net/batman-adv/ COMPAT_PATCH 0001-netlink-portid.cocci 0001-netlink-portid.cocci /home/tux/dev/batman-adv-t_x init_defs_builtins: /usr/share/coccinelle/standard.h HANDLING: /home/tux/dev/batman-adv-t_x/build/net/batman-adv/netlink.c diff = HANDLING: /home/tux/dev/batman-adv-t_x/build/net/batman-adv/bat_algo.c diff = HANDLING: /home/tux/dev/batman-adv-t_x/build/net/batman-adv/bat_iv_ogm.c diff = HANDLING: /home/tux/dev/batman-adv-t_x/build/net/batman-adv/translation-table.c diff = HANDLING: /home/tux/dev/batman-adv-t_x/build/net/batman-adv/bridge_loop_avoidance.c diff = HANDLING: /home/tux/dev/batman-adv-t_x/build/net/batman-adv/bat_v.c diff = COMPAT_PATCH 0002-genl-const.cocci 0002-genl-const.cocci /home/tux/dev/batman-adv-t_x init_defs_builtins: /usr/share/coccinelle/standard.h Fatal error: exception Failure("plus: parse error: = File "compat-patches/0002-genl-const.cocci", line 6, column 14, charpos = 81 around = 'struct', whole content = +__genl_const struct genl_multicast_group ") Makefile:111: recipe for target '/home/tux/dev/batman-adv-t_x/build/net/batman-adv/.compat-prepared' failed make: *** [/home/tux/dev/batman-adv-t_x/build/net/batman-adv/.compat-prepared] Error 2
Bisecting leads me to this commit 2f9f52d1dfc417201028cc65f91aaddc5eaf493a ("batman-adv: compat: Move netlink const compat to coccinelle").
EDIT: coccinelle version is from Debian stable: 1.0.0~rc22.deb-1
EDIT2: Trying to compile for a 4.9-rc3 kernel does not help. Compiling on a Debian Sid with a newer coccinelle (1.0.4.deb-3+b1) seems to apply the .cocci files fine, though.
Updated by Sven Eckelmann almost 5 years ago
Revert patches can be found at:
Updated by Linus Lüssing over 4 years ago
I've built coccinelle 1.0.6 from the according github tag. I further added a "ln -s ./spatch.opt ./spatch" in the build directory. Then I tried compiling batman-adv with a preceding PATH variable to the coccinelle build directory.
Now this fails for me both on Debian Sid and Stretch.
So it seems it's not the coccinelle version exactly, but probably some build option? Or something is different with a more recent Debian package version?
Updated by Sven Eckelmann over 4 years ago
Yes, this sounds plausible. My guess was that either some build option or dependency was different. I think I've read that some important dependency was first shipped as part of coccinelle because the actual upstream was not working as expected. This was later fixed upstream and then coccinelle switched back to upstream. But I cannot find the mails anymore - so maybe I am remembering incorrectly. But at least this sounds like a possible reason why the behavior is sometimes different.