-
Notifications
You must be signed in to change notification settings - Fork 809
bpf2go: Allow multiple commands inside BPF2GO_CC
#1829
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
Conversation
7fcf7ff to
d59b67e
Compare
lmb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, does the following work?
bpf2go -cc ccache ... -- clang
Hunch: this will fail because of overrideFlags being passed to ccache before clang. Not sure that ccache likes that. If that's the case we can be a bit smarter in Compile and insert overrideFlags at the position where the first flags starts with -.
Yeah, it won't work currently. And yes, you could reposition However, from the perspective of using bpf2go in the same Makefile as a bunch of other build commands, it would be inconvenient to need to do some special handling around its invocation to, e.g., split apart my |
d59b67e to
874a074
Compare
|
/test |
|
@lmb Could you take another look at this when you get a chance? This is a blocker for me on cilium/cilium#38693 |
874a074 to
9107a5f
Compare
9107a5f to
952e6e4
Compare
|
@jrife DCO is failing, please take a look at https://github.com/cilium/ebpf/pull/1829/checks?check_run_id=46950786710 |
952e6e4 to
46a14b5
Compare
Fixed. Author didn't match the Also, switched back to |
Allow multiple commands to be specified inside BPF2GO_CC. Example: ``` BPF2GO_CC="ccache clang" go generate ../pkg/a/b ``` Signed-off-by: Jordan Rife <[email protected]>
46a14b5 to
c72a634
Compare
bpf_sock_term.o was built from the start to be "clang free". Use bpf2go to embed compiled BPF bytecode and generate Go skeletons. Reorder struct definitions inside union u6addr to ensure that the generated Go struct has a [16]uint8 for the Addr field and name the anonymous structs to get bpf2go to stop complaining. Add llvm-strip to the builder image, a dependency of bpf2go, and use the builder image for BPF generation (`make -C bpf generate`) to ensure reproducible results on systems with different LLVM versions. Bump github.com/cilium/ebpf module version to pull in [1]. [1]: cilium/ebpf#1829 Fixes: cilium#37907 Signed-off-by: Jordan Rife <[email protected]>
bpf_sock_term.o was built from the start to be "clang free". Use bpf2go to embed compiled BPF bytecode and generate Go skeletons. Reorder struct definitions inside union u6addr to ensure that the generated Go struct has a [16]uint8 for the Addr field and name the anonymous structs to get bpf2go to stop complaining. Add llvm-strip to the builder image, a dependency of bpf2go, and use the builder image for BPF generation (`make -C bpf generate`) to ensure reproducible results on systems with different LLVM versions. Bump github.com/cilium/ebpf module version to pull in [1]. [1]: cilium/ebpf#1829 Fixes: cilium#37907 Signed-off-by: Jordan Rife <[email protected]>
bpf_sock_term.o was built from the start to be "clang free". Use bpf2go to embed compiled BPF bytecode and generate Go skeletons. Reorder struct definitions inside union u6addr to ensure that the generated Go struct has a [16]uint8 for the Addr field and name the anonymous structs to get bpf2go to stop complaining. Add llvm-strip to the builder image, a dependency of bpf2go, and use the builder image for BPF generation (`make -C bpf generate`) to ensure reproducible results on systems with different LLVM versions. Bump github.com/cilium/ebpf module version to pull in [1]. [1]: cilium/ebpf#1829 Fixes: cilium#37907 Signed-off-by: Jordan Rife <[email protected]>
bpf_sock_term.o was built from the start to be "clang free". Use bpf2go to embed compiled BPF bytecode and generate Go skeletons. Reorder struct definitions inside union u6addr to ensure that the generated Go struct has a [16]uint8 for the Addr field and name the anonymous structs to get bpf2go to stop complaining. Add llvm-strip to the builder image, a dependency of bpf2go, and use the builder image for BPF generation (`make -C bpf generate`) to ensure reproducible results on systems with different LLVM versions. Bump github.com/cilium/ebpf module version to pull in [1]. [1]: cilium/ebpf#1829 Fixes: cilium#37907 Signed-off-by: Jordan Rife <[email protected]>
bpf_sock_term.o was built from the start to be "clang free". Use bpf2go to embed compiled BPF bytecode and generate Go skeletons. Reorder struct definitions inside union u6addr to ensure that the generated Go struct has a [16]uint8 for the Addr field and name the anonymous structs to get bpf2go to stop complaining. Add llvm-strip to the builder image, a dependency of bpf2go, and use the builder image for BPF generation (`make -C bpf generate`) to ensure reproducible results on systems with different LLVM versions. Bump github.com/cilium/ebpf module version to pull in [1]. [1]: cilium/ebpf#1829 Fixes: #37907 Signed-off-by: Jordan Rife <[email protected]>
bpf_sock_term.o was built from the start to be "clang free". Use bpf2go to embed compiled BPF bytecode and generate Go skeletons. Reorder struct definitions inside union u6addr to ensure that the generated Go struct has a [16]uint8 for the Addr field and name the anonymous structs to get bpf2go to stop complaining. Add llvm-strip to the builder image, a dependency of bpf2go, and use the builder image for BPF generation (`make -C bpf generate`) to ensure reproducible results on systems with different LLVM versions. Bump github.com/cilium/ebpf module version to pull in [1]. [1]: cilium/ebpf#1829 Fixes: #37907 Signed-off-by: Jordan Rife <[email protected]>
bpf_sock_term.o was built from the start to be "clang free". Use bpf2go to embed compiled BPF bytecode and generate Go skeletons. Reorder struct definitions inside union u6addr to ensure that the generated Go struct has a [16]uint8 for the Addr field and name the anonymous structs to get bpf2go to stop complaining. Add llvm-strip to the builder image, a dependency of bpf2go, and use the builder image for BPF generation (`make -C bpf generate`) to ensure reproducible results on systems with different LLVM versions. Bump github.com/cilium/ebpf module version to pull in [1]. [1]: cilium/ebpf#1829 Fixes: cilium#37907 Signed-off-by: Jordan Rife <[email protected]>
Allow multiple commands to be specified inside
BPF2GO_CC. Example:I'm working on cilium/cilium#38693 where one of the checks uses
ccache clanginstead of justclangas the compile command substitution. Currently, this doesn't work withbpf2go. This change makes it possible to use the same compile command as the rest of the build in cases like this.