Help addressing compilation error (under WSL2 Ubuntu env in Windows 11)
Venkat Venkatsubra <[email protected]> Thu, 25 Jun 2026 15:40:01 +0000 (UTC)
| Newsgroups | dev.linux.lists.xdp2 |
|---|---|
| Message-ID | <[email protected]> |
Hello All,
In WSL 2 (Windows Subsystem for Linux) on my Windows 11 laptop,
I have Ubuntu environment.
root@Ambika:~/tom-xdp/xdp2/samples/xdp/flow_tracker_simple# uname -a
Linux Ambika 6.18.33.1-microsoft-standard-WSL2
I get these compilation errors.
Any suggestion what I should be looking at ?
root@Ambika:~/tom-xdp/xdp2/samples/xdp/flow_tracker_simple# make XDP2DIR=~/tom-xdp/xdp2/install/x86_64
clang -I/root/tom-xdp/xdp2/install/x86_64/include -g -O2 -c -o parser.o parser.c
/root/tom-xdp/xdp2/install/x86_64/bin/xdp2-compiler -I/root/tom-xdp/xdp2/install/x86_64/include -i parser.c -o p
arser.xdp.h
struct __attribute__((aligned(64))) __attribute__((packed)) xdp2_parse_node {
enum xdp2_parser_node_type node_type __attribute__((packed));
__s8 unknown_ret;
__u8 key_sel;
__u8 flags;
__u8 rsvd;
const struct xdp2_proto_def *proto_def;
const struct xdp2_parse_node_ops ops;
const struct xdp2_proto_table *proto_table;
const struct xdp2_parse_node *wildcard_node;
char *text_name;
}struct xdp2_parse_node_ops {
void (*extract_metadata)(const void *, size_t, void *, void *, const struct xdp2_ctrl_data *);
int (*handler)(const void *, size_t, void *, void *, const struct xdp2_ctrl_data *);
int (*post_handler)(const void *, size_t, void *, void *, const struct xdp2_ctrl_data *);
}struct __attribute__((aligned(64))) __attribute__((packed)) xdp2_parse_node {
enum xdp2_parser_node_type node_type __attribute__((packed));
__s8 unknown_ret;
__u8 key_sel;
__u8 flags;
__u8 rsvd;
const struct xdp2_proto_def *proto_def;
const struct xdp2_parse_node_ops ops;
const struct xdp2_proto_table *proto_table;
const struct xdp2_parse_node *wildcard_node;
char *text_name;
}struct __attribute__((aligned(64))) __attribute__((packed)) xdp2_parse_node {
enum xdp2_parser_node_type node_type __attribute__((packed));
__s8 unknown_ret;
__u8 key_sel;
__u8 flags;
__u8 rsvd;
const struct xdp2_proto_def *proto_def;
const struct xdp2_parse_node_ops ops;
const struct xdp2_proto_table *proto_table;
const struct xdp2_parse_node *wildcard_node;
char *text_name;
}struct xdp2_parse_node_ops {
void (*extract_metadata)(const void *, size_t, void *, void *, const struct xdp2_ctrl_data *);
int (*handler)(const void *, size_t, void *, void *, const struct xdp2_ctrl_data *);
int (*post_handler)(const void *, size_t, void *, void *, const struct xdp2_ctrl_data *);
}struct __attribute__((aligned(64))) __attribute__((packed)) xdp2_parse_node {
enum xdp2_parser_node_type node_type __attribute__((packed));
__s8 unknown_ret;
__u8 key_sel;
__u8 flags;
__u8 rsvd;
const struct xdp2_proto_def *proto_def;
const struct xdp2_parse_node_ops ops;
const struct xdp2_proto_table *proto_table;
const struct xdp2_parse_node *wildcard_node;
char *text_name;
}struct xdp2_parse_node_ops {
void (*extract_metadata)(const void *, size_t, void *, void *, const struct xdp2_ctrl_data *);
int (*handler)(const void *, size_t, void *, void *, const struct xdp2_ctrl_data *);
int (*post_handler)(const void *, size_t, void *, void *, const struct xdp2_ctrl_data *);
}[Python template] Graph has 4 vertices
[Python template] ether_node: out_edges=1, next_proto_info=0
[Python template] -> ip_check_node key=0x8
[Python template] ip_check_node: out_edges=1, next_proto_info=0
[Python template] -> ipv4_node key=0x4
[Python template] ipv4_node: out_edges=2, next_proto_info=0
[Python template] -> ports_node key=0x6
[Python template] -> ports_node key=0x11
[Python template] ports_node: out_edges=0, next_proto_info=0
clang -x c -target bpf -I/root/tom-xdp/xdp2/install/x86_64/include -g -O2 -c -o flow_tracker.xdp.o flow_tracker.xdp.c
In file included from flow_tracker.xdp.c:35:
In file included from ./common.h:32:
In file included from /root/tom-xdp/xdp2/install/x86_64/include/xdp2/parser.h:45:
In file included from /root/tom-xdp/xdp2/install/x86_64/include/xdp2/arrays.h:40:
In file included from /root/tom-xdp/xdp2/install/x86_64/include/xdp2/parser_types.h:57:
/root/tom-xdp/xdp2/install/x86_64/include/xdp2/utility.h:172:45: error: unknown type name 'off_t'
172 | static inline bool xdp2_offset_page_aligned(off_t offset)
| ^
/root/tom-xdp/xdp2/install/x86_64/include/xdp2/utility.h:174:32: error: call to undeclared function 'sysconf'; ISO C99 and later do not
support implicit function declarations [-Wimplicit-function-declaration]
174 | return (offset == (offset & ~(XDP2_PAGE_SIZE - 1)));
| ^
/root/tom-xdp/xdp2/install/x86_64/include/xdp2/utility.h:85:25: note: expanded from macro 'XDP2_PAGE_SIZE'
85 | #define XDP2_PAGE_SIZE (sysconf(_SC_PAGE_SIZE))
| ^
/root/tom-xdp/xdp2/install/x86_64/include/xdp2/utility.h:174:32: error: use of undeclared identifier '_SC_PAGE_SIZE'
174 | return (offset == (offset & ~(XDP2_PAGE_SIZE - 1)));
| ^~~~~~~~~~~~~~
/root/tom-xdp/xdp2/install/x86_64/include/xdp2/utility.h:85:33: note: expanded from macro 'XDP2_PAGE_SIZE'
85 | #define XDP2_PAGE_SIZE (sysconf(_SC_PAGE_SIZE))
| ^~~~~~~~~~~~~
/root/tom-xdp/xdp2/install/x86_64/include/xdp2/utility.h:230:26: error: call to undeclared function 'sysconf'; ISO C99 and later do not
support implicit function declarations [-Wimplicit-function-declaration]
230 | return xdp2_round_up(x, XDP2_PAGE_SIZE);
| ^
/root/tom-xdp/xdp2/install/x86_64/include/xdp2/utility.h:85:25: note: expanded from macro 'XDP2_PAGE_SIZE'
85 | #define XDP2_PAGE_SIZE (sysconf(_SC_PAGE_SIZE))
| ^
/root/tom-xdp/xdp2/install/x86_64/include/xdp2/utility.h:230:26: error: use of undeclared identifier '_SC_PAGE_SIZE'
230 | return xdp2_round_up(x, XDP2_PAGE_SIZE);
| ^~~~~~~~~~~~~~
/root/tom-xdp/xdp2/install/x86_64/include/xdp2/utility.h:85:33: note: expanded from macro 'XDP2_PAGE_SIZE'
85 | #define XDP2_PAGE_SIZE (sysconf(_SC_PAGE_SIZE))
| ^~~~~~~~~~~~~
5 errors generated.
make: *** [Makefile:31: flow_tracker.xdp.o] Error 1
root@Ambika:~/tom-xdp/xdp2/samples/xdp/flow_tracker_simple#
Thanks for your help.
Thanks,
Venkat