]> git.baikalelectronics.ru Git - kernel.git/commit
runqslower: Fix Makefile
authorYulia Kartseva <hex@fb.com>
Thu, 30 Jan 2020 23:13:10 +0000 (15:13 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 31 Jan 2020 00:19:47 +0000 (16:19 -0800)
commit04f772d22fa4ec2e4509727635f6d102e550f50e
tree48a10d37021cb4641f66e7e8af8e90a99c39a3e3
parent11769490bb2f19be0bd84f7d7073f24863737df8
runqslower: Fix Makefile

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'

Fixes: 046ac40f64e1 ("tools/bpf: Add runqslower tool to tools/bpf")
Signed-off-by: Julia Kartseva <hex@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/908498f794661c44dca54da9e09dc0c382df6fcb.1580425879.git.hex@fb.com
tools/bpf/runqslower/Makefile