]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Support Debian in resolve_full_path()
authorIlya Leoshkevich <iii@linux.ibm.com>
Mon, 4 Apr 2022 22:50:20 +0000 (00:50 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 4 Apr 2022 23:47:16 +0000 (16:47 -0700)
commita8b331782c193cca8a3d267fc9b4208b8532cf9f
treeea0b4b0cc69737817786850969446c22dc58cc8b
parent37e943a5e25a37e3a6218a0b4d661079940ce655
libbpf: Support Debian in resolve_full_path()

attach_probe selftest fails on Debian-based distros with `failed to
resolve full path for 'libc.so.6'`. The reason is that these distros
embraced multiarch to the point where even for the "main" architecture
they store libc in /lib/<triple>.

This is configured in /etc/ld.so.conf and in theory it's possible to
replicate the loader's parsing and processing logic in libbpf, however
a much simpler solution is to just enumerate the known library paths.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220404225020.51029-1-iii@linux.ibm.com
tools/lib/bpf/libbpf.c