aboutsummaryrefslogtreecommitdiffstats
path: root/package/libs
diff options
context:
space:
mode:
authorTony Ambardar <itugrok@yahoo.com>2023-05-21 02:14:37 -0700
committerDaniel Golle <daniel@makrotopia.org>2023-05-25 09:33:59 +0100
commitf54bea12b6d5193509716b4c85bf2d342bbc0123 (patch)
tree26239dc9763bdce5165752e613007650d096917a /package/libs
parente996c6eb19ce9fca583d4b146788309e1c10093b (diff)
downloadupstream-f54bea12b6d5193509716b4c85bf2d342bbc0123.tar.gz
upstream-f54bea12b6d5193509716b4c85bf2d342bbc0123.tar.bz2
upstream-f54bea12b6d5193509716b4c85bf2d342bbc0123.zip
bpftools: update, split off bpftool and libbpf packages
My original bpftools package made "variant" builds of bpftool and libbpf as a convenience, since both used the same local kernel sources with the same versioning. This is no longer the case, since the commit below switched to using an out-of-tree build mirror hosting repos for each. Replace bpftools with separate bpftool and libbpf packages, each simplified and correctly versioned. Also fix the broken libbpf ABI introduced in the same commit. Existing build .config files are not impacted. Fixes: 00cbf6f6ab1d ("bpftools: update to standalone bpftools + libbpf, use the latest version") Signed-off-by: Tony Ambardar <itugrok@yahoo.com> (cherry picked from commit afe1bf11f2539f75e30ab3206891dbe6f8c43bd5) Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'package/libs')
-rw-r--r--package/libs/libbpf/Makefile75
-rw-r--r--package/libs/libbpf/patches/001-cflags.patch10
2 files changed, 85 insertions, 0 deletions
diff --git a/package/libs/libbpf/Makefile b/package/libs/libbpf/Makefile
new file mode 100644
index 0000000000..ee7666f734
--- /dev/null
+++ b/package/libs/libbpf/Makefile
@@ -0,0 +1,75 @@
+#
+# Copyright (C) 2020-2023 Tony Ambardar <itugrok@yahoo.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libbpf
+PKG_VERSION:=1.2.0
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=https://github.com/libbpf/libbpf
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=fbd60dbff51c870f5e80a17c4f2fd639eb80af90
+PKG_MIRROR_HASH:=80a80dfba71576e017b596fb28068e2a92de629e426f063e4b37314c8d576336
+PKG_ABI_VERSION:=$(firstword $(subst .,$(space),$(PKG_VERSION)))
+
+PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com>
+
+PKG_BUILD_FLAGS:=no-mips16
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/libbpf
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=libbpf - eBPF helper library
+ LICENSE:=LGPL-2.1 OR BSD-2-Clause
+ ABI_VERSION:=$(PKG_ABI_VERSION)
+ URL:=http://www.kernel.org
+ DEPENDS:=+libelf
+endef
+
+define Package/libbpf/description
+ libbpf is a library for loading eBPF programs and reading and manipulating eBPF objects from user-space.
+endef
+
+MAKE_VARS = \
+ EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS)"
+
+MAKE_FLAGS += \
+ $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
+ LIBSUBDIR=lib
+
+MAKE_PATH = src
+
+define Build/InstallDev/libbpf
+ $(INSTALL_DIR) $(1)/usr/include/bpf
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/bpf/*.h $(1)/usr/include/bpf/
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbpf.{a,so*} \
+ $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libbpf.pc \
+ $(1)/usr/lib/pkgconfig/
+ $(SED) 's,/usr/include,$$$${prefix}/include,g' \
+ $(1)/usr/lib/pkgconfig/libbpf.pc
+ $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' \
+ $(1)/usr/lib/pkgconfig/libbpf.pc
+endef
+
+Build/InstallDev=$(Build/InstallDev/libbpf)
+
+define Package/libbpf/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbpf.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libbpf))
diff --git a/package/libs/libbpf/patches/001-cflags.patch b/package/libs/libbpf/patches/001-cflags.patch
new file mode 100644
index 0000000000..d6ffc3f907
--- /dev/null
+++ b/package/libs/libbpf/patches/001-cflags.patch
@@ -0,0 +1,10 @@
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -34,6 +34,7 @@ ALL_CFLAGS := $(INCLUDES)
+
+ SHARED_CFLAGS += -fPIC -fvisibility=hidden -DSHARED
+
++CFLAGS = $(EXTRA_CFLAGS)
+ CFLAGS ?= -g -O2 -Werror -Wall -std=gnu89
+ ALL_CFLAGS += $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 $(EXTRA_CFLAGS)
+ ALL_LDFLAGS += $(LDFLAGS) $(EXTRA_LDFLAGS)