I'm adding a generic-package to Buildroot 2019.02.1. This package (fbi) includes <asm/page.h> in the fbtools.c, but the headers are not available in output/target. Compiling the package causes the following error:
$ make fbi-rebuild
[...]
CC fbi.o
CC fbtools.o
fbtools.c:24:30: fatal error: asm/page.h: No such file or directory
#include <asm/page.h>
^
compilation terminated.
[...]
I've added patches to and selected necessary packages for fbi:
$ grep -E '^[^#].*(HEADERS|FBI|JPEG)' .config
BR2_KERNEL_HEADERS_VERSION=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=y
BR2_DEFAULT_KERNEL_HEADERS="4.9.17"
BR2_PACKAGE_LINUX_HEADERS=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0=y
[...]
BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_9=y
BR2_TOOLCHAIN_HEADERS_AT_LEAST="4.9"
BR2_PACKAGE_FBI=y
BR2_PACKAGE_JPEG=y
BR2_PACKAGE_JPEG_SIMD_SUPPORT=y
BR2_PACKAGE_LIBJPEG=y
BR2_PACKAGE_HAS_JPEG=y
BR2_PACKAGE_PROVIDES_JPEG="libjpeg"
$ for i in `ls package/fbi/000*`; do echo $i; cat $i | grep -E '^[-+][^-+]'; done
package/fbi/0001-fix-verion.patch
- fprintf(stderr, "fbi version " VERSION
+ fprintf(stderr, "fbi version 1.32 "
package/fbi/0002-fix-makefile.patch
- @echo -e "$(make-config-q)" > $@
+ @echo "$(make-config-q)" > $@
$ find output/ -name page.h
output/build/linux-headers-4.9.17/fs/nilfs2/page.h
output/build/linux-headers-4.9.17/include/asm-generic/page.h
[...]
output/build/linux-headers-4.9.17/arch/score/include/asm/page.h
The kernel I use (also 4.9.17) is not part of Buildroot, but I think that shouldn't be a problem.
What is the correct way to compile against the kernel headers within Buildroot?