-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem to statically link bpftool #66
Comments
I tried this on a debian docker image, and it still doesn't link, and I'm getting a whole bunch of errors like:
I'm trying to build/link it similar to the instructions here: https://github.com/projectcalico/bpftool, but instead of building it from the Linux kernel, I thought it would be faster to P.S. Without the |
Hi, and thanks for the report! The README specifies that I haven't found the time to look into the details for compiling statically with libbfd or llvm. I've been told that it works with LLVM, provided that the statically compiled version of the library is installed. For libbfd, it seems the libbfd.a library on the system is not enough, but I need to dig more to figure out the cause of these messages. Eventually we probably want to try static builds in the CI, too. In the meantime, a quick workaround would be to disable linking against libbfd/llvm; then |
@qmonnet oh hey thanks for the quick reply. Can I ask what did you modify in the Makefile to disable libbfd/llvm? I can try it on my Debian box, and if it doesn't work, I can certainly try it on Ubuntu as well. |
Ah I figured it out, just putting it here in case others might need a workaround:
|
Yes, disabling them should be doable just by changing |
OK, seems like I used brute force that did the trick, but there are nicer ways. Thanks a lot for your help on finding a workaround @qmonnet . Closing |
It was a useful report, I opened another issue as a follow-up. |
I also fixed the usage of |
Following the instructions in README.md, I used the command
hoping to compile and statically link the bpftool binary, however, the error I got it
I'm using a fedora:32 docker container to build. I'm guessing I need to install statically linked versions of libelf, libz and libc? I see libelf.so, libz.so and libc.so are all there in /usr/lib64. Where do I get libelf.a, libz.a, and libc.a? Not very familiar with statically linked libraries. Any help is appreciated!
The text was updated successfully, but these errors were encountered: