Skip to content

Commit 43f7ab2

Browse files
guidosarduccianakryiko
authored andcommitted
tools/runqslower: Fix LDFLAGS and add LDLIBS support
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: 585bf46 ("tools: runqslower: Add EXTRA_CFLAGS and EXTRA_LDFLAGS support") Signed-off-by: Tony Ambardar <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Acked-by: Ilya Leoshkevich <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 25042fa commit 43f7ab2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/bpf/runqslower/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ INCLUDES := -I$(OUTPUT) -I$(BPF_INCLUDE) -I$(abspath ../../include/uapi)
1515
CFLAGS := -g -Wall $(CLANG_CROSS_FLAGS)
1616
CFLAGS += $(EXTRA_CFLAGS)
1717
LDFLAGS += $(EXTRA_LDFLAGS)
18+
LDLIBS += -lelf -lz
1819

1920
# Try to detect best kernel BTF source
2021
KERNEL_REL := $(shell uname -r)
@@ -51,7 +52,7 @@ clean:
5152
libbpf_hdrs: $(BPFOBJ)
5253

5354
$(OUTPUT)/runqslower: $(OUTPUT)/runqslower.o $(BPFOBJ)
54-
$(QUIET_LINK)$(CC) $(CFLAGS) $^ -lelf -lz -o $@
55+
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@
5556

5657
$(OUTPUT)/runqslower.o: runqslower.h $(OUTPUT)/runqslower.skel.h \
5758
$(OUTPUT)/runqslower.bpf.o | libbpf_hdrs

0 commit comments

Comments
 (0)