xdp-tools: fix compilation wrongly using host header
authorChristian Marangi <ansuelsmth@gmail.com>
Wed, 18 Jan 2023 19:50:58 +0000 (20:50 +0100)
committerRISCi_ATOM <bob@bobcall.me>
Wed, 5 Jun 2024 19:42:49 +0000 (15:42 -0400)
commit7c528be2f2fbf63f0f958487b639eed074a40419
tree00c704dae0549614b32273ede9b5f41fc93f2c86
parent66d791e6c89c276182dc3ab550b534a9faddffb1
xdp-tools: fix compilation wrongly using host header

Currently it's needed to have gcc-multilib on the host to correctly
compile xdp-tools. This is wrong and means that we are using host header
to compile a tool.

By some searching in how the makefile works it was discovered that
BPF_CFLAGS were not used and required to be appended to config.mk

Only one single header was added but we should include each BPF_CFLAGS
from bpf.mk. To make this some patching to bpf-header were required and
some patches to xdp-tools were required.
Also it's needed to pass the correct target to BPF_CFLAGS.

With the following changes xdp-tools can correctly compile with each
header from bpf-headers and should not use any host header.

Co-Developed-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Andre Heider <a.heider@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/11825
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
package/network/utils/xdp-tools/Makefile
package/network/utils/xdp-tools/patches/010-configure-respect-LDFLAGS.patch
package/network/utils/xdp-tools/patches/020-libxdp-Use-__noinline__-reserved-attribute-for-XDP-d.patch [new file with mode: 0644]
package/network/utils/xdp-tools/patches/021-headers-xdp-drop-vlan_hdr-as-already-defined.patch [new file with mode: 0644]
package/network/utils/xdp-tools/patches/022-xdp-dump-add-missing-perf_event-include-for-bpf-and-.patch [new file with mode: 0644]
package/network/utils/xdp-tools/patches/023-libxdp-fix-compilation-on-multiarch-systems.patch [new file with mode: 0644]
package/network/utils/xdp-tools/patches/024-lib-allow-overwriting-W-flags-via-BPF_CFLAGS.patch [new file with mode: 0644]
package/network/utils/xdp-tools/patches/025-Add-BPF_LDFLAGS-to-allow-overwriting-llc-s-march-arg.patch [new file with mode: 0644]