kmesh-net / kmesh

High Performance ServiceMesh Data Plane Based on Programmable Kernel
https://kmesh.net
Apache License 2.0
361 stars 46 forks source link

Build error #452

Closed Okabe-Rintarou-0 closed 6 days ago

Okabe-Rintarou-0 commented 1 week ago

What happened: In the current main branch, make build will fail

/kmesh/bpf/kmesh/workload/sendmsg.c:115:78: note: passing argument to parameter 'data' here
static inline void sk_msg_write_buf(struct sk_msg_md *msg, __u32 *off, __u8 *data, __u32 len)
                                                                             ^
../workload/sendmsg.c:123:5: error: A call to built-in function 'memcpy' is not supported.
    bpf_memcpy(begin, data, len);
    ^
3 warnings and 1 error generated.
Error: can't execute clang: exit status 1
exit status 1
bpf/kmesh/bpf2go/bpf2go.go:14: running "go": exit status 1
make: *** [Makefile:83: all] Error 1
   INSTALL //usr/lib64/libkmesh_api_v2_c.so
   INSTALL //usr/lib64/libkmesh_deserial.so
make[1]: Nothing to be done for 'install'.
   INSTALL //usr/bin/kmesh-daemon
install: cannot stat 'kmesh-daemon': No such file or directory
make: *** [Makefile:122: install] Error 1

What you expected to happen: Should build success How to reproduce it (as minimally and precisely as possible): make build Anything else we need to know?:

Environment:

hzxuzhonghu commented 1 week ago

@nlgwcy I can build successfully via ./build.sh, but cannot via make build

nlgwcy commented 1 week ago

What is os version? I can compile successfully via make build in openEuler 22.03 LTS SP3.

Okabe-Rintarou-0 commented 1 week ago

ubuntu 20.04, github action also failed image

Okabe-Rintarou-0 commented 1 week ago

ubuntu 22.04 also failed.

image

hzxuzhonghu commented 1 week ago

I suspect the build image we used does not support memcpy

Okabe-Rintarou-0 commented 1 week ago

image

bfforever commented 1 week ago

bpf_memcpy(begin, data, len) change variable len to constant can compile. It seems problem that len is not constant.

hzxuzhonghu commented 1 week ago

Why can it build sucessfully with ./build.sh

bfforever commented 1 week ago

The problem seems like as https://github.com/llvm/llvm-project/issues/93700#issuecomment-2138421752 descibed. maybe the llvm in our local machine and kemsh-build image is different.