BPF List
 help / color / mirror / Atom feed
From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Tony Ambardar <tony.ambardar@gmail.com>
Cc: bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Eduard Zingerman <eddyz87@gmail.com>, 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@google.com>, Hao Luo <haoluo@google.com>,
	Jiri Olsa <jolsa@kernel.org>
Subject: Re: [PATCH bpf-next v2] tools/runqslower: Fix LDFLAGS and add LDLIBS support
Date: Tue, 23 Jul 2024 11:57:28 +0200	[thread overview]
Message-ID: <4ab4a294118ed51156e5114193cb0b1838c5dfa3.camel@linux.ibm.com> (raw)
In-Reply-To: <Zp9wq1fRPdaU9/sE@kodidev-ubuntu>

On Tue, 2024-07-23 at 01:58 -0700, Tony Ambardar wrote:
> On Tue, Jul 23, 2024 at 09:56:56AM +0200, Ilya Leoshkevich wrote:
> > On Mon, 2024-07-22 at 17:30 -0700, Tony Ambardar wrote:
> > > Actually use previously defined LDFLAGS during build and add
> > > support
> > > for
> > > LDLIBS to link extra standalone libraries e.g. 'argp' which is
> > > not
> > > provided
> > > by musl libc.
> > > 
> > > Fixes: 585bf4640ebe ("tools: runqslower: Add EXTRA_CFLAGS and
> > > EXTRA_LDFLAGS support")
> > > Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
> > > ---
> > > v1-v2:
> > >  - add missing CC for Ilya
> > > 
> > > ---
> > >  tools/bpf/runqslower/Makefile | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/tools/bpf/runqslower/Makefile
> > > b/tools/bpf/runqslower/Makefile
> > > index d8288936c912..c4f1f1735af6 100644
> > > --- a/tools/bpf/runqslower/Makefile
> > > +++ b/tools/bpf/runqslower/Makefile
> > > @@ -15,6 +15,7 @@ INCLUDES := -I$(OUTPUT) -I$(BPF_INCLUDE) -
> > > I$(abspath ../../include/uapi)
> > >  CFLAGS := -g -Wall $(CLANG_CROSS_FLAGS)
> > >  CFLAGS += $(EXTRA_CFLAGS)
> > >  LDFLAGS += $(EXTRA_LDFLAGS)
> > > +LDLIBS += -lelf -lz
> > >  
> > >  # Try to detect best kernel BTF source
> > >  KERNEL_REL := $(shell uname -r)
> > > @@ -51,7 +52,7 @@ clean:
> > >  libbpf_hdrs: $(BPFOBJ)
> > >  
> > >  $(OUTPUT)/runqslower: $(OUTPUT)/runqslower.o $(BPFOBJ)
> > > -	$(QUIET_LINK)$(CC) $(CFLAGS) $^ -lelf -lz -o $@
> > > +	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o
> > > $@
> > >  
> > >  $(OUTPUT)/runqslower.o: runqslower.h
> > > $(OUTPUT)/runqslower.skel.h	      \
> > >  			$(OUTPUT)/runqslower.bpf.o | libbpf_hdrs
> > 
> > Looks reasonable to me, but I don't quite get what exactly did
> > 585bf4640ebe break? In any case:
> > 
> > Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
> 
> I believe 585bf4640ebe added the LDFLAGS definition above but then
> didn't
> include it in the runqslower target's compile command. I only
> happened to
> notice while adding LDLIBS.
> 
> Thanks for looking at this.

Ah, I see. Perhaps what I was passing in CFLAGS was already enough for
my use case, so I didn't notice back then. Thanks for the explanation.

  reply	other threads:[~2024-07-23  9:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-23  0:30 [PATCH bpf-next v2] tools/runqslower: Fix LDFLAGS and add LDLIBS support Tony Ambardar
2024-07-23  0:34 ` bot+bpf-ci
2024-07-23  1:40 ` bot+bpf-ci
2024-07-23  2:45 ` bot+bpf-ci
2024-07-23  7:56 ` Ilya Leoshkevich
2024-07-23  8:58   ` Tony Ambardar
2024-07-23  9:57     ` Ilya Leoshkevich [this message]
2024-07-23 20:30 ` 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=4ab4a294118ed51156e5114193cb0b1838c5dfa3.camel@linux.ibm.com \
    --to=iii@linux.ibm.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=kpsingh@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=tony.ambardar@gmail.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