Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 814644 - dev-util/bcc-0.22.0 ebuild fails in compile stage: 'BTF_KIND_FLOAT' undeclared
Summary: dev-util/bcc-0.22.0 ebuild fails in compile stage: 'BTF_KIND_FLOAT' undeclared
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Zac Medico
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-24 20:41 UTC by Kyle Terrien
Modified: 2021-10-21 04:16 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (bcc-build.log,22.21 KB, text/x-log)
2021-09-24 20:41 UTC, Kyle Terrien
Details
emerge --info (emerge-info,6.62 KB, text/plain)
2021-09-24 20:42 UTC, Kyle Terrien
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle Terrien 2021-09-24 20:41:04 UTC
emerging dev-util/bcc-0.22.0 yields a build failure in the compile stage:

> [4/287] /usr/bin/x86_64-pc-linux-gnu-gcc -DHAVE_EXTERNAL_LIBBPF -I/usr/src/linux -I/usr/lib/llvm/12/include/../tools/clang/include -I/var/tmp/portage/dev-util/bcc-0.22.0/work/bcc-0.22.0/src -Isrc -Isrc/cc -I/var/tmp/portage/dev-util/bcc-0.22.0/work/bcc-0.22.0/src/cc -Isrc/cc/frontends/b -I/var/tmp/portage/dev-util/bcc-0.22.0/work/bcc-0.22.0/src/cc/frontends/b -I/var/tmp/portage/dev-util/bcc-0.22.0/work/bcc-0.22.0/src/cc/frontends/clang -I/usr/lib/llvm/12/include  -O2 -march=nehalem -mindirect-branch=thunk -frecord-gcc-switches -fno-omit-frame-pointer -pipe -Wall -fPIC -Wno-unused-result -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -MD -MT src/cc/CMakeFiles/bpf-static.dir/libbpf.c.o -MF src/cc/CMakeFiles/bpf-static.dir/libbpf.c.o.d -o src/cc/CMakeFiles/bpf-static.dir/libbpf.c.o -c /var/tmp/portage/dev-util/bcc-0.22.0/work/bcc-0.22.0/src/cc/libbpf.c
> [31mFAILED: [0msrc/cc/CMakeFiles/bpf-static.dir/libbpf.c.o 
> /usr/bin/x86_64-pc-linux-gnu-gcc -DHAVE_EXTERNAL_LIBBPF -I/usr/src/linux -I/usr/lib/llvm/12/include/../tools/clang/include -I/var/tmp/portage/dev-util/bcc-0.22.0/work/bcc-0.22.0/src -Isrc -Isrc/cc -I/var/tmp/portage/dev-util/bcc-0.22.0/work/bcc-0.22.0/src/cc -Isrc/cc/frontends/b -I/var/tmp/portage/dev-util/bcc-0.22.0/work/bcc-0.22.0/src/cc/frontends/b -I/var/tmp/portage/dev-util/bcc-0.22.0/work/bcc-0.22.0/src/cc/frontends/clang -I/usr/lib/llvm/12/include  -O2 -march=nehalem -mindirect-branch=thunk -frecord-gcc-switches -fno-omit-frame-pointer -pipe -Wall -fPIC -Wno-unused-result -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -MD -MT src/cc/CMakeFiles/bpf-static.dir/libbpf.c.o -MF src/cc/CMakeFiles/bpf-static.dir/libbpf.c.o.d -o src/cc/CMakeFiles/bpf-static.dir/libbpf.c.o -c /var/tmp/portage/dev-util/bcc-0.22.0/work/bcc-0.22.0/src/cc/libbpf.c
> In file included from /var/tmp/portage/dev-util/bcc-0.22.0/work/bcc-0.22.0/src/cc/bcc_libbpf_inc.h:5,
>                  from /var/tmp/portage/dev-util/bcc-0.22.0/work/bcc-0.22.0/src/cc/libbpf.c:57:
> /usr/include/bpf/btf.h: In function 'btf_is_float':
> /usr/include/bpf/btf.h:328:24: error: 'BTF_KIND_FLOAT' undeclared (first use in this function); did you mean 'BTF_KIND_INT'?
>   328 |  return btf_kind(t) == BTF_KIND_FLOAT;
>       |                        ^~~~~~~~~~~~~~
>       |                        BTF_KIND_INT
> /usr/include/bpf/btf.h:328:24: note: each undeclared identifier is reported only once for each function it appears in

...

>  * ERROR: dev-util/bcc-0.22.0::gentoo failed (compile phase):
>  *   ninja -v -j12 -l16 failed
>  * 
>  * Call stack:
>  *     ebuild.sh, line  127:  Called src_compile
>  *   environment, line 4635:  Called cmake_src_compile
>  *   environment, line 1735:  Called cmake_build
>  *   environment, line 1704:  Called eninja
>  *   environment, line 2448:  Called die
>  * The specific snippet of code:
>  *       "$@" || die "${nonfatal_args[@]}" "${*} failed"
>  * 
>  * If you need support, post the output of `emerge --info '=dev-util/bcc-0.22.0::gentoo'`,
>  * the complete build log and the output of `emerge -pqv '=dev-util/bcc-0.22.0::gentoo'`.
>  * The complete build log is located at '/var/tmp/portage/dev-util/bcc-0.22.0/temp/build.log'.
>  * The ebuild environment file is located at '/var/tmp/portage/dev-util/bcc-0.22.0/temp/environment'.
>  * Working directory: '/var/tmp/portage/dev-util/bcc-0.22.0/work/bcc-0.22.0_build'
>  * S: '/var/tmp/portage/dev-util/bcc-0.22.0/work/bcc-0.22.0'

USE flags:

> $ emerge -pqv '=dev-util/bcc-0.22.0::gentoo'
> [ebuild  r  U ] dev-libs/libbpf-0.5.0 [0.3] USE="static-libs" 
> [ebuild     U ] dev-util/bcc-0.22.0 [0.20.0-r1] USE="lua -test" LUA_SINGLE_TARGET="luajit" PYTHON_TARGETS="python3_8 (-python3_10) -python3_9" 
> [ebuild  rR   ] sys-apps/iproute2-5.13.0-r1  USE="bpf caps elf ipv6 -atm -berkdb -iptables -libbsd -minimal (-selinux)" 
> [ebuild  rR   ] dev-util/bpftrace-0.12.1-r1  USE="-fuzzing -test" 
> 
> The following packages are causing rebuilds:
> 
>   (dev-libs/libbpf-0.5.0:0/0.5.0::gentoo, ebuild scheduled for merge) causes rebuilds for:
>     (sys-apps/iproute2-5.13.0-r1:0/0::gentoo, ebuild scheduled for merge)
>     (dev-util/bpftrace-0.12.1-r1:0/0::gentoo, ebuild scheduled for merge)


Reproducible: Always

Steps to Reproduce:
1. emerge -a dev-util/bcc
Comment 1 Kyle Terrien 2021-09-24 20:41:41 UTC
Created attachment 741153 [details]
build.log
Comment 2 Kyle Terrien 2021-09-24 20:42:15 UTC
Created attachment 741156 [details]
emerge --info
Comment 3 Jan K 2021-10-01 11:48:16 UTC
I run into this bug as well, apparently dev-util/bcc-0.22.0 requires newer kernel headers:

>=sys-kernel/linux-headers-5.13

BTF_KIND_FLOAT has been introduced in some 5.13 release candidate:
https://github.com/torvalds/linux/commit/8fd886911a6a99acf4a8facf619a2e7b5225be78

After upgrading kernel headers (to latest unstable) bcc compiled fine.

(I'm too lazy to do a PR for this.)
Comment 4 Mario Klebsch 2021-10-05 06:51:24 UTC
> I run into this bug as well, apparently dev-util/bcc-0.22.0 requires
> newer kernel headers:
>
> >=sys-kernel/linux-headers-5.13

Shouldn't the dependencies of bcc-0.22.0 should be updated to reflect this dependency?

73, Mario
Comment 5 Mario Klebsch 2021-10-05 07:04:06 UTC
~ $ diff -c /usr/portage/dev-util/bcc/bcc-0.22.0.ebuild /usr/local/portage/dev-util/bcc/bcc-0.22.0-r1.ebuild
*** /usr/portage/dev-util/bcc/bcc-0.22.0.ebuild 2021-09-21 03:09:52.000000000 +0200
--- /usr/local/portage/dev-util/bcc/bcc-0.22.0-r1.ebuild        2021-10-05 08:54:01.661258786 +0200
***************
*** 34,39 ****
--- 34,40 ----
        ${PYTHON_DEPS}
  "
  DEPEND="${RDEPEND}
+       >=sys-kernel/linux-headers-5.13
        test? (
                || (
                        net-misc/iputils[arping]
~ $
Comment 6 Larry the Git Cow gentoo-dev 2021-10-21 04:16:29 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=947035ae921b5ca1c79cf92bb3d20e193cc13de2

commit 947035ae921b5ca1c79cf92bb3d20e193cc13de2
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-10-21 04:16:06 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-10-21 04:16:15 +0000

    dev-util/bcc: increase linux-headers dependency
    
    Closes: https://bugs.gentoo.org/814644
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-util/bcc/bcc-0.22.0.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)