Open hp77-creator opened 5 months ago
relates to #145
A better title: Make examples depending on libbpf able to build on macos
libbpf itself can't work on macos obviously, but if we may get it able to be built on macos by providing mocked implementation of linux-specified functions that libbpf needs. These mocked implementations could be just empty functions. They don't need to really work, since they'll be overriden by function implementations provided by syscall-server. We provide these functions just to trick the linker.
If we were able to build examples of bpftime on macos, we'll be able to test them on macos with bpftime.
@Officeyutong , I am planning to close this one before frida, working on this atm.
@Officeyutong , I am planning to close this one before frida, working on this atm.
ok
@Officeyutong I observe that 'bpftime_frida_uprobe_attach_tests' fail in '--config RelWithDebInfo' and pass in '--config Debug' when using CMake to build tests and whole 'bpftime'.
@Officeyutong I observe that 'bpftime_frida_uprobe_attach_tests' fail in '--config RelWithDebInfo' and pass in '--config Debug' when using CMake to build tests and whole 'bpftime'.
Let me have a look at compile messages
@Officeyutong Do you mean the output of make
commands? I tried running make build-wo-libbpf
with slight change in config
option and then ran the tests. Do you want to see the output of the same. I am not building tests separately as such. I can try that if you mean that
Referenc
I mean CMake output when building bpftime_frida_uprobe_attach_tests
with RelWithDebInfo. It is not expected to fail
Is your feature request related to a problem? Please describe.
Right now, libbpf doesn't compile on macOS because of some headers which are not present. This issue is to add those headers or maybe their alternatives to the project and make bpftime work with libbpf on macOS. **Describe the solution you'd like**libbpf should work with bpftime on macOS. identify all the headers and syscalls that are being used and replace it with hooks to make them work.
Provide usage examples
After this feature is incoporated, bpftime will be able to work on macOS without
LIBBPF
flag disabled.