On Monday, February 26, 2018 1:51:32 PM CET Sven Eckelmann wrote:
The compat.h will be included by default via the -include gcc parameter. This is done by appending the incude information to NOSTDINC_FLAGS in the Makefile. But Debian decided [1] that this NOSTDINC_FLAGS must also be used when not compiling kernel sources. This for example happens when the gcc-version.sh script is executed. This results in error messages like
In file included from <command-line>:0:0: /usr/src//batman-adv/build/../compat.h:25:52: fatal error: linux/version.h: No such file or directory #include <linux/version.h> /* LINUX_VERSION_CODE */ ^ compilation terminated. In file included from <command-line>:0:0: /usr/src//batman-adv/build/../compat.h:25:52: fatal error: linux/version.h: No such file or directory #include <linux/version.h> /* LINUX_VERSION_CODE */ ^ compilation terminated. /usr/src/linux-headers-4.14.0-0.bpo.3-common/scripts/gcc-version.sh: line 32: printf: #: invalid number /usr/src/linux-headers-4.14.0-0.bpo.3-common/scripts/gcc-version.sh: line 32: printf: #: invalid number /bin/sh: 1: [: 0001: unexpected operator
This can be avoided by disabling the compat.h whenever the preprocessor define __KERNEL__ is not set.
[1] https://patchwork.kernel.org/patch/5238591/
Signed-off-by: Sven Eckelmann sven@narfation.org
Applied in 934b3884.
Thank you! Simon