Bug 10861 - Package batman_adv Makefile is missing include header directory
Summary: Package batman_adv Makefile is missing include header directory
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2018.02
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-15 08:23 UTC by Miltiadis Koutsokeras
Modified: 2019-08-15 21:33 UTC (History)
1 user (show)

See Also:
Host: ARM
Target:
Build: X86_64


Attachments
batman_adv package Makefile fix (502 bytes, patch)
2018-03-15 08:23 UTC, Miltiadis Koutsokeras
Details
br2-external tree that reproduces the problem (72.33 KB, application/gzip)
2018-07-25 09:00 UTC, Miltiadis Koutsokeras
Details
full standard output of BUG reproduction (32.19 KB, text/x-log)
2018-07-25 09:04 UTC, Miltiadis Koutsokeras
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Miltiadis Koutsokeras 2018-03-15 08:23:06 UTC
Created attachment 7511 [details]
batman_adv package Makefile fix

Bug found in package/batman-adv/batman-adv.mk leading to compilation error due to missing headers:

fatal error: uapi/linux/batman_adv.h: No such file or directory
 #include <uapi/linux/batman_adv.h>

There is an extra include directory (-I$(PWD)/include/) added in batman_adv source Makefile in commit:

https://git.open-mesh.org/batman-adv.git/blobdiff/14adbd701dec0717606bff4f0c8c084827bf4735..2b20eb572f271edca0d0fd1abd5350876c315d28:/Makefile

but the extra directory is missing from the Buildroot package/batman-adv/batman-adv.mk:

BATMAN_ADV_CFLAGS = \
        -I$(@D)/compat-include/ \
        -include $(@D)/compat.h \
        -DBATADV_SOURCE_VERSION=\"\\\"$(BATMAN_ADV_VERSION)\\\"\"

Patch attached fixes the issue and the build finishes properly.
Comment 1 Thomas Petazzoni 2018-06-06 13:24:17 UTC
I'm sorry, but I can't reproduce this problem with the version of batman-adv in Buildroot today (2017.0.1). I.e the following defconfig builds fine:

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2018.02-891-g046c5e2.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_GCC_4_9=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_1=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.11"
BR2_LINUX_KERNEL_DEFCONFIG="mvebu_v5"
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_BATMAN_ADV=y
BR2_PACKAGE_BATMAN_ADV_DEBUG=y
BR2_PACKAGE_BATMAN_ADV_NC=y
BR2_PACKAGE_BATMAN_ADV_BATMAN_V=y
# BR2_TARGET_ROOTFS_TAR is not set

If I bump batman-adv to 2018.1, I indeed need this header path to be added in the compiler flags. But not with the existing 2017.0.1, so I'm a bit surprised how you ran into this issue.

Could you share an example Buildroot configuration (preferably minimal) that exhibits the problem ? Thanks!
Comment 2 Miltiadis Koutsokeras 2018-06-12 07:20:46 UTC
I need to go back in my Git repo and find the exact defconfig of that period and strip it down to the minimal reproducing case. It has changed since then.

Apart from that I'm quite confident that your minimal defconfig differs from mine in these:

1) We do not use the upstream Linux kernel, we use this: https://github.com/linux4sam/linux-at91.git, version 4.4 (tag linux4sam_5.5) and 4.9 (tag linux4sam_5.7) were tested.

2) We use a Buildroot generated toolchain.

3) Custom Linux kernel configuration (got to find specific version from Git repo).

Thank you for your time, I will come back with more info and a minimal defconfig that reproduces the problem.
Comment 3 Miltiadis Koutsokeras 2018-07-25 08:58:30 UTC
Hi again and sorry for the delayed response,

I managed to strip down my external configuration directory to a version that reproduces the problem exactly as I encountered it months ago. I will attach the external configuration directory and the captured standard output of the process.

The build was performed with these commands in a Debian 9 host:
cd path/to/reproduce
make V=1 O="$(pwd)" -C "path/to/buildroot-2018.02" BR2_EXTERNAL="path/to/buildroot-external" "shiratech_sparkgate-7_InternalNAND_defconfig"
make V=1 O="$(pwd)" -C "path/to/buildroot-2018.02"

