-
Notifications
You must be signed in to change notification settings - Fork 22
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
Could not compile on Debian 12 #32
Comments
Just to confirm please check whether bpf/vmlinux.h is empty, if it is, please apt-get install bpftool , make clean, make |
) Summary: in case of #32 missing bpftool can cause such build failures, this makes `make` fail in case we are missing bpftool Also replace asciinemas with gifs Pull Request resolved: #33 Reviewed By: abulimov Differential Revision: D45867469 Pulled By: deathowl fbshipit-source-id: 4b0899a6407f4cfab4f4957bf7b8eb348149f270
@l1x please try pulling latest main, make should warn you about missing bpftool now. Please close the issue if this has been resolved for you |
> git pull origin main
From github.com:facebookincubator/dns
* branch main -> FETCH_HEAD
Already up to date. l1x@deby ~/c/d/dnswatch (main)> make clean
rm -f snoop/out/dnswatch_bpf_probe_core.o
rm -f bpf/vmlinux.h l1x@deby ~/c/d/dnswatch (main)> make
clang -g -O2 -Wall -fpie -fno-stack-protector -I /usr/include/bpf -target bpf -D__TARGET_ARCH_x86 -I bpf -c bpf/dnswatch.bpf.c -o snoop/out/dnswatch_bpf_probe_core.o
In file included from bpf/dnswatch.bpf.c:23:
In file included from /usr/include/bpf/bpf_helpers.h:11:
In file included from /usr/include/linux/types.h:9:
/usr/include/linux/posix_types.h:27:3: error: typedef redefinition with different types ('struct __kernel_fd_set' vs 'struct __kernel_fd_set')
} __kernel_fd_set;
^
bpf/vmlinux.h:104571:3: note: previous definition is here
} __kernel_fd_set;
^
In file included from bpf/dnswatch.bpf.c:23:
In file included from /usr/include/bpf/bpf_helpers.h:11:
In file included from /usr/include/linux/types.h:9:
In file included from /usr/include/linux/posix_types.h:36:
In file included from /usr/include/asm/posix_types.h:7:
In file included from /usr/include/asm/posix_types_64.h:18:
/usr/include/asm-generic/posix_types.h:68:22: error: typedef redefinition with different types ('unsigned int' vs '__kernel_ulong_t' (aka 'unsigned long'))
typedef unsigned int __kernel_size_t;
^
bpf/vmlinux.h:55:26: note: previous definition is here
typedef __kernel_ulong_t __kernel_size_t;
^
In file included from bpf/dnswatch.bpf.c:23:
In file included from /usr/include/bpf/bpf_helpers.h:11:
In file included from /usr/include/linux/types.h:9:
In file included from /usr/include/linux/posix_types.h:36:
In file included from /usr/include/asm/posix_types.h:7:
In file included from /usr/include/asm/posix_types_64.h:18:
/usr/include/asm-generic/posix_types.h:69:14: error: typedef redefinition with different types ('int' vs '__kernel_long_t' (aka 'long'))
typedef int __kernel_ssize_t;
^
bpf/vmlinux.h:57:25: note: previous definition is here
typedef __kernel_long_t __kernel_ssize_t;
^
In file included from bpf/dnswatch.bpf.c:23:
In file included from /usr/include/bpf/bpf_helpers.h:11:
In file included from /usr/include/linux/types.h:9:
In file included from /usr/include/linux/posix_types.h:36:
In file included from /usr/include/asm/posix_types.h:7:
In file included from /usr/include/asm/posix_types_64.h:18:
/usr/include/asm-generic/posix_types.h:70:14: error: typedef redefinition with different types ('int' vs '__kernel_long_t' (aka 'long'))
typedef int __kernel_ptrdiff_t;
^
bpf/vmlinux.h:69816:25: note: previous definition is here
typedef __kernel_long_t __kernel_ptrdiff_t;
^
In file included from bpf/dnswatch.bpf.c:23:
In file included from /usr/include/bpf/bpf_helpers.h:11:
In file included from /usr/include/linux/types.h:9:
In file included from /usr/include/linux/posix_types.h:36:
In file included from /usr/include/asm/posix_types.h:7:
In file included from /usr/include/asm/posix_types_64.h:18:
/usr/include/asm-generic/posix_types.h:81:3: error: typedef redefinition with different types ('struct __kernel_fsid_t' vs 'struct __kernel_fsid_t')
} __kernel_fsid_t;
^
bpf/vmlinux.h:19770:3: note: previous definition is here
} __kernel_fsid_t;
^
bpf/dnswatch.bpf.c:151:21: warning: unused variable 'inet' [-Wunused-variable]
struct inet_sock* inet = (struct inet_sock*)sk;
^
bpf/dnswatch.bpf.c:176:21: warning: unused variable 'inet' [-Wunused-variable]
struct inet_sock* inet = (struct inet_sock*)sk;
^
2 warnings and 5 errors generated.
make: *** [Makefile:9: snoop/out/dnswatch_bpf_probe_core.o] Error 1
|
I am updating everything to latest greatest and try to figure out what is causing this. |
l1x@deby ~/c/d/dnswatch (main) [2]> apt list | egrep 'bpftool|headers' | egrep installed
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
bpftool/testing,now 7.1.0+6.1.27-1 amd64 [installed]
linux-headers-6.1.0-8-amd64/now 6.1.25-1 amd64 [installed,local]
linux-headers-6.1.0-8-common/now 6.1.25-1 all [installed,local] l1x@deby ~/c/d/dnswatch (main)> make clean && make
rm -f snoop/out/dnswatch_bpf_probe_core.o
rm -f bpf/vmlinux.h
bpftool btf dump file /sys/kernel/btf/vmlinux format c > bpf/vmlinux.h
clang -g -O2 -Wall -fpie -fno-stack-protector -I /usr/include/bpf -target bpf -D__TARGET_ARCH_x86 -I bpf -c bpf/dnswatch.bpf.c -o snoop/out/dnswatch_bpf_probe_core.o
In file included from bpf/dnswatch.bpf.c:23:
In file included from /usr/include/bpf/bpf_helpers.h:11:
In file included from /usr/include/linux/types.h:9:
/usr/include/linux/posix_types.h:27:3: error: typedef redefinition with different types ('struct __kernel_fd_set' vs 'struct __kernel_fd_set')
} __kernel_fd_set;
^
bpf/vmlinux.h:104571:3: note: previous definition is here
} __kernel_fd_set;
^
In file included from bpf/dnswatch.bpf.c:23:
In file included from /usr/include/bpf/bpf_helpers.h:11:
In file included from /usr/include/linux/types.h:9:
In file included from /usr/include/linux/posix_types.h:36:
In file included from /usr/include/asm/posix_types.h:7:
In file included from /usr/include/asm/posix_types_64.h:18:
/usr/include/asm-generic/posix_types.h:68:22: error: typedef redefinition with different types ('unsigned int' vs '__kernel_ulong_t' (aka 'unsigned long'))
typedef unsigned int __kernel_size_t;
^
bpf/vmlinux.h:55:26: note: previous definition is here
typedef __kernel_ulong_t __kernel_size_t;
^
In file included from bpf/dnswatch.bpf.c:23:
In file included from /usr/include/bpf/bpf_helpers.h:11:
In file included from /usr/include/linux/types.h:9:
In file included from /usr/include/linux/posix_types.h:36:
In file included from /usr/include/asm/posix_types.h:7:
In file included from /usr/include/asm/posix_types_64.h:18:
/usr/include/asm-generic/posix_types.h:69:14: error: typedef redefinition with different types ('int' vs '__kernel_long_t' (aka 'long'))
typedef int __kernel_ssize_t;
^
bpf/vmlinux.h:57:25: note: previous definition is here
typedef __kernel_long_t __kernel_ssize_t;
^
In file included from bpf/dnswatch.bpf.c:23:
In file included from /usr/include/bpf/bpf_helpers.h:11:
In file included from /usr/include/linux/types.h:9:
In file included from /usr/include/linux/posix_types.h:36:
In file included from /usr/include/asm/posix_types.h:7:
In file included from /usr/include/asm/posix_types_64.h:18:
/usr/include/asm-generic/posix_types.h:70:14: error: typedef redefinition with different types ('int' vs '__kernel_long_t' (aka 'long'))
typedef int __kernel_ptrdiff_t;
^
bpf/vmlinux.h:69816:25: note: previous definition is here
typedef __kernel_long_t __kernel_ptrdiff_t;
^
In file included from bpf/dnswatch.bpf.c:23:
In file included from /usr/include/bpf/bpf_helpers.h:11:
In file included from /usr/include/linux/types.h:9:
In file included from /usr/include/linux/posix_types.h:36:
In file included from /usr/include/asm/posix_types.h:7:
In file included from /usr/include/asm/posix_types_64.h:18:
/usr/include/asm-generic/posix_types.h:81:3: error: typedef redefinition with different types ('struct __kernel_fsid_t' vs 'struct __kernel_fsid_t')
} __kernel_fsid_t;
^
bpf/vmlinux.h:19770:3: note: previous definition is here
} __kernel_fsid_t;
^
bpf/dnswatch.bpf.c:151:21: warning: unused variable 'inet' [-Wunused-variable]
struct inet_sock* inet = (struct inet_sock*)sk;
^
bpf/dnswatch.bpf.c:176:21: warning: unused variable 'inet' [-Wunused-variable]
struct inet_sock* inet = (struct inet_sock*)sk;
^
2 warnings and 5 errors generated.
make: *** [Makefile:9: snoop/out/dnswatch_bpf_probe_core.o] Error 1 |
So far what I understand is that we have a duplicated definition:
/usr/include/linux/posix_types.h and bpf/vmlinux.h both have the same __kernel_fd_set type. |
I'm using
fbdns
version:Given:
When I run:
I expected this to happen:
Working compilation
But, instead this happened:
The text was updated successfully, but these errors were encountered: