From a2838a20323a541360123e72ff7c81524f5455f6 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sun, 8 Oct 2023 23:18:19 +0200 Subject: [PATCH 01/12] quectel-timesync: add package This tool allows for acquiring the current time from the cellular network for configuring the local clock. Compared to NTP, this has the advantage of nut using up mobile traffic. It takes advantage of the AT+QLTS command found on Quectel modems. This functionality depends on support of the mobile network. Compile-tested: ath79-nand Run-tested: ath79-nand (GL.iNET GL-XE300) Signed-off-by: David Bauer --- utils/quectel-timesync/Makefile | 51 +++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 utils/quectel-timesync/Makefile diff --git a/utils/quectel-timesync/Makefile b/utils/quectel-timesync/Makefile new file mode 100644 index 0000000000..f624683c29 --- /dev/null +++ b/utils/quectel-timesync/Makefile @@ -0,0 +1,51 @@ +# SPDX-License-Identifier: GPL-2.0-only + +include $(TOPDIR)/rules.mk + +PKG_NAME:=quectel-timesync +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL=https://github.com/freifunk-darmstadt/quectel-timesync.git +PKG_SOURCE_DATE:=2023-10-08 +PKG_SOURCE_VERSION:=4333888cb8025b92511597a95859943fae0a0bc8 +PKG_MIRROR_HASH:=696b878891f884318847069b0590cbdbab2ff48461864ecb418e4575935a29e3 + +PKG_MAINTAINER:=David Bauer +PKG_LICENSE:=GPL-2.0-only + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/quectel-timesync + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Tool for configuring system clock using Quectel cellular modems + DEPENDS:=+kmod-usb-serial-option +endef + +define Package/quectel-timesync/description +This tool allows for acquiring the current time from +the cellular network for configuring the local clock. +Compared to NTP, this has the advantage of nut using up +mobile traffic. + +It takes advantage of the AT+QLTS command found on Quectel +modems. This functionality depends on support of the mobile +network. +endef + +define Package/quectel-timesync/conffiles +/etc/config/quectel-timesync +endef + +define Package/quectel-timesync/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config + + $(CP) $(PKG_BUILD_DIR)/openwrt/quectel-timesync/files/quectel-timesync.config $(1)/etc/config/quectel-timesync + + $(INSTALL_BIN) $(PKG_BUILD_DIR)/openwrt/quectel-timesync/files/quectel-timesync.init $(1)/etc/init.d/quectel-timesync + $(INSTALL_BIN) $(PKG_BUILD_DIR)/quectel-timesync $(1)/usr/sbin/quectel-timesync +endef + +$(eval $(call BuildPackage,quectel-timesync)) From 0449b530ba1d75911abf52c30d3cbee056b8f7b4 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Fri, 20 Oct 2023 16:28:20 +0800 Subject: [PATCH 02/12] rclone: Update to 1.64.1 Signed-off-by: Tianling Shen --- net/rclone/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/rclone/Makefile b/net/rclone/Makefile index 01d253a9a7..5ae35a4e5f 100644 --- a/net/rclone/Makefile +++ b/net/rclone/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rclone -PKG_VERSION:=1.64.0 +PKG_VERSION:=1.64.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/rclone/rclone/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=3297838fdcf611a5ad605835f41c0e51031ce9f220c77a4ad0af6283b7805329 +PKG_HASH:=c94ad2c2fa79485667aae4a239ed04e786bd6e26bced05f9d95dda6d10f7a014 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE From 3be6f6bec9d57b046673d18ed53f8fb57fec99f1 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Mon, 16 Oct 2023 21:44:41 +0300 Subject: [PATCH 03/12] pillow: bump to version 10.1.0 Add test.sh also. Signed-off-by: Alexandru Ardelean --- lang/python/pillow/Makefile | 4 ++-- .../001-remove-setuptools-version-limit.patch | 2 +- lang/python/pillow/test.sh | 20 +++++++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 lang/python/pillow/test.sh diff --git a/lang/python/pillow/Makefile b/lang/python/pillow/Makefile index c974723a97..c6b1faf0ee 100644 --- a/lang/python/pillow/Makefile +++ b/lang/python/pillow/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pillow -PKG_VERSION:=10.0.0 +PKG_VERSION:=10.1.0 PKG_RELEASE:=1 PYPI_NAME:=Pillow -PKG_HASH:=9c82b5b3e043c7af0d95792d0d20ccf68f61a1fec6b3530e718b688422727396 +PKG_HASH:=e6bf8de6c36ed96c86ea3b6e1d5273c53f46ef518a062464cd7ef5dd2cf92e38 PKG_BUILD_DEPENDS:=python-setuptools-scm/host diff --git a/lang/python/pillow/patches/001-remove-setuptools-version-limit.patch b/lang/python/pillow/patches/001-remove-setuptools-version-limit.patch index 3dc07d9926..e5ac168cbf 100644 --- a/lang/python/pillow/patches/001-remove-setuptools-version-limit.patch +++ b/lang/python/pillow/patches/001-remove-setuptools-version-limit.patch @@ -6,6 +6,6 @@ requires = [ - "setuptools>=67.8", + "setuptools", - "wheel", ] backend-path = [ + "_custom_build", diff --git a/lang/python/pillow/test.sh b/lang/python/pillow/test.sh new file mode 100644 index 0000000000..9bad292415 --- /dev/null +++ b/lang/python/pillow/test.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +[ "$1" = "python3-pillow" ] || exit 0 + +python3 - << EOF +import sys +from PIL import Image, ImageDraw + +if (Image.__version__ != "$2"): + print("Wrong version: " + Image.__version__) + sys.exit(1) + +from PIL import Image, ImageDraw +img = Image.new('RGB', (100, 30), color = (73, 109, 137)) +d = ImageDraw.Draw(img) +d.text((10,10), "Hello World", fill=(255,255,0)) + +# Getting here means we did not get exceptions +sys.exit(0) +EOF From 80bdd776ca5371cc43fb64dec6a9e991f9cfe0a2 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Wed, 21 Dec 2022 17:05:32 +0100 Subject: [PATCH 04/12] acpica-unix: add host build In order to build additional acpi tables during the build process, this package needs to be build for the host. Signed-off-by: Florian Eckert --- utils/acpica-unix/Makefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/utils/acpica-unix/Makefile b/utils/acpica-unix/Makefile index b1471c7c08..e415b14d0e 100644 --- a/utils/acpica-unix/Makefile +++ b/utils/acpica-unix/Makefile @@ -22,6 +22,7 @@ PKG_LICENSE:=GPL-2.0 PKG_FORTIFY_SOURCE:=0 PKG_BUILD_PARALLEL:=1 +include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk define Package/acpica-unix @@ -43,6 +44,25 @@ endef define Build/Configure endef +define Host/Install + $(INSTALL_DIR) $(STAGING_DIR_HOST)/usr/bin + $(INSTALL_BIN) $(HOST_BUILD_DIR)/generate/unix/bin/{acpibin,acpidump} \ + $(STAGING_DIR_HOST)/usr/bin/ + $(INSTALL_BIN) $(HOST_BUILD_DIR)/generate/unix/bin/{acpiexamples,acpiexec} \ + $(STAGING_DIR_HOST)/usr/bin/ + $(INSTALL_BIN) $(HOST_BUILD_DIR)/generate/unix/bin/{acpihelp,acpisrc} \ + $(STAGING_DIR_HOST)/usr/bin/ + $(INSTALL_BIN) $(HOST_BUILD_DIR)/generate/unix/bin/{acpixtract,iasl} \ + $(STAGING_DIR_HOST)/usr/bin/ +endef + +define Host/Clean + $(RM) $(STAGING_DIR_HOST)/usr/bin/{acpibin,acpidump} + $(RM) $(STAGING_DIR_HOST)/usr/bin/{acpiexamples,acpiexec} + $(RM) $(STAGING_DIR_HOST)/usr/bin/{acpihelp,acpisrc} + $(RM) $(STAGING_DIR_HOST)/usr/bin/{acpixtract,iasl} +endef + MAKE_VARS += HOST=_LINUX MAKE_PATH:=generate/unix @@ -55,3 +75,4 @@ define Package/acpica-unix/install endef $(eval $(call BuildPackage,acpica-unix)) +$(eval $(call HostBuild)) From 42cc50eec890b2f86c5f9573938051149a62321d Mon Sep 17 00:00:00 2001 From: Stan Grishin Date: Sat, 21 Oct 2023 02:26:02 +0000 Subject: [PATCH 05/12] adblock-fast: bugfix: allow command * fix sed to properly purge allowed domains from block-lists * ensure resolver is restarted on allow command * reduce pause default/max in attempt to make it work with luci Signed-off-by: Stan Grishin --- net/adblock-fast/Makefile | 2 +- net/adblock-fast/files/etc/config/adblock-fast | 1 + net/adblock-fast/files/etc/init.d/adblock-fast | 11 ++++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/net/adblock-fast/Makefile b/net/adblock-fast/Makefile index f923a27b47..5c7936891c 100644 --- a/net/adblock-fast/Makefile +++ b/net/adblock-fast/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=adblock-fast PKG_VERSION:=1.0.0 -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_MAINTAINER:=Stan Grishin PKG_LICENSE:=GPL-3.0-or-later diff --git a/net/adblock-fast/files/etc/config/adblock-fast b/net/adblock-fast/files/etc/config/adblock-fast index f459411f03..e55475dd1a 100644 --- a/net/adblock-fast/files/etc/config/adblock-fast +++ b/net/adblock-fast/files/etc/config/adblock-fast @@ -29,6 +29,7 @@ config adblock-fast 'config' # list force_dns_port '8443' option led 'none' option parallel_downloads '1' + option pause_timeout '20' option procd_trigger_wan6 '0' option procd_boot_wan_timeout '60' option verbosity '2' diff --git a/net/adblock-fast/files/etc/init.d/adblock-fast b/net/adblock-fast/files/etc/init.d/adblock-fast index 8229f0845d..57fe5b9328 100755 --- a/net/adblock-fast/files/etc/init.d/adblock-fast +++ b/net/adblock-fast/files/etc/init.d/adblock-fast @@ -1155,7 +1155,7 @@ adb_allow() { for c in $string; do output 2 " $c " hf="$(echo "$c" | sed 's/\./\\./g')" - if sed -i "/\(^\|\.\)${hf}$/d;" "$outputFile" && \ + if sed -i "\:\(/\|\.\)${hf}/:d" "$outputFile" && \ uci_add_list_if_new "${packageName}" 'config' 'allowed_domain' "$c"; then output_ok else @@ -1171,7 +1171,7 @@ adb_allow() { fi fi output 2 "Committing changes to config " - if [ -n "$(uci_changes "$packageName")" ] && uci_commit "$packageName"; then + if uci_commit "$packageName"; then allowed_domain="$(uci_get "$packageName" 'config' 'allowed_domain')" json set triggers json set stats "$serviceName is blocking $(wc -l < "$outputFile") domains (with ${dns})" @@ -1196,7 +1196,8 @@ adb_allow() { output 2 "Allowing domain(s) \\n" for c in $string; do output 2 " $c " - if sed -i "/${string}/d" "$outputFile" && \ + hf="$(echo "$c" | sed 's/\./\\./g')" + if sed -i "\:\(\"\|\.\)${hf}\":d" "$outputFile" && \ uci_add_list_if_new "$packageName" 'config' 'allowed_domain' "$string"; then output_ok else @@ -1212,7 +1213,7 @@ adb_allow() { fi fi output 2 "Committing changes to config " - if [ -n "$(uci_changes "$packageName")" ] && uci_commit "$packageName"; then + if uci_commit "$packageName"; then allowed_domain="$(uci_get "$packageName" 'config' 'allowed_domain')" json set triggers json set stats "$serviceName is blocking $(wc -l < "$outputFile") domains (with ${dns})" @@ -1725,7 +1726,7 @@ load_validate_config() { 'config_update_enabled:bool:0' \ 'config_update_url:string:https://cdn.jsdelivr.net/gh/openwrt/packages/net/adblock-fast/files/adblock-fast.conf.update' \ 'download_timeout:range(1,60):20' \ - 'pause_timeout:range(10,120):60' \ + 'pause_timeout:range(1,60):20' \ 'curl_additional_param:or("", string)' \ 'curl_max_file_size:or("", uinteger)' \ 'curl_retry:range(0,30):3' \ From db305165c9a0b9b69a83f6379d0994c3708d58e8 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 9 Oct 2023 18:30:58 +0200 Subject: [PATCH 06/12] shadowsocks-libev: convert to PCRE2 Convert package to PCRE2 by porting a pending patch from a closed PR. The PR is old but the code never changed and is simple enough to check the changes. The patch apply directly with no changes (aside from commenting out the travis CI file) The PR was never merged as PCRE2 at times was too new and they were trying to find a better regex lib. Signed-off-by: Christian Marangi --- net/shadowsocks-libev/Makefile | 8 +- .../patches/100-Upgrade-PCRE-to-PCRE2.patch | 544 ++++++++++++++++++ 2 files changed, 548 insertions(+), 4 deletions(-) create mode 100644 net/shadowsocks-libev/patches/100-Upgrade-PCRE-to-PCRE2.patch diff --git a/net/shadowsocks-libev/Makefile b/net/shadowsocks-libev/Makefile index 0c4ce1bd68..b10eb32f7f 100644 --- a/net/shadowsocks-libev/Makefile +++ b/net/shadowsocks-libev/Makefile @@ -14,7 +14,7 @@ include $(TOPDIR)/rules.mk # PKG_NAME:=shadowsocks-libev PKG_VERSION:=3.3.5 -PKG_RELEASE:=9 +PKG_RELEASE:=10 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$(PKG_VERSION) @@ -29,7 +29,7 @@ PKG_FIXUP:=autoreconf PKG_INSTALL:=1 PKG_BUILD_FLAGS:=no-mips16 lto PKG_BUILD_PARALLEL:=1 -PKG_BUILD_DEPENDS:=c-ares pcre +PKG_BUILD_DEPENDS:=c-ares pcre2 include $(INCLUDE_DIR)/package.mk @@ -71,8 +71,8 @@ define Package/shadowsocks-libev/Default endef -DEPENDS_ss-local = +libpcre -DEPENDS_ss-server = +libcares +libpcre +DEPENDS_ss-local = +libpcre2 +DEPENDS_ss-server = +libcares +libpcre2 SHADOWSOCKS_COMPONENTS:=ss-local ss-redir ss-tunnel ss-server define shadowsocks-libev/templates diff --git a/net/shadowsocks-libev/patches/100-Upgrade-PCRE-to-PCRE2.patch b/net/shadowsocks-libev/patches/100-Upgrade-PCRE-to-PCRE2.patch new file mode 100644 index 0000000000..91b2e5b9d2 --- /dev/null +++ b/net/shadowsocks-libev/patches/100-Upgrade-PCRE-to-PCRE2.patch @@ -0,0 +1,544 @@ +From d4f4d9761cbd41c3ab6de79383ff39b9f97bf452 Mon Sep 17 00:00:00 2001 +From: Syrone Wong +Date: Sat, 18 Nov 2017 20:06:50 +0800 +Subject: [PATCH] Upgrade PCRE to PCRE2 + +- Use 8bit variant by default + +This comes from a PR closed and never reopen as at times PCRE2 was too +new(???.) + +Ref: https://github.com/shadowsocks/shadowsocks-libev/pull/1792 +Signed-off-by: Syrone Wong +[ squash the first 2 patch from PR, drop the last one ] +Signed-off-by: Christian Marangi +--- + .travis.yml | 9 ++- + configure.ac | 8 +-- + m4/pcre.m4 | 152 ------------------------------------------ + m4/pcre2.m4 | 181 +++++++++++++++++++++++++++++++++++++++++++++++++++ + src/rule.c | 53 ++++++++++++--- + src/rule.h | 23 +++++-- + 6 files changed, 253 insertions(+), 173 deletions(-) + delete mode 100644 m4/pcre.m4 + create mode 100644 m4/pcre2.m4 + +# diff --git a/.travis.yml b/.travis.yml +# index ee3424c..e7da08c 100644 +# --- a/.travis.yml +# +++ b/.travis.yml +# @@ -11,11 +11,12 @@ env: +# global: +# - LIBSODIUM_VER=1.0.12 +# - MBEDTLS_VER=2.4.0 +# + - PCRE2_VER=10.30 +# before_install: +# - | +# if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then +# # All dependencies for macOS build. Some packages has been installed by travis so use reinstall. +# - brew reinstall autoconf automake xmlto c-ares libev mbedtls libsodium asciidoc >> /dev/null 2>&1; +# + brew reinstall autoconf automake xmlto pcre2 c-ares libev mbedtls libsodium asciidoc >> /dev/null 2>&1; +# else +# wget https://github.com/jedisct1/libsodium/releases/download/$LIBSODIUM_VER/libsodium-$LIBSODIUM_VER.tar.gz; +# tar xvf libsodium-$LIBSODIUM_VER.tar.gz; +# @@ -29,6 +30,12 @@ before_install: +# make SHARED=1; +# sudo make install; +# popd; +# + wget https://ftp.pcre.org/pub/pcre/pcre2-$PCRE2_VER.tar.gz; +# + tar xvf pcre2-$PCRE2_VER.tar.gz; +# + pushd pcre2-$PCRE2_VER; +# + ./configure --prefix=/usr --enable-pcre2-16 --enable-pcre2-32 && make; +# + sudo make install; +# + popd; +# # Load cached docker images +# if [[ -d $HOME/docker ]]; then +# ls $HOME/docker/*.tar.gz | xargs -I {file} sh -c "zcat {file} | docker load"; +--- a/configure.ac ++++ b/configure.ac +@@ -20,10 +20,10 @@ AC_DISABLE_STATIC + AC_DISABLE_SHARED + LT_INIT([dlopen]) + +-dnl Check for pcre library +-TS_CHECK_PCRE +-if test "x${enable_pcre}" != "xyes"; then +- AC_MSG_ERROR([Cannot find pcre library. Configure --with-pcre=DIR]) ++dnl Check for pcre2 library ++TS_CHECK_PCRE2 ++if test "x${enable_pcre2}" != "xyes"; then ++ AC_MSG_ERROR([Cannot find pcre2 library. Configure --with-pcre2=DIR]) + fi + + dnl Checks for using shared libraries from system +--- a/m4/pcre.m4 ++++ /dev/null +@@ -1,152 +0,0 @@ +-dnl -------------------------------------------------------- -*- autoconf -*- +-dnl Licensed to the Apache Software Foundation (ASF) under one or more +-dnl contributor license agreements. See the NOTICE file distributed with +-dnl this work for additional information regarding copyright ownership. +-dnl The ASF licenses this file to You under the Apache License, Version 2.0 +-dnl (the "License"); you may not use this file except in compliance with +-dnl the License. You may obtain a copy of the License at +-dnl +-dnl http://www.apache.org/licenses/LICENSE-2.0 +-dnl +-dnl Unless required by applicable law or agreed to in writing, software +-dnl distributed under the License is distributed on an "AS IS" BASIS, +-dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-dnl See the License for the specific language governing permissions and +-dnl limitations under the License. +- +-dnl +-dnl TS_ADDTO(variable, value) +-dnl +-dnl Add value to variable +-dnl +-AC_DEFUN([TS_ADDTO], [ +- if test "x$$1" = "x"; then +- test "x$verbose" = "xyes" && echo " setting $1 to \"$2\"" +- $1="$2" +- else +- ats_addto_bugger="$2" +- for i in $ats_addto_bugger; do +- ats_addto_duplicate="0" +- for j in $$1; do +- if test "x$i" = "x$j"; then +- ats_addto_duplicate="1" +- break +- fi +- done +- if test $ats_addto_duplicate = "0"; then +- test "x$verbose" = "xyes" && echo " adding \"$i\" to $1" +- $1="$$1 $i" +- fi +- done +- fi +-])dnl +- +-dnl +-dnl TS_ADDTO_RPATH(path) +-dnl +-dnl Adds path to variable with the '-rpath' directive. +-dnl +-AC_DEFUN([TS_ADDTO_RPATH], [ +- AC_MSG_NOTICE([adding $1 to RPATH]) +- TS_ADDTO(LIBTOOL_LINK_FLAGS, [-R$1]) +-])dnl +- +-dnl +-dnl pcre.m4: Trafficserver's pcre autoconf macros +-dnl +- +-dnl +-dnl TS_CHECK_PCRE: look for pcre libraries and headers +-dnl +-AC_DEFUN([TS_CHECK_PCRE], [ +-enable_pcre=no +-AC_ARG_WITH(pcre, [AC_HELP_STRING([--with-pcre=DIR],[use a specific pcre library])], +-[ +- if test "x$withval" != "xyes" && test "x$withval" != "x"; then +- pcre_base_dir="$withval" +- if test "$withval" != "no"; then +- enable_pcre=yes +- case "$withval" in +- *":"*) +- pcre_include="`echo $withval |sed -e 's/:.*$//'`" +- pcre_ldflags="`echo $withval |sed -e 's/^.*://'`" +- AC_MSG_CHECKING(checking for pcre includes in $pcre_include libs in $pcre_ldflags ) +- ;; +- *) +- pcre_include="$withval/include" +- pcre_ldflags="$withval/lib" +- AC_MSG_CHECKING(checking for pcre includes in $withval) +- ;; +- esac +- fi +- fi +-], +-[ +- AC_CHECK_PROG(PCRE_CONFIG, pcre-config, pcre-config) +- if test "x$PCRE_CONFIG" != "x"; then +- enable_pcre=yes +- pcre_base_dir="`$PCRE_CONFIG --prefix`" +- pcre_include="`$PCRE_CONFIG --cflags | sed -es/-I//`" +- pcre_ldflags="`$PCRE_CONFIG --libs | sed -es/-lpcre// -es/-L//`" +- fi +-]) +- +-if test "x$pcre_base_dir" = "x"; then +- AC_MSG_CHECKING([for pcre location]) +- AC_CACHE_VAL(ats_cv_pcre_dir,[ +- for dir in /usr/local /usr ; do +- if test -d $dir && ( test -f $dir/include/pcre.h || test -f $dir/include/pcre/pcre.h ); then +- ats_cv_pcre_dir=$dir +- break +- fi +- done +- ]) +- pcre_base_dir=$ats_cv_pcre_dir +- if test "x$pcre_base_dir" = "x"; then +- enable_pcre=no +- AC_MSG_RESULT([not found]) +- else +- enable_pcre=yes +- pcre_include="$pcre_base_dir/include" +- pcre_ldflags="$pcre_base_dir/lib" +- AC_MSG_RESULT([$pcre_base_dir]) +- fi +-else +- AC_MSG_CHECKING(for pcre headers in $pcre_include) +- if test -d $pcre_include && test -d $pcre_ldflags && ( test -f $pcre_include/pcre.h || test -f $pcre_include/pcre/pcre.h ); then +- AC_MSG_RESULT([ok]) +- else +- AC_MSG_RESULT([not found]) +- fi +-fi +- +-pcreh=0 +-pcre_pcreh=0 +-if test "$enable_pcre" != "no"; then +- saved_ldflags=$LDFLAGS +- saved_cppflags=$CFLAGS +- pcre_have_headers=0 +- pcre_have_libs=0 +- if test "$pcre_base_dir" != "/usr"; then +- TS_ADDTO(CFLAGS, [-I${pcre_include}]) +- TS_ADDTO(CFLAGS, [-DPCRE_STATIC]) +- TS_ADDTO(LDFLAGS, [-L${pcre_ldflags}]) +- TS_ADDTO_RPATH(${pcre_ldflags}) +- fi +- AC_SEARCH_LIBS([pcre_exec], [pcre], [pcre_have_libs=1]) +- if test "$pcre_have_libs" != "0"; then +- AC_CHECK_HEADERS(pcre.h, [pcre_have_headers=1]) +- AC_CHECK_HEADERS(pcre/pcre.h, [pcre_have_headers=1]) +- fi +- if test "$pcre_have_headers" != "0"; then +- AC_DEFINE(HAVE_LIBPCRE,1,[Compiling with pcre support]) +- AC_SUBST(LIBPCRE, [-lpcre]) +- else +- enable_pcre=no +- CFLAGS=$saved_cppflags +- LDFLAGS=$saved_ldflags +- fi +-fi +-AC_SUBST(pcreh) +-AC_SUBST(pcre_pcreh) +-]) +--- /dev/null ++++ b/m4/pcre2.m4 +@@ -0,0 +1,181 @@ ++dnl -------------------------------------------------------- -*- autoconf -*- ++dnl Licensed to the Apache Software Foundation (ASF) under one or more ++dnl contributor license agreements. See the NOTICE file distributed with ++dnl this work for additional information regarding copyright ownership. ++dnl The ASF licenses this file to You under the Apache License, Version 2.0 ++dnl (the "License"); you may not use this file except in compliance with ++dnl the License. You may obtain a copy of the License at ++dnl ++dnl http://www.apache.org/licenses/LICENSE-2.0 ++dnl ++dnl Unless required by applicable law or agreed to in writing, software ++dnl distributed under the License is distributed on an "AS IS" BASIS, ++dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++dnl See the License for the specific language governing permissions and ++dnl limitations under the License. ++ ++dnl Modified by Syrone Wong to support pcre2 8bit variant only ++ ++dnl ++dnl TS_ADDTO(variable, value) ++dnl ++dnl Add value to variable ++dnl ++AC_DEFUN([TS_ADDTO], [ ++ if test "x$$1" = "x"; then ++ test "x$verbose" = "xyes" && echo " setting $1 to \"$2\"" ++ $1="$2" ++ else ++ ats_addto_bugger="$2" ++ for i in $ats_addto_bugger; do ++ ats_addto_duplicate="0" ++ for j in $$1; do ++ if test "x$i" = "x$j"; then ++ ats_addto_duplicate="1" ++ break ++ fi ++ done ++ if test $ats_addto_duplicate = "0"; then ++ test "x$verbose" = "xyes" && echo " adding \"$i\" to $1" ++ $1="$$1 $i" ++ fi ++ done ++ fi ++])dnl ++ ++dnl ++dnl TS_ADDTO_RPATH(path) ++dnl ++dnl Adds path to variable with the '-rpath' directive. ++dnl ++AC_DEFUN([TS_ADDTO_RPATH], [ ++ AC_MSG_NOTICE([adding $1 to RPATH]) ++ TS_ADDTO(LIBTOOL_LINK_FLAGS, [-R$1]) ++])dnl ++ ++dnl ++dnl pcre2.m4: Trafficserver's pcre2 autoconf macros ++dnl ++ ++dnl ++dnl TS_CHECK_PCRE2: look for pcre2 libraries and headers ++dnl ++AC_DEFUN([TS_CHECK_PCRE2], [ ++enable_pcre2=no ++AC_ARG_WITH(pcre2, [AC_HELP_STRING([--with-pcre2=DIR],[use a specific pcre2 library])], ++[ ++ if test "x$withval" != "xyes" && test "x$withval" != "x"; then ++ pcre2_base_dir="$withval" ++ if test "$withval" != "no"; then ++ enable_pcre2=yes ++ case "$withval" in ++ *":"*) ++ pcre2_include="`echo $withval |sed -e 's/:.*$//'`" ++ pcre2_ldflags="`echo $withval |sed -e 's/^.*://'`" ++ AC_MSG_CHECKING(checking for pcre2 includes in $pcre2_include libs in $pcre2_ldflags ) ++ ;; ++ *) ++ pcre2_include="$withval/include" ++ pcre2_ldflags="$withval/lib" ++ AC_MSG_CHECKING(checking for pcre2 includes in $withval) ++ ;; ++ esac ++ fi ++ fi ++], ++[ ++ AC_CHECK_PROG(PCRE2_CONFIG, pcre2-config, pcre2-config) ++ if test "x$PCRE2_CONFIG" != "x"; then ++ enable_pcre2=yes ++ pcre2_base_dir="`$PCRE2_CONFIG --prefix`" ++ pcre2_include="`$PCRE2_CONFIG --cflags | sed -es/-I//`" ++ pcre2_ldflags="`$PCRE2_CONFIG --libs8 | sed -es/-lpcre2-8// -es/-L//`" ++ fi ++]) ++ ++if test "x$pcre2_base_dir" = "x"; then ++ AC_MSG_CHECKING([for pcre2 location]) ++ AC_CACHE_VAL(ats_cv_pcre2_dir,[ ++ for dir in /usr/local /usr ; do ++ if test -d $dir && ( test -f $dir/include/pcre2.h || test -f $dir/include/pcre2/pcre2.h ); then ++ ats_cv_pcre2_dir=$dir ++ break ++ fi ++ done ++ ]) ++ pcre2_base_dir=$ats_cv_pcre2_dir ++ if test "x$pcre2_base_dir" = "x"; then ++ enable_pcre2=no ++ AC_MSG_RESULT([not found]) ++ else ++ enable_pcre2=yes ++ pcre2_include="$pcre2_base_dir/include" ++ pcre2_ldflags="$pcre2_base_dir/lib" ++ AC_MSG_RESULT([$pcre2_base_dir]) ++ fi ++else ++ AC_MSG_CHECKING(for pcre2 headers in $pcre2_include) ++ if test -d $pcre2_include && test -d $pcre2_ldflags && ( test -f $pcre2_include/pcre2.h || test -f $pcre2_include/pcre2/pcre2.h ); then ++ AC_MSG_RESULT([ok]) ++ else ++ AC_MSG_RESULT([not found]) ++ fi ++fi ++ ++pcre2h=0 ++pcre2_pcre2h=0 ++if test "$enable_pcre2" != "no"; then ++ saved_ldflags=$LDFLAGS ++ saved_cppflags=$CFLAGS ++ pcre2_have_headers=0 ++ pcre2_have_libs=0 ++ if test "$pcre2_base_dir" != "/usr"; then ++ TS_ADDTO(CFLAGS, [-I${pcre2_include}]) ++ TS_ADDTO(CFLAGS, [-DPCRE2_STATIC]) ++ TS_ADDTO(LDFLAGS, [-L${pcre2_ldflags}]) ++ TS_ADDTO_RPATH(${pcre2_ldflags}) ++ fi ++ AC_SEARCH_LIBS([pcre2_match_8], [pcre2-8], [pcre2_have_libs=1]) ++ if test "$pcre2_have_libs" != "0"; then ++ AC_MSG_CHECKING([pcre2.h]) ++ AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[ ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include ++ ]], ++ [[ ++ ]] ++ )], ++ [pcre2_have_headers=1 ++ AC_MSG_RESULT([ok])], ++ [AC_MSG_RESULT([not found])] ++ ) ++ ++ AC_MSG_CHECKING([pcre2/pcre2.h]) ++ AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM( ++ [[ ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include ++ ]], ++ [[ ++ ]] ++ )], ++ [pcre2_have_headers=1 ++ AC_MSG_RESULT([ok])], ++ [AC_MSG_RESULT([not found])] ++ ) ++ fi ++ if test "$pcre2_have_headers" != "0"; then ++ AC_DEFINE(HAVE_LIBPCRE2,1,[Compiling with pcre2 support]) ++ AC_SUBST(LIBPCRE2, [-lpcre2-8]) ++ else ++ enable_pcre2=no ++ CFLAGS=$saved_cppflags ++ LDFLAGS=$saved_ldflags ++ fi ++fi ++AC_SUBST(pcre2h) ++AC_SUBST(pcre2_pcre2h) ++]) +--- a/src/rule.c ++++ b/src/rule.c +@@ -1,6 +1,7 @@ + /* + * Copyright (c) 2011 and 2012, Dustin Lundquist + * Copyright (c) 2011 Manuel Kasper ++ * Copyright (c) 2017 Syrone Wong + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -74,18 +75,37 @@ add_rule(struct cork_dllist *rules, rule + cork_dllist_add(rules, &rule->entries); + } + ++/* ++ * XXX: As pattern and subject are char arguments, they can be straightforwardly ++ * cast to PCRE2_SPTR as we are working in 8-bit code units. ++ */ ++ + int + init_rule(rule_t *rule) + { + if (rule->pattern_re == NULL) { +- const char *reerr; +- int reerroffset; ++ int errornumber; ++ PCRE2_SIZE erroroffset; ++ rule->pattern_re = pcre2_compile( ++ (PCRE2_SPTR)rule->pattern, /* the pattern */ ++ PCRE2_ZERO_TERMINATED, /* indicates pattern is zero-terminated */ ++ 0, /* default options */ ++ &errornumber, /* for error number */ ++ &erroroffset, /* for error offset */ ++ NULL); /* use default compile context */ + +- rule->pattern_re = +- pcre_compile(rule->pattern, 0, &reerr, &reerroffset, NULL); + if (rule->pattern_re == NULL) { +- LOGE("Regex compilation of \"%s\" failed: %s, offset %d", +- rule->pattern, reerr, reerroffset); ++ PCRE2_UCHAR errbuffer[512]; ++ pcre2_get_error_message(errornumber, errbuffer, sizeof(errbuffer)); ++ LOGE("PCRE2 regex compilation failed at offset %d: %s\n", (int)erroroffset, ++ errbuffer); ++ return 0; ++ } ++ ++ rule->pattern_re_match_data = pcre2_match_data_create_from_pattern(rule->pattern_re, NULL); ++ ++ if (rule->pattern_re_match_data == NULL) { ++ ERROR("PCRE2: the memory for the block could not be obtained"); + return 0; + } + } +@@ -105,8 +125,15 @@ lookup_rule(const struct cork_dllist *ru + + cork_dllist_foreach_void(rules, curr, next) { + rule_t *rule = cork_container_of(curr, rule_t, entries); +- if (pcre_exec(rule->pattern_re, NULL, +- name, name_len, 0, 0, NULL, 0) >= 0) ++ if (pcre2_match( ++ rule->pattern_re, /* the compiled pattern */ ++ (PCRE2_SPTR)name, /* the subject string */ ++ name_len, /* the length of the subject */ ++ 0, /* start at offset 0 in the subject */ ++ 0, /* default options */ ++ rule->pattern_re_match_data, /* block for storing the result */ ++ NULL /* use default match context */ ++ ) >= 0) + return rule; + } + +@@ -127,7 +154,13 @@ free_rule(rule_t *rule) + return; + + ss_free(rule->pattern); +- if (rule->pattern_re != NULL) +- pcre_free(rule->pattern_re); ++ if (rule->pattern_re != NULL) { ++ pcre2_code_free(rule->pattern_re); /* data and the compiled pattern. */ ++ rule->pattern_re = NULL; ++ } ++ if (rule->pattern_re_match_data != NULL) { ++ pcre2_match_data_free(rule->pattern_re_match_data); /* Release memory used for the match */ ++ rule->pattern_re_match_data = NULL; ++ } + ss_free(rule); + } +--- a/src/rule.h ++++ b/src/rule.h +@@ -1,6 +1,7 @@ + /* + * Copyright (c) 2011 and 2012, Dustin Lundquist + * Copyright (c) 2011 Manuel Kasper ++ * Copyright (c) 2017 Syrone Wong + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -33,17 +34,27 @@ + + #include + +-#ifdef HAVE_PCRE_H +-#include +-#elif HAVE_PCRE_PCRE_H +-#include +-#endif ++/* ++ * The PCRE2_CODE_UNIT_WIDTH macro must be defined before including pcre2.h. ++ * For a program that uses only one code unit width, setting it to 8, 16, or 32 ++ * makes it possible to use generic function names such as pcre2_compile(). Note ++ * that just changing 8 to 16 (for example) is not sufficient to convert this ++ * program to process 16-bit characters. Even in a fully 16-bit environment, where ++ * string-handling functions such as strcmp() and printf() work with 16-bit ++ * characters, the code for handling the table of named substrings will still need ++ * to be modified. ++ */ ++/* we only need to support ASCII chartable, thus set it to 8 */ ++#define PCRE2_CODE_UNIT_WIDTH 8 ++ ++#include + + typedef struct rule { + char *pattern; + + /* Runtime fields */ +- pcre *pattern_re; ++ pcre2_code *pattern_re; ++ pcre2_match_data *pattern_re_match_data; + + struct cork_dllist_item entries; + } rule_t; From 5a917a2a1cd068081d6f30e6ffc282ae977423bb Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Fri, 13 Oct 2023 08:57:18 +0200 Subject: [PATCH 07/12] ooniprobe: remove unused package This package is not maintained anymore in the OpenWrt packages feed and since we updated Go to 1.21 version, it is not compiled either. Let's hope that with removing this package from our feed, someone will step it and become a maintainer to take care of this package. Signed-off-by: Josef Schlehofer --- net/ooniprobe/Makefile | 53 ------------------------------------------ net/ooniprobe/test.sh | 3 --- 2 files changed, 56 deletions(-) delete mode 100644 net/ooniprobe/Makefile delete mode 100644 net/ooniprobe/test.sh diff --git a/net/ooniprobe/Makefile b/net/ooniprobe/Makefile deleted file mode 100644 index bb7cf42812..0000000000 --- a/net/ooniprobe/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -# -# Copyright (C) 2020-2021 CZ.NIC, z. s. p. o. (https://www.nic.cz/) -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=ooniprobe -PKG_VERSION:=3.18.0 -PKG_RELEASE:=1 - -PKG_SOURCE:=probe-cli-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://codeload.github.com/ooni/probe-cli/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=d28c050226c9282d7155da6cabf5547ddd43dc11eecacc485b6c05161c2d1d88 - -PKG_MAINTAINER:=Jan Pavlinec -PKG_LICENSE:=GPL-3.0-or-later -PKG_LICENSE_FILES:=LICENSE - -PKG_BUILD_DIR:=$(BUILD_DIR)/probe-cli-$(PKG_VERSION) -PKG_BUILD_DEPENDS:=golang/host -PKG_BUILD_PARALLEL:=1 -PKG_BUILD_FLAGS:=no-mips16 - -GO_PKG:=github.com/ooni/probe-cli -GO_PKG_BUILD_PKG:=github.com/ooni/probe-cli/v3/cmd/ooniprobe - -include $(INCLUDE_DIR)/package.mk -include ../../lang/golang/golang-package.mk - -define Package/ooniprobe - SECTION:=net - CATEGORY:=Network - TITLE:=OONI probe-cli - URL:=https://ooni.org - DEPENDS:=$(GO_ARCH_DEPENDS) -endef - -define Package/ooniprobe/description - The next generation of Open Observatory of Network Interference (OONI) - Probe Command Line Interface. -endef - -# Workaround for musl 1.2.4 compability in mattn/go-sqlite3 -# https://github.com/mattn/go-sqlite3/issues/1164 -ifneq ($(CONFIG_USE_MUSL),) - TARGET_CFLAGS += -D_LARGEFILE64_SOURCE -endif - -$(eval $(call GoBinPackage,ooniprobe)) -$(eval $(call BuildPackage,ooniprobe)) diff --git a/net/ooniprobe/test.sh b/net/ooniprobe/test.sh deleted file mode 100644 index 9ecab82f90..0000000000 --- a/net/ooniprobe/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -ooniprobe version | grep "$2" From d191c3d0c409e150d7234a52715718dbe05c1bce Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Thu, 28 Sep 2023 23:51:28 +0200 Subject: [PATCH 08/12] micropython-lib: move to PCRE2 Add pending patch converting the package to PCRE2. Signed-off-by: Christian Marangi --- lang/python/micropython-lib/Makefile | 4 +- .../004-unix-ffi-re-convert-to-PCRE2.patch | 148 ++++++++++++++++++ 2 files changed, 150 insertions(+), 2 deletions(-) create mode 100644 lang/python/micropython-lib/patches/004-unix-ffi-re-convert-to-PCRE2.patch diff --git a/lang/python/micropython-lib/Makefile b/lang/python/micropython-lib/Makefile index 7bd167898a..490e6e2e7d 100644 --- a/lang/python/micropython-lib/Makefile +++ b/lang/python/micropython-lib/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=micropython-lib -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/micropython/micropython-lib.git @@ -50,7 +50,7 @@ endef define Package/micropython-lib-unix $(call Package/micropython-lib/Default) TITLE+= - Unix port packages - DEPENDS:=+micropython +libpcre +librt +libsqlite3 + DEPENDS:=+micropython +libpcre2 +librt +libsqlite3 endef define Package/micropython-lib-unix-src diff --git a/lang/python/micropython-lib/patches/004-unix-ffi-re-convert-to-PCRE2.patch b/lang/python/micropython-lib/patches/004-unix-ffi-re-convert-to-PCRE2.patch new file mode 100644 index 0000000000..6bf539b144 --- /dev/null +++ b/lang/python/micropython-lib/patches/004-unix-ffi-re-convert-to-PCRE2.patch @@ -0,0 +1,148 @@ +From 1cbe8c4dd653336c5766dfd75eb379ad37f04249 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Thu, 28 Sep 2023 20:59:26 +0200 +Subject: [PATCH] unix-ffi: re: convert to PCRE2 + +PCRE is marked as EOL and won't receive any new security update. + +Convert the re module to PCRE2 API to enforce security. +Additional dependency is now needed with uctypes due to changes in how +PCRE2 return the match_data in a pointer and require special handling. + +The converted module is tested with the test_re.py with no regression. + +Signed-off-by: Christian Marangi +--- + unix-ffi/re/re.py | 73 +++++++++++++++++++++++++++++++---------------- + 1 file changed, 48 insertions(+), 25 deletions(-) + +--- a/unix-ffi/re/re.py ++++ b/unix-ffi/re/re.py +@@ -1,36 +1,55 @@ + import sys + import ffilib + import array ++import uctypes + ++pcre2 = ffilib.open("libpcre2-8") + +-pcre = ffilib.open("libpcre") +- +-# pcre *pcre_compile(const char *pattern, int options, +-# const char **errptr, int *erroffset, +-# const unsigned char *tableptr); +-pcre_compile = pcre.func("p", "pcre_compile", "sipps") +- +-# int pcre_exec(const pcre *code, const pcre_extra *extra, +-# const char *subject, int length, int startoffset, +-# int options, int *ovector, int ovecsize); +-pcre_exec = pcre.func("i", "pcre_exec", "PPsiiipi") +- +-# int pcre_fullinfo(const pcre *code, const pcre_extra *extra, +-# int what, void *where); +-pcre_fullinfo = pcre.func("i", "pcre_fullinfo", "PPip") +- +- +-IGNORECASE = I = 1 +-MULTILINE = M = 2 +-DOTALL = S = 4 +-VERBOSE = X = 8 +-PCRE_ANCHORED = 0x10 ++# pcre2_code *pcre2_compile(PCRE2_SPTR pattern, PCRE2_SIZE length, ++# uint32_t options, int *errorcode, PCRE2_SIZE *erroroffset, ++# pcre2_compile_context *ccontext); ++pcre2_compile = pcre2.func("p", "pcre2_compile_8", "siippp") ++ ++# int pcre2_match(const pcre2_code *code, PCRE2_SPTR subject, ++# PCRE2_SIZE length, PCRE2_SIZE startoffset, uint32_t options, ++# pcre2_match_data *match_data, pcre2_match_context *mcontext); ++pcre2_match = pcre2.func("i", "pcre2_match_8", "Psiiipp") ++ ++# int pcre2_pattern_info(const pcre2_code *code, uint32_t what, ++# void *where); ++pcre2_pattern_info = pcre2.func("i", "pcre2_pattern_info_8", "Pip") ++ ++# PCRE2_SIZE *pcre2_get_ovector_pointer(pcre2_match_data *match_data); ++pcre2_get_ovector_pointer = pcre2.func("p", "pcre2_get_ovector_pointer_8", "p") ++ ++# pcre2_match_data *pcre2_match_data_create_from_pattern(const pcre2_code *code, ++# pcre2_general_context *gcontext); ++pcre2_match_data_create_from_pattern = pcre2.func( ++ "p", "pcre2_match_data_create_from_pattern_8", "Pp" ++) ++ ++# PCRE2_SIZE that is of type size_t. ++# Use ULONG as type to support both 32bit and 64bit. ++PCRE2_SIZE_SIZE = uctypes.sizeof({"field": 0 | uctypes.ULONG}) ++PCRE2_SIZE_TYPE = "L" ++ ++# Real value in pcre2.h is 0xFFFFFFFF for 32bit and ++# 0x0xFFFFFFFFFFFFFFFF for 64bit that is equivalent ++# to -1 ++PCRE2_ZERO_TERMINATED = -1 ++ ++ ++IGNORECASE = I = 0x8 ++MULTILINE = M = 0x400 ++DOTALL = S = 0x20 ++VERBOSE = X = 0x80 ++PCRE2_ANCHORED = 0x80000000 + + # TODO. Note that Python3 has unicode by default + ASCII = A = 0 + UNICODE = U = 0 + +-PCRE_INFO_CAPTURECOUNT = 2 ++PCRE2_INFO_CAPTURECOUNT = 0x4 + + + class PCREMatch: +@@ -67,19 +86,23 @@ class PCREPattern: + def search(self, s, pos=0, endpos=-1, _flags=0): + assert endpos == -1, "pos: %d, endpos: %d" % (pos, endpos) + buf = array.array("i", [0]) +- pcre_fullinfo(self.obj, None, PCRE_INFO_CAPTURECOUNT, buf) ++ pcre2_pattern_info(self.obj, PCRE2_INFO_CAPTURECOUNT, buf) + cap_count = buf[0] +- ov = array.array("i", [0, 0, 0] * (cap_count + 1)) +- num = pcre_exec(self.obj, None, s, len(s), pos, _flags, ov, len(ov)) ++ match_data = pcre2_match_data_create_from_pattern(self.obj, None) ++ num = pcre2_match(self.obj, s, len(s), pos, _flags, match_data, None) + if num == -1: + # No match + return None ++ ov_ptr = pcre2_get_ovector_pointer(match_data) ++ # pcre2_get_ovector_pointer return PCRE2_SIZE ++ ov_buf = uctypes.bytearray_at(ov_ptr, PCRE2_SIZE_SIZE * (cap_count + 1) * 2) ++ ov = array.array(PCRE2_SIZE_TYPE, ov_buf) + # We don't care how many matching subexpressions we got, we + # care only about total # of capturing ones (including empty) + return PCREMatch(s, cap_count + 1, ov) + + def match(self, s, pos=0, endpos=-1): +- return self.search(s, pos, endpos, PCRE_ANCHORED) ++ return self.search(s, pos, endpos, PCRE2_ANCHORED) + + def sub(self, repl, s, count=0): + if not callable(repl): +@@ -141,9 +164,9 @@ class PCREPattern: + + + def compile(pattern, flags=0): +- errptr = bytes(4) ++ errcode = bytes(4) + erroffset = bytes(4) +- regex = pcre_compile(pattern, flags, errptr, erroffset, None) ++ regex = pcre2_compile(pattern, PCRE2_ZERO_TERMINATED, flags, errcode, erroffset, None) + assert regex + return PCREPattern(regex) + +@@ -154,7 +177,7 @@ def search(pattern, string, flags=0): + + + def match(pattern, string, flags=0): +- r = compile(pattern, flags | PCRE_ANCHORED) ++ r = compile(pattern, flags | PCRE2_ANCHORED) + return r.search(string) + + From bb9d02be0303f71cb6f5fa19b95b8a513c867935 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Thu, 5 Oct 2023 16:55:10 +0200 Subject: [PATCH 09/12] nginx: add option to compile STREAM REAL IP module Add option to compile STREAM REAL IP module. Closes: #22310 Signed-off-by: Christian Marangi --- net/nginx/Config_ssl.in | 5 +++++ net/nginx/Makefile | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/net/nginx/Config_ssl.in b/net/nginx/Config_ssl.in index 990a01e813..b02166f36d 100644 --- a/net/nginx/Config_ssl.in +++ b/net/nginx/Config_ssl.in @@ -200,4 +200,9 @@ config NGINX_HTTP_SUB prompt "Enable HTTP sub module" default n +config NGINX_STREAM_REAL_IP + bool + prompt "Enable STREAM real ip module" + default n + endmenu diff --git a/net/nginx/Makefile b/net/nginx/Makefile index 66a0c8713d..0accdd0999 100644 --- a/net/nginx/Makefile +++ b/net/nginx/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nginx PKG_VERSION:=1.25.2 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://nginx.org/download/ @@ -82,6 +82,7 @@ PKG_CONFIG_DEPENDS := \ CONFIG_NGINX_PCRE \ CONFIG_NGINX_HTTP_REAL_IP \ CONFIG_NGINX_HTTP_SECURE_LINK \ + CONFIG_NGINX_STREAM_REAL_IP \ CONFIG_OPENSSL_ENGINE \ CONFIG_OPENSSL_WITH_NPN \ $(foreach m,$(PKG_MOD_EXTRA),CONFIG_PACKAGE_$(m)) @@ -449,6 +450,7 @@ CONFIGURE_ARGS += \ $(if $(call IsEnabled,NGINX_HTTP_SECURE_LINK),--with-http_secure_link_module) \ $(if $(call IsEnabled,NGINX_HTTP_SUB),--with-http_sub_module) \ $(if $(CONFIG_PACKAGE_nginx-mod-stream),--with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module) \ + $(if $(call IsEnabled,NGINX_STREAM_REAL_IP),--with-stream_realip_module) \ $(if $(CONFIG_PACKAGE_nginx-mod-naxsi),--add-dynamic-module=$(PKG_BUILD_DIR)/nginx-mod-naxsi/naxsi_src) \ $(foreach m,$(filter-out lua-resty-core lua-resty-lrucache naxsi,$(PKG_MOD_EXTRA)), \ $(if $(CONFIG_PACKAGE_nginx-mod-$(m)),--add-dynamic-module=$(PKG_BUILD_DIR)/nginx-mod-$(m))) From af58942738c13c431f531e78f368d18a0d2dd84d Mon Sep 17 00:00:00 2001 From: ValdikSS ValdikSS Date: Sun, 22 Oct 2023 19:30:04 +0300 Subject: [PATCH 10/12] tor: fix daemon reloading procd requires init script name, not the path to executable Signed-off-by: ValdikSS ValdikSS --- net/tor/Makefile | 2 +- net/tor/files/tor.init | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/tor/Makefile b/net/tor/Makefile index 756d2785c0..da2e478335 100644 --- a/net/tor/Makefile +++ b/net/tor/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tor PKG_VERSION:=0.4.8.4 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://dist.torproject.org/ \ diff --git a/net/tor/files/tor.init b/net/tor/files/tor.init index 142e2512de..cb1cb73c5c 100644 --- a/net/tor/files/tor.init +++ b/net/tor/files/tor.init @@ -32,7 +32,7 @@ generate_conf() { } reload_service() { - procd_send_signal /usr/sbin/tor + procd_send_signal tor } start_service() { From 98bcb56eb3de7ae1ffc1ed66287168750a72a059 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Sat, 14 Oct 2023 09:03:52 +0300 Subject: [PATCH 11/12] stress-ng: backport immintrin.h header detection for GCC 13 Backport patch from: https://github.com/ColinIanKing/stress-ng/commit/cd84c46ce780242879e8aaa7d698b9cd87996dbd With GCC 12 there is no issue. With GCC 13, there is a compilation issue on x86_64. Fixes https://github.com/openwrt/packages/issues/22373 Signed-off-by: Alexandru Ardelean --- utils/stress-ng/Makefile | 2 +- ...musl-gcc-detection-and-HAVE_COMPILER.patch | 531 ++++++++++++++++++ utils/stress-ng/test.sh | 3 + 3 files changed, 535 insertions(+), 1 deletion(-) create mode 100644 utils/stress-ng/patches/002-core-stress-Add-musl-gcc-detection-and-HAVE_COMPILER.patch create mode 100644 utils/stress-ng/test.sh diff --git a/utils/stress-ng/Makefile b/utils/stress-ng/Makefile index 890a7be1bf..11a4cbf22b 100644 --- a/utils/stress-ng/Makefile +++ b/utils/stress-ng/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=stress-ng PKG_VERSION:=0.17.00 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/ColinIanKing/stress-ng/tar.gz/refs/tags/V$(PKG_VERSION)? diff --git a/utils/stress-ng/patches/002-core-stress-Add-musl-gcc-detection-and-HAVE_COMPILER.patch b/utils/stress-ng/patches/002-core-stress-Add-musl-gcc-detection-and-HAVE_COMPILER.patch new file mode 100644 index 0000000000..1b161102dc --- /dev/null +++ b/utils/stress-ng/patches/002-core-stress-Add-musl-gcc-detection-and-HAVE_COMPILER.patch @@ -0,0 +1,531 @@ +From cd84c46ce780242879e8aaa7d698b9cd87996dbd Mon Sep 17 00:00:00 2001 +From: Colin Ian King +Date: Sun, 15 Oct 2023 15:50:07 +0100 +Subject: [PATCH] core-*, stress-*: Add musl-gcc detection and + HAVE_COMPILER_MUSL + +Detect for musl-gcc and define HAVE_COMPILER_MUSL and also define +HAVE_COMPILER_GCC_OR_MUSL for GCC or MUSL compilers. Allows one +to differentiate between gcc tool chains with and without glibc/musl +libc. + +Fixes https://github.com/ColinIanKing/stress-ng/issues/325 + +Signed-off-by: Colin Ian King +--- + core-attribute.h | 56 ++++++++++++++++++++++---------------------- + core-helper.c | 4 ++-- + core-pragma.h | 18 +++++++------- + core-shim.c | 2 +- + core-target-clones.h | 2 +- + core-vecmath.h | 4 ++-- + stress-atomic.c | 4 ++-- + stress-flushcache.c | 2 +- + stress-lockbus.c | 4 ++-- + stress-malloc.c | 4 ++-- + stress-memthrash.c | 12 +++++----- + stress-ng.h | 32 ++++++++++++++++--------- + stress-regs.c | 8 +++---- + stress-rseq.c | 14 +++++------ + stress-vnni.c | 4 ++++ + 15 files changed, 92 insertions(+), 78 deletions(-) + +--- a/core-attribute.h ++++ b/core-attribute.h +@@ -20,7 +20,7 @@ + #define CORE_ATTRIBUTE_H + + /* warn unused attribute */ +-#if (defined(HAVE_COMPILER_GCC) && NEED_GNUC(4, 2, 0)) || \ ++#if (defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(4, 2, 0)) || \ + (defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0)) + #define WARN_UNUSED __attribute__((warn_unused_result)) + #else +@@ -36,7 +36,7 @@ + + #if defined(HAVE_ATTRIBUTE_FAST_MATH) && \ + !defined(HAVE_COMPILER_ICC) && \ +- defined(HAVE_COMPILER_GCC) && \ ++ defined(HAVE_COMPILER_GCC_OR_MUSL) && \ + NEED_GNUC(10, 0, 0) + #define OPTIMIZE_FAST_MATH __attribute__((optimize("fast-math"))) + #else +@@ -44,7 +44,7 @@ + #endif + + /* no return hint */ +-#if (defined(HAVE_COMPILER_GCC) && NEED_GNUC(2, 5, 0)) || \ ++#if (defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(2, 5, 0)) || \ + (defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0)) + #define NORETURN __attribute__((noreturn)) + #else +@@ -52,7 +52,7 @@ + #endif + + /* weak attribute */ +-#if (defined(HAVE_COMPILER_GCC) && NEED_GNUC(4, 0, 0)) || \ ++#if (defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(4, 0, 0)) || \ + (defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 4, 0)) + #define WEAK __attribute__((weak)) + #define HAVE_WEAK_ATTRIBUTE +@@ -64,7 +64,7 @@ + #undef ALWAYS_INLINE + #endif + /* force inlining hint */ +-#if (defined(HAVE_COMPILER_GCC) && NEED_GNUC(3, 4, 0) \ ++#if (defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(3, 4, 0) \ + && ((!defined(__s390__) && !defined(__s390x__)) || NEED_GNUC(6, 0, 1))) || \ + (defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0)) + #define ALWAYS_INLINE __attribute__((always_inline)) +@@ -73,7 +73,7 @@ + #endif + + /* force no inlining hint */ +-#if (defined(HAVE_COMPILER_GCC) && NEED_GNUC(3, 4, 0)) || \ ++#if (defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(3, 4, 0)) || \ + (defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0)) + #define NOINLINE __attribute__((noinline)) + #else +@@ -81,9 +81,9 @@ + #endif + + /* -O3 attribute support */ +-#if defined(HAVE_COMPILER_GCC) && \ +- !defined(HAVE_COMPILER_CLANG) && \ +- !defined(HAVE_COMPILER_ICC) && \ ++#if defined(HAVE_COMPILER_GCC_OR_MUSL) && \ ++ !defined(HAVE_COMPILER_CLANG) && \ ++ !defined(HAVE_COMPILER_ICC) && \ + NEED_GNUC(4, 6, 0) + #define OPTIMIZE3 __attribute__((optimize("-O3"))) + #else +@@ -91,9 +91,9 @@ + #endif + + /* -O2 attribute support */ +-#if defined(HAVE_COMPILER_GCC) && \ +- !defined(HAVE_COMPILER_CLANG) && \ +- !defined(HAVE_COMPILER_ICC) && \ ++#if defined(HAVE_COMPILER_GCC_OR_MUSL) && \ ++ !defined(HAVE_COMPILER_CLANG) && \ ++ !defined(HAVE_COMPILER_ICC) && \ + NEED_GNUC(4, 6, 0) + #define OPTIMIZE2 __attribute__((optimize("-O2"))) + #else +@@ -101,9 +101,9 @@ + #endif + + /* -O1 attribute support */ +-#if defined(HAVE_COMPILER_GCC) && \ +- !defined(HAVE_COMPILER_CLANG) && \ +- !defined(HAVE_COMPILER_ICC) && \ ++#if defined(HAVE_COMPILER_GCC_OR_MUSL) && \ ++ !defined(HAVE_COMPILER_CLANG) && \ ++ !defined(HAVE_COMPILER_ICC) && \ + NEED_GNUC(4, 6, 0) + #define OPTIMIZE1 __attribute__((optimize("-O1"))) + #else +@@ -111,8 +111,8 @@ + #endif + + /* -O0 attribute support */ +-#if defined(HAVE_COMPILER_GCC) && \ +- !defined(HAVE_COMPILER_ICC) && \ ++#if defined(HAVE_COMPILER_GCC_OR_MUSL) && \ ++ !defined(HAVE_COMPILER_ICC) && \ + NEED_GNUC(4, 6, 0) + #define OPTIMIZE0 __attribute__((optimize("-O0"))) + #elif (defined(HAVE_COMPILER_CLANG) && NEED_CLANG(10, 0, 0)) +@@ -121,10 +121,10 @@ + #define OPTIMIZE0 + #endif + +-#if ((defined(HAVE_COMPILER_GCC) && NEED_GNUC(3, 3, 0)) || \ +- (defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0)) || \ +- (defined(HAVE_COMPILER_ICC) && NEED_ICC(2021, 0, 0))) && \ +- !defined(HAVE_COMPILER_PCC) && \ ++#if ((defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(3, 3, 0)) || \ ++ (defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0)) || \ ++ (defined(HAVE_COMPILER_ICC) && NEED_ICC(2021, 0, 0))) && \ ++ !defined(HAVE_COMPILER_PCC) && \ + !defined(__minix__) + #define ALIGNED(a) __attribute__((aligned(a))) + #else +@@ -136,7 +136,7 @@ + #define ALIGN64 ALIGNED(64) + + +-#if (defined(HAVE_COMPILER_GCC) && NEED_GNUC(4, 6, 0)) || \ ++#if (defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(4, 6, 0)) || \ + (defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0)) + #if (defined(__APPLE__) && defined(__MACH__)) + #define SECTION(s) __attribute__((__section__(# s "," # s))) +@@ -148,7 +148,7 @@ + #endif + + /* GCC hot attribute */ +-#if (defined(HAVE_COMPILER_GCC) && NEED_GNUC(4, 6, 0)) || \ ++#if (defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(4, 6, 0)) || \ + (defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 3, 0)) + #define HOT __attribute__((hot)) + #else +@@ -156,10 +156,10 @@ + #endif + + /* GCC mlocked data and data section attribute */ +-#if ((defined(HAVE_COMPILER_GCC) && NEED_GNUC(4, 6, 0) || \ +- (defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0)))) && \ +- !defined(__sun__) && \ +- !defined(__APPLE__) && \ ++#if ((defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(4, 6, 0) || \ ++ (defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0)))) && \ ++ !defined(__sun__) && \ ++ !defined(__APPLE__) && \ + !defined(BUILD_STATIC) + #define MLOCKED_TEXT __attribute__((__section__("mlocked_text"))) + #define MLOCKED_SECTION (1) +@@ -168,7 +168,7 @@ + #endif + + /* print format attribute */ +-#if ((defined(HAVE_COMPILER_GCC) && NEED_GNUC(3, 2, 0)) || \ ++#if ((defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(3, 2, 0)) || \ + (defined(HAVE_COMPILER_CLANG) && NEED_CLANG(3, 0, 0))) + #define FORMAT(func, a, b) __attribute__((format(func, a, b))) + #else +--- a/core-helper.c ++++ b/core-helper.c +@@ -3486,8 +3486,8 @@ void NORETURN MLOCKED_TEXT stress_sig_ha + * __stack_chk_fail() + * override stack smashing callback + */ +-#if defined(HAVE_COMPILER_GCC) && \ +- !defined(HAVE_COMPILER_CLANG) && \ ++#if defined(HAVE_COMPILER_GCC_OR_MUSL) && \ ++ !defined(HAVE_COMPILER_CLANG) && \ + defined(HAVE_WEAK_ATTRIBUTE) + extern void __stack_chk_fail(void); + +--- a/core-pragma.h ++++ b/core-pragma.h +@@ -22,8 +22,8 @@ + #define STRESS_PRAGMA_(x) _Pragma (#x) + #define STRESS_PRAGMA(x) STRESS_PRAGMA_(x) + +-#if defined(HAVE_PRAGMA_NO_HARD_DFP) && \ +- defined(HAVE_COMPILER_GCC) && \ ++#if defined(HAVE_PRAGMA_NO_HARD_DFP) && \ ++ defined(HAVE_COMPILER_GCC_OR_MUSL) && \ + defined(HAVE_PRAGMA) + #define STRESS_PRAGMA_NO_HARD_DFP _Pragma("GCC target (\"no-hard-dfp\")") + #endif +@@ -34,8 +34,8 @@ + #define STRESS_PRAGMA_PUSH _Pragma("GCC diagnostic push") + #define STRESS_PRAGMA_POP _Pragma("GCC diagnostic pop") + #define STRESS_PRAGMA_WARN_OFF _Pragma("GCC diagnostic ignored \"-Weverything\"") +-#elif defined(HAVE_COMPILER_GCC) && \ +- defined(HAVE_PRAGMA) && \ ++#elif defined(HAVE_COMPILER_GCC_OR_MUSL) && \ ++ defined(HAVE_PRAGMA) && \ + NEED_GNUC(7, 5, 0) + #define STRESS_PRAGMA_PUSH _Pragma("GCC diagnostic push") + #define STRESS_PRAGMA_POP _Pragma("GCC diagnostic pop") +@@ -45,8 +45,8 @@ + _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") \ + _Pragma("GCC diagnostic ignored \"-Wnonnull\"") \ + _Pragma("GCC diagnostic ignored \"-Wstringop-overflow\"") +-#elif defined(HAVE_COMPILER_GCC) && \ +- defined(HAVE_PRAGMA) && \ ++#elif defined(HAVE_COMPILER_GCC_OR_MUSL) && \ ++ defined(HAVE_PRAGMA) && \ + NEED_GNUC(4, 6, 0) + #define STRESS_PRAGMA_PUSH _Pragma("GCC diagnostic push") + #define STRESS_PRAGMA_POP _Pragma("GCC diagnostic pop") +@@ -65,8 +65,8 @@ + NEED_CLANG(8, 0, 0) && \ + defined(HAVE_PRAGMA) + #define STRESS_PRAGMA_WARN_CPP_OFF _Pragma("GCC diagnostic ignored \"-Wcpp\"") +-#elif defined(HAVE_COMPILER_GCC) && \ +- defined(HAVE_PRAGMA) && \ ++#elif defined(HAVE_COMPILER_GCC_OR_MUSL) && \ ++ defined(HAVE_PRAGMA) && \ + NEED_GNUC(10, 0, 0) + #define STRESS_PRAGMA_WARN_CPP_OFF _Pragma("GCC diagnostic ignored \"-Wcpp\"") + #else +@@ -80,7 +80,7 @@ + NEED_CLANG(9, 0, 0) + #define PRAGMA_UNROLL_N(n) STRESS_PRAGMA(unroll n) + #define PRAGMA_UNROLL STRESS_PRAGMA(unroll) +-#elif defined(HAVE_COMPILER_GCC) && \ ++#elif defined(HAVE_COMPILER_GCC_OR_MUSL) && \ + NEED_GNUC(10, 0, 0) + #define PRAGMA_UNROLL_N(n) STRESS_PRAGMA(GCC unroll n) + #define PRAGMA_UNROLL STRESS_PRAGMA(GCC unroll 8) +--- a/core-shim.c ++++ b/core-shim.c +@@ -494,7 +494,7 @@ int shim_getrandom(void *buff, size_t bu + */ + void shim_flush_icache(void *begin, void *end) + { +-#if defined(HAVE_COMPILER_GCC) && \ ++#if defined(HAVE_COMPILER_GCC_OR_MUSL) && \ + defined(STRESS_ARCH_ARM) + __clear_cache(begin, end); + #elif defined(STRESS_ARCH_RISCV) && \ +--- a/core-target-clones.h ++++ b/core-target-clones.h +@@ -138,7 +138,7 @@ + #endif + + #if defined(HAVE_TARGET_CLONES_GRANITERAPIDS) && \ +- defined(HAVE_COMPILER_GCC) ++ defined(HAVE_COMPILER_GCC_OR_MUSL) + #define TARGET_CLONE_GRANITERAPIDS "arch=graniterapids", + #define TARGET_CLONE_USE + #else +--- a/core-vecmath.h ++++ b/core-vecmath.h +@@ -38,8 +38,8 @@ + * PPC64 for some reason with some flavours of the toolchain + * so disable this test for now + */ +-#if defined(STRESS_ARCH_PPC64) && \ +- defined(HAVE_COMPILER_GCC) && \ ++#if defined(STRESS_ARCH_PPC64) && \ ++ defined(HAVE_COMPILER_GCC_OR_MUSL) && \ + __GNUC__ < 6 + #undef HAVE_VECMATH + #endif +--- a/stress-atomic.c ++++ b/stress-atomic.c +@@ -71,7 +71,7 @@ typedef int (*atomic_func_t)(const stres + + #if defined(HAVE_ATOMIC_FETCH_NAND) + #define HAVE_ATOMIC_OPS +-#if defined(HAVE_COMPILER_GCC) && __GNUC__ != 11 ++#if defined(HAVE_COMPILER_GCC_OR_MUSL) && __GNUC__ != 11 + #define SHIM_ATOMIC_FETCH_NAND(ptr, val, memorder) \ + do { __atomic_fetch_nand(ptr, val, memorder); } while (0) + #else +@@ -121,7 +121,7 @@ typedef int (*atomic_func_t)(const stres + + #if defined(HAVE_ATOMIC_NAND_FETCH) + #define HAVE_ATOMIC_OPS +-#if defined(HAVE_COMPILER_GCC) && __GNUC__ != 11 ++#if defined(HAVE_COMPILER_GCC_OR_MUSL) && __GNUC__ != 11 + #define SHIM_ATOMIC_NAND_FETCH(ptr, val, memorder) \ + do { __atomic_nand_fetch(ptr, val, memorder); } while (0) + #else +--- a/stress-flushcache.c ++++ b/stress-flushcache.c +@@ -37,7 +37,7 @@ static const stress_help_t help[] = { + defined(STRESS_ARCH_S390) || \ + defined(STRESS_ARCH_PPC64)) && \ + defined(HAVE_MPROTECT) && \ +- ((defined(HAVE_COMPILER_GCC) && NEED_GNUC(4,6,0)) || \ ++ ((defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(4,6,0)) || \ + (defined(HAVE_COMPILER_CLANG) && NEED_CLANG(9,0,0)) || \ + (defined(HAVE_COMPILER_ICX) && NEED_ICX(2023,2,0)) || \ + (defined(HAVE_COMPILER_ICC) && NEED_ICC(2021,0,0))) +--- a/stress-lockbus.c ++++ b/stress-lockbus.c +@@ -37,14 +37,14 @@ static const stress_opt_set_func_t opt_s + { 0, NULL }, + }; + +-#if (((defined(HAVE_COMPILER_GCC) || \ ++#if (((defined(HAVE_COMPILER_GCC_OR_MUSL) || \ + defined(HAVE_COMPILER_CLANG) || \ + defined(HAVE_COMPILER_ICC) || \ + defined(HAVE_COMPILER_ICX) || \ + defined(HAVE_COMPILER_TCC) || \ + defined(HAVE_COMPILER_PCC)) && \ + defined(STRESS_ARCH_X86)) || \ +- (defined(HAVE_COMPILER_GCC) && \ ++ (defined(HAVE_COMPILER_GCC_OR_MUSL) && \ + (defined(HAVE_ATOMIC_ADD_FETCH) || \ + defined(HAVE_ATOMIC_FETCH_ADD)) && \ + defined(__ATOMIC_SEQ_CST) && \ +--- a/stress-malloc.c ++++ b/stress-malloc.c +@@ -453,8 +453,8 @@ static int stress_malloc(const stress_ar + malloc_max = MIN_MALLOC_MAX; + } + +-#if defined(HAVE_COMPILER_GCC) && \ +- defined(HAVE_MALLOPT) && \ ++#if defined(HAVE_COMPILER_GCC_OR_MUSL) && \ ++ defined(HAVE_MALLOPT) && \ + defined(M_MMAP_THRESHOLD) + { + size_t malloc_threshold = DEFAULT_MALLOC_THRESHOLD; +--- a/stress-memthrash.c ++++ b/stress-memthrash.c +@@ -94,12 +94,12 @@ static sigset_t set; + + static stress_memthrash_primes_t stress_memthrash_primes[MEM_SIZE_PRIMES]; + +-#if (((defined(HAVE_COMPILER_GCC) || defined(HAVE_COMPILER_CLANG)) && \ +- defined(STRESS_ARCH_X86)) || \ +- (defined(HAVE_COMPILER_GCC) && \ +- defined(HAVE_ATOMIC_ADD_FETCH) && \ +- defined(__ATOMIC_SEQ_CST) && \ +- NEED_GNUC(4,7,0) && \ ++#if (((defined(HAVE_COMPILER_GCC_OR_MUSL) || defined(HAVE_COMPILER_CLANG)) && \ ++ defined(STRESS_ARCH_X86)) || \ ++ (defined(HAVE_COMPILER_GCC_OR_MUSL) && \ ++ defined(HAVE_ATOMIC_ADD_FETCH) && \ ++ defined(__ATOMIC_SEQ_CST) && \ ++ NEED_GNUC(4,7,0) && \ + defined(STRESS_ARCH_ARM))) + #if defined(HAVE_ATOMIC_ADD_FETCH) + #define MEM_LOCK(ptr, inc) __atomic_add_fetch(ptr, inc, __ATOMIC_SEQ_CST) +--- a/stress-ng.h ++++ b/stress-ng.h +@@ -22,6 +22,14 @@ + + #include "config.h" + ++#ifndef _GNU_SOURCE ++#define _GNU_SOURCE ++#endif ++ ++#if defined(HAVE_FEATURES_H) ++#include ++#endif ++ + #if defined(__ICC) && \ + defined(__INTEL_COMPILER) + /* Intel ICC compiler */ +@@ -41,15 +49,20 @@ + #elif defined(__clang__) + /* clang */ + #define HAVE_COMPILER_CLANG ++#elif defined(__GNUC__) && \ ++ !defined(__USE_GNU) ++/* musl gcc */ ++#define HAVE_COMPILER_MUSL ++#define HAVE_COMPILER_GCC_OR_MUSL + #elif defined(__GNUC__) + /* GNU C compiler */ + #define HAVE_COMPILER_GCC ++#define HAVE_COMPILER_GCC_OR_MUSL + #endif + +-#ifndef _GNU_SOURCE +-#define _GNU_SOURCE +-#endif ++#ifndef _ATFILE_SOURCE + #define _ATFILE_SOURCE ++#endif + #ifndef _LARGEFILE_SOURCE + #define _LARGEFILE_SOURCE + #endif +@@ -101,9 +114,6 @@ + #include + #include + #include +-#if defined(HAVE_FEATURES_H) +-#include +-#endif + #if defined(HAVE_LIB_PTHREAD) + #include + #endif +@@ -144,7 +154,7 @@ + #endif + #if defined(HAVE_SYS_SYSINFO_H) + #include +-#if defined(HAVE_COMPILER_GCC) && \ ++#if defined(HAVE_COMPILER_GCC_OR_MUSL) && \ + !defined(__GLIBC__) + /* Suppress kernel sysinfo to avoid collision with musl */ + #define _LINUX_SYSINFO_H +@@ -237,7 +247,7 @@ typedef struct stress_stressor_info { + + #if defined(CHECK_UNEXPECTED) && \ + defined(HAVE_PRAGMA) && \ +- defined(HAVE_COMPILER_GCC) ++ defined(HAVE_COMPILER_GCC_OR_MUSL) + #define UNEXPECTED_PRAGMA(x) _Pragma (#x) + #define UNEXPECTED_XSTR(x) UNEXPECTED_STR(x) + #define UNEXPECTED_STR(x) # x +@@ -427,7 +437,7 @@ typedef struct stressor_info { + } stressor_info_t; + + /* gcc 4.7 and later support vector ops */ +-#if defined(HAVE_COMPILER_GCC) && \ ++#if defined(HAVE_COMPILER_GCC_OR_MUSL) && \ + NEED_GNUC(4, 7, 0) + #define STRESS_VECTOR (1) + #endif +@@ -508,7 +518,7 @@ extern const char stress_config[]; + #define PAGE_MAPPED (0x01) + #define PAGE_MAPPED_FAIL (0x02) + +-#if defined(HAVE_COMPILER_GCC) || defined(HAVE_COMPILER_CLANG) ++#if defined(HAVE_COMPILER_GCC_OR_MUSL) || defined(HAVE_COMPILER_CLANG) + #define TYPEOF_CAST(a) (typeof(a)) + #else + #define TYPEOF_CAST(a) +@@ -839,7 +849,7 @@ extern void stress_metrics_set_const_che + + #if !defined(STRESS_CORE_SHIM) && \ + !defined(HAVE_PEDANTIC) && \ +- (defined(HAVE_COMPILER_GCC) && defined(HAVE_COMPILER_CLANG)) ++ (defined(HAVE_COMPILER_GCC_OR_MUSL) && defined(HAVE_COMPILER_CLANG)) + int unlink(const char *pathname) __attribute__((deprecated("use shim_unlink"))); + int unlinkat(int dirfd, const char *pathname, int flags) __attribute__((deprecated("use shim_unlinkat"))); + int rmdir(const char *pathname) __attribute__((deprecated("use shim_rmdir"))); +--- a/stress-regs.c ++++ b/stress-regs.c +@@ -33,10 +33,10 @@ static const stress_help_t help[] = { + { NULL, NULL, NULL } + }; + +-#if (defined(HAVE_COMPILER_GCC) && NEED_GNUC(8, 0, 0)) && \ +- !defined(HAVE_COMPILER_CLANG) && \ +- !defined(HAVE_COMPILER_ICC) && \ +- !defined(HAVE_COMPILER_PCC) && \ ++#if (defined(HAVE_COMPILER_GCC_OR_MUSL) && NEED_GNUC(8, 0, 0)) && \ ++ !defined(HAVE_COMPILER_CLANG) && \ ++ !defined(HAVE_COMPILER_ICC) && \ ++ !defined(HAVE_COMPILER_PCC) && \ + !defined(HAVE_COMPILER_TCC) + + static volatile uint32_t stash32; +--- a/stress-rseq.c ++++ b/stress-rseq.c +@@ -32,13 +32,13 @@ static const stress_help_t help[] = { + { NULL, NULL, NULL } + }; + +-#if defined(HAVE_LINUX_RSEQ_H) && \ +- defined(HAVE_ASM_NOP) && \ +- defined(__NR_rseq) && \ +- defined(HAVE_SYSCALL) && \ +- defined(HAVE_COMPILER_GCC) && \ +- !defined(HAVE_COMPILER_CLANG) && \ +- !defined(HAVE_COMPILER_ICC) && \ ++#if defined(HAVE_LINUX_RSEQ_H) && \ ++ defined(HAVE_ASM_NOP) && \ ++ defined(__NR_rseq) && \ ++ defined(HAVE_SYSCALL) && \ ++ defined(HAVE_COMPILER_GCC_OR_MUSL) && \ ++ !defined(HAVE_COMPILER_CLANG) && \ ++ !defined(HAVE_COMPILER_ICC) && \ + !defined(HAVE_COMPILER_ICX) + + #define STRESS_ACCESS_ONCE(x) (*(__volatile__ __typeof__(x) *)&(x)) +--- a/stress-vnni.c ++++ b/stress-vnni.c +@@ -25,6 +25,10 @@ + #include "core-pragma.h" + #include "core-target-clones.h" + ++#if defined(HAVE_COMPILER_MUSL) ++#undef HAVE_IMMINTRIN_H ++#endif ++ + #if defined(HAVE_IMMINTRIN_H) + #include + #endif diff --git a/utils/stress-ng/test.sh b/utils/stress-ng/test.sh new file mode 100644 index 0000000000..0b70f7cc36 --- /dev/null +++ b/utils/stress-ng/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh -e + +stress-ng --version | grep "$2" From cf59047d3c3f07baed76751e19f06db9c6541800 Mon Sep 17 00:00:00 2001 From: Zoltan HERPAI Date: Thu, 12 Oct 2023 16:20:07 +0200 Subject: [PATCH 12/12] perl: add support for riscv64 Required by sifiveu and upcoming riscv targets. Signed-off-by: Zoltan HERPAI --- lang/perl/Makefile | 2 +- lang/perl/files/riscv64.config | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 lang/perl/files/riscv64.config diff --git a/lang/perl/Makefile b/lang/perl/Makefile index 2763de2777..7b603b5af2 100644 --- a/lang/perl/Makefile +++ b/lang/perl/Makefile @@ -11,7 +11,7 @@ include perlver.mk PKG_NAME:=perl PKG_VERSION:=$(PERL_VERSION) -PKG_RELEASE:=9 +PKG_RELEASE:=10 PKG_SOURCE_URL:=\ https://cpan.metacpan.org/src/5.0 \ diff --git a/lang/perl/files/riscv64.config b/lang/perl/files/riscv64.config new file mode 100644 index 0000000000..4596f8cde5 --- /dev/null +++ b/lang/perl/files/riscv64.config @@ -0,0 +1,21 @@ +owrt:arch=riscv +owrt:bits=64 +owrt:endian=little + +ccsymbols='' +cppccsymbols='' +cppsymbols='_FILE_OFFSET_BITS=64 _FORTIFY_SOURCE=2 _GNU_SOURCE=1 _LARGEFILE64_SOURCE=1 _LARGEFILE_SOURCE=1 _LP64=1 _POSIX_C_SOURCE=200809L _POSIX_SOURCE=1 _REENTRANT=1 _STDC_PREDEF_H=1 _XOPEN_SOURCE=700 _XOPEN_SOURCE_EXTENDED=1 __ATOMIC_ACQUIRE=2 __ATOMIC_ACQ_REL=4 __ATOMIC_CONSUME=1 __ATOMIC_RELAXED=0 __ATOMIC_RELEASE=3 __ATOMIC_SEQ_CST=5 __BIGGEST_ALIGNMENT__=16 __BYTE_ORDER__=1234 __CHAR16_TYPE__=short\ unsigned\ int __CHAR32_TYPE__=unsigned\ int __CHAR_BIT__=8 __CHAR_UNSIGNED__=1 __DBL_DECIMAL_DIG__=17 __DBL_DENORM_MIN__=((double)4.94065645841246544176568792868221372e-324L) __DBL_DIG__=15 __DBL_EPSILON__=((double)2.22044604925031308084726333618164062e-16L) __DBL_HAS_DENORM__=1 __DBL_HAS_INFINITY__=1 __DBL_HAS_QUIET_NAN__=1 __DBL_MANT_DIG__=53 __DBL_MAX_10_EXP__=308 __DBL_MAX_EXP__=1024 __DBL_MAX__=((double)1.79769313486231570814527423731704357e+308L) __DBL_MIN_10_EXP__=(-307) __DBL_MIN_EXP__=(-1021) __DBL_MIN__=((double)2.22507385850720138309023271733240406e-308L) __DEC128_EPSILON__=1E-33DL __DEC128_MANT_DIG__=34 __DEC128_MAX_EXP__=6145 __DEC128_MAX__=9.999999999999999999999999999999999E6144DL __DEC128_MIN_EXP__=(-6142) __DEC128_MIN__=1E-6143DL __DEC128_SUBNORMAL_MIN__=0.000000000000000000000000000000001E-6143DL __DEC32_EPSILON__=1E-6DF __DEC32_MANT_DIG__=7 __DEC32_MAX_EXP__=97 __DEC32_MAX__=9.999999E96DF __DEC32_MIN_EXP__=(-94) __DEC32_MIN__=1E-95DF __DEC32_SUBNORMAL_MIN__=0.000001E-95DF __DEC64_EPSILON__=1E-15DD __DEC64_MANT_DIG__=16 __DEC64_MAX_EXP__=385 __DEC64_MAX__=9.999999999999999E384DD __DEC64_MIN_EXP__=(-382) __DEC64_MIN__=1E-383DD __DEC64_SUBNORMAL_MIN__=0.000000000000001E-383DD __DECIMAL_DIG__=36 __DEC_EVAL_METHOD__=2 __ELF__=1 __FINITE_MATH_ONLY__=0 __FLOAT_WORD_ORDER__=1234 __FLT128_DECIMAL_DIG__=36 __FLT128_DENORM_MIN__=6.47517511943802511092443895822764655e-4966F128 __FLT128_DIG__=33 __FLT128_EPSILON__=1.92592994438723585305597794258492732e-34F128 __FLT128_HAS_DENORM__=1 __FLT128_HAS_INFINITY__=1 __FLT128_HAS_QUIET_NAN__=1 __FLT128_MANT_DIG__=113 __FLT128_MAX_10_EXP__=4932 __FLT128_MAX_EXP__=16384 __FLT128_MAX__=1.18973149535723176508575932662800702e+4932F128 __FLT128_MIN_10_EXP__=(-4931) __FLT128_MIN_EXP__=(-16381) __FLT128_MIN__=3.36210314311209350626267781732175260e-4932F128 __FLT32X_DECIMAL_DIG__=17 __FLT32X_DENORM_MIN__=4.94065645841246544176568792868221372e-324F32x __FLT32X_DIG__=15 __FLT32X_EPSILON__=2.22044604925031308084726333618164062e-16F32x __FLT32X_HAS_DENORM__=1 __FLT32X_HAS_INFINITY__=1 __FLT32X_HAS_QUIET_NAN__=1 __FLT32X_MANT_DIG__=53 __FLT32X_MAX_10_EXP__=308 __FLT32X_MAX_EXP__=1024 __FLT32X_MAX__=1.79769313486231570814527423731704357e+308F32x __FLT32X_MIN_10_EXP__=(-307) __FLT32X_MIN_EXP__=(-1021) __FLT32X_MIN__=2.22507385850720138309023271733240406e-308F32x __FLT32_DECIMAL_DIG__=9 __FLT32_DENORM_MIN__=1.40129846432481707092372958328991613e-45F32 __FLT32_DIG__=6 __FLT32_EPSILON__=1.19209289550781250000000000000000000e-7F32 __FLT32_HAS_DENORM__=1 __FLT32_HAS_INFINITY__=1 __FLT32_HAS_QUIET_NAN__=1 __FLT32_MANT_DIG__=24 __FLT32_MAX_10_EXP__=38 __FLT32_MAX_EXP__=128 __FLT32_MAX__=3.40282346638528859811704183484516925e+38F32 __FLT32_MIN_10_EXP__=(-37) __FLT32_MIN_EXP__=(-125) __FLT32_MIN__=1.17549435082228750796873653722224568e-38F32 __FLT64X_DECIMAL_DIG__=36 __FLT64X_DENORM_MIN__=6.47517511943802511092443895822764655e-4966F64x __FLT64X_DIG__=33 __FLT64X_EPSILON__=1.92592994438723585305597794258492732e-34F64x __FLT64X_HAS_DENORM__=1 __FLT64X_HAS_INFINITY__=1 __FLT64X_HAS_QUIET_NAN__=1 __FLT64X_MANT_DIG__=113 __FLT64X_MAX_10_EXP__=4932 __FLT64X_MAX_EXP__=16384 __FLT64X_MAX__=1.18973149535723176508575932662800702e+4932F64x __FLT64X_MIN_10_EXP__=(-4931) __FLT64X_MIN_EXP__=(-16381) __FLT64X_MIN__=3.36210314311209350626267781732175260e-4932F64x __FLT64_DECIMAL_DIG__=17 __FLT64_DENORM_MIN__=4.94065645841246544176568792868221372e-324F64 __FLT64_DIG__=15 __FLT64_EPSILON__=2.22044604925031308084726333618164062e-16F64 __FLT64_HAS_DENORM__=1 __FLT64_HAS_INFINITY__=1 __FLT64_HAS_QUIET_NAN__=1 __FLT64_MANT_DIG__=53 __FLT64_MAX_10_EXP__=308 __FLT64_MAX_EXP__=1024 __FLT64_MAX__=1.79769313486231570814527423731704357e+308F64 __FLT64_MIN_10_EXP__=(-307) __FLT64_MIN_EXP__=(-1021) __FLT64_MIN__=2.22507385850720138309023271733240406e-308F64 __FLT_DECIMAL_DIG__=9 __FLT_DENORM_MIN__=1.40129846432481707092372958328991613e-45F __FLT_DIG__=6 __FLT_EPSILON__=1.19209289550781250000000000000000000e-7F __FLT_EVAL_METHOD_TS_18661_3__=0 __FLT_EVAL_METHOD__=0 __FLT_HAS_DENORM__=1 __FLT_HAS_INFINITY__=1 __FLT_HAS_QUIET_NAN__=1 __FLT_MANT_DIG__=24 __FLT_MAX_10_EXP__=38 __FLT_MAX_EXP__=128 __FLT_MAX__=3.40282346638528859811704183484516925e+38F __FLT_MIN_10_EXP__=(-37) __FLT_MIN_EXP__=(-125) __FLT_MIN__=1.17549435082228750796873653722224568e-38F __FLT_RADIX__=2 __FP_FAST_FMA=1 __FP_FAST_FMAF32=1 __FP_FAST_FMAF32x=1 __FP_FAST_FMAF64=1 __FP_FAST_FMAF=1 __GCC_ATOMIC_BOOL_LOCK_FREE=1 __GCC_ATOMIC_CHAR16_T_LOCK_FREE=1 __GCC_ATOMIC_CHAR32_T_LOCK_FREE=2 __GCC_ATOMIC_CHAR_LOCK_FREE=1 __GCC_ATOMIC_INT_LOCK_FREE=2 __GCC_ATOMIC_LLONG_LOCK_FREE=2 __GCC_ATOMIC_LONG_LOCK_FREE=2 __GCC_ATOMIC_POINTER_LOCK_FREE=2 __GCC_ATOMIC_SHORT_LOCK_FREE=1 __GCC_ATOMIC_TEST_AND_SET_TRUEVAL=1 __GCC_ATOMIC_WCHAR_T_LOCK_FREE=2 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8=1 __GCC_IEC_559=2 __GCC_IEC_559_COMPLEX=2 __GLIBC_MINOR__=27 __GLIBC__=2 __GNUC_MINOR__=2 __GNUC_PATCHLEVEL__=0 __GNUC_STDC_INLINE__=1 __GNUC__=8 __GNU_LIBRARY__=6 __GXX_ABI_VERSION=1013 __INT16_C=__INT16_C __INT16_MAX__=0x7fff __INT16_TYPE__=short\ int __INT32_C=__INT32_C __INT32_MAX__=0x7fffffff __INT32_TYPE__=int __INT64_C=__INT64_C __INT64_MAX__=0x7fffffffffffffffL __INT64_TYPE__=long\ int __INT8_C=__INT8_C __INT8_MAX__=0x7f __INT8_TYPE__=signed\ char __INTMAX_C=__INTMAX_C __INTMAX_MAX__=0x7fffffffffffffffL __INTMAX_TYPE__=long\ int __INTMAX_WIDTH__=64 __INTPTR_MAX__=0x7fffffffffffffffL __INTPTR_TYPE__=long\ int __INTPTR_WIDTH__=64 __INT_FAST16_MAX__=0x7fffffffffffffffL __INT_FAST16_TYPE__=long\ int __INT_FAST16_WIDTH__=64 __INT_FAST32_MAX__=0x7fffffffffffffffL __INT_FAST32_TYPE__=long\ int __INT_FAST32_WIDTH__=64 __INT_FAST64_MAX__=0x7fffffffffffffffL __INT_FAST64_TYPE__=long\ int __INT_FAST64_WIDTH__=64 __INT_FAST8_MAX__=0x7f __INT_FAST8_TYPE__=signed\ char __INT_FAST8_WIDTH__=8 __INT_LEAST16_MAX__=0x7fff __INT_LEAST16_TYPE__=short\ int __INT_LEAST16_WIDTH__=16 __INT_LEAST32_MAX__=0x7fffffff __INT_LEAST32_TYPE__=int __INT_LEAST32_WIDTH__=32 __INT_LEAST64_MAX__=0x7fffffffffffffffL __INT_LEAST64_TYPE__=long\ int __INT_LEAST64_WIDTH__=64 __INT_LEAST8_MAX__=0x7f __INT_LEAST8_TYPE__=signed\ char __INT_LEAST8_WIDTH__=8 __INT_MAX__=0x7fffffff __INT_WIDTH__=32 __LDBL_DECIMAL_DIG__=36 __LDBL_DENORM_MIN__=6.47517511943802511092443895822764655e-4966L __LDBL_DIG__=33 __LDBL_EPSILON__=1.92592994438723585305597794258492732e-34L __LDBL_HAS_DENORM__=1 __LDBL_HAS_INFINITY__=1 __LDBL_HAS_QUIET_NAN__=1 __LDBL_MANT_DIG__=113 __LDBL_MAX_10_EXP__=4932 __LDBL_MAX_EXP__=16384 __LDBL_MAX__=1.18973149535723176508575932662800702e+4932L __LDBL_MIN_10_EXP__=(-4931) __LDBL_MIN_EXP__=(-16381) __LDBL_MIN__=3.36210314311209350626267781732175260e-4932L __LONG_LONG_MAX__=0x7fffffffffffffffLL __LONG_LONG_WIDTH__=64 __LONG_MAX__=0x7fffffffffffffffL __LONG_WIDTH__=64 __LP64__=1 __ORDER_BIG_ENDIAN__=4321 __ORDER_LITTLE_ENDIAN__=1234 __ORDER_PDP_ENDIAN__=3412 __PIC__=2 __PIE__=2 __PRAGMA_REDEFINE_EXTNAME=1 __PTRDIFF_MAX__=0x7fffffffffffffffL __PTRDIFF_TYPE__=long\ int __PTRDIFF_WIDTH__=64 __REGISTER_PREFIX__= __SCHAR_MAX__=0x7f __SCHAR_WIDTH__=8 __SHRT_MAX__=0x7fff __SHRT_WIDTH__=16 __SIG_ATOMIC_MAX__=0x7fffffff __SIG_ATOMIC_MIN__=(-0x7fffffff\ -\ 1) __SIG_ATOMIC_TYPE__=int __SIG_ATOMIC_WIDTH__=32 __SIZEOF_DOUBLE__=8 __SIZEOF_FLOAT__=4 __SIZEOF_INT128__=16 __SIZEOF_INT__=4 __SIZEOF_LONG_DOUBLE__=16 __SIZEOF_LONG_LONG__=8 __SIZEOF_LONG__=8 __SIZEOF_POINTER__=8 __SIZEOF_PTRDIFF_T__=8 __SIZEOF_SHORT__=2 __SIZEOF_SIZE_T__=8 __SIZEOF_WCHAR_T__=4 __SIZEOF_WINT_T__=4 __SIZE_MAX__=0xffffffffffffffffUL __SIZE_TYPE__=long\ unsigned\ int __SIZE_WIDTH__=64 __STDC_HOSTED__=1 __STDC_IEC_559_COMPLEX__=1 __STDC_IEC_559__=1 __STDC_ISO_10646__=201706L __STDC_NO_THREADS__=1 __STDC_UTF_16__=1 __STDC_UTF_32__=1 __STDC_VERSION__=201710L __STDC__=1 __UINT16_C=__UINT16_C __UINT16_MAX__=0xffff __UINT16_TYPE__=short\ unsigned\ int __UINT32_C=__UINT32_C __UINT32_MAX__=0xffffffffU __UINT32_TYPE__=unsigned\ int __UINT64_C=__UINT64_C __UINT64_MAX__=0xffffffffffffffffUL __UINT64_TYPE__=long\ unsigned\ int __UINT8_C=__UINT8_C __UINT8_MAX__=0xff __UINT8_TYPE__=unsigned\ char __UINTMAX_C=__UINTMAX_C __UINTMAX_MAX__=0xffffffffffffffffUL __UINTMAX_TYPE__=long\ unsigned\ int __UINTPTR_MAX__=0xffffffffffffffffUL __UINTPTR_TYPE__=long\ unsigned\ int __UINT_FAST16_MAX__=0xffffffffffffffffUL __UINT_FAST16_TYPE__=long\unsigned\ int __UINT_FAST32_MAX__=0xffffffffffffffffUL __UINT_FAST32_TYPE__=long\ unsigned\ int __UINT_FAST64_MAX__=0xffffffffffffffffUL __UINT_FAST64_TYPE__=long\ unsigned\ int __UINT_FAST8_MAX__=0xff __UINT_FAST8_TYPE__=unsigned\ char__UINT_LEAST16_MAX__=0xffff __UINT_LEAST16_TYPE__=short\ unsigned\ int __UINT_LEAST32_MAX__=0xffffffffU __UINT_LEAST32_TYPE__=unsigned\ int __UINT_LEAST64_MAX__=0xffffffffffffffffUL __UINT_LEAST64_TYPE__=long\ unsigned\ int __UINT_LEAST8_MAX__=0xff __UINT_LEAST8_TYPE__=unsigned\ char __USER_LABEL_PREFIX__= __USE_FILE_OFFSET64=1 __USE_GNU=1 __USE_LARGEFILE64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_POSIX=1 __USE_UNIX98=1 __USE_XOPEN=1 __USE_XOPEN_EXTENDED=1 __VERSION__="8.2.0" __WCHAR_MAX__=0x7fffffff __WCHAR_MIN__=(-0x7fffffff\ -\ 1) __WCHAR_TYPE__=int __WCHAR_WIDTH__=32 __WINT_MAX__=0xffffffffU __WINT_MIN__=0U __WINT_TYPE__=unsigned\ int __WINT_WIDTH__=32 __gnu_linux__=1 __has_include=__has_include __has_include_next=__has_include_next __linux=1 __linux__=1 __pic__=2 __pie__=2 __riscv=1 __riscv_atomic=1 __riscv_cmodel_pic=1 __riscv_compressed=1 __riscv_div=1 __riscv_fdiv=1 __riscv_flen=64 __riscv_float_abi_double=1 __riscv_fsqrt=1 __riscv_mul=1 __riscv_muldiv=1 __riscv_xlen=64 __unix=1 __unix__=1 linux=1 unix=1' + +d_casti32='define' +d_double_style_ieee='define' +d_modflproto='define' +doublekind='3' +fpossize='16' +longdblkind='1' +need_va_copy='undef' +quadkind='2' + +owrt:sig_count='64' +owrt:sigs='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS' +owrt:sig_name_extra='IOT CLD POLL UNUSED' +owrt:sig_num_extra='6 17 29 31'