I will attach the external configuration directory archived in 'buildroot-external-bug-10861.tar.gz' and the standard output of the commands in 'reproduce.log'. The errors at the end summarized (paths changed for easier searching):

--------------------------------------------
/usr/bin/make -f ./scripts/Makefile.build obj=path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv
  path/to/reproduce/host/bin/arm-buildroot-linux-uclibcgnueabihf-gcc -Wp,-MD,path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/.bat_algo.o.d -Ipath/to/reproduce/build/batman-adv-2017.0.1/compat-include/ -include path/to/reproduce/build/batman-adv-2017.0.1/compat.h -DBATADV_SOURCE_VERSION="\"2017.0.1\"" -I./arch/arm/include -Iarch/arm/include/generated/uapi -Iarch/arm/include/generated  -Iinclude -I./arch/arm/include/uapi -Iarch/arm/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-dwarf2-cfi-asm -fno-ipa-sra -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -Wno-unused-const-variable -fomit-frame-pointer -fno-var-tracking-assignments -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO  -DMODULE  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(bat_algo)"  -D"KBUILD_MODNAME=KBUILD_STR(batman_adv)" -c -o path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bat_algo.o path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bat_algo.c
  path/to/reproduce/host/bin/arm-buildroot-linux-uclibcgnueabihf-gcc -Wp,-MD,path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/.bat_iv_ogm.o.d -Ipath/to/reproduce/build/batman-adv-2017.0.1/compat-include/ -include path/to/reproduce/build/batman-adv-2017.0.1/compat.h -DBATADV_SOURCE_VERSION="\"2017.0.1\"" -I./arch/arm/include -Iarch/arm/include/generated/uapi -Iarch/arm/include/generated  -Iinclude -I./arch/arm/include/uapi -Iarch/arm/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-dwarf2-cfi-asm -fno-ipa-sra -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -Wno-unused-const-variable -fomit-frame-pointer -fno-var-tracking-assignments -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO  -DMODULE  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(bat_iv_ogm)"  -D"KBUILD_MODNAME=KBUILD_STR(batman_adv)" -c -o path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bat_iv_ogm.o path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bat_iv_ogm.c
  path/to/reproduce/host/bin/arm-buildroot-linux-uclibcgnueabihf-gcc -Wp,-MD,path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/.bitarray.o.d -Ipath/to/reproduce/build/batman-adv-2017.0.1/compat-include/ -include path/to/reproduce/build/batman-adv-2017.0.1/compat.h -DBATADV_SOURCE_VERSION="\"2017.0.1\"" -I./arch/arm/include -Iarch/arm/include/generated/uapi -Iarch/arm/include/generated  -Iinclude -I./arch/arm/include/uapi -Iarch/arm/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-dwarf2-cfi-asm -fno-ipa-sra -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -Wno-unused-const-variable -fomit-frame-pointer -fno-var-tracking-assignments -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO  -DMODULE  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(bitarray)"  -D"KBUILD_MODNAME=KBUILD_STR(batman_adv)" -c -o path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bitarray.o path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bitarray.c
  path/to/reproduce/host/bin/arm-buildroot-linux-uclibcgnueabihf-gcc -Wp,-MD,path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/.distributed-arp-table.o.d -Ipath/to/reproduce/build/batman-adv-2017.0.1/compat-include/ -include path/to/reproduce/build/batman-adv-2017.0.1/compat.h -DBATADV_SOURCE_VERSION="\"2017.0.1\"" -I./arch/arm/include -Iarch/arm/include/generated/uapi -Iarch/arm/include/generated  -Iinclude -I./arch/arm/include/uapi -Iarch/arm/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-dwarf2-cfi-asm -fno-ipa-sra -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -Wno-unused-const-variable -fomit-frame-pointer -fno-var-tracking-assignments -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO  -DMODULE  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(distributed_arp_table)"  -D"KBUILD_MODNAME=KBUILD_STR(batman_adv)" -c -o path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/distributed-arp-table.o path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/distributed-arp-table.c
  path/to/reproduce/host/bin/arm-buildroot-linux-uclibcgnueabihf-gcc -Wp,-MD,path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/.bridge_loop_avoidance.o.d -Ipath/to/reproduce/build/batman-adv-2017.0.1/compat-include/ -include path/to/reproduce/build/batman-adv-2017.0.1/compat.h -DBATADV_SOURCE_VERSION="\"2017.0.1\"" -I./arch/arm/include -Iarch/arm/include/generated/uapi -Iarch/arm/include/generated  -Iinclude -I./arch/arm/include/uapi -Iarch/arm/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-dwarf2-cfi-asm -fno-ipa-sra -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -Wno-unused-const-variable -fomit-frame-pointer -fno-var-tracking-assignments -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO  -DMODULE  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(bridge_loop_avoidance)"  -D"KBUILD_MODNAME=KBUILD_STR(batman_adv)" -c -o path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bridge_loop_avoidance.o path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bridge_loop_avoidance.c
