DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Ashok Kaladi <ashok.k.kaladi@intel.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH] net/tap: fix BPF build failure in cross-compilation environment
Date: Wed, 23 Jul 2025 07:24:42 -0700	[thread overview]
Message-ID: <20250723072442.62ba35ff@hermes.local> (raw)
In-Reply-To: <20250723125702.3787183-1-ashok.k.kaladi@intel.com>

On Wed, 23 Jul 2025 07:57:02 -0500
Ashok Kaladi <ashok.k.kaladi@intel.com> wrote:

> During cross-compilation, BPF build incorrectly includes header files
> from the host system instead of the target sysroot. This leads to
> build failures due to incompatible headers or unavailability of header
> files in the host.
> 
> Fix by using the Meson sysroot property to correctly locate and include
> BPF-related headers from the cross-compilation environment.
> 
> Fixes: d8d065045c4a ("net/tap: rewrite RSS BPF program")
> Cc: stephen@networkplumber.org
> 
> Signed-off-by: Ashok Kaladi <ashok.k.kaladi@intel.com>
> ---
>  drivers/net/tap/bpf/meson.build | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/tap/bpf/meson.build b/drivers/net/tap/bpf/meson.build
> index 35d7438c74..1b87d5018e 100644
> --- a/drivers/net/tap/bpf/meson.build
> +++ b/drivers/net/tap/bpf/meson.build
> @@ -39,13 +39,14 @@ endif
>  
>  enable_tap_rss = true
>  
> -libbpf_include_dir = libbpf.get_variable(pkgconfig : 'includedir')
> +# Determine sysroot if cross-compiling and the property exists in the
> +# init files. Note that this environment variable will have to be passed
> +# in as a property during meson setup.
> +sysroot = meson.get_external_property('sysroot', '')
> +libbpf_include_dir = sysroot + libbpf.get_variable(pkgconfig : 'includedir')
>  
> -# The include files <linux/bpf.h> and others include <asm/types.h>
> -# but <asm/types.h> is not defined for multi-lib environment target.
> -# Workaround by using include directoriy from the host build environment.
>  machine_name = run_command('uname', '-m', check: true).stdout().strip()
> -march_include_dir = '/usr/include/' + machine_name + '-linux-gnu'
> +march_include_dir = sysroot + '/usr/include/' + machine_name + '-linux-gnu'

Keep the comment about why uname -m is used.

  reply	other threads:[~2025-07-23 14:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-23 12:57 Ashok Kaladi
2025-07-23 14:24 ` Stephen Hemminger [this message]
2025-07-25  6:43 ` [PATCH v2] " Ashok Kaladi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250723072442.62ba35ff@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=ashok.k.kaladi@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).