All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam James <sam@gentoo.org>
To: Kris Van Hees via DTrace-devel <dtrace-devel@oss.oracle.com>
Cc: dtrace@lists.linux.dev,  Kris Van Hees <kris.van.hees@oracle.com>
Subject: Re: [DTrace-devel] [PATCH] bpf: compile BPF library functions with -ffreestanding
Date: Thu, 31 Jul 2025 05:12:48 +0100	[thread overview]
Message-ID: <875xf93sn3.fsf@gentoo.org> (raw)
In-Reply-To: <SJ0PR10MB567217E9DF1F38898F33711BC227A@SJ0PR10MB5672.namprd10.prod.outlook.com>

Kris Van Hees via DTrace-devel <dtrace-devel@oss.oracle.com> writes:

> Per Jose, we should be compiling our BPF code with -ffreestanding to
> ensure that BPF-specific standard header files are used instead of
> host-specific ones.

Consider adding a link to https://gcc.gnu.org/PR121259 and
https://bugs.gentoo.org/959876.

Thanks -- it fixes the problem and it looks right.

Tested-by: Sam James <sam@gentoo.org>
Reviewed-by: Sam James <sam@gentoo.org>

>
> Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
> ---
>  GNUmakefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/GNUmakefile b/GNUmakefile
> index b8e09f574..7ad857f88 100644
> --- a/GNUmakefile
> +++ b/GNUmakefile
> @@ -127,7 +127,7 @@ PREPROCESS = $(CC) -E
>  export BPFC ?= bpf-unknown-none-gcc
>  
>  BPFCPPFLAGS += -D$(subst sparc64,__sparc,$(subst aarch64,__aarch64__,$(subst x86_64,__amd64,$(ARCH))))
> -BPFCFLAGS ?= -O2 -Wall -Wno-unknown-pragmas $(if $(HAVE_BPFV3),-mcpu=v3) $(if $(HAVE_BPFMASM),-masm=normal)
> +BPFCFLAGS ?= -O2 -Wall -Wno-unknown-pragmas $(if $(HAVE_BPFV3),-mcpu=v3) $(if $(HAVE_BPFMASM),-masm=normal) -ffreestanding
>  export BPFLD ?= bpf-unknown-none-ld
>  
>  all::

      parent reply	other threads:[~2025-07-31  4:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-31  3:09 [PATCH] bpf: compile BPF library functions with -ffreestanding Kris Van Hees
2025-07-31  3:44 ` Eugene Loh
2025-07-31  4:12 ` Sam James [this message]

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=875xf93sn3.fsf@gentoo.org \
    --to=sam@gentoo.org \
    --cc=dtrace-devel@oss.oracle.com \
    --cc=dtrace@lists.linux.dev \
    --cc=kris.van.hees@oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.