Skip to content

Commit

Permalink
iproute2: simplify linking libelf for eBFP/XDP object file support
Browse files Browse the repository at this point in the history
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 Feb 11, 2019
1 parent e6d84fa commit 26681fa
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 61 deletions.
11 changes: 10 additions & 1 deletion package/network/utils/iproute2/Makefile
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 \
Expand Down
@@ -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.