From patchwork Thu May 19 16:37:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dominick Grift X-Patchwork-Id: 1633428 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=dwPQptm/; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=defensec.nl header.i=@defensec.nl header.a=rsa-sha256 header.s=default header.b=o5qOOcRq; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4L3wcF43rBz9t0J for ; Fri, 20 May 2022 02:41:48 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JqseQYg65PEFtC3x0MiKcci1C0j6FmDUizU2jnlnTBU=; b=dwPQptm/l/nxhT wVF89SSeAzVk42POeu9fsDbR6tc2WiW4s+a7Qfk0dTIxRifWtFqy4KO7nO6AeKREP++/v3Rz2ioeH 5052LmHWFI1KnTSj6lM/9Vk7p8WKTibGbWuRVcplrhEzO6Z9D+C4kvWvMNpVYYApgV/cXJgwwnzeY zKu9mt9F6cT+ngOGiQJSnWNICiGuqL/DecRBz/hBNx1VIf7+sN4q9+g7RLOqaND9UYw32NxFeoYWu hF5Ap5BYpdlslZyIhLP8kndSjESuUOnLNOjrjfQpT/lsuoF270B2QZVcpss4YLZZrlU7eY8U3lmWZ qFKvkTKlfe8JwsGQZAbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrjAj-008Q14-MT; Thu, 19 May 2022 16:38:45 +0000 Received: from markus.defensec.nl ([45.80.168.93]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrjA3-008Pmt-Cs for openwrt-devel@lists.openwrt.org; Thu, 19 May 2022 16:38:05 +0000 Received: from brutus.. (brutus.lan [IPv6:2a10:3781:2099::438]) by markus.defensec.nl (Postfix) with ESMTPSA id 31BC9FC08CF; Thu, 19 May 2022 18:37:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=defensec.nl; s=default; t=1652978274; bh=mcb9ucWAlJfrcQlW9qAXq87YeCWpYIVChkzYYgU/mSQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o5qOOcRqGPnUsDx/hDwmZwrOC9FF3O9M8RnSUnzsgU1aDNdNgXVm0WRxZx4UbM/uI akzTNcUfRnXGLePff83BAAeBHCHqvPERGoE29Np+RMomS86WmAeZRLV3jeQWoHggOx 59UKWvEaupIDWorvmYAMvClQZVY3WiwlpJ1ApFSg= From: Dominick Grift To: openwrt-devel@lists.openwrt.org Cc: lookatyouhacker@gmail.com, daniel@makrotopia.org, stijn@linux-ipv6.be, Dominick Grift Subject: [PATCH 1/4] pcre2: adds pcre2 to base Date: Thu, 19 May 2022 18:37:28 +0200 Message-Id: <20220519163731.164817-2-dominick.grift@defensec.nl> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220519163731.164817-1-dominick.grift@defensec.nl> References: <20220519130333.159011-1-dominick.grift@defensec.nl> <20220519163731.164817-1-dominick.grift@defensec.nl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220519_093803_630025_572F6236 X-CRM114-Status: GOOD ( 17.05 ) X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: libselinux-3.4 requires pcre2 Signed-off-by: Dominick Grift --- package/libs/pcre2/Config.in | 30 ++++++++++++ package/libs/pcre2/Makefile | 92 ++++++++++++++++++++++++++++++++++++ 2 files changed, 122 [...] Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [45.80.168.93 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org libselinux-3.4 requires pcre2 Signed-off-by: Dominick Grift --- package/libs/pcre2/Config.in | 30 ++++++++++++ package/libs/pcre2/Makefile | 92 ++++++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 package/libs/pcre2/Config.in create mode 100644 package/libs/pcre2/Makefile diff --git a/package/libs/pcre2/Config.in b/package/libs/pcre2/Config.in new file mode 100644 index 0000000000..8777a4e84c --- /dev/null +++ b/package/libs/pcre2/Config.in @@ -0,0 +1,30 @@ +config PCRE2_JIT_ENABLED + bool + depends on PACKAGE_libpcre2 && (aarch64 || aarch64_be || arm || i386 || i686 || x86_64 || mips || mipsel || mips64 || mips64el || powerpc || powerpc64 || powerpcle || sparc) + default y if (arm || i686 || x86_64) + prompt "Enable JIT compiler support" + help + Enable JIT (Just-In-Time) compiler support. + + Just-in-time compiling is a heavyweight optimization that can greatly + speed up pattern matching. However, it comes at the cost of extra + processing before the match is performed, so it is of most benefit when + the same pattern is going to be matched many times. This does not + necessarily mean many calls of a matching function; if the pattern is + not anchored, matching attempts may take place many times at various + positions in the subject, even for a single call. Therefore, if the + subject string is very long, it may still pay to use JIT even for + one-off matches. JIT support is available for all of the 8-bit, 16-bit + and 32-bit PCRE2 libraries and adds about 100KB to the resulting + libpcre2.so. JIT support applies only to the traditional Perl-compatible + matching function. It does not apply when the DFA matching function is + being used. + + Enabling this option can give an about 10x performance increase on JIT + operations. It can be desireable for e.g. high performance Apache + mod_rewrite or HA-Proxy reqrep operations. + + However, JIT should _only_ be enabled on architectures that are supported. + Enabling JIT on unsupported platforms will result in a compilation + failure. A list of supported architectures can be found here: + https://pcre.org/current/doc/html/pcre2jit.html#SEC2 diff --git a/package/libs/pcre2/Makefile b/package/libs/pcre2/Makefile new file mode 100644 index 0000000000..4e75a1cda9 --- /dev/null +++ b/package/libs/pcre2/Makefile @@ -0,0 +1,92 @@ +# +# Copyright (C) 2017 Shane Peelar +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=pcre2 +PKG_VERSION:=10.37 +PKG_RELEASE:=$(AUTORELEASE) + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/pcre/$(PKG_NAME)/$(PKG_VERSION) +PKG_HASH:=4d95a96e8b80529893b4562be12648d798b957b1ba1aae39606bbc2ab956d270 + +PKG_MAINTAINER:=Shane Peelar +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENCE +PKG_CPE_ID:=cpe:/a:pcre:pcre + +PKG_CONFIG_DEPENDS:=\ + CONFIG_PACKAGE_libpcre2-16 \ + CONFIG_PACKAGE_libpcre2-32 \ + CONFIG_PCRE2_JIT_ENABLED + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/libpcre2/default + SECTION:=libs + CATEGORY:=Libraries + URL:=https://www.pcre.org/ +endef + +define Package/libpcre2/config + source "$(SOURCE)/Config.in" +endef + +define Package/libpcre2 + $(call Package/libpcre2/default) + TITLE:=A Perl Compatible Regular Expression library +endef + +define Package/libpcre2-16 + $(call Package/libpcre2/default) + TITLE:=A Perl Compatible Regular Expression library (16bit support) +endef + +define Package/libpcre2-32 + $(call Package/libpcre2/default) + TITLE:=A Perl Compatible Regular Expression library (32bit support) +endef + +CMAKE_OPTIONS += \ + -DBUILD_SHARED_LIBS=ON \ + -DPCRE2_BUILD_PCRE2_8=ON \ + -DPCRE2_BUILD_PCRE2_16=O$(if $(CONFIG_PACKAGE_libpcre2-16),N,FF) \ + -DPCRE2_BUILD_PCRE2_32=O$(if $(CONFIG_PACKAGE_libpcre2-32),N,FF) \ + -DPCRE2_DEBUG=OFF \ + -DPCRE2_DISABLE_PERCENT_ZT=ON \ + -DPCRE2_SUPPORT_JIT=O$(if $(CONFIG_PCRE2_JIT_ENABLED),N,FF) \ + -DPCRE2_SHOW_REPORT=OFF \ + -DPCRE2_BUILD_PCRE2GREP=OFF \ + -DPCRE2_BUILD_TESTS=OFF + +define Build/InstallDev + $(call Build/InstallDev/cmake,$(1)) + $(SED) 's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' $(1)/usr/bin/pcre2-config + $(INSTALL_DIR) $(2)/bin + $(LN) ../../usr/bin/pcre2-config $(2)/bin/pcre2-config +endef + +define Package/libpcre2/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre2-{8,posix}.so* $(1)/usr/lib/ +endef + +define Package/libpcre2-16/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre2-16.so* $(1)/usr/lib/ +endef + +define Package/libpcre2-32/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpcre2-32.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libpcre2)) +$(eval $(call BuildPackage,libpcre2-16)) +$(eval $(call BuildPackage,libpcre2-32))