libbpfgo
libbpfgo copied to clipboard
Building static libbpfgo fails in Makefile running in v0.2.5: /usr/bin/ld cannot found lXX
Run command make -C selftest/perfbuffers or make selftest-static-run
Out Error
/usr/lib/golang/pkg/tool/linux_amd64/link: running clang failed: exit status 1
/usr/bin/ld: cannot found -lelf
/usr/bin/ld: cannot found -lz
/usr/bin/ld: cannot found -lelf
/usr/bin/ld: cannot found -lz
/usr/bin/ld: cannot found -lelf
/usr/bin/ld: cannot found -lz
/usr/bin/ld: cannot found -lc
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
Linux Version
Fedora release 36 (Thirty Six)
Linux fedora 5.17.5 #2 SMP PREEMPT Sun Sep 4 19:24:15 CST 2022 x86_64 x86_64 x86_64 GNU/Linux
Libbpf Version
Name : libbpf
Epoch : 2
Version : 0.7.0
Release : 3.fc36
Architecture : x86_64
Size : 356 k
Source : libbpf-0.7.0-3.fc36.src.rpm
Possible example on how to "solve" issues like this in Makefile: https://github.com/aquasecurity/tracee/blob/main/Makefile#L50
I have the same problem, have you solved it? Architecture:ARM64 clang version:clang-12
@zbh255 @sunhaotian0122 In the meantime you can try: https://github.com/aquasecurity/libbpfgo#contributing
@zbh255 Would you mind trying against main? We've merged related fixes: https://github.com/aquasecurity/libbpfgo/pull/431