Skip to contentSkip to conversation

samples/bpf: Add missing -lz to TPROGS_LDLIBS

PATCH Applied Toke Høiland-Jørgensen 3 participants 3 messages Dec 16, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 samples/bpf: Add missing -lz to TPROGS_LDLIBS

Since libbpf now links against zlib, this needs to be included in the linker invocation for the userspace programs in samples/bpf that link statically against libbpf.

Fixes 166750bc1dd2 ("libbpf: Support libbpf-provided extern variables")
---
 samples/bpf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
samples/bpf/Makefile +1 -1
index 1fc42ad8ff49..b00651608765 100644
@@ -196,7 +196,7 @@ endif
 
 TPROGCFLAGS_bpf_load.o += -Wno-unused-variable
 
-TPROGS_LDLIBS			+= $(LIBBPF) -lelf
+TPROGS_LDLIBS			+= $(LIBBPF) -lelf -lz
 TPROGLDLIBS_tracex4		+= -lrt
 TPROGLDLIBS_trace_output	+= -lrt
 TPROGLDLIBS_map_perf_test	+= -lrt
Signature · 1 line
2.24.0
Tested-by on v1 1/1
#1 lore raw
Quoted 7 lines · Toke Høiland-Jørgensen

Since libbpf now links against zlib, this needs to be included in the linker invocation for the userspace programs in samples/bpf that link statically against libbpf.

Fixes 166750bc1dd2 ("libbpf: Support libbpf-provided extern variables")

Thanks Toke!

Quoted 20 lines
---
 samples/bpf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
samples/bpf/Makefile +1 -2
index 1fc42ad8ff49..b00651608765 100644
@@ -196,7 +196,7 @@ endif
 
 TPROGCFLAGS_bpf_load.o += -Wno-unused-variable
 
-TPROGS_LDLIBS                  += $(LIBBPF) -lelf
+TPROGS_LDLIBS                  += $(LIBBPF) -lelf -lz
 TPROGLDLIBS_tracex4            += -lrt
 TPROGLDLIBS_trace_output       += -lrt
 TPROGLDLIBS_map_perf_test      += -lrt
--

2.24.0

#2 lore raw
Quoted 7 lines · Björn Töpel
Quoted 5 lines · Toke Høiland-Jørgensen

Since libbpf now links against zlib, this needs to be included in the linker invocation for the userspace programs in samples/bpf that link statically against libbpf.

Quoted 6 lines
Quoted 2 lines
Fixes 166750bc1dd2 ("libbpf: Support libbpf-provided extern variables")

Thanks Toke!

Applied. Thanks