Skip to contentSkip to conversation

runqslower: fix Makefile

PATCH Superseded Yulia Kartseva 2 participants 4 messages Jan 30, 2020

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover runqslower: fix Makefile

From: Julia Kartseva <[email protected]>

Fix undefined reference linker errors when building runqslower with gcc 7.4.0 on Ubuntu 18.04.
The issue is with misplaced -lelf, -lz options in Makefile:
$(Q)$(CC) $(CFLAGS) -lelf -lz $^ -o $@

-lelf, -lz options should follow the list of target dependencies:
$(Q)$(CC) $(CFLAGS) $^ -lelf -lz -o $@
or after substitution
cc -g -Wall runqslower.o libbpf.a -lelf -lz -o runqslower

The current order of gcc params causes failure in libelf symbols resolution, e.g. undefined reference to `elf_memory'

Julia Kartseva (1):
runqslower: fix Makefile

 tools/bpf/runqslower/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 runqslower: fix Makefile

From: Julia Kartseva <[email protected]>

Fix undefined reference linker errors when building runqslower with gcc 7.4.0 on Ubuntu 18.04.
The issue is with misplaced -lelf, -lz options in Makefile:
$(Q)$(CC) $(CFLAGS) -lelf -lz $^ -o $@

-lelf, -lz options should follow the list of target dependencies:
$(Q)$(CC) $(CFLAGS) $^ -lelf -lz -o $@
or after substitution
cc -g -Wall runqslower.o libbpf.a -lelf -lz -o runqslower

The current order of gcc params causes failure in libelf symbols resolution, e.g. undefined reference to `elf_memory'

---
 tools/bpf/runqslower/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/runqslower/Makefile +1 -1
index 0c021352b..87eae5be9 100644
@@ -41,7 +41,7 @@ clean:
 
 $(OUTPUT)/runqslower: $(OUTPUT)/runqslower.o $(BPFOBJ)
 	$(call msg,BINARY,$@)
-	$(Q)$(CC) $(CFLAGS) -lelf -lz $^ -o $@
+	$(Q)$(CC) $(CFLAGS) $^ -lelf -lz -o $@
 
 $(OUTPUT)/runqslower.o: runqslower.h $(OUTPUT)/runqslower.skel.h	      \
 			$(OUTPUT)/runqslower.bpf.o
Signature · 1 line
2.17.1
#2 lore raw
Quoted 8 lines · Yulia Kartseva

From: Julia Kartseva <[email protected]>

Fix undefined reference linker errors when building runqslower with gcc 7.4.0 on Ubuntu 18.04.
The issue is with misplaced -lelf, -lz options in Makefile:
$(Q)$(CC) $(CFLAGS) -lelf -lz $^ -o $@

Quoted 8 lines

-lelf, -lz options should follow the list of target dependencies:
$(Q)$(CC) $(CFLAGS) $^ -lelf -lz -o $@
or after substitution
cc -g -Wall runqslower.o libbpf.a -lelf -lz -o runqslower

The current order of gcc params causes failure in libelf symbols resolution, e.g. undefined reference to `elf_memory'
---

Thanks for fixing!

Just for the future, there is no need to create a cover letter for a single patch.

Please also add Fixes tag like so:

Fixes 9c01546d26d2 ("tools/bpf: Add runqslower tool to tools/bpf")
Quoted 19 lines
 tools/bpf/runqslower/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/runqslower/Makefile +1 -2
index 0c021352b..87eae5be9 100644
@@ -41,7 +41,7 @@ clean:
 
 $(OUTPUT)/runqslower: $(OUTPUT)/runqslower.o $(BPFOBJ)
        $(call msg,BINARY,$@)
-       $(Q)$(CC) $(CFLAGS) -lelf -lz $^ -o $@
+       $(Q)$(CC) $(CFLAGS) $^ -lelf -lz -o $@
 
 $(OUTPUT)/runqslower.o: runqslower.h $(OUTPUT)/runqslower.skel.h             \
                        $(OUTPUT)/runqslower.bpf.o
--

2.17.1

#3 lore raw
Quoted 19 lines · Andrii Nakryiko
Quoted 8 lines · Yulia Kartseva

From: Julia Kartseva <[email protected]>

Fix undefined reference linker errors when building runqslower with gcc 7.4.0 on Ubuntu 18.04.
The issue is with misplaced -lelf, -lz options in Makefile:
$(Q)$(CC) $(CFLAGS) -lelf -lz $^ -o $@

Quoted 8 lines

-lelf, -lz options should follow the list of target dependencies:
$(Q)$(CC) $(CFLAGS) $^ -lelf -lz -o $@
or after substitution
cc -g -Wall runqslower.o libbpf.a -lelf -lz -o runqslower

The current order of gcc params causes failure in libelf symbols resolution, e.g. undefined reference to `elf_memory'
---

Quoted 8 lines

Thanks for fixing!

Just for the future, there is no need to create a cover letter for a single patch.

Please also add Fixes tag like so:

Fixes 9c01546d26d2 ("tools/bpf: Add runqslower tool to tools/bpf")

Oh, and Signed-off-by is missing too, please add and respin v2.

With that, also add:

Quoted 20 lines
Quoted 20 lines
 tools/bpf/runqslower/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/runqslower/Makefile +1 -2
index 0c021352b..87eae5be9 100644
@@ -41,7 +41,7 @@ clean:
 
 $(OUTPUT)/runqslower: $(OUTPUT)/runqslower.o $(BPFOBJ)
        $(call msg,BINARY,$@)
-       $(Q)$(CC) $(CFLAGS) -lelf -lz $^ -o $@
+       $(Q)$(CC) $(CFLAGS) $^ -lelf -lz -o $@
 
 $(OUTPUT)/runqslower.o: runqslower.h $(OUTPUT)/runqslower.skel.h             \
                        $(OUTPUT)/runqslower.bpf.o
--

2.17.1