From bded5cdbbca837ebbc2c9fe55912d0be69555c22 Mon Sep 17 00:00:00 2001 From: Christian Lachner Date: Tue, 30 Jun 2020 11:18:44 +0200 Subject: [PATCH 1/3] liburing: new package: liburing v0.6 - Add initial Makefile - Add patch to fix inttypes.h inclusion when __kernel_timespec is unavailable Signed-off-by: Christian Lachner --- libs/liburing/Makefile | 65 +++++++++++++++++++ .../000-OPENWRT-add-int64_t-detection.patch | 11 ++++ 2 files changed, 76 insertions(+) create mode 100644 libs/liburing/Makefile create mode 100644 libs/liburing/patches/000-OPENWRT-add-int64_t-detection.patch diff --git a/libs/liburing/Makefile b/libs/liburing/Makefile new file mode 100644 index 000000000..f3968d2f6 --- /dev/null +++ b/libs/liburing/Makefile @@ -0,0 +1,65 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=liburing +PKG_VERSION:=0.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://git.kernel.dk/cgit/liburing/snapshot +PKG_HASH:=44c99b9f148a885d882acd7aa63658141675eae251298cbf79bb9a4ab307ef9c + +PKG_MAINTAINER:=Christian Lachner +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=COPYING + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/liburing + SECTION:=libs + CATEGORY:=Libraries + TITLE:=liburing + URL:=https://git.kernel.dk/cgit/liburing +endef + +define Package/liburing/description + liburing provides helpers to setup and teardown io_uring instances, + and also a simplified interface for applications that don't need + (or want) to deal with the full kernel side implementation. + For more info on io_uring, please see: https://kernel.dk/io_uring.pdf +endef + +CONFIGURE_ARGS:=--prefix=$(CONFIGURE_PREFIX) --cc=${TARGET_CC} + +ifeq ($(CONFIG_USE_MUSL),y) + TARGET_CFLAGS+=-Dloff_t=off_t +endif + +ifeq ($(CONFIG_USE_UCLIBC),y) + TARGET_CFLAGS+=-fno-stack-protector +endif + +define Build/Compile + $(MAKE) $(PKG_BUILD_DIR) \ + DSTROOT="$(PKG_INSTALL_DIR)" +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/liburing.pc $(1)/usr/lib/pkgconfig/ + $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/liburing.pc + $(SED) 's,/usr/lib,$$$${prefix}/lib,g' $(1)/usr/lib/pkgconfig/liburing.pc +endef + +define Package/liburing/install + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/liburing.so $(PKG_INSTALL_DIR)/usr/lib/liburing.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,liburing)) diff --git a/libs/liburing/patches/000-OPENWRT-add-int64_t-detection.patch b/libs/liburing/patches/000-OPENWRT-add-int64_t-detection.patch new file mode 100644 index 000000000..6409956ee --- /dev/null +++ b/libs/liburing/patches/000-OPENWRT-add-int64_t-detection.patch @@ -0,0 +1,11 @@ +--- ./configure ++++ ./configure +@@ -301,6 +301,8 @@ + fi + if test "$__kernel_timespec" != "yes"; then + cat >> $compat_h << EOF ++#include ++ + struct __kernel_timespec { + int64_t tv_sec; + long long tv_nsec; From f345e6646db9da68551de7b1aa1623d1002d202e Mon Sep 17 00:00:00 2001 From: Christian Lachner Date: Thu, 2 Jul 2020 07:03:45 +0200 Subject: [PATCH 2/3] liburing: Re-enable stack-protection for uClibc targets - Remove -fno-stack-protector for uClibc targets - Make TITLE a little nicer Signed-off-by: Christian Lachner --- libs/liburing/Makefile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libs/liburing/Makefile b/libs/liburing/Makefile index f3968d2f6..409bca3dc 100644 --- a/libs/liburing/Makefile +++ b/libs/liburing/Makefile @@ -20,7 +20,7 @@ include $(INCLUDE_DIR)/package.mk define Package/liburing SECTION:=libs CATEGORY:=Libraries - TITLE:=liburing + TITLE:=io_uring library URL:=https://git.kernel.dk/cgit/liburing endef @@ -37,10 +37,6 @@ ifeq ($(CONFIG_USE_MUSL),y) TARGET_CFLAGS+=-Dloff_t=off_t endif -ifeq ($(CONFIG_USE_UCLIBC),y) - TARGET_CFLAGS+=-fno-stack-protector -endif - define Build/Compile $(MAKE) $(PKG_BUILD_DIR) \ DSTROOT="$(PKG_INSTALL_DIR)" From c12c8ceafb54cbda16c8f2b1490924939110b18d Mon Sep 17 00:00:00 2001 From: Christian Lachner Date: Thu, 2 Jul 2020 09:04:45 +0200 Subject: [PATCH 3/3] liburing: Simplify CFLAGS assignment for MUSL targets - Simplify the way we deal with additional CFLAGS for MUSL targets Signed-off-by: Christian Lachner --- libs/liburing/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libs/liburing/Makefile b/libs/liburing/Makefile index 409bca3dc..7238d5bcc 100644 --- a/libs/liburing/Makefile +++ b/libs/liburing/Makefile @@ -33,9 +33,7 @@ endef CONFIGURE_ARGS:=--prefix=$(CONFIGURE_PREFIX) --cc=${TARGET_CC} -ifeq ($(CONFIG_USE_MUSL),y) - TARGET_CFLAGS+=-Dloff_t=off_t -endif +TARGET_CFLAGS += $(if $(CONFIG_USE_MUSL),-Dloff_t=off_t) define Build/Compile $(MAKE) $(PKG_BUILD_DIR) \