Project

General

Profile

Bug #304

Updated by Linus L├╝ssing almost 5 years ago

On a Debian Sid compiling for a 4.9-rc3 kernel with gcc 6.2.0-10, kernel, I curently get the following error:

<pre>
root@Linus-Debian:/mnt/batman-adv-t_x# make
/mnt/batman-adv-t_x/gen-compat-autoconf.sh /mnt/batman-adv-t_x/compat-autoconf.h
mkdir -p /mnt/batman-adv-t_x/build/net/batman-adv/
compat-patches/replacements.sh
touch /mnt/batman-adv-t_x/build/net/batman-adv/.compat-prepared
make -C /lib/modules/4.9.0-rc3+/build M=/mnt/batman-adv-t_x PWD=/mnt/batman-adv-t_x REVISION=2016.4 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-4.9.0-rc3+'
cat: -: No such file or directory
CC [M] /mnt/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/core/skbuff.o
/mnt/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/core/skbuff.c:1:0: error: code model kernel does not support PIC mode
/*

scripts/Makefile.build:290: recipe for target '/mnt/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/core/skbuff.o' failed
make[3]: *** [/mnt/batman-adv-t_x/build/net/batman-adv/../../../compat-sources/net/core/skbuff.o] Error 1
scripts/Makefile.build:475: recipe for target '/mnt/batman-adv-t_x/build/net/batman-adv' failed
make[2]: *** [/mnt/batman-adv-t_x/build/net/batman-adv] Error 2
Makefile:1482: recipe for target '_module_/mnt/batman-adv-t_x' failed
make[1]: *** [_module_/mnt/batman-adv-t_x] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.9.0-rc3+'
Makefile:89: recipe for target 'all' failed
make: *** [all] Error 2
</pre>

It seems to have something to do with PIE hardening which got enabled by default in gcc6 last week in Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835148

Compiling with '$ make EXTRA_CFLAGS="-fno-pie"' helps.

So my question is, whether this flag should be added to the batman-adv out-of-tree Makefile.

Some comments seem to suggest, that PIE does not work for kernels / kernel modules by design. (I have not looked at what PIE hardening actually is, so I have no clue yet whether disabling is the right choice)

Back