Skip to contentSkip to conversation

BUG BPF examples broken

dpdk-dev Stephen Hemminger 2 participants 2 messages Feb 8, 2020 – Feb 9, 2020

lore
Share & tools
lore
#0 lore raw

The BPF examples do not compile on Debian.

The issue is that ret_mbuf_core.h includes rte_atomic which include rte_common which pulls in errno.h and bits/errno.h. And then asm/errno.h

/usr/include/linux/errno.h:1:10: fatal error: 'asm/errno.h' file not found

#include <asm/errno.h>
         ^~~~~~~~~~~~~

1 error generated.

asm/errno.h is architecture specific and BPF is an architecture.

#1 lore raw
Quoted 14 lines

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Saturday, February 8, 2020 4:05 AM
To: Ananyev, Konstantin <[email protected]>
Cc: [email protected]
Subject: BUG BPF examples broken

The BPF examples do not compile on Debian.

The issue is that ret_mbuf_core.h includes rte_atomic which include rte_common which pulls in errno.h and bits/errno.h. And then asm/errno.h

Quoted 6 lines

/usr/include/linux/errno.h:1:10: fatal error: 'asm/errno.h' file not found

#include <asm/errno.h>
         ^~~~~~~~~~~~~

1 error generated.

asm/errno.h is architecture specific and BPF is an architecture.

AFAIK, installing gcc-multilib package will generate a symlink for /usr/include/asm:
On my ubuntu box:
ls -ld /usr/include/asm
lrwxrwxrwx 1 root root 20 May 20 2019 /usr/include/asm -> x86_64-linux-gnu/asm

As another possible way: -I/usr/include/x86_64-linux-gnu manually.
clang -O2 -U __GNUC__ -I/usr/include/x86_64-linux-gnu -I${RTE_SDK}/${RTE_TARGET}/include -target bpf -Wno-int-to-void-pointer-cast -c t3.c