xdp-tools: fix compilation wrongly using host header
authorChristian Marangi <ansuelsmth@gmail.com>
Wed, 18 Jan 2023 19:50:58 +0000 (20:50 +0100)
committerChristian Marangi <ansuelsmth@gmail.com>
Wed, 1 May 2024 17:11:34 +0000 (19:11 +0200)
commit5acc4f919c28ee8ea20c98856e1e824168cf2270
tree59b3aa2d635f7fdb6e4aaebd4eb12263462a534a
parentdfcc0ff5d2bf6eb7c6ad7621c61c896e69ff8103
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]