In file included from path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/main.h:196:0,
                 from path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bat_algo.c:18:
path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/types.h:37:10: fatal error: uapi/linux/batman_adv.h: No such file or directory
 #include <uapi/linux/batman_adv.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
scripts/Makefile.build:258: recipe for target 'path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bat_algo.o' failed
make[2]: *** [path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bat_algo.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/main.h:196:0,
                 from path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bridge_loop_avoidance.h:21,
                 from path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bridge_loop_avoidance.c:18:
path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/types.h:37:10: fatal error: uapi/linux/batman_adv.h: No such file or directory
 #include <uapi/linux/batman_adv.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/main.h:196:0,
                 from path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/distributed-arp-table.h:21,
                 from path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/distributed-arp-table.c:18:
path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/types.h:37:10: fatal error: uapi/linux/batman_adv.h: No such file or directory
 #include <uapi/linux/batman_adv.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~
scripts/Makefile.build:258: recipe for target 'path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bridge_loop_avoidance.o' failed
make[2]: *** [path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bridge_loop_avoidance.o] Error 1
compilation terminated.
scripts/Makefile.build:258: recipe for target 'path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/distributed-arp-table.o' failed
make[2]: *** [path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/distributed-arp-table.o] Error 1
In file included from path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/main.h:196:0,
                 from path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bat_iv_ogm.h:21,
                 from path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bat_iv_ogm.c:18:
path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/types.h:37:10: fatal error: uapi/linux/batman_adv.h: No such file or directory
 #include <uapi/linux/batman_adv.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/main.h:196:0,
                 from path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bitarray.h:21,
                 from path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bitarray.c:18:
path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/types.h:37:10: fatal error: uapi/linux/batman_adv.h: No such file or directory
 #include <uapi/linux/batman_adv.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
scripts/Makefile.build:258: recipe for target 'path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bat_iv_ogm.o' failed
make[2]: *** [path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bat_iv_ogm.o] Error 1
scripts/Makefile.build:258: recipe for target 'path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bitarray.o' failed
make[2]: *** [path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv/bitarray.o] Error 1
Makefile:1400: recipe for target '_module_path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv' failed
make[1]: *** [_module_path/to/reproduce/build/batman-adv-2017.0.1/net/batman-adv] Error 2
make[1]: Leaving directory 'path/to/reproduce/build/linux-linux4sam_5.5'
package/pkg-generic.mk:247: recipe for target 'path/to/reproduce/build/batman-adv-2017.0.1/.stamp_built' failed
make: *** [path/to/reproduce/build/batman-adv-2017.0.1/.stamp_built] Error 2
make: Leaving directory '/home/isense/Development/Embedded/Buildroot/buildroot-2018.02'
--------------------------------------------

Again, I'm really sorry for the delay.

Thank you for your time,
Miltos
Comment 4 Miltiadis Koutsokeras 2018-07-25 09:00:23 UTC
Created attachment 7676 [details]
br2-external tree that reproduces the problem
Comment 5 Miltiadis Koutsokeras 2018-07-25 09:04:15 UTC
Created attachment 7681 [details]
full standard output of BUG reproduction