Commit Graph

21 Commits

Author SHA1 Message Date
Mingli Yu
31a08525be
bpftool-native: Empty DEBUG_PREFIX_MAP_EXTRA
Most host gcc doesn't support -fcanon-prefix-map right now, so
empty DEBUG_PREFIX_MAP_EXTRA to fix the below build error.
 | gcc: error: unrecognized command-line option ‘-fcanon-prefix-map’; did you mean ‘-fmacro-prefix-map=’?

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-12-05 17:01:11 -08:00
Khem Raj
6d3a650372
bpftool,bpftool-native: Separate out native recipe
build uses prepared sourcedir for kernel and relying
on target kernel recipe to prepare this is not the correct
thing for native package. Since the kernel will need target
dependencies cross-compiler etc. to build/prepare the kernel sourcedir

This issue is revealed when bpftool-native is built for riscv64
it ends up in build errors

ERROR: bpftool-native-1.0-r0 do_configure: The sstate manifest for task 'linux-libc-headers:populate_sysroot' (multilib variant '') could not be found.
The pkgarchs considered were: qemuriscv64, allarch, x86_64_x86_64-nativesdk.
But none of these manifests exists:
    /mnt/b/yoe/master/sources/poky/build/tmp/sstate-control/manifest-qemuriscv64-linux-libc-headers.populate_sysroot
    /mnt/b/yoe/master/sources/poky/build/tmp/sstate-control/manifest-allarch-linux-libc-headers.populate_sysroot
    /mnt/b/yoe/master/sources/poky/build/tmp/sstate-control/manifest-x86_64_x86_64-nativesdk-linux-libc-headers.populate_sysroot
ERROR: Logfile of failure stored in: /mnt/b/yoe/master/sources/poky/build/tmp/work/x86_64-linux/bpftool-native/1.0/temp/log.do_configure.2509356

Therefore separate it out into independent recipe and use latest stable
kernel to build it.

Enable musl builds as well for bpftool, it works now.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-09-06 14:17:15 -07:00
Khem Raj
ac107efa0c
bpftool: Use -ffile-prefix-map instead of -fdebug-prefix-map
ffile-prefix-map is superset for reproducibility

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-04-22 09:10:56 -07:00
Preeti Sachan
d634c5c1a6
bpftool: fix libelf.h not found error
When build host machine is not installed with elfutils-libelf-devel, it
throws compile error "libelf.h: No such file or directory". Fix missing
headers file by including path ${STAGING_INCDIR_NATIVE} via CFLAGS variable.
Use headers file from ${STAGING_INCDIR_NATIVE} instead of host machine.

Error:
| libbpf_internal.h:19:10: fatal error: libelf.h: No such file or directory

Signed-off-by: Preeti Sachan <preeti.sachan@intel.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-01-07 09:33:13 -08:00
Harish Sadineni
1b3b373781
bpftool: Add support for riscv64
bpftool is supported for riscv64 and tested on qemuriscv64.

Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2024-09-12 06:17:04 -07:00
Khem Raj
dfb5a96169
bpftool: Add missing dep on elfutils-native
Point host CC to OE defined BUILD_CC

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2024-01-31 23:22:09 -08:00
Denys Zagorui
0bcfd6291f bpftool: add native and nativesdk support
There are issues with nativesdk variant
...
ERROR: nativesdk-bpftool-1.0-r0 do_package: QA Issue:
nativesdk-bpftool: Files/directories were installed but not shipped in any package:
  /usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-xesdk-linux/usr/sbin/bpftool
  /usr/share/bash-completion/completions/bpftool
...

nativesdk.bbclass sets sbindir = "${bindir}" but bpftool is installed under sbin
to fix that add sbin to FILES

for bpftool completions {prefix} is not used but it seems that bitbake expects that
installed files should be perfixed with "${SDKPATHNATIVE}${prefix_nativesdk}"
to fix that override bash_compdir

Signed-off-by: Denys Zagorui <dzagorui@cisco.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-09-07 08:22:43 -07:00
Denys Zagorui
de786f5ee6 bpftool: return do_configure dependency
return do_configure dependency that was removed
by (3de33c7ecc "bpftool: Fix externalsrc support")

do_configure and do_populate_lic runs independently
and do_configure require prepared kernel sources dir

