From: Eduard Zingerman <eddyz87@gmail.com>
To: Viktor Malik <vmalik@redhat.com>, bpf@vger.kernel.org
Cc: andrii@kernel.org, ast@kernel.org, daniel@iogearbox.net,
martin.lau@linux.dev, kernel-team@fb.com,
yonghong.song@linux.dev, masahiroy@kernel.org,
Stanislav Fomichev <sdf@fomichev.me>
Subject: Re: [PATCH bpf v3] samples/bpf: remove unnecessary -I flags from libbpf EXTRA_CFLAGS
Date: Wed, 04 Dec 2024 09:13:49 -0800 [thread overview]
Message-ID: <c1277e5fb5b32f3354c6e042380b3188aeefd146.camel@gmail.com> (raw)
In-Reply-To: <778668f2-bb1a-438e-b075-05a12db726af@redhat.com>
On Wed, 2024-12-04 at 10:41 +0100, Viktor Malik wrote:
[...]
> I was not quick enough to reply before this got merged, sorry about that.
>
> This will break situations when we want to pass extra flags to the
> libbpf sub-make from the command line, e.g. to build samples as PIE:
>
> $ make TPROGS_USER_CFLAGS="-fpie" TPROGS_USER_LDFLAGS="-pie"
> [...]
> /usr/bin/ld: /bpf/samples/bpf/libbpf/libbpf.a(libbpf-in.o):
> relocation R_X86_64_32 against `.rodata.str1.1' can not be used when
> making a PIE object; recompile with -fPIE
> /usr/bin/ld: failed to set dynamic section sizes: bad value
>
> I think that we should add
>
> COMMON_CFLAGS = $(TPROGS_USER_CFLAGS)
>
> somewhere to the top of the Makefile.
Hi Viktor,
This makes sense. Surprisingly enough, your example with -pie compiles
successfully for me, both using clang and gcc. I'll post an update
adding the suggested line.
Thanks,
Eduard
prev parent reply other threads:[~2024-12-04 17:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-03 18:22 [PATCH bpf v3] samples/bpf: remove unnecessary -I flags from libbpf EXTRA_CFLAGS Eduard Zingerman
2024-12-03 22:20 ` patchwork-bot+netdevbpf
2024-12-04 9:41 ` Viktor Malik
2024-12-04 17:13 ` Eduard Zingerman [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=c1277e5fb5b32f3354c6e042380b3188aeefd146.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@fb.com \
--cc=martin.lau@linux.dev \
--cc=masahiroy@kernel.org \
--cc=sdf@fomichev.me \
--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