Project

General

Profile

Actions

Bug #311

closed

Compiling with EXTRA_CFLAGS="-O0" fails

Added by Linus Lüssing over 7 years ago. Updated over 7 years ago.

Status:
Rejected
Priority:
Normal
Target version:
-
Start date:
11/12/2016
Due date:
% Done:

0%

Estimated time:

Description

Trying to compile batman-adv (current master) with gcc optimizations disabled fails with the following error message:

/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 EXTRA_CFLAGS="-O0" 
/home/tux/dev/batman-adv-t_x/gen-compat-autoconf.sh /home/tux/dev/batman-adv-t_x/compat-autoconf.h
/usr/bin/make -C /home/tux/mesh-node/usr/src/linux-headers-4.8.0-rc7+ M=/home/tux/dev/batman-adv-t_x/build PWD=/home/tux/dev/batman-adv-t_x/build REVISION=2016.4-76-g7c21738 CONFIG_BATMAN_ADV=m CONFIG_BATMAN_ADV_DEBUG=y 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=y INSTALL_MOD_DIR=updates/  modules
make[1]: Entering directory '/home/tux/mesh-node/usr/src/linux-headers-4.8.0-rc7+'
  CC [M]  /home/tux/dev/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/core/skbuff.o
  CC [M]  /home/tux/dev/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/ipv4/igmp.o
  CC [M]  /home/tux/dev/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/ipv6/mcast_snoop.o
  CC [M]  /home/tux/dev/batman-adv-t_x/build/net/batman-adv/bat_algo.o
  CC [M]  /home/tux/dev/batman-adv-t_x/build/net/batman-adv/bat_iv_ogm.o
In file included from /home/tux/dev/batman-adv-t_x/build/../compat-include/linux/rculist.h:25:0,
                 from ./include/linux/sched.h:45,
                 from ./include/linux/kasan.h:4,
                 from ./include/linux/slab.h:118,
                 from /home/tux/dev/batman-adv-t_x/build/../compat-include/linux/slab.h:25,
                 from ./include/linux/textsearch.h:8,
                 from ./include/linux/skbuff.h:30,
                 from /home/tux/dev/batman-adv-t_x/build/../compat-include/linux/skbuff.h:25,
                 from ./include/linux/if_ether.h:23,
                 from /home/tux/dev/batman-adv-t_x/build/../compat-include/linux/if_ether.h:25,
                 from ./include/linux/etherdevice.h:25,
                 from /home/tux/dev/batman-adv-t_x/build/../compat-include/linux/etherdevice.h:25,
                 from /home/tux/dev/batman-adv-t_x/build/net/batman-adv/main.h:189,
                 from /home/tux/dev/batman-adv-t_x/build/net/batman-adv/bat_iv_ogm.h:21,
                 from /home/tux/dev/batman-adv-t_x/build/net/batman-adv/bat_iv_ogm.c:18:
./include/linux/rculist.h: In function ‘hlist_add_head_rcu’:
./include/linux/rculist.h:485:922: error: call to ‘__compiletime_assert_485’ declared with attribute error: Need native word sized stores/loads for atomicity.
  rcu_assign_pointer(hlist_first_rcu(h), n);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ^
scripts/Makefile.build:289: recipe for target '/home/tux/dev/batman-adv-t_x/build/net/batman-adv/bat_iv_ogm.o' failed
make[3]: *** [/home/tux/dev/batman-adv-t_x/build/net/batman-adv/bat_iv_ogm.o] Error 1
scripts/Makefile.build:440: recipe for target '/home/tux/dev/batman-adv-t_x/build/net/batman-adv' failed
make[2]: *** [/home/tux/dev/batman-adv-t_x/build/net/batman-adv] Error 2
Makefile:1471: recipe for target '_module_/home/tux/dev/batman-adv-t_x/build' failed
make[1]: *** [_module_/home/tux/dev/batman-adv-t_x/build] Error 2
make[1]: Leaving directory '/home/tux/mesh-node/usr/src/linux-headers-4.8.0-rc7+'
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2

I tried compiling for a 4.8-rc7 and a 4.9-rc3 kernel and various others, which are all failing. 3.14 works though while 3.15 doesn't, so seems to be related to some change introduced with 3.15.

GCC version is from Debian stable:

$ gcc --version
gcc-4.9.real (Debian 4.9.2-10) 4.9.2
[...]

Also, all v2015.x and v2016.x batman-adv versions fail, too.

Actions #1

Updated by Sven Eckelmann over 7 years ago

  • Assignee set to Linus Lüssing

This is to be expected. The kernel requires compile time asserts which are only correctly evaluated when optimization is enabled. So if you want to do something like this then you are on your own.

And I am actually wondering why it should have worked with 3.14. I've already had this problem way before - which lead me to use "-fno-inline -O1 -fno-optimize-sibling-calls" to get better backtraces while still being able to compile the kernel

So if you want to have this functionality then please discuss it on .

@Simon Wunderlich/@Marek should we just close this one? Because it is nothing we can do about in batman-adv

Actions #2

Updated by Sven Eckelmann over 7 years ago

  • Status changed from New to Rejected

Marking this as rejected because this is a kernel problem and not a batman-adv problem

Actions

Also available in: Atom PDF