Skip to content
Permalink
Browse files

iproute2: simplify linking libelf for eBFP/XDP object file support

Simplify build and runtime dependencies on libelf, which allows tc and ip
to load BPF and XDP object files respectively.

Preserve optionality of libelf by having configuration script follow the
HAVE_ELF environment variable, used similarly to the HAVE_MNL variable.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
  • Loading branch information...
guidosarducci authored and ldir-EDB0 committed Nov 24, 2018
1 parent e6d84fa commit 26681fa6a6fcbec0024906eb8367e9a3160521fb
@@ -49,7 +49,7 @@ $(call Package/iproute2/Default)
VARIANT:=full
PROVIDES:=ip
ALTERNATIVES:=300:/sbin/ip:/usr/libexec/ip-full
DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl
DEPENDS:=+libnl-tiny +libelf +(PACKAGE_devlink||PACKAGE_rdma):libmnl
endef

define Package/tc
@@ -100,6 +100,14 @@ ifeq ($(BUILD_VARIANT),tiny)
IP_CONFIG_TINY:=y
endif

ifeq ($(BUILD_VARIANT),full)
HAVE_ELF:=y
endif

ifeq ($(BUILD_VARIANT),tc)
HAVE_ELF:=y
endif

ifdef CONFIG_PACKAGE_devlink
HAVE_MNL:=y
endif
@@ -121,6 +129,7 @@ MAKE_FLAGS += \
KERNEL_INCLUDE="$(LINUX_DIR)/user_headers/include" \
SHARED_LIBS="" \
IP_CONFIG_TINY=$(IP_CONFIG_TINY) \
HAVE_ELF=$(HAVE_ELF) \
HAVE_MNL=$(HAVE_MNL) \
IPT_LIB_DIR=/usr/lib/iptables \
XT_LIB_DIR=/usr/lib/iptables \
@@ -0,0 +1,11 @@
--- a/configure
+++ b/configure
@@ -228,7 +228,7 @@ EOF

check_elf()
{
- if ${PKG_CONFIG} libelf --exists; then
+ if [ "${HAVE_ELF}" = "y" ] && ${PKG_CONFIG} libelf --exists; then
echo "HAVE_ELF:=y" >>$CONFIG
echo "yes"

This file was deleted.

0 comments on commit 26681fa

Please sign in to comment.
You can’t perform that action at this time.