Re: [PATCH bpf-next v2] tools/runqslower: Fix LDFLAGS and add LDLIBS support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> > > ---
> > > 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@xxxxxxxxxxxxx>
> 
> 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.





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux