From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
Viktor Malik <vmalik@redhat.com>
Cc: bpf@vger.kernel.org, Andrii Nakryiko <andrii@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>,
Mykola Lysenko <mykolal@fb.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>, Shuah Khan <shuah@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>
Subject: Re: [PATCH bpf-next v3 1/3] selftests/bpf: Allow building with extra flags
Date: Mon, 04 Nov 2024 14:43:40 +0100 [thread overview]
Message-ID: <87a5ef9ks3.fsf@toke.dk> (raw)
In-Reply-To: <CAEf4BzZ_kB3YaeA5c2cB7dyiaJna4nGBtww9n0fS_b1d-ZtMGQ@mail.gmail.com>
Andrii Nakryiko <andrii.nakryiko@gmail.com> writes:
> On Fri, Nov 1, 2024 at 1:29 AM Viktor Malik <vmalik@redhat.com> wrote:
>>
>> In order to specify extra compilation or linking flags to BPF selftests,
>> it is possible to set EXTRA_CFLAGS and EXTRA_LDFLAGS from the command
>> line. The problem is that they are not propagated to sub-make calls
>> (runqslower, bpftool, libbpf) and in the better case are not applied, in
>> the worse case cause the entire build fail.
>>
>> Propagate EXTRA_CFLAGS and EXTRA_LDFLAGS to the sub-makes.
>>
>> This, for instance, allows to build selftests as PIE with
>>
>> $ make EXTRA_CFLAGS='-fPIE' EXTRA_LDFLAGS='-pie'
>>
>> Without this change, the command would fail because libbpf.a would not
>> be built with -fPIE and other PIE binaries would not link against it.
>>
>> The only problem is that we have to explicitly provide empty
>> EXTRA_CFLAGS='' and EXTRA_LDFLAGS='' to the builds of kernel modules as
>> we don't want to build modules with flags used for userspace (the above
>> example would fail as kernel doesn't support PIE).
>>
>> Signed-off-by: Viktor Malik <vmalik@redhat.com>
>> ---
>> tools/testing/selftests/bpf/Makefile | 34 +++++++++++++++++++---------
>> 1 file changed, 23 insertions(+), 11 deletions(-)
>>
>
> Ok, so this will conflict with Toke's [0]. Who should go first? :)
I'm OK with rebasing on top of Viktor's patch :)
>
> And given you guys touch these more obscure parts of BPF selftests
> Makefile, I'd really appreciate it if you can help reviewing them for
> each other :)
Sure, can do!
-Toke
next prev parent reply other threads:[~2024-11-04 13:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-01 8:27 [PATCH bpf-next v3 0/3] selftests/bpf: Improve building with extra Viktor Malik
2024-11-01 8:27 ` [PATCH bpf-next v3 1/3] selftests/bpf: Allow building with extra flags Viktor Malik
2024-11-01 19:34 ` Andrii Nakryiko
2024-11-04 13:43 ` Toke Høiland-Jørgensen [this message]
2024-11-06 20:37 ` Andrii Nakryiko
2024-11-04 14:03 ` Toke Høiland-Jørgensen
2024-11-01 8:27 ` [PATCH bpf-next v3 2/3] bpftool: Prevent setting duplicate _GNU_SOURCE in Makefile Viktor Malik
2024-11-04 14:05 ` Toke Høiland-Jørgensen
2024-11-01 8:27 ` [PATCH bpf-next v3 3/3] selftests/bpf: Disable warnings on unused flags for Clang builds Viktor Malik
2024-11-01 19:46 ` [PATCH bpf-next v3 0/3] selftests/bpf: Improve building with extra Andrii Nakryiko
2024-11-04 11:34 ` Viktor Malik
2024-11-01 19:50 ` patchwork-bot+netdevbpf
2024-11-06 20:40 ` patchwork-bot+netdevbpf
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=87a5ef9ks3.fsf@toke.dk \
--to=toke@redhat.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=justinstitt@google.com \
--cc=kpsingh@kernel.org \
--cc=martin.lau@linux.dev \
--cc=morbo@google.com \
--cc=mykolal@fb.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=vmalik@redhat.com \
--cc=yonghong.song@linux.dev \
/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