mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
tools/runqslower: Fix LDFLAGS and add LDLIBS support
[ Upstream commit f86601c3661946721e8f260bdd812b759854ac22 ]
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: 585bf4640e
("tools: runqslower: Add EXTRA_CFLAGS and EXTRA_LDFLAGS support")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Link: https://lore.kernel.org/bpf/20240723003045.2273499-1-tony.ambardar@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
cd1b7f772f
commit
b0b99c1226
1 changed files with 2 additions and 1 deletions
|
@ -15,6 +15,7 @@ INCLUDES := -I$(OUTPUT) -I$(BPF_INCLUDE) -I$(abspath ../../include/uapi)
|
||||||
CFLAGS := -g -Wall $(CLANG_CROSS_FLAGS)
|
CFLAGS := -g -Wall $(CLANG_CROSS_FLAGS)
|
||||||
CFLAGS += $(EXTRA_CFLAGS)
|
CFLAGS += $(EXTRA_CFLAGS)
|
||||||
LDFLAGS += $(EXTRA_LDFLAGS)
|
LDFLAGS += $(EXTRA_LDFLAGS)
|
||||||
|
LDLIBS += -lelf -lz
|
||||||
|
|
||||||
# Try to detect best kernel BTF source
|
# Try to detect best kernel BTF source
|
||||||
KERNEL_REL := $(shell uname -r)
|
KERNEL_REL := $(shell uname -r)
|
||||||
|
@ -51,7 +52,7 @@ clean:
|
||||||
libbpf_hdrs: $(BPFOBJ)
|
libbpf_hdrs: $(BPFOBJ)
|
||||||
|
|
||||||
$(OUTPUT)/runqslower: $(OUTPUT)/runqslower.o $(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.o: runqslower.h $(OUTPUT)/runqslower.skel.h \
|
||||||
$(OUTPUT)/runqslower.bpf.o | libbpf_hdrs
|
$(OUTPUT)/runqslower.bpf.o | libbpf_hdrs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue