andrewkroh / go-ebpf

eBPF programs without a libbcc dependency
Apache License 2.0
59 stars 11 forks source link

Can i use go-ebpf to compile restricted C code to ebpf bytecode? #5

Closed tsinhi closed 5 years ago

tsinhi commented 5 years ago

Hi, i'm just looking for a tool which can comiple C(restricted) to ebpf bytecode without clang/llvm. i read the readme.md file ,it says like as follows:

The bytecode is shipped with the Go program to avoid having a runtime dependency on clang and llc “.

Does it means I can use go-ebpf for compiling C to ebpf bytecode? Thanks!

andrewkroh commented 5 years ago

No. The examples in this package require LLVM at build time. Then they ship the bytecode as part of the binary.