Signed-off-by: Denys Zagorui <dzagorui@cisco.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-05-24 07:23:55 -07:00
Denys Zagorui
3de33c7ecc bpftool: Fix externalsrc support
When the externalsrc class is used the tasks listed in
SRCTREECOVEREDTASKS are deleted to prevent them being executed. If
externalsrc is used for the kernel then this will include
virtual/kernel:do_patch.

We can depend on do_shared_workdir instead as this will survive when
externalsrc is used.

Similar to [openembedded-core] (eab605bab945 "perf: Fix externalsrc support")

Signed-off-by: Denys Zagorui <dzagorui@cisco.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-05-23 23:08:06 -07:00
Gianluigi Spagnuolo
b53a59f326 bpftool: add aarch64 to COMPATIBLE_HOST 2022-09-29 08:14:17 -07:00
Khem Raj
14c7d8a0d7 recipes: Update LICENSE variable to use SPDX license identifiers
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2022-03-04 17:41:45 -08:00
Martin Jansa
c61dc077bb Convert to new override syntax
This is the result of automated script (0.9.1) conversion:

oe-core/scripts/contrib/convert-overrides.py .

converting the metadata to use ":" as the override character instead of "_".

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2021-08-03 10:21:25 -07:00
INC@Cisco)
120de5e02a bpftool: improve reproducibility
Pass -f(debug|macro)-prefix-map through CC because libbpf
build system overrides CFLAGS. Also remap STAGING_KERNEL_DIR
because it is also stored in resulting executable

Signed-off-by: Denys Zagorui <dzagorui@cisco.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-03-30 09:15:52 -07:00
INC@Cisco)
2179569945 bpftool: remove recipe from blacklist
Have not seen build issues for 5.4 and 5.10
x86-64 kernels so allow to build it

Signed-off-by: Denys Zagorui <dzagorui@cisco.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2021-03-28 12:12:58 -07:00
Robert P. J. Day
d7f5367b53 use weak assignments for PNBLACKLIST in recipe files
Make sure PNBLACKLIST assignments in recipe files use weak assignment,
so they can be overridden in, for example, local.conf files.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2020-05-26 10:28:39 -07:00
Khem Raj
649d491b21 vboxguestdrivers,can-isotp,bpftool: Add to Blacklist
They need forward porting to kernel 5.2+

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-09-07 12:35:59 -07:00
Khem Raj
d46e1e767f bpftool.bb: Disable SECURITY_CFLAGS
We do not pass CFLAGS to build and fortify sources needs some
optimization to be enabled, its better to reset the additional flags and
let the build system add them as it needs

Fixes build failures like
tools/include/tools/libc_compat.h:11:21: error: static declaration of 'reallocarray' follows non-static declaration
|    11 | static inline void *reallocarray(void *ptr, size_t nmemb, size_t size)
|       |                     ^~~~~~~~~~~~

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-08-29 09:06:54 -07:00
Nicolas Dechesne
53d74cea0e bpftool: remove LIC_FILES_CHKSUM
bpftool is a 'special' recipe since it does "inherit kernelsrc", like
perf in oe-core or cpupower in meta-oe.

they don't have their own sources, but reuse the kernel source tree,
from virtual/kernel recipe. As such, checking the license file does
not seem relevant, since the fetching (and license check) is deferred
to the virtual/kernel recipe.

Remove LIC_FILES_CHKSUM like it is done in perf and cpupower.

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-05-10 09:19:21 -07:00
André Draszik
e219649594 meta-oe: remove True option to getVar calls (again)
A couple have still been missed in the past despite multiple
attempts at doing so (or simply have re-appeared?).

Search & replace made using the following command:
    sed -e 's|\(d\.getVar \?\)( \?\([^,()]*\), \?True)|\1(\2)|g' \
        -i $(git grep -E 'getVar ?\( ?([^,()]*), ?True\)' \
             | cut -d':' -f1 \
             | sort -u)

Signed-off-by: André Draszik <andre.draszik@jci.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2019-01-13 10:28:01 -08:00
Khem Raj
deea62edde bpftool: don't build under musl
uses FTW_SKIP_SUBTREE which is GNU extentions, available in glibc but
not in musl

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2018-12-04 17:51:35 -08:00
Daniel Díaz
00d5219d65 bpftool: add new recipe
The bpftool allows for inspection and simple manipulation of
eBPF programs and maps, so common in the kernel selftests.

Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2018-06-27 22:17:33 -07:00