Merge pull request #18781 from paper42/fail2ban-py310
authorJosef Schlehofer <pepe.schlehofer@gmail.com>
Thu, 4 Aug 2022 11:45:31 +0000 (13:45 +0200)
committerGitHub <noreply@github.com>
Thu, 4 Aug 2022 11:45:31 +0000 (13:45 +0200)
fail2ban: fix patch for python 3.10

257 files changed:
admin/openwisp-config/Makefile
admin/openwisp-monitoring/Makefile [new file with mode: 0644]
admin/rsyslog/Makefile
admin/rsyslog/files/20_rsyslog [new file with mode: 0644]
admin/rsyslog/files/rsyslog.conf
admin/rsyslog/files/rsyslog.init
admin/sudo/Makefile
admin/syslog-ng/Makefile
admin/syslog-ng/files/syslog-ng.conf
devel/gcc/Makefile
devel/gcc/patches/11.2.0/001-v11.3.0-ranger-Fix-up-fold_using_range-range_of_address-PR10.patch [deleted file]
devel/gcc/patches/11.2.0/002-case_insensitive.patch [deleted file]
devel/gcc/patches/11.2.0/003-dont-choke-when-building-32bit-on-64bit.patch [deleted file]
devel/gcc/patches/11.2.0/010-documentation.patch [deleted file]
devel/gcc/patches/11.2.0/011-v12-configure-define-TARGET_LIBC_GNUSTACK-on-musl.patch [deleted file]
devel/gcc/patches/11.2.0/110-Fix-MIPS-PR-84790.patch [deleted file]
devel/gcc/patches/11.2.0/230-musl_libssp.patch [deleted file]
devel/gcc/patches/11.2.0/300-mips_Os_cpu_rtx_cost_model.patch [deleted file]
devel/gcc/patches/11.2.0/810-arm-softfloat-libgcc.patch [deleted file]
devel/gcc/patches/11.2.0/820-libgcc_pic.patch [deleted file]
devel/gcc/patches/11.2.0/840-armv4_pass_fix-v4bx_to_ld.patch [deleted file]
devel/gcc/patches/11.2.0/850-use_shared_libgcc.patch [deleted file]
devel/gcc/patches/11.2.0/851-libgcc_no_compat.patch [deleted file]
devel/gcc/patches/11.2.0/870-ppc_no_crtsavres.patch [deleted file]
devel/gcc/patches/11.2.0/881-no_tm_section.patch [deleted file]
devel/gcc/patches/11.2.0/900-bad-mips16-crt.patch [deleted file]
devel/gcc/patches/11.2.0/910-mbsd_multi.patch [deleted file]
devel/gcc/patches/11.2.0/920-specs_nonfatal_getenv.patch [deleted file]
devel/gcc/patches/11.2.0/931-libffi-fix-MIPS-softfloat-build-issue.patch [deleted file]
devel/gcc/patches/11.2.0/960-gotools-fix-compilation-when-making-cross-compiler.patch [deleted file]
devel/gcc/patches/11.2.0/970-macos_arm64-building-fix.patch [deleted file]
devel/gcc/patches/11.2.0/980-add-nostdinc++.patch [deleted file]
devel/gcc/patches/11.3.0/002-case_insensitive.patch [new file with mode: 0644]
devel/gcc/patches/11.3.0/003-dont-choke-when-building-32bit-on-64bit.patch [new file with mode: 0644]
devel/gcc/patches/11.3.0/010-documentation.patch [new file with mode: 0644]
devel/gcc/patches/11.3.0/011-v12-configure-define-TARGET_LIBC_GNUSTACK-on-musl.patch [new file with mode: 0644]
devel/gcc/patches/11.3.0/110-Fix-MIPS-PR-84790.patch [new file with mode: 0644]
devel/gcc/patches/11.3.0/230-musl_libssp.patch [new file with mode: 0644]
devel/gcc/patches/11.3.0/300-mips_Os_cpu_rtx_cost_model.patch [new file with mode: 0644]
devel/gcc/patches/11.3.0/810-arm-softfloat-libgcc.patch [new file with mode: 0644]
devel/gcc/patches/11.3.0/820-libgcc_pic.patch [new file with mode: 0644]
devel/gcc/patches/11.3.0/840-armv4_pass_fix-v4bx_to_ld.patch [new file with mode: 0644]
devel/gcc/patches/11.3.0/850-use_shared_libgcc.patch [new file with mode: 0644]
devel/gcc/patches/11.3.0/851-libgcc_no_compat.patch [new file with mode: 0644]
devel/gcc/patches/11.3.0/870-ppc_no_crtsavres.patch [new file with mode: 0644]
devel/gcc/patches/11.3.0/881-no_tm_section.patch [new file with mode: 0644]
devel/gcc/patches/11.3.0/900-bad-mips16-crt.patch [new file with mode: 0644]
devel/gcc/patches/11.3.0/910-mbsd_multi.patch [new file with mode: 0644]
devel/gcc/patches/11.3.0/920-specs_nonfatal_getenv.patch [new file with mode: 0644]
devel/gcc/patches/11.3.0/931-libffi-fix-MIPS-softfloat-build-issue.patch [new file with mode: 0644]
devel/gcc/patches/11.3.0/960-gotools-fix-compilation-when-making-cross-compiler.patch [new file with mode: 0644]
devel/gcc/patches/11.3.0/970-macos_arm64-building-fix.patch [new file with mode: 0644]
lang/erlang/Makefile
lang/erlang/patches/030-crypto-Make-configure-flag-disable-otp-test-engine.patch [new file with mode: 0644]
lang/erlang/patches/031-Update-configure-scripts.patch [new file with mode: 0644]
lang/erlang/patches/032-crypto-do-disable-otp-test-engine-for-LibreSSL-3.5.0.patch [new file with mode: 0644]
lang/erlang/patches/033-Update-configure-scripts.patch [new file with mode: 0644]
lang/golang/golang/Makefile
lang/luajit/Makefile
lang/luajit/patches/040-softfloat-ppc.patch [new file with mode: 0644]
lang/luajit/patches/050-ppc-softfloat.patch [new file with mode: 0644]
lang/luajit/patches/060-ppc-musl.patch [new file with mode: 0644]
lang/node/Makefile
lang/perl-parse-yapp/Makefile
lang/php8/Makefile
lang/python/django/Makefile
lang/python/pillow/Makefile
lang/python/python-chardet/Makefile
lang/python/python-cryptography/Makefile
lang/python/python-cryptography/patches/0004-disable-rust.patch
lang/python/python-jsonschema/Makefile
lang/python/python-lxml/Makefile
lang/python/python-requests/Makefile
lang/python/python-websocket-client/Makefile
lang/python/python3/Makefile
lang/python/python3/patches/026-openssl-feature-flags.patch
lang/python/python3/patches/028-host-python-support-ssl-with-libressl.patch
lang/ruby/patches/001-fix-build-with-libressl-3.5.patch [new file with mode: 0644]
lang/ruby/patches/002-fix-operator-precedence.patch [new file with mode: 0644]
libs/elektra/Makefile
libs/elektra/patches/010-iconv.patch [new file with mode: 0644]
libs/glib2/Makefile
libs/gnutls/Makefile
libs/hidapi/Makefile
libs/hidapi/patches/020-iconv.patch [new file with mode: 0644]
libs/libarchive/Makefile
libs/libextractor/Makefile
libs/libfmt/Makefile
libs/libmad/Makefile
libs/libmad/patches/001-mips_removal_h_constraint.patch [deleted file]
libs/libmad/patches/010-aarch64.patch [new file with mode: 0644]
libs/libmad/patches/101-CVE-2017-8374-length-check.patch [deleted file]
libs/libmad/patches/102-CVE-2017-8373-CVE-2017-8372-md-size.patch [deleted file]
libs/libndpi/Makefile
libs/libnpupnp/Makefile
libs/liborcania/Makefile
libs/libowfat/Makefile
libs/libowfat/patches/020-cflags.patch [new file with mode: 0644]
libs/libradcli/Makefile
libs/libtirpc/Makefile
libs/libulfius/Makefile
libs/libulfius/patches/0001-cmake-pc-orcania-found.patch [new file with mode: 0644]
libs/liburing/Makefile
libs/libuwsc/patches/100-cmake-fix-wolfssl-detection.patch [new file with mode: 0644]
libs/libv4l/Makefile
libs/libwebp/Makefile
libs/libwebp/patches/001-fix-cmake-webpmux-linking.patch [deleted file]
libs/libwebp/patches/010-mips16.patch
libs/libxcrypt/Makefile
libs/libxml2/Makefile
libs/opusfile/Makefile
libs/pcre2/Makefile
libs/rpcsvc-proto/Makefile
libs/slang2/Makefile
libs/totem-pl-parser/Makefile
libs/zmq/Makefile
libs/zmq/patches/020-no-libbsd.patch [new file with mode: 0644]
mail/mutt/Makefile
mail/postfix/Makefile
multimedia/ffmpeg/Makefile
multimedia/ffmpeg/patches/050-glibc.patch
multimedia/ttymidi-sysex/patches/100-add-support-for-System-Realtime-and-System-Common.patch [new file with mode: 0644]
multimedia/yt-dlp/Makefile
net/apinger/Makefile
net/apinger/files/apinger-hotplug [new file with mode: 0644]
net/apinger/files/apinger.config [new file with mode: 0644]
net/apinger/files/apinger.init
net/apinger/files/apinger.rpc [new file with mode: 0644]
net/apinger/files/graphs.sh [new file with mode: 0644]
net/apinger/files/iface.hotplug [new file with mode: 0644]
net/apinger/files/user.hotplug [new file with mode: 0644]
net/apinger/patches/030-apinger-no_exit.patch [new file with mode: 0644]
net/apinger/patches/040-srcip.patch [new file with mode: 0644]
net/apinger/patches/050-statusformat.patch [new file with mode: 0644]
net/apinger/patches/060-format-alarm-list.patch [new file with mode: 0644]
net/autossh/Makefile
net/autossh/files/autossh.hotplug
net/autossh/files/autossh.init
net/bind/Makefile
net/chrony/Makefile
net/clamav/Makefile
net/clamav/patches/020-iconv.patch [new file with mode: 0644]
net/cloudflared/Makefile
net/curl/Config.in
net/curl/patches/100-wolfssl.patch [new file with mode: 0644]
net/dawn/Makefile
net/dawn/files/dawn.config
net/dnsdist/Makefile
net/dnslookup/Makefile
net/frr/Makefile
net/frr/patches/997-reverse_python_test.patch
net/frr/patches/999-thread_reverse.patch
net/gensio/Makefile
net/geth/Makefile
net/gsocket/Makefile [new file with mode: 0644]
net/gsocket/test.sh [new file with mode: 0755]
net/haproxy/Makefile
net/haproxy/get-latest-patches.sh
net/isc-dhcp/files/dhcpd.init
net/kea/files/kea.init
net/knot-resolver/Makefile
net/knot-resolver/patches/030-fix-policy-hack.patch
net/ksmbd-tools/Makefile
net/ksmbd-tools/patches/010-meson.patch
net/modemmanager/files/25-modemmanager-net
net/modemmanager/files/25-modemmanager-tty
net/modemmanager/files/25-modemmanager-wwan
net/modemmanager/files/modemmanager.proto
net/nebula/Makefile
net/nebula/files/nebula.init
net/netifyd/Makefile
net/netifyd/files/netifyd.init
net/netsniff-ng/Makefile
net/netsniff-ng/patches/010-uclibc.patch [deleted file]
net/pdns-recursor/Makefile
net/pdns/Makefile
net/radsecproxy/Makefile
net/radsecproxy/patches/100-fix-setstacksize-for-glibc-2.34.patch [deleted file]
net/radsecproxy/patches/200-logdest-on-foreground.patch
net/rclone/Makefile
net/restic-rest-server/Makefile
net/restic-rest-server/files/etc/config/restic-rest-server
net/restic-rest-server/files/etc/init.d/restic-rest-server
net/rpcbind/Makefile
net/samba4/Makefile
net/ser2net/Makefile
net/ser2net/files/ser2net.init
net/softethervpn/Makefile
net/softethervpn/patches/130-iconv.patch [deleted file]
net/softethervpn5/Makefile
net/spoofer/Makefile
net/stunnel/Makefile
net/tgt/Makefile
net/tor/Makefile
net/transmission/Makefile
net/travelmate/Makefile
net/travelmate/files/travelmate.sh
net/travelmate/files/travelmate.vpn
net/unbound/Makefile
net/unbound/patches/010-configure-uname.patch
net/usteer/Makefile
net/wifidog/Makefile
net/wifidog/patches/030-wolfssl-options.patch [new file with mode: 0644]
net/wsdd2/Makefile
net/xfrpc/Makefile
net/xfrpc/files/xfrpc.init
net/xray-core/Makefile
net/xtables-addons/Makefile
net/zerotier/Makefile
net/zerotier/patches/0001-fix-makefile.patch
net/zerotier/patches/0002-fix-compilation-for-arm_cortex-a7-neon.patch
sound/mpd/Makefile
sound/mpd/patches/010-iconv.patch
utils/collectd/files/collectd.init
utils/collectd/files/collectd.uci
utils/collectd/files/lua-scripts/dsl.lua
utils/collectd/files/usr/share/collectd/plugin/write_http.json [new file with mode: 0644]
utils/containerd/Makefile
utils/coremark/Makefile
utils/coreutils/Makefile
utils/coreutils/patches/001-no_docs_man_tests.patch
utils/coreutils/patches/002-chmod-fix_exit_status_when_ignoring_sylinks.patch [deleted file]
utils/crelay/Makefile
utils/crelay/patches/010-link_with_ftdi1.patch [deleted file]
utils/crelay/patches/010-meson.patch [new file with mode: 0644]
utils/crelay/patches/011-support-gpio-with-number-bigger-than-255.patch [deleted file]
utils/cryptsetup/Makefile
utils/docker-compose/Makefile
utils/docker/Makefile
utils/dockerd/Makefile
utils/domoticz/files/domoticz.init
utils/fish/Makefile
utils/hfsprogs/Makefile
utils/irqbalance/Makefile
utils/irqbalance/files/irqbalance.config
utils/irqbalance/files/irqbalance.init
utils/irqbalance/patches/010-meson.patch [new file with mode: 0644]
utils/kitty-terminfo/Makefile
utils/lcdproc/Makefile
utils/libnetwork/Makefile
utils/lxc/Makefile
utils/nano/Makefile
utils/ncdu/Makefile
utils/ncdu/patches/900-use-alternative-color.patch [new file with mode: 0644]
utils/open-vm-tools/Makefile
utils/realtek-poe/Makefile [new file with mode: 0644]
utils/restic/Makefile
utils/runc/Makefile
utils/sexpect/Makefile
utils/tar/Makefile
utils/telegraf/Makefile
utils/tmux/Makefile
utils/tmux/patches/100-add-crosscompiling-fallbacks.patch [deleted file]
utils/watchcat/Makefile
utils/watchcat/files/watchcat.init
utils/watchcat/files/watchcat.sh
utils/yq/Makefile

index 8a7713d2cb5fece8381b2164b37d34db47c7e96d..d1419eee327c3fe0e0e8710df9dafc395e3b28f6 100644 (file)
@@ -11,10 +11,9 @@ PKG_MAINTAINER:=Federico Capoano <f.capoano@openwisp.io>
 PKG_LICENSE:=GPL3.0-or-later
 
 PKG_SOURCE_URL:=https://github.com/openwisp/openwisp-config.git
-PKG_MIRROR_HASH:=f0b0866b27a7a75bc33c3bbc4780dd99f5ae693226012ae04e63a303172c2c38
+PKG_MIRROR_HASH:=7daa10a9d170e665f33a5555a246b4da2223c2d8d0e8a047edb01701c8886986
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=1.0.0
-PKGARCH:=all
+PKG_SOURCE_VERSION:=1.0.1
 
 include $(INCLUDE_DIR)/package.mk
 
diff --git a/admin/openwisp-monitoring/Makefile b/admin/openwisp-monitoring/Makefile
new file mode 100644 (file)
index 0000000..fb8a0e8
--- /dev/null
@@ -0,0 +1,116 @@
+# openwisp.org
+#
+# This is free software, licensed under the GNU General Public License v3.
+# See /LICENSE for more information.
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=openwisp-monitoring
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Federico Capoano <support@openwisp.io>
+PKG_LICENSE:=GPL3.0-or-later
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE_URL:=https://github.com/openwisp/openwrt-openwisp-monitoring.git
+PKG_MIRROR_HASH:=ce2ed94d24f68c58320ca700a088471368e1097754be23ad6053842cf0aaa97e
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=0.1.1
+PKGARCH:=all
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/openwisp-monitoring
+  TITLE:=OpenWISP Monitoring agent
+  CATEGORY:=Administration
+  SECTION:=admin
+  SUBMENU:=openwisp
+  DEPENDS:=+netjson-monitoring +openwisp-config
+  URL:=http://openwisp.org
+endef
+
+define Package/netjson-monitoring
+  TITLE:=NetJson Monitoring
+  CATEGORY:=Administration
+  SECTION:=admin
+  SUBMENU:=openwisp
+  DEPENDS:=+libubus-lua +lua-cjson +rpcd +rpcd-mod-iwinfo
+  URL:=http://openwisp.org
+endef
+
+define Build/Compile
+endef
+
+define Package/openwisp-monitoring/conffiles
+/etc/config/openwisp-monitoring
+endef
+
+define Package/netjson-monitoring/install
+       $(INSTALL_DIR) \
+               $(1)/usr/sbin \
+               $(1)/usr/libexec \
+               $(1)/usr/lib/lua/openwisp-monitoring \
+               $(1)/etc/openwisp-monitoring
+
+       $(INSTALL_BIN) \
+               $(PKG_BUILD_DIR)/openwisp-monitoring/files/sbin/netjson-monitoring.lua \
+               $(1)/usr/libexec/netjson-monitoring
+
+       $(INSTALL_BIN) \
+               $(PKG_BUILD_DIR)/openwisp-monitoring/files/netjson-monitoring \
+               $(1)/usr/sbin/netjson-monitoring
+
+       $(INSTALL_DATA) \
+               $(PKG_BUILD_DIR)/openwisp-monitoring/files/lib/openwisp-monitoring/dhcp.lua \
+               $(1)/usr/lib/lua/openwisp-monitoring/dhcp.lua
+
+       $(INSTALL_DATA) \
+               $(PKG_BUILD_DIR)/openwisp-monitoring/files/lib/openwisp-monitoring/interfaces.lua \
+               $(1)/usr/lib/lua/openwisp-monitoring/interfaces.lua
+
+       $(INSTALL_DATA) \
+               $(PKG_BUILD_DIR)/openwisp-monitoring/files/lib/openwisp-monitoring/monitoring.lua \
+               $(1)/usr/lib/lua/openwisp-monitoring/monitoring.lua
+
+       $(INSTALL_DATA) \
+               $(PKG_BUILD_DIR)/openwisp-monitoring/files/lib/openwisp-monitoring/utils.lua \
+               $(1)/usr/lib/lua/openwisp-monitoring/utils.lua
+
+       $(INSTALL_DATA) \
+               $(PKG_BUILD_DIR)/openwisp-monitoring/files/lib/openwisp-monitoring/neighbors.lua \
+               $(1)/usr/lib/lua/openwisp-monitoring/neighbors.lua
+
+       $(INSTALL_DATA) \
+               $(PKG_BUILD_DIR)/openwisp-monitoring/files/lib/openwisp-monitoring/resources.lua \
+               $(1)/usr/lib/lua/openwisp-monitoring/resources.lua
+
+       $(INSTALL_DATA) \
+               $(PKG_BUILD_DIR)/openwisp-monitoring/files/lib/openwisp-monitoring/wifi.lua \
+               $(1)/usr/lib/lua/openwisp-monitoring/wifi.lua
+
+       $(CP) $(PKG_BUILD_DIR)/VERSION $(1)/etc/openwisp-monitoring/
+
+endef
+
+define Package/openwisp-monitoring/install
+       $(INSTALL_DIR) \
+               $(1)/usr/sbin \
+               $(1)/etc/init.d \
+               $(1)/etc/config \
+               $(1)/etc/openwisp-monitoring
+
+       $(INSTALL_BIN) \
+               $(PKG_BUILD_DIR)/openwisp-monitoring/files/monitoring.agent \
+               $(1)/usr/sbin/openwisp-monitoring
+
+       $(INSTALL_BIN) \
+               $(PKG_BUILD_DIR)/openwisp-monitoring/files/monitoring.init \
+               $(1)/etc/init.d/openwisp-monitoring
+
+       $(INSTALL_CONF) \
+               $(PKG_BUILD_DIR)/openwisp-monitoring/files/monitoring.config \
+               $(1)/etc/config/openwisp-monitoring
+
+endef
+
+$(eval $(call BuildPackage,openwisp-monitoring))
+$(eval $(call BuildPackage,netjson-monitoring))
index 596fb2e25cc0ee4714fc2cdcc78ed1272d8486c3..d27778f31f8af44488880c9804d5f7b1341d3b66 100644 (file)
@@ -72,6 +72,8 @@ define Package/rsyslog/install
        $(INSTALL_CONF) ./files/rsyslog.conf $(1)/etc
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/rsyslog.init $(1)/etc/init.d/rsyslog
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(INSTALL_CONF) ./files/20_rsyslog $(1)/etc/uci-defaults
 endef
 
 define Package/rsyslog/config
diff --git a/admin/rsyslog/files/20_rsyslog b/admin/rsyslog/files/20_rsyslog
new file mode 100644 (file)
index 0000000..50fdbaa
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+grep -qv -e '^\s*#' -e '^\s*$' /etc/rsyslog.conf 2>/dev/null && exit 0
+[ "$(uci -q get rsyslog.syslog)" == "syslog" ] && exit 0
+
+uci -q import rsyslog << EOI
+config syslog 'syslog'
+       option tcp_input_port '514'
+       option udp_input '1'
+       option tcp_input '0'
+       option udp_input_port '514'
+       option default_template 'RSYSLOG_TraditionalFileFormat'
+       list modules 'imuxsock'
+       list modules 'imklog'
+
+config selector
+       option source '*.info;mail.none;authpriv.none;cron.none'
+       option destination '/var/log/messages'
+
+config selector
+       option source 'authpriv.*'
+       option destination '/var/log/secure'
+
+config selector
+       option source 'mail.*'
+       option destination '/var/log/maillog'
+
+config selector
+       option source 'cron.*'
+       option destination '/var/log/cron'
+
+config selector
+       option source 'local7.*'
+       option destination '/var/log/boot.log'
+EOI
index 5aaed415b57df47324a0e8cf8340bf825bb3fb5c..0381b3e6f244ea5ab871792ddf1d9d4e4d4db325 100644 (file)
@@ -1,18 +1,18 @@
-module(load="imuxsock")
-module(load="imklog")
-module(load="imudp")
-input(type="imudp" port="514")
-#module(load="imtcp")
-#input(type="imtcp" port="514")
-
-$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
-
-*.info;mail.none;authpriv.none;cron.none  /var/log/messages
-
-authpriv.*                                /var/log/secure
-
-mail.*                                    /var/log/maillog
-
-cron.*                                    /var/log/cron
-
-local7.*                                  /var/log/boot.log
+#
+# The preferred way to configure rsyslogd is now UCI.
+#
+# This file can be still used and will be included
+# on top of the final configuration inside /var/etc/rsyslog.conf
+#
+# Example of default configuration:
+#
+# module(load="imuxsock")
+# module(load="imklog")
+# module(load="imudp")
+# input(type="imudp" port="514")
+# $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
+# *.info;mail.none;authpriv.none;cron.none  /var/log/messages
+# authpriv.*                                /var/log/secure
+# mail.*                                    /var/log/maillog
+# cron.*                                    /var/log/cron
+local7.*                                  /var/log/boot.log
index 20eb2a41f111eaac4ac3dee78a0d424a94f09c30..77a9fc70505dbf817096752b5e39a1bb8850dd95 100644 (file)
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2014 OpenWrt.org
 
+# shellcheck disable=SC3043
+# shellcheck disable=SC2034
+# shellcheck disable=SC3037
+# shellcheck disable=SC2154
+# shellcheck disable=SC2129
+
 START=20
 
 USE_PROCD=1
 
+UCI_CONF="rsyslog"
+CONFIG_FILE="/var/etc/rsyslog.conf"
+BASE_CONFIG_FILE="/etc/rsyslog.conf"
+
+modules=""
+selectors=""
+forwarders=""
+
+handle_selector() {
+       local config="$1"
+       local src
+       local dst
+
+       config_get src "${config}" source
+       config_get dst "${config}" destination
+       if [ "${src}" != "" ] && [ "$dst" != "" ]; then
+               selectors="${selectors}\n${src}\t${dst}\n"
+       fi
+}
+
+handle_forwarder() {
+       local config="$1"
+       local src
+       local target
+       local protocol
+       local port
+       local rfc
+       local opts
+
+       config_get src "${config}" source
+       config_get target "${config}" target
+       config_get protocol "${config}" protocol "udp"
+       config_get port "${config}" port "514"
+       config_get rfc "${config}" rfc "3164"
+
+       if [ "$rfc" = "5424" ]; then
+               opts='Template="RSYSLOG_SyslogProtocol23Format" TCP_Framing="octet-counted"'
+       fi
+
+       if [ "${src}" != "" ] && [ "${target}" != "" ]; then
+               action="action(type=\"omfwd\" target=\"$target\" port=\"$port\" protocol=\"$protocol\" $opts action.resumeRetryCount=\"100\" queue.type=\"linkedList\" queue.size=\"10000\")"
+          forwarders="${forwarders}\n${src}\t${action}\n"
+       fi
+}
+
+
+expand_config() {
+       local input_t=""
+       local input_u=""
+
+       config_load "${UCI_CONF}"
+       config_list_foreach syslog modules handle_module
+       config_get_bool tcp_input syslog tcp_input
+       if [ "${tcp_input}" -eq 1 ]; then
+               modules="${modules} imtcp"
+               config_get tcp_port syslog tcp_input_port
+               input_t="input(type=\"imtcp\" port=\"${tcp_port}\")"
+       fi
+
+       config_get_bool udp_input syslog udp_input
+       if [ "${udp_input}" -eq 1 ]; then
+               modules="${modules} imudp"
+               config_get udp_port syslog udp_input_port
+               input_u="input(type=\"imudp\" port=\"${udp_port}\")"
+
+       fi
+       config_get template syslog default_template
+       config_foreach handle_selector selector
+       config_foreach handle_forwarder forwarder
+
+       mkdir -p "$(dirname ${CONFIG_FILE})"
+       # shellcheck disable=SC2188
+       > ${CONFIG_FILE}
+       echo "include(file=\"${BASE_CONFIG_FILE}\" mode=\"optional\")" >> ${CONFIG_FILE}
+       for m in ${modules}; do
+               echo "module(load=\"${m}\")" >> ${CONFIG_FILE}
+       done
+       echo "${input_t}" >> ${CONFIG_FILE}
+       echo "${input_u}" >> ${CONFIG_FILE}
+       echo "\$ActionFileDefaultTemplate ${template}" >> ${CONFIG_FILE}
+       echo -e "${selectors}" >> ${CONFIG_FILE}
+       echo -e "${forwarders}" >> ${CONFIG_FILE}
+}
+
+handle_module() {
+       local module="$1"
+       modules="${modules} $module"
+}
+
 start_service() {
+       expand_config
        procd_open_instance
-       procd_set_param command /usr/sbin/rsyslogd -n
+       procd_set_param command /usr/sbin/rsyslogd -f ${CONFIG_FILE} -n
        procd_close_instance
 }
+
+
+service_triggers()
+{
+       procd_add_reload_trigger ${UCI_CONF}
+}
index 0af721dd586db307351e9eed8ae8075b0050e914..3c3f425eb91ae27ae5004da7b32d7dc813a906be 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sudo
-PKG_VERSION:=1.9.10
+PKG_VERSION:=1.9.11p3
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://www.sudo.ws/dist
-PKG_HASH:=44a1461098e7c7b8e6ac597499c24fb2e43748c0c139a8b4944e57d1349a64f4
+PKG_HASH:=4687e7d2f56721708f59cca2e1352c056cb23de526c22725615a42bb094f1f70
 
 PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
 
@@ -23,6 +23,7 @@ PKG_CPE_ID:=cpe:/a:todd_miller:sudo
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
+PKG_USE_MIPS16:=0
 
 include $(INCLUDE_DIR)/package.mk
 
index 260031a25be6021cdc5c8e223c458345235fe9af..9530f75a008e163984603f8158b4894d2c0e4c02 100644 (file)
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=syslog-ng
-PKG_VERSION:=3.36.1
+PKG_VERSION:=3.37.1
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_MAINTAINER:=Josef Schlehofer <josef.schlehofer@nic.cz>
@@ -11,7 +11,7 @@ PKG_CPE_ID:=cpe:/a:balabit:syslog-ng
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/syslog-ng/syslog-ng/releases/download/$(PKG_NAME)-$(PKG_VERSION)/
-PKG_HASH:=90a25c9767fe749db50f118ddfc92ec71399763d2ecd5ad4f11ff5eea049e60b
+PKG_HASH:=d67a320cb896cd5d62f24d9e1bec138847fa4618ae13a3946cae2b75c528ee14
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
index a9da788ac9ba3f79873954039c908a9fa0d2b01c..909b60f691c6d8ac2d221ea076b08acca030bf64 100644 (file)
@@ -4,7 +4,7 @@
 # More details about these settings can be found here:
 # https://www.syslog-ng.com/technical-documents/list/syslog-ng-open-source-edition
 
-@version: 3.36
+@version: 3.37
 @include "scl.conf"
 
 options {
index 70b547a590676e29dc45914f42e707d9b7834224..554ba0b879b465db81b9f65c3a51a272b5ce8444 100644 (file)
@@ -42,8 +42,8 @@ ifeq ($(PKG_VERSION),10.3.0)
        PKG_HASH:=64f404c1a650f27fc33da242e1f2df54952e3963a49e06e73f6940f3223ac344
 endif
 
-ifeq ($(PKG_VERSION),11.2.0)
-       PKG_HASH:=d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b
+ifeq ($(PKG_VERSION),11.3.0)
+       PKG_HASH:=b47cf2818691f5b1e21df2bb38c795fac2cfbd640ede2d0a5e1c89e338a3ac39
 endif
 
 PATCH_DIR=./patches/$(GCC_VERSION)
diff --git a/devel/gcc/patches/11.2.0/001-v11.3.0-ranger-Fix-up-fold_using_range-range_of_address-PR10.patch b/devel/gcc/patches/11.2.0/001-v11.3.0-ranger-Fix-up-fold_using_range-range_of_address-PR10.patch
deleted file mode 100644 (file)
index 71bbfe5..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-From a6219e8e0719b14f474b0dcaa7bde2f4e57474f9 Mon Sep 17 00:00:00 2001
-From: Jakub Jelinek <jakub@redhat.com>
-Date: Wed, 17 Nov 2021 13:45:53 +0100
-Subject: [PATCH] ranger: Fix up fold_using_range::range_of_address [PR103255]
-
-If on &base->member the offset isn't constant or isn't zero and
--fdelete-null-pointer-checks and not -fwrapv-pointer and base has a range
-that doesn't include NULL, we return the range of the base.
-Usually it isn't a big deal, because for most pointers we just use
-varying, range_zero and range_nonzero ranges and nothing beyond that,
-but if a pointer is initialized from a constant, we actually track the
-exact range and in that case this causes miscompilation.
-As discussed on IRC, I think doing something like:
-              offset_int off2;
-              if (off_cst && off.is_constant (&off2))
-                {
-                  tree cst = wide_int_to_tree (sizetype, off2 / BITS_PER_UNIT);
-                  // adjust range r with POINTER_PLUS_EXPR cst
-                  if (!range_includes_zero_p (&r))
-                    return true;
-                }
-              // Fallback
-              r = range_nonzero (TREE_TYPE (gimple_assign_rhs1 (stmt)));
-              return true;
-could work, given that most of the pointer ranges are just the simple ones
-perhaps it is too much for little benefit.
-
-2021-11-17  Jakub Jelinek  <jakub@redhat.com>
-
-       PR tree-optimization/103255
-       * gimple-range.cc (fold_using_range::range_of_address): Return
-       range_nonzero rather than unadjusted base's range.  Formatting fixes.
-
-       * gcc.c-torture/execute/pr103255.c: New test.
-
-(cherry picked from commit c39cb6bf835ca12e590eaa6f90222e51be207c50)
----
- gcc/gimple-range.cc                           | 16 +++++---
- .../gcc.c-torture/execute/pr103255.c          | 41 +++++++++++++++++++
- 2 files changed, 52 insertions(+), 5 deletions(-)
- create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr103255.c
-
---- a/gcc/gimple-range.cc
-+++ b/gcc/gimple-range.cc
-@@ -491,14 +491,20 @@ gimple_ranger::range_of_address (irange
-       }
-       /* If &X->a is equal to X, the range of X is the result.  */
-       if (off_cst && known_eq (off, 0))
--        return true;
-+      return true;
-       else if (flag_delete_null_pointer_checks
-              && !TYPE_OVERFLOW_WRAPS (TREE_TYPE (expr)))
-       {
--       /* For -fdelete-null-pointer-checks -fno-wrapv-pointer we don't
--       allow going from non-NULL pointer to NULL.  */
--         if(!range_includes_zero_p (&r))
--          return true;
-+        /* For -fdelete-null-pointer-checks -fno-wrapv-pointer we don't
-+           allow going from non-NULL pointer to NULL.  */
-+        if (!range_includes_zero_p (&r))
-+          {
-+            /* We could here instead adjust r by off >> LOG2_BITS_PER_UNIT
-+               using POINTER_PLUS_EXPR if off_cst and just fall back to
-+               this.  */
-+            r = range_nonzero (TREE_TYPE (gimple_assign_rhs1 (stmt)));
-+            return true;
-+          }
-       }
-       /* If MEM_REF has a "positive" offset, consider it non-NULL
-        always, for -fdelete-null-pointer-checks also "negative"
---- /dev/null
-+++ b/gcc/testsuite/gcc.c-torture/execute/pr103255.c
-@@ -0,0 +1,41 @@
-+/* PR tree-optimization/103255 */
-+
-+struct H
-+{
-+  unsigned a;
-+  unsigned b;
-+  unsigned c;
-+};
-+
-+#if __SIZEOF_POINTER__ >= 4
-+#define ADDR 0x400000
-+#else
-+#define ADDR 0x4000
-+#endif
-+#define OFF 0x20
-+
-+int
-+main ()
-+{
-+  struct H *h = 0;
-+  unsigned long o;
-+  volatile int t = 1;
-+
-+  for (o = OFF; o <= OFF; o += 0x1000)
-+    {
-+      struct H *u;
-+      u = (struct H *) (ADDR + o);
-+      if (t)
-+      {
-+        h = u;
-+        break;
-+      }
-+    }
-+
-+  if (h == 0)
-+    return 0;
-+  unsigned *tt = &h->b;
-+  if ((__SIZE_TYPE__) tt != (ADDR + OFF + __builtin_offsetof (struct H, b)))
-+    __builtin_abort ();
-+  return 0;
-+}
diff --git a/devel/gcc/patches/11.2.0/002-case_insensitive.patch b/devel/gcc/patches/11.2.0/002-case_insensitive.patch
deleted file mode 100644 (file)
index 409497e..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-commit 81cc26c706b2bc8c8c1eb1a322e5c5157900836e
-Author: Felix Fietkau <nbd@openwrt.org>
-Date:   Sun Oct 19 21:45:51 2014 +0000
-
-    gcc: do not assume that the Mac OS X filesystem is case insensitive
-    
-    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-    
-    SVN-Revision: 42973
-
---- a/include/filenames.h
-+++ b/include/filenames.h
-@@ -44,11 +44,6 @@ extern "C" {
- #  define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c)
- #  define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f)
- #else /* not DOSish */
--#  if defined(__APPLE__)
--#    ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
--#      define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1
--#    endif
--#  endif /* __APPLE__ */
- #  define HAS_DRIVE_SPEC(f) (0)
- #  define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c)
- #  define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f)
diff --git a/devel/gcc/patches/11.2.0/003-dont-choke-when-building-32bit-on-64bit.patch b/devel/gcc/patches/11.2.0/003-dont-choke-when-building-32bit-on-64bit.patch
deleted file mode 100644 (file)
index c41f35e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/gcc/real.h
-+++ b/gcc/real.h
-@@ -77,8 +77,10 @@ struct GTY(()) real_value {
-    + (REAL_VALUE_TYPE_SIZE%HOST_BITS_PER_WIDE_INT ? 1 : 0)) /* round up */
- /* Verify the guess.  */
-+#ifndef __LP64__
- extern char test_real_width
-   [sizeof (REAL_VALUE_TYPE) <= REAL_WIDTH * sizeof (HOST_WIDE_INT) ? 1 : -1];
-+#endif
- /* Calculate the format for CONST_DOUBLE.  We need as many slots as
-    are necessary to overlay a REAL_VALUE_TYPE on them.  This could be
diff --git a/devel/gcc/patches/11.2.0/010-documentation.patch b/devel/gcc/patches/11.2.0/010-documentation.patch
deleted file mode 100644 (file)
index 885bd03..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-commit 098bd91f5eae625c7d2ee621e10930fc4434e5e2
-Author: Luka Perkov <luka@openwrt.org>
-Date:   Tue Feb 26 16:16:33 2013 +0000
-
-    gcc: don't build documentation
-    
-    This closes #13039.
-    
-    Signed-off-by: Luka Perkov <luka@openwrt.org>
-    
-    SVN-Revision: 35807
-
---- a/gcc/Makefile.in
-+++ b/gcc/Makefile.in
-@@ -3355,18 +3355,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
- doc/gccint.info: $(TEXI_GCCINT_FILES)
- doc/cppinternals.info: $(TEXI_CPPINT_FILES)
--doc/%.info: %.texi
--      if [ x$(BUILD_INFO) = xinfo ]; then \
--              $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \
--                      -I $(gcc_docdir)/include -o $@ $<; \
--      fi
-+doc/%.info:
- # Duplicate entry to handle renaming of gccinstall.info
--doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES)
--      if [ x$(BUILD_INFO) = xinfo ]; then \
--              $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \
--                      -I $(gcc_docdir)/include -o $@ $<; \
--      fi
-+doc/gccinstall.info:
- doc/cpp.dvi: $(TEXI_CPP_FILES)
- doc/gcc.dvi: $(TEXI_GCC_FILES)
diff --git a/devel/gcc/patches/11.2.0/011-v12-configure-define-TARGET_LIBC_GNUSTACK-on-musl.patch b/devel/gcc/patches/11.2.0/011-v12-configure-define-TARGET_LIBC_GNUSTACK-on-musl.patch
deleted file mode 100644 (file)
index 94105bd..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-From ea650cae26da4a8fc04f0c4666f4dd776d0b5fc0 Mon Sep 17 00:00:00 2001
-From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
-Date: Sun, 14 Nov 2021 21:54:25 -0800
-Subject: [PATCH] configure: define TARGET_LIBC_GNUSTACK on musl
-
-musl only uses PT_GNU_STACK to set default thread stack size and has no
-executable stack support[0], so there is no reason not to emit the
-.note.GNU-stack section on musl builds.
-
-[0]: https://lore.kernel.org/all/20190423192534.GN23599@brightrain.aerifal.cx/T/#u
-
-gcc/ChangeLog:
-
-       * configure: Regenerate.
-       * configure.ac: define TARGET_LIBC_GNUSTACK on musl
-
-Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
----
- gcc/configure    | 3 +++
- gcc/configure.ac | 3 +++
- 2 files changed, 6 insertions(+)
-
---- a/gcc/configure
-+++ b/gcc/configure
-@@ -30954,6 +30954,9 @@ fi
- # Check if the target LIBC handles PT_GNU_STACK.
- gcc_cv_libc_gnustack=unknown
- case "$target" in
-+  mips*-*-linux-musl*)
-+    gcc_cv_libc_gnustack=yes
-+    ;;
-   mips*-*-linux*)
- if test $glibc_version_major -gt 2 \
---- a/gcc/configure.ac
-+++ b/gcc/configure.ac
-@@ -6788,6 +6788,9 @@ fi
- # Check if the target LIBC handles PT_GNU_STACK.
- gcc_cv_libc_gnustack=unknown
- case "$target" in
-+  mips*-*-linux-musl*)
-+    gcc_cv_libc_gnustack=yes
-+    ;;
-   mips*-*-linux*)
-     GCC_GLIBC_VERSION_GTE_IFELSE([2], [31], [gcc_cv_libc_gnustack=yes], )
-     ;;
diff --git a/devel/gcc/patches/11.2.0/110-Fix-MIPS-PR-84790.patch b/devel/gcc/patches/11.2.0/110-Fix-MIPS-PR-84790.patch
deleted file mode 100644 (file)
index 82ac013..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-Fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790.
-MIPS16 functions have a static assembler prologue which clobbers
-registers v0 and v1. Add these register clobbers to function call
-instructions.
-
---- a/gcc/config/mips/mips.c
-+++ b/gcc/config/mips/mips.c
-@@ -3132,6 +3132,12 @@ mips_emit_call_insn (rtx pattern, rtx or
-       emit_insn (gen_update_got_version ());
-     }
-+  if (TARGET_MIPS16 && TARGET_USE_GOT)
-+    {
-+      clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS16_PIC_TEMP);
-+      clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS_PROLOGUE_TEMP (word_mode));
-+    }
-+
-   if (TARGET_MIPS16
-       && TARGET_EXPLICIT_RELOCS
-       && TARGET_CALL_CLOBBERED_GP)
diff --git a/devel/gcc/patches/11.2.0/230-musl_libssp.patch b/devel/gcc/patches/11.2.0/230-musl_libssp.patch
deleted file mode 100644 (file)
index 66b88bc..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -978,7 +978,9 @@ proper position among the other output f
- #endif
- #ifndef LINK_SSP_SPEC
--#ifdef TARGET_LIBC_PROVIDES_SSP
-+#if DEFAULT_LIBC == LIBC_MUSL
-+#define LINK_SSP_SPEC "-lssp_nonshared"
-+#elif defined(TARGET_LIBC_PROVIDES_SSP)
- #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
-                      "|fstack-protector-strong|fstack-protector-explicit:}"
- #else
diff --git a/devel/gcc/patches/11.2.0/300-mips_Os_cpu_rtx_cost_model.patch b/devel/gcc/patches/11.2.0/300-mips_Os_cpu_rtx_cost_model.patch
deleted file mode 100644 (file)
index 8c4a5fc..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-commit ecf7671b769fe96f7b5134be442089f8bdba55d2
-Author: Felix Fietkau <nbd@nbd.name>
-Date:   Thu Aug 4 20:29:45 2016 +0200
-
-gcc: add a patch to generate better code with Os on mips
-
-Also happens to reduce compressed code size a bit
-
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
---- a/gcc/config/mips/mips.c
-+++ b/gcc/config/mips/mips.c
-@@ -20041,7 +20041,7 @@ mips_option_override (void)
-     flag_pcc_struct_return = 0;
-   /* Decide which rtx_costs structure to use.  */
--  if (optimize_size)
-+  if (0 && optimize_size)
-     mips_cost = &mips_rtx_cost_optimize_size;
-   else
-     mips_cost = &mips_rtx_cost_data[mips_tune];
diff --git a/devel/gcc/patches/11.2.0/810-arm-softfloat-libgcc.patch b/devel/gcc/patches/11.2.0/810-arm-softfloat-libgcc.patch
deleted file mode 100644 (file)
index 5c9d86a..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-commit 8570c4be394cff7282f332f97da2ff569a927ddb
-Author: Imre Kaloz <kaloz@openwrt.org>
-Date:   Wed Feb 2 20:06:12 2011 +0000
-
-    fixup arm soft-float symbols
-    
-    SVN-Revision: 25325
-
---- a/libgcc/config/arm/t-linux
-+++ b/libgcc/config/arm/t-linux
-@@ -1,6 +1,10 @@
- LIB1ASMSRC = arm/lib1funcs.S
- LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
--      _ctzsi2 _arm_addsubdf3 _arm_addsubsf3
-+      _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \
-+      _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
-+      _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \
-+      _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \
-+      _arm_fixsfsi _arm_fixunssfsi
- # Just for these, we omit the frame pointer since it makes such a big
- # difference.
---- a/gcc/config/arm/linux-elf.h
-+++ b/gcc/config/arm/linux-elf.h
-@@ -58,8 +58,6 @@
-    %{shared:-lc} \
-    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
--#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
--
- #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
- #define LINUX_TARGET_LINK_SPEC  "%{h*} \
diff --git a/devel/gcc/patches/11.2.0/820-libgcc_pic.patch b/devel/gcc/patches/11.2.0/820-libgcc_pic.patch
deleted file mode 100644 (file)
index 525a95b..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-commit c96312958c0621e72c9b32da5bc224ffe2161384
-Author: Felix Fietkau <nbd@openwrt.org>
-Date:   Mon Oct 19 23:26:09 2009 +0000
-
-    gcc: create a proper libgcc_pic.a static library for relinking (4.3.3+ for now, backport will follow)
-    
-    SVN-Revision: 18086
-
---- a/libgcc/Makefile.in
-+++ b/libgcc/Makefile.in
-@@ -930,11 +930,12 @@ $(libgcov-driver-objects): %$(objext): $
- # Static libraries.
- libgcc.a: $(libgcc-objects)
-+libgcc_pic.a: $(libgcc-s-objects)
- libgcov.a: $(libgcov-objects)
- libunwind.a: $(libunwind-objects)
- libgcc_eh.a: $(libgcc-eh-objects)
--libgcc.a libgcov.a libunwind.a libgcc_eh.a:
-+libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a:
-       -rm -f $@
-       objects="$(objects)";                                   \
-@@ -958,7 +959,7 @@ all: libunwind.a
- endif
- ifeq ($(enable_shared),yes)
--all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
-+all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT)
- ifneq ($(LIBUNWIND),)
- all: libunwind$(SHLIB_EXT)
- libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
-@@ -1164,6 +1165,10 @@ install-shared:
-       chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
-       $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
-+      $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/
-+      chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a
-+      $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a
-+
-       $(subst @multilib_dir@,$(MULTIDIR),$(subst \
-               @shlib_base_name@,libgcc_s,$(subst \
-               @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
diff --git a/devel/gcc/patches/11.2.0/840-armv4_pass_fix-v4bx_to_ld.patch b/devel/gcc/patches/11.2.0/840-armv4_pass_fix-v4bx_to_ld.patch
deleted file mode 100644 (file)
index e3cb616..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-commit 7edc8ca5456d9743dd0075eb3cc5b04f4f24c8cc
-Author: Imre Kaloz <kaloz@openwrt.org>
-Date:   Wed Feb 2 19:34:36 2011 +0000
-
-    add armv4 fixup patches
-    
-    SVN-Revision: 25322
-
-
---- a/gcc/config/arm/linux-eabi.h
-+++ b/gcc/config/arm/linux-eabi.h
-@@ -91,10 +91,15 @@
- #define MUSL_DYNAMIC_LINKER \
-   "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}%{mfdpic:-fdpic}.so.1"
-+/* For armv4 we pass --fix-v4bx to linker to support EABI */
-+#undef TARGET_FIX_V4BX_SPEC
-+#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\
-+  "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}"
-+
- /* At this point, bpabi.h will have clobbered LINK_SPEC.  We want to
-    use the GNU/Linux version, not the generic BPABI version.  */
- #undef  LINK_SPEC
--#define LINK_SPEC EABI_LINK_SPEC                                      \
-+#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC                 \
-   LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC,                                \
-                      LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
diff --git a/devel/gcc/patches/11.2.0/850-use_shared_libgcc.patch b/devel/gcc/patches/11.2.0/850-use_shared_libgcc.patch
deleted file mode 100644 (file)
index 8b17f13..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-commit dcfc40358b5a3cae7320c17f8d1cebd5ad5540cd
-Author: Felix Fietkau <nbd@openwrt.org>
-Date:   Sun Feb 12 20:25:47 2012 +0000
-
-    gcc 4.6: port over the missing patch 850-use_shared_libgcc.patch to prevent libgcc crap from leaking into every single binary
-    
-    SVN-Revision: 30486
---- a/gcc/config/arm/linux-eabi.h
-+++ b/gcc/config/arm/linux-eabi.h
-@@ -132,10 +132,6 @@
-   "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} "   \
-   LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
--/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we
--   do not use -lfloat.  */
--#undef LIBGCC_SPEC
--
- /* Clear the instruction cache from `beg' to `end'.  This is
-    implemented in lib1funcs.S, so ensure an error if this definition
-    is used.  */
---- a/gcc/config/linux.h
-+++ b/gcc/config/linux.h
-@@ -66,6 +66,10 @@ see the files COPYING3 and COPYING.RUNTI
-         builtin_version ("CRuntime_Musl");                    \
-     } while (0)
-+#ifndef LIBGCC_SPEC
-+#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}"
-+#endif
-+
- /* Determine which dynamic linker to use depending on whether GLIBC or
-    uClibc or Bionic or musl is the default C library and whether
-    -muclibc or -mglibc or -mbionic or -mmusl has been passed to change
---- a/libgcc/mkmap-symver.awk
-+++ b/libgcc/mkmap-symver.awk
-@@ -136,5 +136,5 @@ function output(lib) {
-   else if (inherit[lib])
-     printf("} %s;\n", inherit[lib]);
-   else
--    printf ("\n  local:\n\t*;\n};\n");
-+    printf ("\n\t*;\n};\n");
- }
---- a/gcc/config/rs6000/linux.h
-+++ b/gcc/config/rs6000/linux.h
-@@ -62,6 +62,9 @@
- #undef        CPP_OS_DEFAULT_SPEC
- #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
-+#undef LIBGCC_SPEC
-+#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc"
-+
- #undef  LINK_SHLIB_SPEC
- #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}} \
-   %{static-pie:-static -pie --no-dynamic-linker -z text}"
diff --git a/devel/gcc/patches/11.2.0/851-libgcc_no_compat.patch b/devel/gcc/patches/11.2.0/851-libgcc_no_compat.patch
deleted file mode 100644 (file)
index d710e40..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-commit 64661de100da1ec1061ef3e5e400285dce115e6b
-Author: Felix Fietkau <nbd@openwrt.org>
-Date:   Sun May 10 13:16:35 2015 +0000
-
-    gcc: add some size optimization patches
-    
-    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-    
-    SVN-Revision: 45664
-
---- a/libgcc/config/t-libunwind
-+++ b/libgcc/config/t-libunwind
-@@ -2,8 +2,7 @@
- HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER
--LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
--  $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c
-+LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
- LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
- # Override the default value from t-slibgcc-elf-ver and mention -lunwind
diff --git a/devel/gcc/patches/11.2.0/870-ppc_no_crtsavres.patch b/devel/gcc/patches/11.2.0/870-ppc_no_crtsavres.patch
deleted file mode 100644 (file)
index bc182f0..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/gcc/config/rs6000/rs6000-logue.c
-+++ b/gcc/config/rs6000/rs6000-logue.c
-@@ -348,7 +348,7 @@ rs6000_savres_strategy (rs6000_stack_t *
-   /* Define cutoff for using out-of-line functions to save registers.  */
-   if (DEFAULT_ABI == ABI_V4 || TARGET_ELF)
-     {
--      if (!optimize_size)
-+      if (1)
-       {
-         strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS;
-         strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS;
diff --git a/devel/gcc/patches/11.2.0/881-no_tm_section.patch b/devel/gcc/patches/11.2.0/881-no_tm_section.patch
deleted file mode 100644 (file)
index 2029910..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/libgcc/crtstuff.c
-+++ b/libgcc/crtstuff.c
-@@ -152,7 +152,7 @@ call_ ## FUNC (void)                                       \
- #endif
- #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF)
--# define USE_TM_CLONE_REGISTRY 1
-+# define USE_TM_CLONE_REGISTRY 0
- #elif !defined(USE_TM_CLONE_REGISTRY)
- # define USE_TM_CLONE_REGISTRY 0
- #endif
diff --git a/devel/gcc/patches/11.2.0/900-bad-mips16-crt.patch b/devel/gcc/patches/11.2.0/900-bad-mips16-crt.patch
deleted file mode 100644 (file)
index dd6e9dc..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
---- a/libgcc/config/mips/t-mips16
-+++ b/libgcc/config/mips/t-mips16
-@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16
- # Version these symbols if building libgcc.so.
- SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver
-+
-+CRTSTUFF_T_CFLAGS += -mno-mips16
-+CRTSTUFF_T_CFLAGS_S += -mno-mips16
diff --git a/devel/gcc/patches/11.2.0/910-mbsd_multi.patch b/devel/gcc/patches/11.2.0/910-mbsd_multi.patch
deleted file mode 100644 (file)
index 9f9d322..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-commit 99368862e44740ff4fd33760893f04e14f9dbdf1
-Author: Felix Fietkau <nbd@openwrt.org>
-Date:   Tue Jul 31 00:52:27 2007 +0000
-
-    Port the mbsd_multi patch from freewrt, which adds -fhonour-copts. This will emit warnings in packages that don't use our target cflags properly
-    
-    SVN-Revision: 8256
-
-       This patch brings over a feature from MirBSD:
-       * -fhonour-copts
-         If this option is not given, it's warned (depending
-         on environment variables). This is to catch errors
-         of misbuilt packages which override CFLAGS themselves.
-
-       This patch was authored by Thorsten Glaser <tg at mirbsd.de>
-       with copyright assignment to the FSF in effect.
-
---- a/gcc/c-family/c-opts.c
-+++ b/gcc/c-family/c-opts.c
-@@ -107,6 +107,9 @@ static dump_flags_t original_dump_flags;
- /* Whether any standard preincluded header has been preincluded.  */
- static bool done_preinclude;
-+/* Check if a port honours COPTS.  */
-+static int honour_copts = 0;
-+
- static void handle_OPT_d (const char *);
- static void set_std_cxx98 (int);
- static void set_std_cxx11 (int);
-@@ -469,6 +472,12 @@ c_common_handle_option (size_t scode, co
-       flag_no_builtin = !value;
-       break;
-+    case OPT_fhonour_copts:
-+      if (c_language == clk_c) {
-+        honour_copts++;
-+      }
-+      break;
-+
-     case OPT_fconstant_string_class_:
-       constant_string_class_name = arg;
-       break;
-@@ -1196,6 +1205,47 @@ c_common_init (void)
-       return false;
-     }
-+  if (c_language == clk_c) {
-+    char *ev = getenv ("GCC_HONOUR_COPTS");
-+    int evv;
-+    if (ev == NULL)
-+      evv = -1;
-+    else if ((*ev == '0') || (*ev == '\0'))
-+      evv = 0;
-+    else if (*ev == '1')
-+      evv = 1;
-+    else if (*ev == '2')
-+      evv = 2;
-+    else if (*ev == 's')
-+      evv = -1;
-+    else {
-+      warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1");
-+      evv = 1; /* maybe depend this on something like MIRBSD_NATIVE?  */
-+    }
-+    if (evv == 1) {
-+      if (honour_copts == 0) {
-+        error ("someone does not honour COPTS at all in lenient mode");
-+        return false;
-+      } else if (honour_copts != 1) {
-+        warning (0, "someone does not honour COPTS correctly, passed %d times",
-+         honour_copts);
-+      }
-+    } else if (evv == 2) {
-+      if (honour_copts == 0) {
-+        error ("someone does not honour COPTS at all in strict mode");
-+        return false;
-+      } else if (honour_copts != 1) {
-+        error ("someone does not honour COPTS correctly, passed %d times",
-+         honour_copts);
-+        return false;
-+      }
-+    } else if (evv == 0) {
-+      if (honour_copts != 1)
-+        inform (UNKNOWN_LOCATION, "someone does not honour COPTS correctly, passed %d times",
-+         honour_copts);
-+    }
-+  }
-+
-   return true;
- }
---- a/gcc/c-family/c.opt
-+++ b/gcc/c-family/c.opt
-@@ -1663,6 +1663,9 @@ C++ ObjC++ Optimization Alias(fexception
- fhonor-std
- C++ ObjC++ WarnRemoved
-+fhonour-copts
-+C ObjC C++ ObjC++ RejectNegative
-+
- fhosted
- C ObjC
- Assume normal C execution environment.
---- a/gcc/common.opt
-+++ b/gcc/common.opt
-@@ -1698,6 +1698,9 @@ fguess-branch-probability
- Common Var(flag_guess_branch_prob) Optimization
- Enable guessing of branch probabilities.
-+fhonour-copts
-+Common RejectNegative
-+
- ; Nonzero means ignore `#ident' directives.  0 means handle them.
- ; Generate position-independent code for executables if possible
- ; On SVR4 targets, it also controls whether or not to emit a
---- a/gcc/doc/invoke.texi
-+++ b/gcc/doc/invoke.texi
-@@ -9055,6 +9055,17 @@ This option is only supported for C and
- @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
- @option{-Wno-pointer-sign}.
-+@item -fhonour-copts
-+@opindex fhonour-copts
-+If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not
-+given at least once, and warn if it is given more than once.
-+If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not
-+given exactly once.
-+If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option
-+is not given exactly once.
-+The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}.
-+This flag and environment variable only affect the C language.
-+
- @item -Wstack-protector
- @opindex Wstack-protector
- @opindex Wno-stack-protector
---- a/gcc/opts.c
-+++ b/gcc/opts.c
-@@ -2448,6 +2448,9 @@ common_handle_option (struct gcc_options
-       /* Currently handled in a prescan.  */
-       break;
-+    case OPT_fhonour_copts:
-+      break;
-+
-     case OPT_Werror:
-       dc->warning_as_error_requested = value;
-       break;
diff --git a/devel/gcc/patches/11.2.0/920-specs_nonfatal_getenv.patch b/devel/gcc/patches/11.2.0/920-specs_nonfatal_getenv.patch
deleted file mode 100644 (file)
index dda33c0..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-Author: Jo-Philipp Wich <jow@openwrt.org>
-Date:   Sat Apr 21 03:02:39 2012 +0000
-
-    gcc: add patch to make the getenv() spec function nonfatal if requested environment variable is unset
-    
-    SVN-Revision: 31390
-
---- a/gcc/gcc.c
-+++ b/gcc/gcc.c
-@@ -10100,8 +10100,10 @@ getenv_spec_function (int argc, const ch
-     }
-   if (!value)
--    fatal_error (input_location,
--               "environment variable %qs not defined", varname);
-+    {
-+      warning (input_location, "environment variable %qs not defined", varname);
-+      value = "";
-+    }
-   /* We have to escape every character of the environment variable so
-      they are not interpreted as active spec characters.  A
diff --git a/devel/gcc/patches/11.2.0/931-libffi-fix-MIPS-softfloat-build-issue.patch b/devel/gcc/patches/11.2.0/931-libffi-fix-MIPS-softfloat-build-issue.patch
deleted file mode 100644 (file)
index fb4cb15..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-From c0c62fa4256f805389f16ebfc4a60cf789129b50 Mon Sep 17 00:00:00 2001
-From: BangLang Huang <banglang.huang@foxmail.com>
-Date: Wed, 9 Nov 2016 10:36:49 +0800
-Subject: [PATCH] libffi: fix MIPS softfloat build issue
-
-Backported from github.com/libffi/libffi#272
-
-Signed-off-by: BangLang Huang <banglang.huang@foxmail.com>
-Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
----
- libffi/src/mips/n32.S | 17 +++++++++++++++++
- libffi/src/mips/o32.S | 17 +++++++++++++++++
- 2 files changed, 34 insertions(+)
-
---- a/libffi/src/mips/n32.S
-+++ b/libffi/src/mips/n32.S
-@@ -107,6 +107,16 @@ loadregs:
-       REG_L   t6, 3*FFI_SIZEOF_ARG($fp)  # load the flags word into t6.
-+#ifdef __mips_soft_float
-+      REG_L   a0, 0*FFI_SIZEOF_ARG(t9)
-+      REG_L   a1, 1*FFI_SIZEOF_ARG(t9)
-+      REG_L   a2, 2*FFI_SIZEOF_ARG(t9)
-+      REG_L   a3, 3*FFI_SIZEOF_ARG(t9)
-+      REG_L   a4, 4*FFI_SIZEOF_ARG(t9)
-+      REG_L   a5, 5*FFI_SIZEOF_ARG(t9)
-+      REG_L   a6, 6*FFI_SIZEOF_ARG(t9)
-+      REG_L   a7, 7*FFI_SIZEOF_ARG(t9)
-+#else
-       and     t4, t6, ((1<<FFI_FLAG_BITS)-1)
-       REG_L   a0, 0*FFI_SIZEOF_ARG(t9)
-       beqz    t4, arg1_next
-@@ -193,6 +203,7 @@ arg7_next:
- arg8_doublep: 
-       l.d     $f19, 7*FFI_SIZEOF_ARG(t9)      
- arg8_next:    
-+#endif
- callit:               
-       # Load the function pointer
-@@ -214,6 +225,7 @@ retint:
-       b       epilogue
- retfloat:
-+#ifndef __mips_soft_float
-       bne     t6, FFI_TYPE_FLOAT, retdouble
-       jal     t9
-       REG_L   t4, 4*FFI_SIZEOF_ARG($fp)
-@@ -272,6 +284,7 @@ retstruct_f_d:
-       s.s     $f0, 0(t4)
-       s.d     $f2, 8(t4)
-       b       epilogue
-+#endif
- retstruct_d_soft:
-       bne     t6, FFI_TYPE_STRUCT_D_SOFT, retstruct_f_soft
-@@ -429,6 +442,7 @@ ffi_closure_N32:
-       REG_S   a6, A6_OFF2($sp)
-       REG_S   a7, A7_OFF2($sp)
-+#ifndef __mips_soft_float
-       # Store all possible float/double registers.
-       s.d     $f12, F12_OFF2($sp)
-       s.d     $f13, F13_OFF2($sp)
-@@ -438,6 +452,7 @@ ffi_closure_N32:
-       s.d     $f17, F17_OFF2($sp)
-       s.d     $f18, F18_OFF2($sp)
-       s.d     $f19, F19_OFF2($sp)
-+#endif
-       # Call ffi_closure_mips_inner_N32 to do the real work.
-       LA      t9, ffi_closure_mips_inner_N32
-@@ -458,6 +473,7 @@ cls_retint:
-       b       cls_epilogue
- cls_retfloat:
-+#ifndef __mips_soft_float
-       bne     v0, FFI_TYPE_FLOAT, cls_retdouble
-       l.s     $f0, V0_OFF2($sp)
-       b       cls_epilogue
-@@ -500,6 +516,7 @@ cls_retstruct_f_d:
-       l.s     $f0, V0_OFF2($sp)
-       l.d     $f2, V1_OFF2($sp)
-       b       cls_epilogue
-+#endif
-       
- cls_retstruct_small2: 
-       REG_L   v0, V0_OFF2($sp)
---- a/libffi/src/mips/o32.S
-+++ b/libffi/src/mips/o32.S
-@@ -82,13 +82,16 @@ sixteen:
-               
-       ADDU    $sp, 4 * FFI_SIZEOF_ARG         # adjust $sp to new args
-+#ifndef __mips_soft_float
-       bnez    t0, pass_d                      # make it quick for int
-+#endif
-       REG_L   a0, 0*FFI_SIZEOF_ARG($sp)       # just go ahead and load the
-       REG_L   a1, 1*FFI_SIZEOF_ARG($sp)       # four regs.
-       REG_L   a2, 2*FFI_SIZEOF_ARG($sp)
-       REG_L   a3, 3*FFI_SIZEOF_ARG($sp)
-       b       call_it
-+#ifndef __mips_soft_float
- pass_d:
-       bne     t0, FFI_ARGS_D, pass_f
-       l.d     $f12, 0*FFI_SIZEOF_ARG($sp)     # load $fp regs from args
-@@ -130,6 +133,7 @@ pass_f_d:
-  #    bne     t0, FFI_ARGS_F_D, call_it
-       l.s     $f12, 0*FFI_SIZEOF_ARG($sp)     # load $fp regs from args
-       l.d     $f14, 2*FFI_SIZEOF_ARG($sp)     # passing double and float
-+#endif
- call_it:      
-       # Load the function pointer
-@@ -158,14 +162,23 @@ retfloat:
-       bne     t2, FFI_TYPE_FLOAT, retdouble
-       jalr    t9
-       REG_L   t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
-+#ifndef __mips_soft_float
-       s.s     $f0, 0(t0)
-+#else
-+      REG_S v0, 0(t0)
-+#endif
-       b       epilogue
- retdouble:    
-       bne     t2, FFI_TYPE_DOUBLE, noretval
-       jalr    t9
-       REG_L   t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
-+#ifndef __mips_soft_float
-       s.d     $f0, 0(t0)
-+#else
-+      REG_S v1, 4(t0)
-+      REG_S v0, 0(t0)
-+#endif
-       b       epilogue
-       
- noretval:     
-@@ -261,9 +274,11 @@ $LCFI7:
-       li      $13, 1          # FFI_O32
-       bne     $16, $13, 1f    # Skip fp save if FFI_O32_SOFT_FLOAT
-       
-+#ifndef __mips_soft_float
-       # Store all possible float/double registers.
-       s.d     $f12, FA_0_0_OFF2($fp)
-       s.d     $f14, FA_1_0_OFF2($fp)
-+#endif
- 1:    
-       # Call ffi_closure_mips_inner_O32 to do the work.
-       la      t9, ffi_closure_mips_inner_O32
-@@ -281,6 +296,7 @@ $LCFI7:
-       li      $13, 1          # FFI_O32
-       bne     $16, $13, 1f    # Skip fp restore if FFI_O32_SOFT_FLOAT
-+#ifndef __mips_soft_float
-       li      $9, FFI_TYPE_FLOAT
-       l.s     $f0, V0_OFF2($fp)
-       beq     $8, $9, closure_done
-@@ -288,6 +304,7 @@ $LCFI7:
-       li      $9, FFI_TYPE_DOUBLE
-       l.d     $f0, V0_OFF2($fp)
-       beq     $8, $9, closure_done
-+#endif
- 1:    
-       REG_L   $3, V1_OFF2($fp)
-       REG_L   $2, V0_OFF2($fp)
diff --git a/devel/gcc/patches/11.2.0/960-gotools-fix-compilation-when-making-cross-compiler.patch b/devel/gcc/patches/11.2.0/960-gotools-fix-compilation-when-making-cross-compiler.patch
deleted file mode 100644 (file)
index b1d7576..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-From dda6b050cd74a352670787a294596a9c56c21327 Mon Sep 17 00:00:00 2001
-From: Yousong Zhou <yszhou4tech@gmail.com>
-Date: Fri, 4 May 2018 18:20:53 +0800
-Subject: [PATCH] gotools: fix compilation when making cross compiler
-
-libgo is "the runtime support library for the Go programming language.
-This library is intended for use with the Go frontend."
-
-gccgo will link target files with libgo.so which depends on libgcc_s.so.1, but
-the linker will complain that it cannot find it.  That's because shared libgcc
-is not present in the install directory yet.  libgo.so was made without problem
-because gcc will emit -lgcc_s when compiled with -shared option.  When gotools
-were being made, it was supplied with -static-libgcc thus no link option was
-provided.  Check LIBGO in gcc/go/gcc-spec.c for how gccgo make a builtin spec
-for linking with libgo.so
-
-- GccgoCrossCompilation, https://github.com/golang/go/wiki/GccgoCrossCompilation
-- Cross-building instructions, http://www.eglibc.org/archives/patches/msg00078.html
-
-When 3-pass GCC compilation is used, shared libgcc runtime libraries will be
-available after gcc pass2 completed and will meet the gotools link requirement
-at gcc pass3
----
- gotools/Makefile.am | 4 +++-
- gotools/Makefile.in | 4 +++-
- 2 files changed, 6 insertions(+), 2 deletions(-)
-
---- a/gotools/Makefile.am
-+++ b/gotools/Makefile.am
-@@ -26,6 +26,7 @@ PWD_COMMAND = $${PWDCMD-pwd}
- STAMP = echo timestamp >
- libgodir = ../$(target_noncanonical)/libgo
-+libgccdir = ../$(target_noncanonical)/libgcc
- LIBGODEP = $(libgodir)/libgo.la
- LIBGOTOOL = $(libgodir)/libgotool.a
-@@ -41,7 +42,8 @@ GOCFLAGS = $(CFLAGS_FOR_TARGET)
- GOCOMPILE = $(GOCOMPILER) $(GOCFLAGS)
- AM_GOCFLAGS = -I $(libgodir)
--AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs
-+AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs \
-+      -L $(libgccdir) -L $(libgccdir)/.libs -lgcc_s
- GOLINK = $(GOCOMPILER) $(GOCFLAGS) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@
- libgosrcdir = $(srcdir)/../libgo/go
---- a/gotools/Makefile.in
-+++ b/gotools/Makefile.in
-@@ -337,6 +337,7 @@ mkinstalldirs = $(SHELL) $(toplevel_srcd
- PWD_COMMAND = $${PWDCMD-pwd}
- STAMP = echo timestamp >
- libgodir = ../$(target_noncanonical)/libgo
-+libgccdir = ../$(target_noncanonical)/libgcc
- LIBGODEP = $(libgodir)/libgo.la
- LIBGOTOOL = $(libgodir)/libgotool.a
- @NATIVE_FALSE@GOCOMPILER = $(GOC)
-@@ -346,7 +347,8 @@ LIBGOTOOL = $(libgodir)/libgotool.a
- GOCFLAGS = $(CFLAGS_FOR_TARGET)
- GOCOMPILE = $(GOCOMPILER) $(GOCFLAGS)
- AM_GOCFLAGS = -I $(libgodir)
--AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs
-+AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs \
-+      -L $(libgccdir) -L $(libgccdir)/.libs -lgcc_s
- GOLINK = $(GOCOMPILER) $(GOCFLAGS) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@
- libgosrcdir = $(srcdir)/../libgo/go
- cmdsrcdir = $(libgosrcdir)/cmd
diff --git a/devel/gcc/patches/11.2.0/970-macos_arm64-building-fix.patch b/devel/gcc/patches/11.2.0/970-macos_arm64-building-fix.patch
deleted file mode 100644 (file)
index 424899e..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-commit 9c6e71079b46ad5433165feaa2001450f2017b56
-Author: PrzemysÅ‚aw Buczkowski <prem@prem.moe>
-Date:   Mon Aug 16 13:16:21 2021 +0100
-
-    GCC: Patch for Apple Silicon compatibility
-    
-    This patch fixes a linker error occuring when compiling
-    the cross-compiler on macOS and ARM64 architecture.
-    
-    Adapted from:
-    https://github.com/richfelker/musl-cross-make/issues/116#issuecomment-823612404
-    
-    Change-Id: Ia3ee98a163bbb62689f42e2da83a5ef36beb0913
-    Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4329
-    Reviewed-by: John Scipione <jscipione@gmail.com>
-    Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
-
---- a/gcc/config/aarch64/aarch64.h
-+++ b/gcc/config/aarch64/aarch64.h
-@@ -1236,7 +1236,7 @@ extern const char *aarch64_rewrite_mcpu
- #define MCPU_TO_MARCH_SPEC_FUNCTIONS \
-   { "rewrite_mcpu", aarch64_rewrite_mcpu },
--#if defined(__aarch64__)
-+#if defined(__aarch64__) && ! defined(__APPLE__)
- extern const char *host_detect_local_cpu (int argc, const char **argv);
- #define HAVE_LOCAL_CPU_DETECT
- # define EXTRA_SPEC_FUNCTIONS                                         \
---- a/gcc/config/host-darwin.c
-+++ b/gcc/config/host-darwin.c
-@@ -22,6 +22,8 @@
- #include "coretypes.h"
- #include "diagnostic-core.h"
- #include "config/host-darwin.h"
-+#include "hosthooks.h"
-+#include "hosthooks-def.h"
- /* Yes, this is really supposed to work.  */
- /* This allows for a pagesize of 16384, which we have on Darwin20, but should
-@@ -79,3 +81,5 @@ darwin_gt_pch_use_address (void *addr, s
-   return ret;
- }
-+
-+const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;
diff --git a/devel/gcc/patches/11.2.0/980-add-nostdinc++.patch b/devel/gcc/patches/11.2.0/980-add-nostdinc++.patch
deleted file mode 100644 (file)
index c1fe3e5..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-From: Jonathan Wakely <jwakely@redhat.com>
-Date: Fri, 7 Jan 2022 15:21:03 +0000 (+0000)
-Subject: libstdc++: Add -nostdinc++ for c++17 sources [PR100017]
-X-Git-Tag: releases/gcc-11.3.0~445
-X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=01a70ccd723eb9a479186fe37c972b0d0f8676cf
-
-libstdc++: Add -nostdinc++ for c++17 sources [PR100017]
-
-When building a build!=host compiler, the just-built gcc can't be used
-to build the target libstdc++ (because it is built for the host triplet,
-not the build triplet). The top-level configure.ac sets up the build
-flags for libstdc++ (and other "raw_cxx" libs) like this:
-
-GCC_TARGET_TOOL(c++ for libstdc++, RAW_CXX_FOR_TARGET, CXX,
-               [gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs],
-               c++)
-
-The -nostdinc++ flag is only used for the IN-TREE-TOOL, i.e. when using
-the just-built gcc/xgcc compiler. This means that the cross-compiler
-used to build libstdc++ will add its own libstdc++ headers to the
-include path. That results in the #include <cfenv> in
-src/c++17/floating_to_chars.cc and src/c++17/floating_from_chars.cc
-doing #include_next <fenv.h> and finding the libstdc++ fenv.h wrapper
-from the host compiler. Because that has the same include guard as the
-<fenv.h> in the libstdc++ we're trying to build, we never reach the
-underlying <fenv.h> from libc. That results in several errors of the
-form:
-
-error: 'fenv_t' has not been declared in '::'
-
-The most correct fix would be to add -nostdinc++ to the
-RAW_CXX_FOR_TARGET variable in configure.ac, or the
-RAW_CXX_TARGET_EXPORTS variable in Makefile.tpl.
-
-Another solution would be to make the libstdc++ <fenv.h> wrapper use
-_GLIBCXX_INCLUDE_NEXT_C_HEADERS like our <stdlib.h> and other C header
-wrappers.
-
-For now though, the simplest and safest solution is to just add
--nostdinc++ to the CXXFLAGS used for src/c++17/*.cc, which is what this
-does.
-
-libstdc++-v3/ChangeLog:
-
-       PR libstdc++/100017
-       * src/c++17/Makefile.am (AM_CXXFLAGS): Add -nostdinc++.
-       * src/c++17/Makefile.in: Regenerate.
-
-(cherry picked from commit 4fde88e5dd152fe866a97b12e0f8229970d15cb3)
----
-
---- a/libstdc++-v3/src/c++17/Makefile.am
-+++ b/libstdc++-v3/src/c++17/Makefile.am
-@@ -79,7 +79,7 @@ endif
- # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
- # as the occasion calls for it.
- AM_CXXFLAGS = \
--      -std=gnu++17 \
-+      -std=gnu++17 -nostdinc++ \
-       $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
-       $(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
-       $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) \
---- a/libstdc++-v3/src/c++17/Makefile.in
-+++ b/libstdc++-v3/src/c++17/Makefile.in
-@@ -455,7 +455,7 @@ libc__17convenience_la_SOURCES = $(sourc
- # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
- # as the occasion calls for it.
- AM_CXXFLAGS = \
--      -std=gnu++17 \
-+      -std=gnu++17 -nostdinc++ \
-       $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
-       $(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
-       $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) \
diff --git a/devel/gcc/patches/11.3.0/002-case_insensitive.patch b/devel/gcc/patches/11.3.0/002-case_insensitive.patch
new file mode 100644 (file)
index 0000000..409497e
--- /dev/null
@@ -0,0 +1,24 @@
+commit 81cc26c706b2bc8c8c1eb1a322e5c5157900836e
+Author: Felix Fietkau <nbd@openwrt.org>
+Date:   Sun Oct 19 21:45:51 2014 +0000
+
+    gcc: do not assume that the Mac OS X filesystem is case insensitive
+    
+    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+    
+    SVN-Revision: 42973
+
+--- a/include/filenames.h
++++ b/include/filenames.h
+@@ -44,11 +44,6 @@ extern "C" {
+ #  define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c)
+ #  define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f)
+ #else /* not DOSish */
+-#  if defined(__APPLE__)
+-#    ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
+-#      define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1
+-#    endif
+-#  endif /* __APPLE__ */
+ #  define HAS_DRIVE_SPEC(f) (0)
+ #  define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c)
+ #  define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f)
diff --git a/devel/gcc/patches/11.3.0/003-dont-choke-when-building-32bit-on-64bit.patch b/devel/gcc/patches/11.3.0/003-dont-choke-when-building-32bit-on-64bit.patch
new file mode 100644 (file)
index 0000000..c41f35e
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/gcc/real.h
++++ b/gcc/real.h
+@@ -77,8 +77,10 @@ struct GTY(()) real_value {
+    + (REAL_VALUE_TYPE_SIZE%HOST_BITS_PER_WIDE_INT ? 1 : 0)) /* round up */
+ /* Verify the guess.  */
++#ifndef __LP64__
+ extern char test_real_width
+   [sizeof (REAL_VALUE_TYPE) <= REAL_WIDTH * sizeof (HOST_WIDE_INT) ? 1 : -1];
++#endif
+ /* Calculate the format for CONST_DOUBLE.  We need as many slots as
+    are necessary to overlay a REAL_VALUE_TYPE on them.  This could be
diff --git a/devel/gcc/patches/11.3.0/010-documentation.patch b/devel/gcc/patches/11.3.0/010-documentation.patch
new file mode 100644 (file)
index 0000000..25a5e1e
--- /dev/null
@@ -0,0 +1,35 @@
+commit 098bd91f5eae625c7d2ee621e10930fc4434e5e2
+Author: Luka Perkov <luka@openwrt.org>
+Date:   Tue Feb 26 16:16:33 2013 +0000
+
+    gcc: don't build documentation
+    
+    This closes #13039.
+    
+    Signed-off-by: Luka Perkov <luka@openwrt.org>
+    
+    SVN-Revision: 35807
+
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -3348,18 +3348,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
+ doc/gccint.info: $(TEXI_GCCINT_FILES)
+ doc/cppinternals.info: $(TEXI_CPPINT_FILES)
+-doc/%.info: %.texi
+-      if [ x$(BUILD_INFO) = xinfo ]; then \
+-              $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \
+-                      -I $(gcc_docdir)/include -o $@ $<; \
+-      fi
++doc/%.info:
+ # Duplicate entry to handle renaming of gccinstall.info
+-doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES)
+-      if [ x$(BUILD_INFO) = xinfo ]; then \
+-              $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \
+-                      -I $(gcc_docdir)/include -o $@ $<; \
+-      fi
++doc/gccinstall.info:
+ doc/cpp.dvi: $(TEXI_CPP_FILES)
+ doc/gcc.dvi: $(TEXI_GCC_FILES)
diff --git a/devel/gcc/patches/11.3.0/011-v12-configure-define-TARGET_LIBC_GNUSTACK-on-musl.patch b/devel/gcc/patches/11.3.0/011-v12-configure-define-TARGET_LIBC_GNUSTACK-on-musl.patch
new file mode 100644 (file)
index 0000000..423def6
--- /dev/null
@@ -0,0 +1,46 @@
+From ea650cae26da4a8fc04f0c4666f4dd776d0b5fc0 Mon Sep 17 00:00:00 2001
+From: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
+Date: Sun, 14 Nov 2021 21:54:25 -0800
+Subject: [PATCH] configure: define TARGET_LIBC_GNUSTACK on musl
+
+musl only uses PT_GNU_STACK to set default thread stack size and has no
+executable stack support[0], so there is no reason not to emit the
+.note.GNU-stack section on musl builds.
+
+[0]: https://lore.kernel.org/all/20190423192534.GN23599@brightrain.aerifal.cx/T/#u
+
+gcc/ChangeLog:
+
+       * configure: Regenerate.
+       * configure.ac: define TARGET_LIBC_GNUSTACK on musl
+
+Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
+---
+ gcc/configure    | 3 +++
+ gcc/configure.ac | 3 +++
+ 2 files changed, 6 insertions(+)
+
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -31533,6 +31533,9 @@ fi
+ # Check if the target LIBC handles PT_GNU_STACK.
+ gcc_cv_libc_gnustack=unknown
+ case "$target" in
++  mips*-*-linux-musl*)
++    gcc_cv_libc_gnustack=yes
++    ;;
+   mips*-*-linux*)
+ if test $glibc_version_major -gt 2 \
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -7023,6 +7023,9 @@ fi
+ # Check if the target LIBC handles PT_GNU_STACK.
+ gcc_cv_libc_gnustack=unknown
+ case "$target" in
++  mips*-*-linux-musl*)
++    gcc_cv_libc_gnustack=yes
++    ;;
+   mips*-*-linux*)
+     GCC_GLIBC_VERSION_GTE_IFELSE([2], [31], [gcc_cv_libc_gnustack=yes], )
+     ;;
diff --git a/devel/gcc/patches/11.3.0/110-Fix-MIPS-PR-84790.patch b/devel/gcc/patches/11.3.0/110-Fix-MIPS-PR-84790.patch
new file mode 100644 (file)
index 0000000..82ac013
--- /dev/null
@@ -0,0 +1,20 @@
+Fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84790.
+MIPS16 functions have a static assembler prologue which clobbers
+registers v0 and v1. Add these register clobbers to function call
+instructions.
+
+--- a/gcc/config/mips/mips.c
++++ b/gcc/config/mips/mips.c
+@@ -3132,6 +3132,12 @@ mips_emit_call_insn (rtx pattern, rtx or
+       emit_insn (gen_update_got_version ());
+     }
++  if (TARGET_MIPS16 && TARGET_USE_GOT)
++    {
++      clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS16_PIC_TEMP);
++      clobber_reg (&CALL_INSN_FUNCTION_USAGE (insn), MIPS_PROLOGUE_TEMP (word_mode));
++    }
++
+   if (TARGET_MIPS16
+       && TARGET_EXPLICIT_RELOCS
+       && TARGET_CALL_CLOBBERED_GP)
diff --git a/devel/gcc/patches/11.3.0/230-musl_libssp.patch b/devel/gcc/patches/11.3.0/230-musl_libssp.patch
new file mode 100644 (file)
index 0000000..66b88bc
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -978,7 +978,9 @@ proper position among the other output f
+ #endif
+ #ifndef LINK_SSP_SPEC
+-#ifdef TARGET_LIBC_PROVIDES_SSP
++#if DEFAULT_LIBC == LIBC_MUSL
++#define LINK_SSP_SPEC "-lssp_nonshared"
++#elif defined(TARGET_LIBC_PROVIDES_SSP)
+ #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+                      "|fstack-protector-strong|fstack-protector-explicit:}"
+ #else
diff --git a/devel/gcc/patches/11.3.0/300-mips_Os_cpu_rtx_cost_model.patch b/devel/gcc/patches/11.3.0/300-mips_Os_cpu_rtx_cost_model.patch
new file mode 100644 (file)
index 0000000..8c4a5fc
--- /dev/null
@@ -0,0 +1,21 @@
+commit ecf7671b769fe96f7b5134be442089f8bdba55d2
+Author: Felix Fietkau <nbd@nbd.name>
+Date:   Thu Aug 4 20:29:45 2016 +0200
+
+gcc: add a patch to generate better code with Os on mips
+
+Also happens to reduce compressed code size a bit
+
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+
+--- a/gcc/config/mips/mips.c
++++ b/gcc/config/mips/mips.c
+@@ -20041,7 +20041,7 @@ mips_option_override (void)
+     flag_pcc_struct_return = 0;
+   /* Decide which rtx_costs structure to use.  */
+-  if (optimize_size)
++  if (0 && optimize_size)
+     mips_cost = &mips_rtx_cost_optimize_size;
+   else
+     mips_cost = &mips_rtx_cost_data[mips_tune];
diff --git a/devel/gcc/patches/11.3.0/810-arm-softfloat-libgcc.patch b/devel/gcc/patches/11.3.0/810-arm-softfloat-libgcc.patch
new file mode 100644 (file)
index 0000000..5c9d86a
--- /dev/null
@@ -0,0 +1,33 @@
+commit 8570c4be394cff7282f332f97da2ff569a927ddb
+Author: Imre Kaloz <kaloz@openwrt.org>
+Date:   Wed Feb 2 20:06:12 2011 +0000
+
+    fixup arm soft-float symbols
+    
+    SVN-Revision: 25325
+
+--- a/libgcc/config/arm/t-linux
++++ b/libgcc/config/arm/t-linux
+@@ -1,6 +1,10 @@
+ LIB1ASMSRC = arm/lib1funcs.S
+ LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
+-      _ctzsi2 _arm_addsubdf3 _arm_addsubsf3
++      _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \
++      _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
++      _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \
++      _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \
++      _arm_fixsfsi _arm_fixunssfsi
+ # Just for these, we omit the frame pointer since it makes such a big
+ # difference.
+--- a/gcc/config/arm/linux-elf.h
++++ b/gcc/config/arm/linux-elf.h
+@@ -58,8 +58,6 @@
+    %{shared:-lc} \
+    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
+-
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+ #define LINUX_TARGET_LINK_SPEC  "%{h*} \
diff --git a/devel/gcc/patches/11.3.0/820-libgcc_pic.patch b/devel/gcc/patches/11.3.0/820-libgcc_pic.patch
new file mode 100644 (file)
index 0000000..525a95b
--- /dev/null
@@ -0,0 +1,44 @@
+commit c96312958c0621e72c9b32da5bc224ffe2161384
+Author: Felix Fietkau <nbd@openwrt.org>
+Date:   Mon Oct 19 23:26:09 2009 +0000
+
+    gcc: create a proper libgcc_pic.a static library for relinking (4.3.3+ for now, backport will follow)
+    
+    SVN-Revision: 18086
+
+--- a/libgcc/Makefile.in
++++ b/libgcc/Makefile.in
+@@ -930,11 +930,12 @@ $(libgcov-driver-objects): %$(objext): $
+ # Static libraries.
+ libgcc.a: $(libgcc-objects)
++libgcc_pic.a: $(libgcc-s-objects)
+ libgcov.a: $(libgcov-objects)
+ libunwind.a: $(libunwind-objects)
+ libgcc_eh.a: $(libgcc-eh-objects)
+-libgcc.a libgcov.a libunwind.a libgcc_eh.a:
++libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a:
+       -rm -f $@
+       objects="$(objects)";                                   \
+@@ -958,7 +959,7 @@ all: libunwind.a
+ endif
+ ifeq ($(enable_shared),yes)
+-all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
++all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT)
+ ifneq ($(LIBUNWIND),)
+ all: libunwind$(SHLIB_EXT)
+ libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
+@@ -1164,6 +1165,10 @@ install-shared:
+       chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
+       $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
++      $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/
++      chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a
++      $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a
++
+       $(subst @multilib_dir@,$(MULTIDIR),$(subst \
+               @shlib_base_name@,libgcc_s,$(subst \
+               @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
diff --git a/devel/gcc/patches/11.3.0/840-armv4_pass_fix-v4bx_to_ld.patch b/devel/gcc/patches/11.3.0/840-armv4_pass_fix-v4bx_to_ld.patch
new file mode 100644 (file)
index 0000000..e3cb616
--- /dev/null
@@ -0,0 +1,28 @@
+commit 7edc8ca5456d9743dd0075eb3cc5b04f4f24c8cc
+Author: Imre Kaloz <kaloz@openwrt.org>
+Date:   Wed Feb 2 19:34:36 2011 +0000
+
+    add armv4 fixup patches
+    
+    SVN-Revision: 25322
+
+
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -91,10 +91,15 @@
+ #define MUSL_DYNAMIC_LINKER \
+   "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}%{mfdpic:-fdpic}.so.1"
++/* For armv4 we pass --fix-v4bx to linker to support EABI */
++#undef TARGET_FIX_V4BX_SPEC
++#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\
++  "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}"
++
+ /* At this point, bpabi.h will have clobbered LINK_SPEC.  We want to
+    use the GNU/Linux version, not the generic BPABI version.  */
+ #undef  LINK_SPEC
+-#define LINK_SPEC EABI_LINK_SPEC                                      \
++#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC                 \
+   LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC,                                \
+                      LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
diff --git a/devel/gcc/patches/11.3.0/850-use_shared_libgcc.patch b/devel/gcc/patches/11.3.0/850-use_shared_libgcc.patch
new file mode 100644 (file)
index 0000000..8b17f13
--- /dev/null
@@ -0,0 +1,54 @@
+commit dcfc40358b5a3cae7320c17f8d1cebd5ad5540cd
+Author: Felix Fietkau <nbd@openwrt.org>
+Date:   Sun Feb 12 20:25:47 2012 +0000
+
+    gcc 4.6: port over the missing patch 850-use_shared_libgcc.patch to prevent libgcc crap from leaking into every single binary
+    
+    SVN-Revision: 30486
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -132,10 +132,6 @@
+   "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} "   \
+   LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
+-/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we
+-   do not use -lfloat.  */
+-#undef LIBGCC_SPEC
+-
+ /* Clear the instruction cache from `beg' to `end'.  This is
+    implemented in lib1funcs.S, so ensure an error if this definition
+    is used.  */
+--- a/gcc/config/linux.h
++++ b/gcc/config/linux.h
+@@ -66,6 +66,10 @@ see the files COPYING3 and COPYING.RUNTI
+         builtin_version ("CRuntime_Musl");                    \
+     } while (0)
++#ifndef LIBGCC_SPEC
++#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}"
++#endif
++
+ /* Determine which dynamic linker to use depending on whether GLIBC or
+    uClibc or Bionic or musl is the default C library and whether
+    -muclibc or -mglibc or -mbionic or -mmusl has been passed to change
+--- a/libgcc/mkmap-symver.awk
++++ b/libgcc/mkmap-symver.awk
+@@ -136,5 +136,5 @@ function output(lib) {
+   else if (inherit[lib])
+     printf("} %s;\n", inherit[lib]);
+   else
+-    printf ("\n  local:\n\t*;\n};\n");
++    printf ("\n\t*;\n};\n");
+ }
+--- a/gcc/config/rs6000/linux.h
++++ b/gcc/config/rs6000/linux.h
+@@ -62,6 +62,9 @@
+ #undef        CPP_OS_DEFAULT_SPEC
+ #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
++#undef LIBGCC_SPEC
++#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc"
++
+ #undef  LINK_SHLIB_SPEC
+ #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}} \
+   %{static-pie:-static -pie --no-dynamic-linker -z text}"
diff --git a/devel/gcc/patches/11.3.0/851-libgcc_no_compat.patch b/devel/gcc/patches/11.3.0/851-libgcc_no_compat.patch
new file mode 100644 (file)
index 0000000..d710e40
--- /dev/null
@@ -0,0 +1,22 @@
+commit 64661de100da1ec1061ef3e5e400285dce115e6b
+Author: Felix Fietkau <nbd@openwrt.org>
+Date:   Sun May 10 13:16:35 2015 +0000
+
+    gcc: add some size optimization patches
+    
+    Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+    
+    SVN-Revision: 45664
+
+--- a/libgcc/config/t-libunwind
++++ b/libgcc/config/t-libunwind
+@@ -2,8 +2,7 @@
+ HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER
+-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
+-  $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c
++LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+ LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+ # Override the default value from t-slibgcc-elf-ver and mention -lunwind
diff --git a/devel/gcc/patches/11.3.0/870-ppc_no_crtsavres.patch b/devel/gcc/patches/11.3.0/870-ppc_no_crtsavres.patch
new file mode 100644 (file)
index 0000000..bc182f0
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/gcc/config/rs6000/rs6000-logue.c
++++ b/gcc/config/rs6000/rs6000-logue.c
+@@ -348,7 +348,7 @@ rs6000_savres_strategy (rs6000_stack_t *
+   /* Define cutoff for using out-of-line functions to save registers.  */
+   if (DEFAULT_ABI == ABI_V4 || TARGET_ELF)
+     {
+-      if (!optimize_size)
++      if (1)
+       {
+         strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS;
+         strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS;
diff --git a/devel/gcc/patches/11.3.0/881-no_tm_section.patch b/devel/gcc/patches/11.3.0/881-no_tm_section.patch
new file mode 100644 (file)
index 0000000..2029910
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/libgcc/crtstuff.c
++++ b/libgcc/crtstuff.c
+@@ -152,7 +152,7 @@ call_ ## FUNC (void)                                       \
+ #endif
+ #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF)
+-# define USE_TM_CLONE_REGISTRY 1
++# define USE_TM_CLONE_REGISTRY 0
+ #elif !defined(USE_TM_CLONE_REGISTRY)
+ # define USE_TM_CLONE_REGISTRY 0
+ #endif
diff --git a/devel/gcc/patches/11.3.0/900-bad-mips16-crt.patch b/devel/gcc/patches/11.3.0/900-bad-mips16-crt.patch
new file mode 100644 (file)
index 0000000..dd6e9dc
--- /dev/null
@@ -0,0 +1,9 @@
+--- a/libgcc/config/mips/t-mips16
++++ b/libgcc/config/mips/t-mips16
+@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16
+ # Version these symbols if building libgcc.so.
+ SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver
++
++CRTSTUFF_T_CFLAGS += -mno-mips16
++CRTSTUFF_T_CFLAGS_S += -mno-mips16
diff --git a/devel/gcc/patches/11.3.0/910-mbsd_multi.patch b/devel/gcc/patches/11.3.0/910-mbsd_multi.patch
new file mode 100644 (file)
index 0000000..21f5320
--- /dev/null
@@ -0,0 +1,146 @@
+commit 99368862e44740ff4fd33760893f04e14f9dbdf1
+Author: Felix Fietkau <nbd@openwrt.org>
+Date:   Tue Jul 31 00:52:27 2007 +0000
+
+    Port the mbsd_multi patch from freewrt, which adds -fhonour-copts. This will emit warnings in packages that don't use our target cflags properly
+    
+    SVN-Revision: 8256
+
+       This patch brings over a feature from MirBSD:
+       * -fhonour-copts
+         If this option is not given, it's warned (depending
+         on environment variables). This is to catch errors
+         of misbuilt packages which override CFLAGS themselves.
+
+       This patch was authored by Thorsten Glaser <tg at mirbsd.de>
+       with copyright assignment to the FSF in effect.
+
+--- a/gcc/c-family/c-opts.c
++++ b/gcc/c-family/c-opts.c
+@@ -107,6 +107,9 @@ static dump_flags_t original_dump_flags;
+ /* Whether any standard preincluded header has been preincluded.  */
+ static bool done_preinclude;
++/* Check if a port honours COPTS.  */
++static int honour_copts = 0;
++
+ static void handle_OPT_d (const char *);
+ static void set_std_cxx98 (int);
+ static void set_std_cxx11 (int);
+@@ -469,6 +472,12 @@ c_common_handle_option (size_t scode, co
+       flag_no_builtin = !value;
+       break;
++    case OPT_fhonour_copts:
++      if (c_language == clk_c) {
++        honour_copts++;
++      }
++      break;
++
+     case OPT_fconstant_string_class_:
+       constant_string_class_name = arg;
+       break;
+@@ -1198,6 +1207,47 @@ c_common_init (void)
+       return false;
+     }
++  if (c_language == clk_c) {
++    char *ev = getenv ("GCC_HONOUR_COPTS");
++    int evv;
++    if (ev == NULL)
++      evv = -1;
++    else if ((*ev == '0') || (*ev == '\0'))
++      evv = 0;
++    else if (*ev == '1')
++      evv = 1;
++    else if (*ev == '2')
++      evv = 2;
++    else if (*ev == 's')
++      evv = -1;
++    else {
++      warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1");
++      evv = 1; /* maybe depend this on something like MIRBSD_NATIVE?  */
++    }
++    if (evv == 1) {
++      if (honour_copts == 0) {
++        error ("someone does not honour COPTS at all in lenient mode");
++        return false;
++      } else if (honour_copts != 1) {
++        warning (0, "someone does not honour COPTS correctly, passed %d times",
++         honour_copts);
++      }
++    } else if (evv == 2) {
++      if (honour_copts == 0) {
++        error ("someone does not honour COPTS at all in strict mode");
++        return false;
++      } else if (honour_copts != 1) {
++        error ("someone does not honour COPTS correctly, passed %d times",
++         honour_copts);
++        return false;
++      }
++    } else if (evv == 0) {
++      if (honour_copts != 1)
++        inform (UNKNOWN_LOCATION, "someone does not honour COPTS correctly, passed %d times",
++         honour_copts);
++    }
++  }
++
+   return true;
+ }
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -1663,6 +1663,9 @@ C++ ObjC++ Optimization Alias(fexception
+ fhonor-std
+ C++ ObjC++ WarnRemoved
++fhonour-copts
++C ObjC C++ ObjC++ RejectNegative
++
+ fhosted
+ C ObjC
+ Assume normal C execution environment.
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -1698,6 +1698,9 @@ fguess-branch-probability
+ Common Var(flag_guess_branch_prob) Optimization
+ Enable guessing of branch probabilities.
++fhonour-copts
++Common RejectNegative
++
+ ; Nonzero means ignore `#ident' directives.  0 means handle them.
+ ; Generate position-independent code for executables if possible
+ ; On SVR4 targets, it also controls whether or not to emit a
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -9058,6 +9058,17 @@ This option is only supported for C and
+ @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
+ @option{-Wno-pointer-sign}.
++@item -fhonour-copts
++@opindex fhonour-copts
++If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not
++given at least once, and warn if it is given more than once.
++If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not
++given exactly once.
++If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option
++is not given exactly once.
++The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}.
++This flag and environment variable only affect the C language.
++
+ @item -Wstack-protector
+ @opindex Wstack-protector
+ @opindex Wno-stack-protector
+--- a/gcc/opts.c
++++ b/gcc/opts.c
+@@ -2448,6 +2448,9 @@ common_handle_option (struct gcc_options
+       /* Currently handled in a prescan.  */
+       break;
++    case OPT_fhonour_copts:
++      break;
++
+     case OPT_Werror:
+       dc->warning_as_error_requested = value;
+       break;
diff --git a/devel/gcc/patches/11.3.0/920-specs_nonfatal_getenv.patch b/devel/gcc/patches/11.3.0/920-specs_nonfatal_getenv.patch
new file mode 100644 (file)
index 0000000..83bcb25
--- /dev/null
@@ -0,0 +1,22 @@
+Author: Jo-Philipp Wich <jow@openwrt.org>
+Date:   Sat Apr 21 03:02:39 2012 +0000
+
+    gcc: add patch to make the getenv() spec function nonfatal if requested environment variable is unset
+    
+    SVN-Revision: 31390
+
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -10106,8 +10106,10 @@ getenv_spec_function (int argc, const ch
+     }
+   if (!value)
+-    fatal_error (input_location,
+-               "environment variable %qs not defined", varname);
++    {
++      warning (input_location, "environment variable %qs not defined", varname);
++      value = "";
++    }
+   /* We have to escape every character of the environment variable so
+      they are not interpreted as active spec characters.  A
diff --git a/devel/gcc/patches/11.3.0/931-libffi-fix-MIPS-softfloat-build-issue.patch b/devel/gcc/patches/11.3.0/931-libffi-fix-MIPS-softfloat-build-issue.patch
new file mode 100644 (file)
index 0000000..fb4cb15
--- /dev/null
@@ -0,0 +1,168 @@
+From c0c62fa4256f805389f16ebfc4a60cf789129b50 Mon Sep 17 00:00:00 2001
+From: BangLang Huang <banglang.huang@foxmail.com>
+Date: Wed, 9 Nov 2016 10:36:49 +0800
+Subject: [PATCH] libffi: fix MIPS softfloat build issue
+
+Backported from github.com/libffi/libffi#272
+
+Signed-off-by: BangLang Huang <banglang.huang@foxmail.com>
+Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
+---
+ libffi/src/mips/n32.S | 17 +++++++++++++++++
+ libffi/src/mips/o32.S | 17 +++++++++++++++++
+ 2 files changed, 34 insertions(+)
+
+--- a/libffi/src/mips/n32.S
++++ b/libffi/src/mips/n32.S
+@@ -107,6 +107,16 @@ loadregs:
+       REG_L   t6, 3*FFI_SIZEOF_ARG($fp)  # load the flags word into t6.
++#ifdef __mips_soft_float
++      REG_L   a0, 0*FFI_SIZEOF_ARG(t9)
++      REG_L   a1, 1*FFI_SIZEOF_ARG(t9)
++      REG_L   a2, 2*FFI_SIZEOF_ARG(t9)
++      REG_L   a3, 3*FFI_SIZEOF_ARG(t9)
++      REG_L   a4, 4*FFI_SIZEOF_ARG(t9)
++      REG_L   a5, 5*FFI_SIZEOF_ARG(t9)
++      REG_L   a6, 6*FFI_SIZEOF_ARG(t9)
++      REG_L   a7, 7*FFI_SIZEOF_ARG(t9)
++#else
+       and     t4, t6, ((1<<FFI_FLAG_BITS)-1)
+       REG_L   a0, 0*FFI_SIZEOF_ARG(t9)
+       beqz    t4, arg1_next
+@@ -193,6 +203,7 @@ arg7_next:
+ arg8_doublep: 
+       l.d     $f19, 7*FFI_SIZEOF_ARG(t9)      
+ arg8_next:    
++#endif
+ callit:               
+       # Load the function pointer
+@@ -214,6 +225,7 @@ retint:
+       b       epilogue
+ retfloat:
++#ifndef __mips_soft_float
+       bne     t6, FFI_TYPE_FLOAT, retdouble
+       jal     t9
+       REG_L   t4, 4*FFI_SIZEOF_ARG($fp)
+@@ -272,6 +284,7 @@ retstruct_f_d:
+       s.s     $f0, 0(t4)
+       s.d     $f2, 8(t4)
+       b       epilogue
++#endif
+ retstruct_d_soft:
+       bne     t6, FFI_TYPE_STRUCT_D_SOFT, retstruct_f_soft
+@@ -429,6 +442,7 @@ ffi_closure_N32:
+       REG_S   a6, A6_OFF2($sp)
+       REG_S   a7, A7_OFF2($sp)
++#ifndef __mips_soft_float
+       # Store all possible float/double registers.
+       s.d     $f12, F12_OFF2($sp)
+       s.d     $f13, F13_OFF2($sp)
+@@ -438,6 +452,7 @@ ffi_closure_N32:
+       s.d     $f17, F17_OFF2($sp)
+       s.d     $f18, F18_OFF2($sp)
+       s.d     $f19, F19_OFF2($sp)
++#endif
+       # Call ffi_closure_mips_inner_N32 to do the real work.
+       LA      t9, ffi_closure_mips_inner_N32
+@@ -458,6 +473,7 @@ cls_retint:
+       b       cls_epilogue
+ cls_retfloat:
++#ifndef __mips_soft_float
+       bne     v0, FFI_TYPE_FLOAT, cls_retdouble
+       l.s     $f0, V0_OFF2($sp)
+       b       cls_epilogue
+@@ -500,6 +516,7 @@ cls_retstruct_f_d:
+       l.s     $f0, V0_OFF2($sp)
+       l.d     $f2, V1_OFF2($sp)
+       b       cls_epilogue
++#endif
+       
+ cls_retstruct_small2: 
+       REG_L   v0, V0_OFF2($sp)
+--- a/libffi/src/mips/o32.S
++++ b/libffi/src/mips/o32.S
+@@ -82,13 +82,16 @@ sixteen:
+               
+       ADDU    $sp, 4 * FFI_SIZEOF_ARG         # adjust $sp to new args
++#ifndef __mips_soft_float
+       bnez    t0, pass_d                      # make it quick for int
++#endif
+       REG_L   a0, 0*FFI_SIZEOF_ARG($sp)       # just go ahead and load the
+       REG_L   a1, 1*FFI_SIZEOF_ARG($sp)       # four regs.
+       REG_L   a2, 2*FFI_SIZEOF_ARG($sp)
+       REG_L   a3, 3*FFI_SIZEOF_ARG($sp)
+       b       call_it
++#ifndef __mips_soft_float
+ pass_d:
+       bne     t0, FFI_ARGS_D, pass_f
+       l.d     $f12, 0*FFI_SIZEOF_ARG($sp)     # load $fp regs from args
+@@ -130,6 +133,7 @@ pass_f_d:
+  #    bne     t0, FFI_ARGS_F_D, call_it
+       l.s     $f12, 0*FFI_SIZEOF_ARG($sp)     # load $fp regs from args
+       l.d     $f14, 2*FFI_SIZEOF_ARG($sp)     # passing double and float
++#endif
+ call_it:      
+       # Load the function pointer
+@@ -158,14 +162,23 @@ retfloat:
+       bne     t2, FFI_TYPE_FLOAT, retdouble
+       jalr    t9
+       REG_L   t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
++#ifndef __mips_soft_float
+       s.s     $f0, 0(t0)
++#else
++      REG_S v0, 0(t0)
++#endif
+       b       epilogue
+ retdouble:    
+       bne     t2, FFI_TYPE_DOUBLE, noretval
+       jalr    t9
+       REG_L   t0, SIZEOF_FRAME + 4*FFI_SIZEOF_ARG($fp)
++#ifndef __mips_soft_float
+       s.d     $f0, 0(t0)
++#else
++      REG_S v1, 4(t0)
++      REG_S v0, 0(t0)
++#endif
+       b       epilogue
+       
+ noretval:     
+@@ -261,9 +274,11 @@ $LCFI7:
+       li      $13, 1          # FFI_O32
+       bne     $16, $13, 1f    # Skip fp save if FFI_O32_SOFT_FLOAT
+       
++#ifndef __mips_soft_float
+       # Store all possible float/double registers.
+       s.d     $f12, FA_0_0_OFF2($fp)
+       s.d     $f14, FA_1_0_OFF2($fp)
++#endif
+ 1:    
+       # Call ffi_closure_mips_inner_O32 to do the work.
+       la      t9, ffi_closure_mips_inner_O32
+@@ -281,6 +296,7 @@ $LCFI7:
+       li      $13, 1          # FFI_O32
+       bne     $16, $13, 1f    # Skip fp restore if FFI_O32_SOFT_FLOAT
++#ifndef __mips_soft_float
+       li      $9, FFI_TYPE_FLOAT
+       l.s     $f0, V0_OFF2($fp)
+       beq     $8, $9, closure_done
+@@ -288,6 +304,7 @@ $LCFI7:
+       li      $9, FFI_TYPE_DOUBLE
+       l.d     $f0, V0_OFF2($fp)
+       beq     $8, $9, closure_done
++#endif
+ 1:    
+       REG_L   $3, V1_OFF2($fp)
+       REG_L   $2, V0_OFF2($fp)
diff --git a/devel/gcc/patches/11.3.0/960-gotools-fix-compilation-when-making-cross-compiler.patch b/devel/gcc/patches/11.3.0/960-gotools-fix-compilation-when-making-cross-compiler.patch
new file mode 100644 (file)
index 0000000..b1d7576
--- /dev/null
@@ -0,0 +1,67 @@
+From dda6b050cd74a352670787a294596a9c56c21327 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Fri, 4 May 2018 18:20:53 +0800
+Subject: [PATCH] gotools: fix compilation when making cross compiler
+
+libgo is "the runtime support library for the Go programming language.
+This library is intended for use with the Go frontend."
+
+gccgo will link target files with libgo.so which depends on libgcc_s.so.1, but
+the linker will complain that it cannot find it.  That's because shared libgcc
+is not present in the install directory yet.  libgo.so was made without problem
+because gcc will emit -lgcc_s when compiled with -shared option.  When gotools
+were being made, it was supplied with -static-libgcc thus no link option was
+provided.  Check LIBGO in gcc/go/gcc-spec.c for how gccgo make a builtin spec
+for linking with libgo.so
+
+- GccgoCrossCompilation, https://github.com/golang/go/wiki/GccgoCrossCompilation
+- Cross-building instructions, http://www.eglibc.org/archives/patches/msg00078.html
+
+When 3-pass GCC compilation is used, shared libgcc runtime libraries will be
+available after gcc pass2 completed and will meet the gotools link requirement
+at gcc pass3
+---
+ gotools/Makefile.am | 4 +++-
+ gotools/Makefile.in | 4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+--- a/gotools/Makefile.am
++++ b/gotools/Makefile.am
+@@ -26,6 +26,7 @@ PWD_COMMAND = $${PWDCMD-pwd}
+ STAMP = echo timestamp >
+ libgodir = ../$(target_noncanonical)/libgo
++libgccdir = ../$(target_noncanonical)/libgcc
+ LIBGODEP = $(libgodir)/libgo.la
+ LIBGOTOOL = $(libgodir)/libgotool.a
+@@ -41,7 +42,8 @@ GOCFLAGS = $(CFLAGS_FOR_TARGET)
+ GOCOMPILE = $(GOCOMPILER) $(GOCFLAGS)
+ AM_GOCFLAGS = -I $(libgodir)
+-AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs
++AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs \
++      -L $(libgccdir) -L $(libgccdir)/.libs -lgcc_s
+ GOLINK = $(GOCOMPILER) $(GOCFLAGS) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@
+ libgosrcdir = $(srcdir)/../libgo/go
+--- a/gotools/Makefile.in
++++ b/gotools/Makefile.in
+@@ -337,6 +337,7 @@ mkinstalldirs = $(SHELL) $(toplevel_srcd
+ PWD_COMMAND = $${PWDCMD-pwd}
+ STAMP = echo timestamp >
+ libgodir = ../$(target_noncanonical)/libgo
++libgccdir = ../$(target_noncanonical)/libgcc
+ LIBGODEP = $(libgodir)/libgo.la
+ LIBGOTOOL = $(libgodir)/libgotool.a
+ @NATIVE_FALSE@GOCOMPILER = $(GOC)
+@@ -346,7 +347,8 @@ LIBGOTOOL = $(libgodir)/libgotool.a
+ GOCFLAGS = $(CFLAGS_FOR_TARGET)
+ GOCOMPILE = $(GOCOMPILER) $(GOCFLAGS)
+ AM_GOCFLAGS = -I $(libgodir)
+-AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs
++AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs \
++      -L $(libgccdir) -L $(libgccdir)/.libs -lgcc_s
+ GOLINK = $(GOCOMPILER) $(GOCFLAGS) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@
+ libgosrcdir = $(srcdir)/../libgo/go
+ cmdsrcdir = $(libgosrcdir)/cmd
diff --git a/devel/gcc/patches/11.3.0/970-macos_arm64-building-fix.patch b/devel/gcc/patches/11.3.0/970-macos_arm64-building-fix.patch
new file mode 100644 (file)
index 0000000..424899e
--- /dev/null
@@ -0,0 +1,45 @@
+commit 9c6e71079b46ad5433165feaa2001450f2017b56
+Author: PrzemysÅ‚aw Buczkowski <prem@prem.moe>
+Date:   Mon Aug 16 13:16:21 2021 +0100
+
+    GCC: Patch for Apple Silicon compatibility
+    
+    This patch fixes a linker error occuring when compiling
+    the cross-compiler on macOS and ARM64 architecture.
+    
+    Adapted from:
+    https://github.com/richfelker/musl-cross-make/issues/116#issuecomment-823612404
+    
+    Change-Id: Ia3ee98a163bbb62689f42e2da83a5ef36beb0913
+    Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4329
+    Reviewed-by: John Scipione <jscipione@gmail.com>
+    Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
+
+--- a/gcc/config/aarch64/aarch64.h
++++ b/gcc/config/aarch64/aarch64.h
+@@ -1236,7 +1236,7 @@ extern const char *aarch64_rewrite_mcpu
+ #define MCPU_TO_MARCH_SPEC_FUNCTIONS \
+   { "rewrite_mcpu", aarch64_rewrite_mcpu },
+-#if defined(__aarch64__)
++#if defined(__aarch64__) && ! defined(__APPLE__)
+ extern const char *host_detect_local_cpu (int argc, const char **argv);
+ #define HAVE_LOCAL_CPU_DETECT
+ # define EXTRA_SPEC_FUNCTIONS                                         \
+--- a/gcc/config/host-darwin.c
++++ b/gcc/config/host-darwin.c
+@@ -22,6 +22,8 @@
+ #include "coretypes.h"
+ #include "diagnostic-core.h"
+ #include "config/host-darwin.h"
++#include "hosthooks.h"
++#include "hosthooks-def.h"
+ /* Yes, this is really supposed to work.  */
+ /* This allows for a pagesize of 16384, which we have on Darwin20, but should
+@@ -79,3 +81,5 @@ darwin_gt_pch_use_address (void *addr, s
+   return ret;
+ }
++
++const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;
index f4ceb46530d80fe1f395af4f7f3e0877653631ea..6ae68319cff2399272d11cdba72583a5696e92e8 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=erlang
 PKG_VERSION:=24.2
-PKG_RELEASE:=1
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=otp_src_$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= http://www.erlang.org/download/
diff --git a/lang/erlang/patches/030-crypto-Make-configure-flag-disable-otp-test-engine.patch b/lang/erlang/patches/030-crypto-Make-configure-flag-disable-otp-test-engine.patch
new file mode 100644 (file)
index 0000000..3120641
--- /dev/null
@@ -0,0 +1,86 @@
+From ca2fed6c60039003f255ffe7a5d98744b8ebdedc Mon Sep 17 00:00:00 2001
+From: Hans Nilsson <hans@erlang.org>
+Date: Thu, 17 Feb 2022 12:22:06 +0100
+Subject: [PATCH] crypto: Make configure flag --disable-otp-test-engine
+
+---
+ lib/crypto/c_src/Makefile.in | 16 ++++++++++++++--
+ lib/crypto/configure.in      | 10 ++++++++++
+ 2 files changed, 24 insertions(+), 2 deletions(-)
+
+--- a/lib/crypto/c_src/Makefile.in
++++ b/lib/crypto/c_src/Makefile.in
+@@ -119,11 +119,17 @@ CRYPTO_STATIC_OBJS = $(patsubst $(OBJDIR
+ NIF_ARCHIVE = $(LIBDIR)/crypto$(TYPEMARKER).a
+-TEST_ENGINE_OBJS = $(OBJDIR)/otp_test_engine$(TYPEMARKER).o
+-
+ NIF_LIB = $(LIBDIR)/crypto$(TYPEMARKER).@DED_EXT@
+ CALLBACK_LIB = $(LIBDIR)/crypto_callback$(TYPEMARKER).@DED_EXT@
++
++DISABLE_OTP_TEST_ENGINE = @DISABLE_OTP_TEST_ENGINE@
++ifeq ($(DISABLE_OTP_TEST_ENGINE),yes)
++TEST_ENGINE_LIB =
++TEST_ENGINE_OBJS =
++else
+ TEST_ENGINE_LIB = $(LIBDIR)/otp_test_engine$(TYPEMARKER).@DED_EXT@
++TEST_ENGINE_OBJS = $(OBJDIR)/otp_test_engine$(TYPEMARKER).o
++endif
+ DYNAMIC_CRYPTO_LIB=@SSL_DYNAMIC_ONLY@
+ # Wierd that we compile as if dynamically linking when statically
+@@ -182,6 +188,8 @@ debug opt valgrind asan: $(NIF_LIB) $(CA
+ static_lib: $(NIF_ARCHIVE)
++ifeq ($(DISABLE_OTP_TEST_ENGINE),yes)
++else
+ $(OBJDIR)/otp_test_engine$(TYPEMARKER).o: otp_test_engine.c
+       $(V_at)$(INSTALL_DIR) $(OBJDIR)
+       $(V_CC) -c -o $@ $(filter-out -Wmissing-prototypes,$(ALL_CFLAGS)) $<
+@@ -193,6 +201,7 @@ $(LIBDIR)/otp_test_engine$(TYPEMARKER).s
+ $(LIBDIR)/otp_test_engine$(TYPEMARKER).dll: $(TEST_ENGINE_OBJS)
+       $(V_at)$(INSTALL_DIR) $(LIBDIR)
+       $(V_LD) $(LDFLAGS) -o $@  $(SSL_DED_LD_RUNTIME_LIBRARY_PATH) -L$(SSL_LIBDIR) $(TEST_ENGINE_OBJS) -l$(SSL_CRYPTO_LIBNAME) -l$(SSL_SSL_LIBNAME) $(SSL_EXTRA_LIBS)
++endif
+ $(OBJDIR)/%$(TYPEMARKER).o: %.c
+       $(V_at)$(INSTALL_DIR) $(OBJDIR)
+@@ -255,7 +264,10 @@ release_spec: opt
+ ifeq ($(DYNAMIC_OR_WIN_CRYPTO_LIB),yes)
+       $(INSTALL_PROGRAM) $(CALLBACK_LIB) "$(RELSYSDIR)/priv/lib"
+ endif
++ifeq ($(DISABLE_OTP_TEST_ENGINE),yes)
++else
+       $(INSTALL_PROGRAM) $(TEST_ENGINE_LIB) "$(RELSYSDIR)/priv/lib"
++endif
+ release_docs_spec:
+--- a/lib/crypto/configure.in
++++ b/lib/crypto/configure.in
+@@ -156,6 +156,15 @@ AS_HELP_STRING([--disable-evp-hmac],
+     *)    DISABLE_EVP_HMAC=0;;
+   esac ], DISABLE_EVP_HMAC=0)
++
++AC_ARG_ENABLE(otp-test-engine,
++AS_HELP_STRING([--disable-otp-test-engine],
++             [intentionally undocumented workaround]),
++[ case "$enableval" in
++    no)   DISABLE_OTP_TEST_ENGINE=yes;;
++    *)    DISABLE_OTP_TEST_ENGINE=no;;
++  esac ], DISABLE_OTP_TEST_ENGINE=no)
++
+ AC_ARG_ENABLE(deprecated_warnings,
+ AS_HELP_STRING([--disable-deprecated-warnings],
+              [disable warnings for deprecated functions in cryptolib (default is to warn, except for OpenSSL 3.x where the default is not to warn)]),
+@@ -826,6 +835,7 @@ AC_SUBST(SSL_DED_LD_RUNTIME_LIBRARY_PATH
+ AC_SUBST(SSL_DYNAMIC_ONLY)
+ AC_SUBST(DISABLE_EVP_DH)
+ AC_SUBST(DISABLE_EVP_HMAC)
++AC_SUBST(DISABLE_OTP_TEST_ENGINE)
+ AC_OUTPUT(c_src/$host/Makefile:c_src/Makefile.in)
diff --git a/lang/erlang/patches/031-Update-configure-scripts.patch b/lang/erlang/patches/031-Update-configure-scripts.patch
new file mode 100644 (file)
index 0000000..174a8b8
--- /dev/null
@@ -0,0 +1,63 @@
+From 4d48c33d413957dc95fc8b921f9708eb0705c796 Mon Sep 17 00:00:00 2001
+From: Hans Nilsson <hans@erlang.org>
+Date: Wed, 16 Feb 2022 09:28:38 +0100
+Subject: [PATCH] Update configure scripts
+
+---
+ lib/crypto/configure | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+--- a/lib/crypto/configure
++++ b/lib/crypto/configure
+@@ -621,6 +621,7 @@ ac_includes_default="\
+ ac_subst_vars='LTLIBOBJS
+ LIBOBJS
++DISABLE_OTP_TEST_ENGINE
+ DISABLE_EVP_HMAC
+ DISABLE_EVP_DH
+ SSL_DYNAMIC_ONLY
+@@ -747,6 +748,7 @@ with_ssl_rpath
+ enable_dynamic_ssl_lib
+ enable_evp_dh
+ enable_evp_hmac
++enable_otp_test_engine
+ enable_deprecated_warnings
+ enable_fips
+ '
+@@ -1420,6 +1422,8 @@ Optional Features:
+                           the crypto NIF
+   --disable-evp-dh        intentionally undocumented workaround
+   --disable-evp-hmac      intentionally undocumented workaround
++  --disable-otp-test-engine
++                          intentionally undocumented workaround
+   --disable-deprecated-warnings
+                           disable warnings for deprecated functions in
+                           cryptolib (default is to warn, except for OpenSSL
+@@ -5096,6 +5100,18 @@ else
+ fi
++
++# Check whether --enable-otp-test-engine was given.
++if test "${enable_otp_test_engine+set}" = set; then :
++  enableval=$enable_otp_test_engine;  case "$enableval" in
++    no)   DISABLE_OTP_TEST_ENGINE=yes;;
++    *)    DISABLE_OTP_TEST_ENGINE=no;;
++  esac
++else
++  DISABLE_OTP_TEST_ENGINE=no
++fi
++
++
+ # Check whether --enable-deprecated_warnings was given.
+ if test "${enable_deprecated_warnings+set}" = set; then :
+   enableval=$enable_deprecated_warnings;  case "$enableval" in
+@@ -6319,6 +6335,7 @@ fi
++
diff --git a/lang/erlang/patches/032-crypto-do-disable-otp-test-engine-for-LibreSSL-3.5.0.patch b/lang/erlang/patches/032-crypto-do-disable-otp-test-engine-for-LibreSSL-3.5.0.patch
new file mode 100644 (file)
index 0000000..6b7f6c6
--- /dev/null
@@ -0,0 +1,45 @@
+From 4e3d154c0f1bd975016eaa2d842affd230b736cc Mon Sep 17 00:00:00 2001
+From: Hans Nilsson <hans@erlang.org>
+Date: Mon, 21 Feb 2022 14:58:08 +0100
+Subject: [PATCH] crypto: do --disable-otp-test-engine for LibreSSL >= 3.5.0
+
+---
+ lib/crypto/configure.in | 17 +++++++++++++++--
+ 1 file changed, 15 insertions(+), 2 deletions(-)
+
+--- a/lib/crypto/configure.in
++++ b/lib/crypto/configure.in
+@@ -159,11 +159,11 @@ AS_HELP_STRING([--disable-evp-hmac],
+ AC_ARG_ENABLE(otp-test-engine,
+ AS_HELP_STRING([--disable-otp-test-engine],
+-             [intentionally undocumented workaround]),
++             [Disable build of the otp_test_engine. (default is --enable-otp-test-engine, unless for LibreSSL >= 3.5.0 where default is --disable-otp-test-engine)]),
+ [ case "$enableval" in
+     no)   DISABLE_OTP_TEST_ENGINE=yes;;
+     *)    DISABLE_OTP_TEST_ENGINE=no;;
+-  esac ], DISABLE_OTP_TEST_ENGINE=no)
++  esac ], DISABLE_OTP_TEST_ENGINE=default)
+ AC_ARG_ENABLE(deprecated_warnings,
+ AS_HELP_STRING([--disable-deprecated-warnings],
+@@ -245,6 +245,19 @@ yes
+                ],
+                [v3_include=yes],
+                [v3_include=no])
++
++if test "x$DISABLE_OTP_TEST_ENGINE" = "xdefault"; then
++# Get default value for the --disable-otp-test-engine. Depends on cryptolib version
++          AC_EGREP_CPP(^yes.?$,[
++#include <openssl/opensslv.h>
++#if LIBRESSL_VERSION_NUMBER >= 0x3050000fL
++yes
++#endif
++                       ],
++                       [DISABLE_OTP_TEST_ENGINE=yes],
++                         [DISABLE_OTP_TEST_ENGINE=no])
++    fi
++
+     CPPFLAGS="$save_CPPFLAGS"
+     if test $valid_include != yes; then
diff --git a/lang/erlang/patches/033-Update-configure-scripts.patch b/lang/erlang/patches/033-Update-configure-scripts.patch
new file mode 100644 (file)
index 0000000..cdc6af7
--- /dev/null
@@ -0,0 +1,89 @@
+From 2f27f4bf85971dc8d8e0c2dcef133729835458c5 Mon Sep 17 00:00:00 2001
+From: Hans Nilsson <hans@erlang.org>
+Date: Mon, 21 Feb 2022 14:58:35 +0100
+Subject: [PATCH] Update configure scripts
+
+---
+ lib/crypto/configure | 50 ++++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 48 insertions(+), 2 deletions(-)
+
+--- a/lib/crypto/configure
++++ b/lib/crypto/configure
+@@ -1423,7 +1423,9 @@ Optional Features:
+   --disable-evp-dh        intentionally undocumented workaround
+   --disable-evp-hmac      intentionally undocumented workaround
+   --disable-otp-test-engine
+-                          intentionally undocumented workaround
++                          Disable build of the otp_test_engine. (default is
++                          --enable-otp-test-engine, unless for LibreSSL >=
++                          3.5.0 where default is --disable-otp-test-engine)
+   --disable-deprecated-warnings
+                           disable warnings for deprecated functions in
+                           cryptolib (default is to warn, except for OpenSSL
+@@ -5108,7 +5110,7 @@ if test "${enable_otp_test_engine+set}"
+     *)    DISABLE_OTP_TEST_ENGINE=no;;
+   esac
+ else
+-  DISABLE_OTP_TEST_ENGINE=no
++  DISABLE_OTP_TEST_ENGINE=default
+ fi
+@@ -5300,6 +5302,28 @@ else
+ fi
+ rm -f conftest*
++
++if test "x$DISABLE_OTP_TEST_ENGINE" = "xdefault"; then
++# Get default value for the --disable-otp-test-engine. Depends on cryptolib version
++          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++#include <openssl/opensslv.h>
++#if LIBRESSL_VERSION_NUMBER >= 0x3050000fL
++yes
++#endif
++
++_ACEOF
++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
++  $EGREP "^yes.?$" >/dev/null 2>&1; then :
++  DISABLE_OTP_TEST_ENGINE=yes
++else
++  DISABLE_OTP_TEST_ENGINE=no
++fi
++rm -f conftest*
++
++    fi
++
+     CPPFLAGS="$save_CPPFLAGS"
+     if test $valid_include != yes; then
+@@ -5705,6 +5729,28 @@ else
+ fi
+ rm -f conftest*
++
++if test "x$DISABLE_OTP_TEST_ENGINE" = "xdefault"; then
++# Get default value for the --disable-otp-test-engine. Depends on cryptolib version
++          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++#include <openssl/opensslv.h>
++#if LIBRESSL_VERSION_NUMBER >= 0x3050000fL
++yes
++#endif
++
++_ACEOF
++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
++  $EGREP "^yes.?$" >/dev/null 2>&1; then :
++  DISABLE_OTP_TEST_ENGINE=yes
++else
++  DISABLE_OTP_TEST_ENGINE=no
++fi
++rm -f conftest*
++
++    fi
++
+     CPPFLAGS="$save_CPPFLAGS"
+     if test $valid_include != yes; then
index 3b7119aaedb003caacb09f5f7184f286ed1ecf0a..3daa0f860f35699ca2969ad61f858f18eac88f1d 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 GO_VERSION_MAJOR_MINOR:=1.18
-GO_VERSION_PATCH:=3
+GO_VERSION_PATCH:=4
 
 PKG_NAME:=golang
 PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PATCH))
@@ -20,7 +20,7 @@ GO_SOURCE_URLS:=https://dl.google.com/go/ \
 
 PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz
 PKG_SOURCE_URL:=$(GO_SOURCE_URLS)
-PKG_HASH:=0012386ddcbb5f3350e407c679923811dbd283fcdc421724931614a842ecbc2d
+PKG_HASH:=4525aa6b0e3cecb57845f4060a7075aafc9ab752bb7b6b4cf8a212d43078e1e4
 
 PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
 PKG_LICENSE:=BSD-3-Clause
index 72e73beff7d08df7452d97b2c7f66ed50aecbdd8..20f0b9fa3b0c5ee67fd885a67c9842e934cb3e97 100644 (file)
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=luajit
 PKG_VERSION:=2.1.0-beta3
-PKG_RELEASE:=6
+PKG_RELEASE:=7
 
 PKG_SOURCE:=LuaJIT-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://luajit.org/download
@@ -24,7 +24,7 @@ define Package/luajit
  CATEGORY:=Languages
  TITLE:=LuaJIT
  URL:=https://www.luajit.org
- DEPENDS:=@(i386||x86_64||arm||armeb||aarch64||(powerpc&&HAS_FPU)||mips||mipsel||mips64)
+ DEPENDS:=@(i386||x86_64||arm||armeb||aarch64||powerpc||mips||mipsel||mips64)
 endef
 
 define Package/luajit/description
diff --git a/lang/luajit/patches/040-softfloat-ppc.patch b/lang/luajit/patches/040-softfloat-ppc.patch
new file mode 100644 (file)
index 0000000..c424b9e
--- /dev/null
@@ -0,0 +1,2742 @@
+From fd37da0d586c331b0008fbfd653a9659344fe76f Mon Sep 17 00:00:00 2001
+From: Mike Pall <mike>
+Date: Wed, 26 Jul 2017 09:52:19 +0200
+Subject: [PATCH] PPC: Add soft-float support to interpreter.
+
+Contributed by Djordje Kovacevic and Stefan Pejic from RT-RK.com.
+Sponsored by Cisco Systems, Inc.
+---
+ src/host/buildvm_asm.c |    2 +-
+ src/lj_arch.h          |   29 +-
+ src/lj_ccall.c         |   38 +-
+ src/lj_ccall.h         |    4 +-
+ src/lj_ccallback.c     |   30 +-
+ src/lj_frame.h         |    2 +-
+ src/lj_ircall.h        |    2 +-
+ src/vm_ppc.dasc        | 1249 +++++++++++++++++++++++++++++++++-------
+ 8 files changed, 1101 insertions(+), 255 deletions(-)
+
+--- a/src/host/buildvm_asm.c
++++ b/src/host/buildvm_asm.c
+@@ -338,7 +338,7 @@ void emit_asm(BuildCtx *ctx)
+ #if !(LJ_TARGET_PS3 || LJ_TARGET_PSVITA)
+     fprintf(ctx->fp, "\t.section .note.GNU-stack,\"\"," ELFASM_PX "progbits\n");
+ #endif
+-#if LJ_TARGET_PPC && !LJ_TARGET_PS3
++#if LJ_TARGET_PPC && !LJ_TARGET_PS3 && !LJ_ABI_SOFTFP
+     /* Hard-float ABI. */
+     fprintf(ctx->fp, "\t.gnu_attribute 4, 1\n");
+ #endif
+--- a/src/lj_arch.h
++++ b/src/lj_arch.h
+@@ -254,6 +254,29 @@
+ #else
+ #define LJ_ARCH_BITS          32
+ #define LJ_ARCH_NAME          "ppc"
++
++#if !defined(LJ_ARCH_HASFPU)
++#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
++#define LJ_ARCH_HASFPU                0
++#else
++#define LJ_ARCH_HASFPU                1
++#endif
++#endif
++
++#if !defined(LJ_ABI_SOFTFP)
++#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
++#define LJ_ABI_SOFTFP         1
++#else
++#define LJ_ABI_SOFTFP         0
++#endif
++#endif
++#endif
++
++#if LJ_ABI_SOFTFP
++#define LJ_ARCH_NOJIT         1  /* NYI */
++#define LJ_ARCH_NUMMODE               LJ_NUMMODE_DUAL
++#else
++#define LJ_ARCH_NUMMODE               LJ_NUMMODE_DUAL_SINGLE
+ #endif
+ #define LJ_TARGET_PPC         1
+@@ -262,7 +285,6 @@
+ #define LJ_TARGET_MASKSHIFT   0
+ #define LJ_TARGET_MASKROT     1
+ #define LJ_TARGET_UNIFYROT    1       /* Want only IR_BROL. */
+-#define LJ_ARCH_NUMMODE               LJ_NUMMODE_DUAL_SINGLE
+ #if LJ_TARGET_CONSOLE
+ #define LJ_ARCH_PPC32ON64     1
+@@ -415,16 +437,13 @@
+ #error "No support for ILP32 model on ARM64"
+ #endif
+ #elif LJ_TARGET_PPC
+-#if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
+-#error "No support for PowerPC CPUs without double-precision FPU"
+-#endif
+ #if !LJ_ARCH_PPC64 && LJ_ARCH_ENDIAN == LUAJIT_LE
+ #error "No support for little-endian PPC32"
+ #endif
+ #if LJ_ARCH_PPC64
+ #error "No support for PowerPC 64 bit mode (yet)"
+ #endif
+-#ifdef __NO_FPRS__
++#if defined(__NO_FPRS__) && !defined(_SOFT_FLOAT)
+ #error "No support for PPC/e500 anymore (use LuaJIT 2.0)"
+ #endif
+ #elif LJ_TARGET_MIPS32
+--- a/src/lj_ccall.c
++++ b/src/lj_ccall.c
+@@ -387,6 +387,24 @@
+ #define CCALL_HANDLE_COMPLEXARG \
+   /* Pass complex by value in 2 or 4 GPRs. */
++#define CCALL_HANDLE_GPR \
++  /* Try to pass argument in GPRs. */ \
++  if (n > 1) { \
++    lua_assert(n == 2 || n == 4);  /* int64_t or complex (float). */ \
++    if (ctype_isinteger(d->info) || ctype_isfp(d->info)) \
++      ngpr = (ngpr + 1u) & ~1u;  /* Align int64_t to regpair. */ \
++    else if (ngpr + n > maxgpr) \
++      ngpr = maxgpr;  /* Prevent reordering. */ \
++  } \
++  if (ngpr + n <= maxgpr) { \
++    dp = &cc->gpr[ngpr]; \
++    ngpr += n; \
++    goto done; \
++  } \
++
++#if LJ_ABI_SOFTFP
++#define CCALL_HANDLE_REGARG  CCALL_HANDLE_GPR
++#else
+ #define CCALL_HANDLE_REGARG \
+   if (isfp) {  /* Try to pass argument in FPRs. */ \
+     if (nfpr + 1 <= CCALL_NARG_FPR) { \
+@@ -395,24 +413,16 @@
+       d = ctype_get(cts, CTID_DOUBLE);  /* FPRs always hold doubles. */ \
+       goto done; \
+     } \
+-  } else {  /* Try to pass argument in GPRs. */ \
+-    if (n > 1) { \
+-      lua_assert(n == 2 || n == 4);  /* int64_t or complex (float). */ \
+-      if (ctype_isinteger(d->info)) \
+-      ngpr = (ngpr + 1u) & ~1u;  /* Align int64_t to regpair. */ \
+-      else if (ngpr + n > maxgpr) \
+-      ngpr = maxgpr;  /* Prevent reordering. */ \
+-    } \
+-    if (ngpr + n <= maxgpr) { \
+-      dp = &cc->gpr[ngpr]; \
+-      ngpr += n; \
+-      goto done; \
+-    } \
++  } else { \
++    CCALL_HANDLE_GPR \
+   }
++#endif
++#if !LJ_ABI_SOFTFP
+ #define CCALL_HANDLE_RET \
+   if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \
+     ctr = ctype_get(cts, CTID_DOUBLE);  /* FPRs always hold doubles. */
++#endif
+ #elif LJ_TARGET_MIPS32
+ /* -- MIPS o32 calling conventions ---------------------------------------- */
+@@ -1080,7 +1090,7 @@ static int ccall_set_args(lua_State *L,
+   }
+   if (fid) lj_err_caller(L, LJ_ERR_FFI_NUMARG);  /* Too few arguments. */
+-#if LJ_TARGET_X64 || LJ_TARGET_PPC
++#if LJ_TARGET_X64 || (LJ_TARGET_PPC && !LJ_ABI_SOFTFP)
+   cc->nfpr = nfpr;  /* Required for vararg functions. */
+ #endif
+   cc->nsp = nsp;
+--- a/src/lj_ccall.h
++++ b/src/lj_ccall.h
+@@ -86,9 +86,9 @@ typedef union FPRArg {
+ #elif LJ_TARGET_PPC
+ #define CCALL_NARG_GPR                8
+-#define CCALL_NARG_FPR                8
++#define CCALL_NARG_FPR                (LJ_ABI_SOFTFP ? 0 : 8)
+ #define CCALL_NRET_GPR                4       /* For complex double. */
+-#define CCALL_NRET_FPR                1
++#define CCALL_NRET_FPR                (LJ_ABI_SOFTFP ? 0 : 1)
+ #define CCALL_SPS_EXTRA               4
+ #define CCALL_SPS_FREE                0
+--- a/src/lj_ccallback.c
++++ b/src/lj_ccallback.c
+@@ -419,6 +419,23 @@ void lj_ccallback_mcode_free(CTState *ct
+ #elif LJ_TARGET_PPC
++#define CALLBACK_HANDLE_GPR \
++  if (n > 1) { \
++    lua_assert(((LJ_ABI_SOFTFP && ctype_isnum(cta->info)) ||  /* double. */ \
++              ctype_isinteger(cta->info)) && n == 2);  /* int64_t. */ \
++    ngpr = (ngpr + 1u) & ~1u;  /* Align int64_t to regpair. */ \
++  } \
++  if (ngpr + n <= maxgpr) { \
++    sp = &cts->cb.gpr[ngpr]; \
++    ngpr += n; \
++    goto done; \
++  }
++
++#if LJ_ABI_SOFTFP
++#define CALLBACK_HANDLE_REGARG \
++  CALLBACK_HANDLE_GPR \
++  UNUSED(isfp);
++#else
+ #define CALLBACK_HANDLE_REGARG \
+   if (isfp) { \
+     if (nfpr + 1 <= CCALL_NARG_FPR) { \
+@@ -427,20 +444,15 @@ void lj_ccallback_mcode_free(CTState *ct
+       goto done; \
+     } \
+   } else {  /* Try to pass argument in GPRs. */ \
+-    if (n > 1) { \
+-      lua_assert(ctype_isinteger(cta->info) && n == 2);  /* int64_t. */ \
+-      ngpr = (ngpr + 1u) & ~1u;  /* Align int64_t to regpair. */ \
+-    } \
+-    if (ngpr + n <= maxgpr) { \
+-      sp = &cts->cb.gpr[ngpr]; \
+-      ngpr += n; \
+-      goto done; \
+-    } \
++    CALLBACK_HANDLE_GPR \
+   }
++#endif
++#if !LJ_ABI_SOFTFP
+ #define CALLBACK_HANDLE_RET \
+   if (ctype_isfp(ctr->info) && ctr->size == sizeof(float)) \
+     *(double *)dp = *(float *)dp;  /* FPRs always hold doubles. */
++#endif
+ #elif LJ_TARGET_MIPS32
+--- a/src/lj_frame.h
++++ b/src/lj_frame.h
+@@ -226,7 +226,7 @@ enum { LJ_CONT_TAILCALL, LJ_CONT_FFI_CAL
+ #define CFRAME_OFS_L          36
+ #define CFRAME_OFS_PC         32
+ #define CFRAME_OFS_MULTRES    28
+-#define CFRAME_SIZE           272
++#define CFRAME_SIZE           (LJ_ARCH_HASFPU ? 272 : 128)
+ #define CFRAME_SHIFT_MULTRES  3
+ #endif
+ #elif LJ_TARGET_MIPS32
+--- a/src/lj_ircall.h
++++ b/src/lj_ircall.h
+@@ -272,7 +272,7 @@ LJ_DATA const CCallInfo lj_ir_callinfo[I
+ #define fp64_f2l __aeabi_f2lz
+ #define fp64_f2ul __aeabi_f2ulz
+ #endif
+-#elif LJ_TARGET_MIPS
++#elif LJ_TARGET_MIPS || LJ_TARGET_PPC
+ #define softfp_add __adddf3
+ #define softfp_sub __subdf3
+ #define softfp_mul __muldf3
+--- a/src/vm_ppc.dasc
++++ b/src/vm_ppc.dasc
+@@ -103,6 +103,18 @@
+ |// Fixed register assignments for the interpreter.
+ |// Don't use: r1 = sp, r2 and r13 = reserved (TOC, TLS or SDATA)
+ |
++|.macro .FPU, a, b
++|.if FPU
++|  a, b
++|.endif
++|.endmacro
++|
++|.macro .FPU, a, b, c
++|.if FPU
++|  a, b, c
++|.endif
++|.endmacro
++|
+ |// The following must be C callee-save (but BASE is often refetched).
+ |.define BASE,                r14     // Base of current Lua stack frame.
+ |.define KBASE,               r15     // Constants of current Lua function.
+@@ -116,8 +128,10 @@
+ |.define TISNUM,      r22
+ |.define TISNIL,      r23
+ |.define ZERO,                r24
++|.if FPU
+ |.define TOBIT,               f30     // 2^52 + 2^51.
+ |.define TONUM,               f31     // 2^52 + 2^51 + 2^31.
++|.endif
+ |
+ |// The following temporaries are not saved across C calls, except for RA.
+ |.define RA,          r20     // Callee-save.
+@@ -133,6 +147,7 @@
+ |
+ |// Saved temporaries.
+ |.define SAVE0,               r21
++|.define SAVE1,               r25
+ |
+ |// Calling conventions.
+ |.define CARG1,               r3
+@@ -141,8 +156,10 @@
+ |.define CARG4,               r6      // Overlaps TMP3.
+ |.define CARG5,               r7      // Overlaps INS.
+ |
++|.if FPU
+ |.define FARG1,               f1
+ |.define FARG2,               f2
++|.endif
+ |
+ |.define CRET1,               r3
+ |.define CRET2,               r4
+@@ -213,10 +230,16 @@
+ |.endif
+ |.else
+ |
++|.if FPU
+ |.define SAVE_LR,     276(sp)
+ |.define CFRAME_SPACE,        272     // Delta for sp.
+ |// Back chain for sp:        272(sp) <-- sp entering interpreter
+ |.define SAVE_FPR_,   128     // .. 128+18*8: 64 bit FPR saves.
++|.else
++|.define SAVE_LR,     132(sp)
++|.define CFRAME_SPACE,        128     // Delta for sp.
++|// Back chain for sp:        128(sp) <-- sp entering interpreter
++|.endif
+ |.define SAVE_GPR_,   56      // .. 56+18*4: 32 bit GPR saves.
+ |.define SAVE_CR,     52(sp)  // 32 bit CR save.
+ |.define SAVE_ERRF,   48(sp)  // 32 bit C frame info.
+@@ -226,16 +249,25 @@
+ |.define SAVE_PC,     32(sp)
+ |.define SAVE_MULTRES,        28(sp)
+ |.define UNUSED1,     24(sp)
++|.if FPU
+ |.define TMPD_LO,     20(sp)
+ |.define TMPD_HI,     16(sp)
+ |.define TONUM_LO,    12(sp)
+ |.define TONUM_HI,    8(sp)
++|.else
++|.define SFSAVE_4,    20(sp)
++|.define SFSAVE_3,    16(sp)
++|.define SFSAVE_2,    12(sp)
++|.define SFSAVE_1,    8(sp)
++|.endif
+ |// Next frame lr:    4(sp)
+ |// Back chain for sp:        0(sp)   <-- sp while in interpreter
+ |
++|.if FPU
+ |.define TMPD_BLO,    23(sp)
+ |.define TMPD,                TMPD_HI
+ |.define TONUM_D,     TONUM_HI
++|.endif
+ |
+ |.endif
+ |
+@@ -245,7 +277,7 @@
+ |.else
+ |  stw r..reg, SAVE_GPR_+(reg-14)*4(sp)
+ |.endif
+-|  stfd f..reg, SAVE_FPR_+(reg-14)*8(sp)
++|  .FPU stfd f..reg, SAVE_FPR_+(reg-14)*8(sp)
+ |.endmacro
+ |.macro rest_, reg
+ |.if GPR64
+@@ -253,7 +285,7 @@
+ |.else
+ |  lwz r..reg, SAVE_GPR_+(reg-14)*4(sp)
+ |.endif
+-|  lfd f..reg, SAVE_FPR_+(reg-14)*8(sp)
++|  .FPU lfd f..reg, SAVE_FPR_+(reg-14)*8(sp)
+ |.endmacro
+ |
+ |.macro saveregs
+@@ -323,6 +355,7 @@
+ |// Trap for not-yet-implemented parts.
+ |.macro NYI; tw 4, sp, sp; .endmacro
+ |
++|.if FPU
+ |// int/FP conversions.
+ |.macro tonum_i, freg, reg
+ |  xoris reg, reg, 0x8000
+@@ -346,6 +379,7 @@
+ |.macro toint, reg, freg
+ |  toint reg, freg, freg
+ |.endmacro
++|.endif
+ |
+ |//-----------------------------------------------------------------------
+ |
+@@ -533,9 +567,19 @@ static void build_subroutines(BuildCtx *
+   |  beq >2
+   |1:
+   |  addic. TMP1, TMP1, -8
++  |.if FPU
+   |   lfd f0, 0(RA)
++  |.else
++  |   lwz CARG1, 0(RA)
++  |   lwz CARG2, 4(RA)
++  |.endif
+   |    addi RA, RA, 8
++  |.if FPU
+   |   stfd f0, 0(BASE)
++  |.else
++  |   stw CARG1, 0(BASE)
++  |   stw CARG2, 4(BASE)
++  |.endif
+   |    addi BASE, BASE, 8
+   |  bney <1
+   |
+@@ -613,23 +657,23 @@ static void build_subroutines(BuildCtx *
+   |  .toc ld TOCREG, SAVE_TOC
+   |     li TISNUM, LJ_TISNUM          // Setup type comparison constants.
+   |  lp BASE, L->base
+-  |     lus TMP3, 0x59c0              // TOBIT = 2^52 + 2^51 (float).
++  |     .FPU lus TMP3, 0x59c0         // TOBIT = 2^52 + 2^51 (float).
+   |   lwz DISPATCH, L->glref          // Setup pointer to dispatch table.
+   |     li ZERO, 0
+-  |     stw TMP3, TMPD
++  |     .FPU stw TMP3, TMPD
+   |  li TMP1, LJ_TFALSE
+-  |     ori TMP3, TMP3, 0x0004                // TONUM = 2^52 + 2^51 + 2^31 (float).
++  |     .FPU ori TMP3, TMP3, 0x0004   // TONUM = 2^52 + 2^51 + 2^31 (float).
+   |     li TISNIL, LJ_TNIL
+   |    li_vmstate INTERP
+-  |     lfs TOBIT, TMPD
++  |     .FPU lfs TOBIT, TMPD
+   |  lwz PC, FRAME_PC(BASE)           // Fetch PC of previous frame.
+   |  la RA, -8(BASE)                  // Results start at BASE-8.
+-  |     stw TMP3, TMPD
++  |     .FPU stw TMP3, TMPD
+   |   addi DISPATCH, DISPATCH, GG_G2DISP
+   |  stw TMP1, 0(RA)                  // Prepend false to error message.
+   |  li RD, 16                                // 2 results: false + error message.
+   |    st_vmstate
+-  |     lfs TONUM, TMPD
++  |     .FPU lfs TONUM, TMPD
+   |  b ->vm_returnc
+   |
+   |//-----------------------------------------------------------------------
+@@ -690,22 +734,22 @@ static void build_subroutines(BuildCtx *
+   |     li TISNUM, LJ_TISNUM          // Setup type comparison constants.
+   |   lp TMP1, L->top
+   |  lwz PC, FRAME_PC(BASE)
+-  |     lus TMP3, 0x59c0              // TOBIT = 2^52 + 2^51 (float).
++  |     .FPU lus TMP3, 0x59c0         // TOBIT = 2^52 + 2^51 (float).
+   |    stb CARG3, L->status
+-  |     stw TMP3, TMPD
+-  |     ori TMP3, TMP3, 0x0004                // TONUM = 2^52 + 2^51 + 2^31 (float).
+-  |     lfs TOBIT, TMPD
++  |     .FPU stw TMP3, TMPD
++  |     .FPU ori TMP3, TMP3, 0x0004   // TONUM = 2^52 + 2^51 + 2^31 (float).
++  |     .FPU lfs TOBIT, TMPD
+   |   sub RD, TMP1, BASE
+-  |     stw TMP3, TMPD
+-  |     lus TMP0, 0x4338              // Hiword of 2^52 + 2^51 (double)
++  |     .FPU stw TMP3, TMPD
++  |     .FPU lus TMP0, 0x4338         // Hiword of 2^52 + 2^51 (double)
+   |   addi RD, RD, 8
+-  |     stw TMP0, TONUM_HI
++  |     .FPU stw TMP0, TONUM_HI
+   |    li_vmstate INTERP
+   |     li ZERO, 0
+   |    st_vmstate
+   |  andix. TMP0, PC, FRAME_TYPE
+   |   mr MULTRES, RD
+-  |     lfs TONUM, TMPD
++  |     .FPU lfs TONUM, TMPD
+   |     li TISNIL, LJ_TNIL
+   |  beq ->BC_RET_Z
+   |  b ->vm_return
+@@ -739,19 +783,19 @@ static void build_subroutines(BuildCtx *
+   |  lp TMP2, L->base                 // TMP2 = old base (used in vmeta_call).
+   |     li TISNUM, LJ_TISNUM          // Setup type comparison constants.
+   |   lp TMP1, L->top
+-  |     lus TMP3, 0x59c0              // TOBIT = 2^52 + 2^51 (float).
++  |     .FPU lus TMP3, 0x59c0         // TOBIT = 2^52 + 2^51 (float).
+   |  add PC, PC, BASE
+-  |     stw TMP3, TMPD
++  |     .FPU stw TMP3, TMPD
+   |     li ZERO, 0
+-  |     ori TMP3, TMP3, 0x0004                // TONUM = 2^52 + 2^51 + 2^31 (float).
+-  |     lfs TOBIT, TMPD
++  |     .FPU ori TMP3, TMP3, 0x0004   // TONUM = 2^52 + 2^51 + 2^31 (float).
++  |     .FPU lfs TOBIT, TMPD
+   |  sub PC, PC, TMP2                 // PC = frame delta + frame type
+-  |     stw TMP3, TMPD
+-  |     lus TMP0, 0x4338              // Hiword of 2^52 + 2^51 (double)
++  |     .FPU stw TMP3, TMPD
++  |     .FPU lus TMP0, 0x4338         // Hiword of 2^52 + 2^51 (double)
+   |   sub NARGS8:RC, TMP1, BASE
+-  |     stw TMP0, TONUM_HI
++  |     .FPU stw TMP0, TONUM_HI
+   |    li_vmstate INTERP
+-  |     lfs TONUM, TMPD
++  |     .FPU lfs TONUM, TMPD
+   |     li TISNIL, LJ_TNIL
+   |    st_vmstate
+   |
+@@ -839,15 +883,30 @@ static void build_subroutines(BuildCtx *
+   |  lwz INS, -4(PC)
+   |   subi CARG2, RB, 16
+   |  decode_RB8 SAVE0, INS
++  |.if FPU
+   |   lfd f0, 0(RA)
++  |.else
++  |   lwz TMP2, 0(RA)
++  |   lwz TMP3, 4(RA)
++  |.endif
+   |  add TMP1, BASE, SAVE0
+   |   stp BASE, L->base
+   |  cmplw TMP1, CARG2
+   |   sub CARG3, CARG2, TMP1
+   |  decode_RA8 RA, INS
++  |.if FPU
+   |   stfd f0, 0(CARG2)
++  |.else
++  |   stw TMP2, 0(CARG2)
++  |   stw TMP3, 4(CARG2)
++  |.endif
+   |  bney ->BC_CAT_Z
++  |.if FPU
+   |   stfdx f0, BASE, RA
++  |.else
++  |   stwux TMP2, RA, BASE
++  |   stw TMP3, 4(RA)
++  |.endif
+   |  b ->cont_nop
+   |
+   |//-- Table indexing metamethods -----------------------------------------
+@@ -900,9 +959,19 @@ static void build_subroutines(BuildCtx *
+   |  // Returns TValue * (finished) or NULL (metamethod).
+   |  cmplwi CRET1, 0
+   |  beq >3
++  |.if FPU
+   |   lfd f0, 0(CRET1)
++  |.else
++  |   lwz TMP0, 0(CRET1)
++  |   lwz TMP1, 4(CRET1)
++  |.endif
+   |  ins_next1
++  |.if FPU
+   |   stfdx f0, BASE, RA
++  |.else
++  |   stwux TMP0, RA, BASE
++  |   stw TMP1, 4(RA)
++  |.endif
+   |  ins_next2
+   |
+   |3:  // Call __index metamethod.
+@@ -920,7 +989,12 @@ static void build_subroutines(BuildCtx *
+   |  // Returns cTValue * or NULL.
+   |  cmplwi CRET1, 0
+   |  beq >1
++  |.if FPU
+   |  lfd f14, 0(CRET1)
++  |.else
++  |  lwz SAVE0, 0(CRET1)
++  |  lwz SAVE1, 4(CRET1)
++  |.endif
+   |  b ->BC_TGETR_Z
+   |1:
+   |  stwx TISNIL, BASE, RA
+@@ -975,11 +1049,21 @@ static void build_subroutines(BuildCtx *
+   |  bl extern lj_meta_tset           // (lua_State *L, TValue *o, TValue *k)
+   |  // Returns TValue * (finished) or NULL (metamethod).
+   |  cmplwi CRET1, 0
++  |.if FPU
+   |   lfdx f0, BASE, RA
++  |.else
++  |   lwzux TMP2, RA, BASE
++  |   lwz TMP3, 4(RA)
++  |.endif
+   |  beq >3
+   |  // NOBARRIER: lj_meta_tset ensures the table is not black.
+   |  ins_next1
++  |.if FPU
+   |   stfd f0, 0(CRET1)
++  |.else
++  |   stw TMP2, 0(CRET1)
++  |   stw TMP3, 4(CRET1)
++  |.endif
+   |  ins_next2
+   |
+   |3:  // Call __newindex metamethod.
+@@ -990,7 +1074,12 @@ static void build_subroutines(BuildCtx *
+   |   add PC, TMP1, BASE
+   |  lwz LFUNC:RB, FRAME_FUNC(BASE)   // Guaranteed to be a function here.
+   |   li NARGS8:RC, 24                        // 3 args for func(t, k, v)
++  |.if FPU
+   |  stfd f0, 16(BASE)                        // Copy value to third argument.
++  |.else
++  |  stw TMP2, 16(BASE)
++  |  stw TMP3, 20(BASE)
++  |.endif
+   |  b ->vm_call_dispatch_f
+   |
+   |->vmeta_tsetr:
+@@ -998,7 +1087,12 @@ static void build_subroutines(BuildCtx *
+   |  stw PC, SAVE_PC
+   |  bl extern lj_tab_setinth  // (lua_State *L, GCtab *t, int32_t key)
+   |  // Returns TValue *.
++  |.if FPU
+   |  stfd f14, 0(CRET1)
++  |.else
++  |  stw SAVE0, 0(CRET1)
++  |  stw SAVE1, 4(CRET1)
++  |.endif
+   |  b ->cont_nop
+   |
+   |//-- Comparison metamethods ---------------------------------------------
+@@ -1037,9 +1131,19 @@ static void build_subroutines(BuildCtx *
+   |
+   |->cont_ra:                         // RA = resultptr
+   |  lwz INS, -4(PC)
++  |.if FPU
+   |   lfd f0, 0(RA)
++  |.else
++  |   lwz CARG1, 0(RA)
++  |   lwz CARG2, 4(RA)
++  |.endif
+   |  decode_RA8 TMP1, INS
++  |.if FPU
+   |   stfdx f0, BASE, TMP1
++  |.else
++  |   stwux CARG1, TMP1, BASE
++  |   stw CARG2, 4(TMP1)
++  |.endif
+   |  b ->cont_nop
+   |
+   |->cont_condt:                      // RA = resultptr
+@@ -1245,22 +1349,32 @@ static void build_subroutines(BuildCtx *
+   |.macro .ffunc_n, name
+   |->ff_ .. name:
+   |  cmplwi NARGS8:RC, 8
+-  |   lwz CARG3, 0(BASE)
++  |   lwz CARG1, 0(BASE)
++  |.if FPU
+   |    lfd FARG1, 0(BASE)
++  |.else
++  |    lwz CARG2, 4(BASE)
++  |.endif
+   |  blt ->fff_fallback
+-  |  checknum CARG3; bge ->fff_fallback
++  |  checknum CARG1; bge ->fff_fallback
+   |.endmacro
+   |
+   |.macro .ffunc_nn, name
+   |->ff_ .. name:
+   |  cmplwi NARGS8:RC, 16
+-  |   lwz CARG3, 0(BASE)
++  |   lwz CARG1, 0(BASE)
++  |.if FPU
+   |    lfd FARG1, 0(BASE)
+-  |   lwz CARG4, 8(BASE)
++  |   lwz CARG3, 8(BASE)
+   |    lfd FARG2, 8(BASE)
++  |.else
++  |    lwz CARG2, 4(BASE)
++  |   lwz CARG3, 8(BASE)
++  |    lwz CARG4, 12(BASE)
++  |.endif
+   |  blt ->fff_fallback
++  |  checknum CARG1; bge ->fff_fallback
+   |  checknum CARG3; bge ->fff_fallback
+-  |  checknum CARG4; bge ->fff_fallback
+   |.endmacro
+   |
+   |// Inlined GC threshold check. Caveat: uses TMP0 and TMP1.
+@@ -1281,14 +1395,21 @@ static void build_subroutines(BuildCtx *
+   |  bge cr1, ->fff_fallback
+   |   stw CARG3, 0(RA)
+   |  addi RD, NARGS8:RC, 8            // Compute (nresults+1)*8.
++  |  addi TMP1, BASE, 8
++  |  add TMP2, RA, NARGS8:RC
+   |   stw CARG1, 4(RA)
+   |  beq ->fff_res                    // Done if exactly 1 argument.
+-  |  li TMP1, 8
+-  |  subi RC, RC, 8
+   |1:
+-  |  cmplw TMP1, RC
+-  |   lfdx f0, BASE, TMP1
+-  |   stfdx f0, RA, TMP1
++  |  cmplw TMP1, TMP2
++  |.if FPU
++  |   lfd f0, 0(TMP1)
++  |   stfd f0, 0(TMP1)
++  |.else
++  |   lwz CARG1, 0(TMP1)
++  |   lwz CARG2, 4(TMP1)
++  |   stw CARG1, -8(TMP1)
++  |   stw CARG2, -4(TMP1)
++  |.endif
+   |    addi TMP1, TMP1, 8
+   |  bney <1
+   |  b ->fff_res
+@@ -1303,8 +1424,14 @@ static void build_subroutines(BuildCtx *
+   |  orc TMP1, TMP2, TMP0
+   |  addi TMP1, TMP1, ~LJ_TISNUM+1
+   |  slwi TMP1, TMP1, 3
++  |.if FPU
+   |   la TMP2, CFUNC:RB->upvalue
+   |  lfdx FARG1, TMP2, TMP1
++  |.else
++  |  add TMP1, CFUNC:RB, TMP1
++  |  lwz CARG1, CFUNC:TMP1->upvalue[0].u32.hi
++  |  lwz CARG2, CFUNC:TMP1->upvalue[0].u32.lo
++  |.endif
+   |  b ->fff_resn
+   |
+   |//-- Base library: getters and setters ---------------------------------
+@@ -1382,7 +1509,12 @@ static void build_subroutines(BuildCtx *
+   |   mr CARG1, L
+   |  bl extern lj_tab_get  // (lua_State *L, GCtab *t, cTValue *key)
+   |  // Returns cTValue *.
++  |.if FPU
+   |  lfd FARG1, 0(CRET1)
++  |.else
++  |  lwz CARG2, 4(CRET1)
++  |  lwz CARG1, 0(CRET1)      // Caveat: CARG1 == CRET1.
++  |.endif
+   |  b ->fff_resn
+   |
+   |//-- Base library: conversions ------------------------------------------
+@@ -1391,7 +1523,11 @@ static void build_subroutines(BuildCtx *
+   |  // Only handles the number case inline (without a base argument).
+   |  cmplwi NARGS8:RC, 8
+   |   lwz CARG1, 0(BASE)
++  |.if FPU
+   |    lfd FARG1, 0(BASE)
++  |.else
++  |    lwz CARG2, 4(BASE)
++  |.endif
+   |  bne ->fff_fallback                       // Exactly one argument.
+   |   checknum CARG1; bgt ->fff_fallback
+   |  b ->fff_resn
+@@ -1442,12 +1578,23 @@ static void build_subroutines(BuildCtx *
+   |  cmplwi CRET1, 0
+   |   li CARG3, LJ_TNIL
+   |  beq ->fff_restv                  // End of traversal: return nil.
+-  |  lfd f0, 8(BASE)                  // Copy key and value to results.
+   |   la RA, -8(BASE)
++  |.if FPU
++  |  lfd f0, 8(BASE)                  // Copy key and value to results.
+   |  lfd f1, 16(BASE)
+   |  stfd f0, 0(RA)
+-  |   li RD, (2+1)*8
+   |  stfd f1, 8(RA)
++  |.else
++  |  lwz CARG1, 8(BASE)
++  |  lwz CARG2, 12(BASE)
++  |  lwz CARG3, 16(BASE)
++  |  lwz CARG4, 20(BASE)
++  |  stw CARG1, 0(RA)
++  |  stw CARG2, 4(RA)
++  |  stw CARG3, 8(RA)
++  |  stw CARG4, 12(RA)
++  |.endif
++  |   li RD, (2+1)*8
+   |  b ->fff_res
+   |
+   |.ffunc_1 pairs
+@@ -1456,17 +1603,32 @@ static void build_subroutines(BuildCtx *
+   |  bne ->fff_fallback
+ #if LJ_52
+   |   lwz TAB:TMP2, TAB:CARG1->metatable
++  |.if FPU
+   |  lfd f0, CFUNC:RB->upvalue[0]
++  |.else
++  |  lwz TMP0, CFUNC:RB->upvalue[0].u32.hi
++  |  lwz TMP1, CFUNC:RB->upvalue[0].u32.lo
++  |.endif
+   |   cmplwi TAB:TMP2, 0
+   |  la RA, -8(BASE)
+   |   bne ->fff_fallback
+ #else
++  |.if FPU
+   |  lfd f0, CFUNC:RB->upvalue[0]
++  |.else
++  |  lwz TMP0, CFUNC:RB->upvalue[0].u32.hi
++  |  lwz TMP1, CFUNC:RB->upvalue[0].u32.lo
++  |.endif
+   |  la RA, -8(BASE)
+ #endif
+   |   stw TISNIL, 8(BASE)
+   |  li RD, (3+1)*8
++  |.if FPU
+   |  stfd f0, 0(RA)
++  |.else
++  |  stw TMP0, 0(RA)
++  |  stw TMP1, 4(RA)
++  |.endif
+   |  b ->fff_res
+   |
+   |.ffunc ipairs_aux
+@@ -1512,14 +1674,24 @@ static void build_subroutines(BuildCtx *
+   |  stfd FARG2, 0(RA)
+   |.endif
+   |  ble >2                           // Not in array part?
++  |.if FPU
+   |  lwzx TMP2, TMP1, TMP3
+   |  lfdx f0, TMP1, TMP3
++  |.else
++  |  lwzux TMP2, TMP1, TMP3
++  |  lwz TMP3, 4(TMP1)
++  |.endif
+   |1:
+   |  checknil TMP2
+   |   li RD, (0+1)*8
+   |  beq ->fff_res                    // End of iteration, return 0 results.
+   |   li RD, (2+1)*8
++  |.if FPU
+   |  stfd f0, 8(RA)
++  |.else
++  |  stw TMP2, 8(RA)
++  |  stw TMP3, 12(RA)
++  |.endif
+   |  b ->fff_res
+   |2:  // Check for empty hash part first. Otherwise call C function.
+   |  lwz TMP0, TAB:CARG1->hmask
+@@ -1533,7 +1705,11 @@ static void build_subroutines(BuildCtx *
+   |   li RD, (0+1)*8
+   |  beq ->fff_res
+   |  lwz TMP2, 0(CRET1)
++  |.if FPU
+   |  lfd f0, 0(CRET1)
++  |.else
++  |  lwz TMP3, 4(CRET1)
++  |.endif
+   |  b <1
+   |
+   |.ffunc_1 ipairs
+@@ -1542,12 +1718,22 @@ static void build_subroutines(BuildCtx *
+   |  bne ->fff_fallback
+ #if LJ_52
+   |   lwz TAB:TMP2, TAB:CARG1->metatable
++  |.if FPU
+   |  lfd f0, CFUNC:RB->upvalue[0]
++  |.else
++  |  lwz TMP0, CFUNC:RB->upvalue[0].u32.hi
++  |  lwz TMP1, CFUNC:RB->upvalue[0].u32.lo
++  |.endif
+   |   cmplwi TAB:TMP2, 0
+   |  la RA, -8(BASE)
+   |   bne ->fff_fallback
+ #else
++  |.if FPU
+   |  lfd f0, CFUNC:RB->upvalue[0]
++  |.else
++  |  lwz TMP0, CFUNC:RB->upvalue[0].u32.hi
++  |  lwz TMP1, CFUNC:RB->upvalue[0].u32.lo
++  |.endif
+   |  la RA, -8(BASE)
+ #endif
+   |.if DUALNUM
+@@ -1557,7 +1743,12 @@ static void build_subroutines(BuildCtx *
+   |.endif
+   |   stw ZERO, 12(BASE)
+   |  li RD, (3+1)*8
++  |.if FPU
+   |  stfd f0, 0(RA)
++  |.else
++  |  stw TMP0, 0(RA)
++  |  stw TMP1, 4(RA)
++  |.endif
+   |  b ->fff_res
+   |
+   |//-- Base library: catch errors ----------------------------------------
+@@ -1576,19 +1767,32 @@ static void build_subroutines(BuildCtx *
+   |
+   |.ffunc xpcall
+   |  cmplwi NARGS8:RC, 16
+-  |   lwz CARG4, 8(BASE)
++  |   lwz CARG3, 8(BASE)
++  |.if FPU
+   |    lfd FARG2, 8(BASE)
+   |    lfd FARG1, 0(BASE)
++  |.else
++  |    lwz CARG1, 0(BASE)
++  |    lwz CARG2, 4(BASE)
++  |    lwz CARG4, 12(BASE)
++  |.endif
+   |  blt ->fff_fallback
+   |  lbz TMP1, DISPATCH_GL(hookmask)(DISPATCH)
+   |   mr TMP2, BASE
+-  |  checkfunc CARG4; bne ->fff_fallback  // Traceback must be a function.
++  |  checkfunc CARG3; bne ->fff_fallback  // Traceback must be a function.
+   |   la BASE, 16(BASE)
+   |  // Remember active hook before pcall.
+   |  rlwinm TMP1, TMP1, 32-HOOK_ACTIVE_SHIFT, 31, 31
++  |.if FPU
+   |    stfd FARG2, 0(TMP2)            // Swap function and traceback.
+-  |  subi NARGS8:RC, NARGS8:RC, 16
+   |    stfd FARG1, 8(TMP2)
++  |.else
++  |    stw CARG3, 0(TMP2)
++  |    stw CARG4, 4(TMP2)
++  |    stw CARG1, 8(TMP2)
++  |    stw CARG2, 12(TMP2)
++  |.endif
++  |  subi NARGS8:RC, NARGS8:RC, 16
+   |  addi PC, TMP1, 16+FRAME_PCALL
+   |  b ->vm_call_dispatch
+   |
+@@ -1631,9 +1835,21 @@ static void build_subroutines(BuildCtx *
+   |  stp BASE, L->top
+   |2:  // Move args to coroutine.
+   |  cmpw TMP1, NARGS8:RC
++  |.if FPU
+   |   lfdx f0, BASE, TMP1
++  |.else
++  |   add CARG3, BASE, TMP1
++  |   lwz TMP2, 0(CARG3)
++  |   lwz TMP3, 4(CARG3)
++  |.endif
+   |  beq >3
++  |.if FPU
+   |   stfdx f0, CARG2, TMP1
++  |.else
++  |   add CARG3, CARG2, TMP1
++  |   stw TMP2, 0(CARG3)
++  |   stw TMP3, 4(CARG3)
++  |.endif
+   |  addi TMP1, TMP1, 8
+   |  b <2
+   |3:
+@@ -1664,8 +1880,17 @@ static void build_subroutines(BuildCtx *
+   |   stp TMP2, L:SAVE0->top          // Clear coroutine stack.
+   |5:  // Move results from coroutine.
+   |  cmplw TMP1, TMP3
++  |.if FPU
+   |   lfdx f0, TMP2, TMP1
+   |   stfdx f0, BASE, TMP1
++  |.else
++  |   add CARG3, TMP2, TMP1
++  |   lwz CARG1, 0(CARG3)
++  |   lwz CARG2, 4(CARG3)
++  |   add CARG3, BASE, TMP1
++  |   stw CARG1, 0(CARG3)
++  |   stw CARG2, 4(CARG3)
++  |.endif
+   |    addi TMP1, TMP1, 8
+   |  bne <5
+   |6:
+@@ -1690,12 +1915,22 @@ static void build_subroutines(BuildCtx *
+   |  andix. TMP0, PC, FRAME_TYPE
+   |  la TMP3, -8(TMP3)
+   |   li TMP1, LJ_TFALSE
++  |.if FPU
+   |  lfd f0, 0(TMP3)
++  |.else
++  |  lwz CARG1, 0(TMP3)
++  |  lwz CARG2, 4(TMP3)
++  |.endif
+   |   stp TMP3, L:SAVE0->top          // Remove error from coroutine stack.
+   |    li RD, (2+1)*8
+   |   stw TMP1, -8(BASE)              // Prepend false to results.
+   |    la RA, -8(BASE)
++  |.if FPU
+   |  stfd f0, 0(BASE)                 // Copy error message.
++  |.else
++  |  stw CARG1, 0(BASE)                       // Copy error message.
++  |  stw CARG2, 4(BASE)
++  |.endif
+   |  b <7
+   |.else
+   |  mr CARG1, L
+@@ -1874,7 +2109,12 @@ static void build_subroutines(BuildCtx *
+   |  lus CARG1, 0x8000                        // -(2^31).
+   |  beqy ->fff_resi
+   |5:
++  |.if FPU
+   |  lfd FARG1, 0(BASE)
++  |.else
++  |  lwz CARG1, 0(BASE)
++  |  lwz CARG2, 4(BASE)
++  |.endif
+   |  blex func
+   |  b ->fff_resn
+   |.endmacro
+@@ -1898,10 +2138,14 @@ static void build_subroutines(BuildCtx *
+   |
+   |.ffunc math_log
+   |  cmplwi NARGS8:RC, 8
+-  |   lwz CARG3, 0(BASE)
+-  |    lfd FARG1, 0(BASE)
++  |   lwz CARG1, 0(BASE)
+   |  bne ->fff_fallback                       // Need exactly 1 argument.
+-  |  checknum CARG3; bge ->fff_fallback
++  |  checknum CARG1; bge ->fff_fallback
++  |.if FPU
++  |  lfd FARG1, 0(BASE)
++  |.else
++  |  lwz CARG2, 4(BASE)
++  |.endif
+   |  blex log
+   |  b ->fff_resn
+   |
+@@ -1923,17 +2167,24 @@ static void build_subroutines(BuildCtx *
+   |.if DUALNUM
+   |.ffunc math_ldexp
+   |  cmplwi NARGS8:RC, 16
+-  |   lwz CARG3, 0(BASE)
++  |   lwz TMP0, 0(BASE)
++  |.if FPU
+   |    lfd FARG1, 0(BASE)
+-  |   lwz CARG4, 8(BASE)
++  |.else
++  |    lwz CARG1, 0(BASE)
++  |    lwz CARG2, 4(BASE)
++  |.endif
++  |   lwz TMP1, 8(BASE)
+   |.if GPR64
+   |    lwz CARG2, 12(BASE)
+-  |.else
++  |.elif FPU
+   |    lwz CARG1, 12(BASE)
++  |.else
++  |    lwz CARG3, 12(BASE)
+   |.endif
+   |  blt ->fff_fallback
+-  |  checknum CARG3; bge ->fff_fallback
+-  |  checknum CARG4; bne ->fff_fallback
++  |  checknum TMP0; bge ->fff_fallback
++  |  checknum TMP1; bne ->fff_fallback
+   |.else
+   |.ffunc_nn math_ldexp
+   |.if GPR64
+@@ -1948,8 +2199,10 @@ static void build_subroutines(BuildCtx *
+   |.ffunc_n math_frexp
+   |.if GPR64
+   |  la CARG2, DISPATCH_GL(tmptv)(DISPATCH)
+-  |.else
++  |.elif FPU
+   |  la CARG1, DISPATCH_GL(tmptv)(DISPATCH)
++  |.else
++  |  la CARG3, DISPATCH_GL(tmptv)(DISPATCH)
+   |.endif
+   |   lwz PC, FRAME_PC(BASE)
+   |  blex frexp
+@@ -1958,7 +2211,12 @@ static void build_subroutines(BuildCtx *
+   |.if not DUALNUM
+   |   tonum_i FARG2, TMP1
+   |.endif
++  |.if FPU
+   |  stfd FARG1, 0(RA)
++  |.else
++  |  stw CRET1, 0(RA)
++  |  stw CRET2, 4(RA)
++  |.endif
+   |  li RD, (2+1)*8
+   |.if DUALNUM
+   |   stw TISNUM, 8(RA)
+@@ -1971,13 +2229,20 @@ static void build_subroutines(BuildCtx *
+   |.ffunc_n math_modf
+   |.if GPR64
+   |  la CARG2, -8(BASE)
+-  |.else
++  |.elif FPU
+   |  la CARG1, -8(BASE)
++  |.else
++  |  la CARG3, -8(BASE)
+   |.endif
+   |   lwz PC, FRAME_PC(BASE)
+   |  blex modf
+   |   la RA, -8(BASE)
++  |.if FPU
+   |  stfd FARG1, 0(BASE)
++  |.else
++  |  stw CRET1, 0(BASE)
++  |  stw CRET2, 4(BASE)
++  |.endif
+   |  li RD, (2+1)*8
+   |  b ->fff_res
+   |
+@@ -1985,13 +2250,13 @@ static void build_subroutines(BuildCtx *
+   |.if DUALNUM
+   |  .ffunc_1 name
+   |  checknum CARG3
+-  |   addi TMP1, BASE, 8
+-  |   add TMP2, BASE, NARGS8:RC
++  |   addi SAVE0, BASE, 8
++  |   add SAVE1, BASE, NARGS8:RC
+   |  bne >4
+   |1:  // Handle integers.
+-  |  lwz CARG4, 0(TMP1)
+-  |   cmplw cr1, TMP1, TMP2
+-  |  lwz CARG2, 4(TMP1)
++  |  lwz CARG4, 0(SAVE0)
++  |   cmplw cr1, SAVE0, SAVE1
++  |  lwz CARG2, 4(SAVE0)
+   |   bge cr1, ->fff_resi
+   |  checknum CARG4
+   |   xoris TMP0, CARG1, 0x8000
+@@ -2008,36 +2273,76 @@ static void build_subroutines(BuildCtx *
+   |.if GPR64
+   |  rldicl CARG1, CARG1, 0, 32
+   |.endif
+-  |   addi TMP1, TMP1, 8
++  |   addi SAVE0, SAVE0, 8
+   |  b <1
+   |3:
+   |  bge ->fff_fallback
+   |  // Convert intermediate result to number and continue below.
++  |.if FPU
+   |  tonum_i FARG1, CARG1
+-  |  lfd FARG2, 0(TMP1)
++  |  lfd FARG2, 0(SAVE0)
++  |.else
++  |  mr CARG2, CARG1
++  |  bl ->vm_sfi2d_1
++  |  lwz CARG3, 0(SAVE0)
++  |  lwz CARG4, 4(SAVE0)
++  |.endif
+   |  b >6
+   |4:
++  |.if FPU
+   |   lfd FARG1, 0(BASE)
++  |.else
++  |   lwz CARG1, 0(BASE)
++  |   lwz CARG2, 4(BASE)
++  |.endif
+   |  bge ->fff_fallback
+   |5:  // Handle numbers.
+-  |  lwz CARG4, 0(TMP1)
+-  |   cmplw cr1, TMP1, TMP2
+-  |  lfd FARG2, 0(TMP1)
++  |  lwz CARG3, 0(SAVE0)
++  |   cmplw cr1, SAVE0, SAVE1
++  |.if FPU
++  |  lfd FARG2, 0(SAVE0)
++  |.else
++  |  lwz CARG4, 4(SAVE0)
++  |.endif
+   |   bge cr1, ->fff_resn
+-  |  checknum CARG4; bge >7
++  |  checknum CARG3; bge >7
+   |6:
++  |   addi SAVE0, SAVE0, 8
++  |.if FPU
+   |  fsub f0, FARG1, FARG2
+-  |   addi TMP1, TMP1, 8
+   |.if ismax
+   |  fsel FARG1, f0, FARG1, FARG2
+   |.else
+   |  fsel FARG1, f0, FARG2, FARG1
+   |.endif
++  |.else
++  |  stw CARG1, SFSAVE_1
++  |  stw CARG2, SFSAVE_2
++  |  stw CARG3, SFSAVE_3
++  |  stw CARG4, SFSAVE_4
++  |  blex __ledf2
++  |  cmpwi CRET1, 0
++  |.if ismax
++  |  blt >8
++  |.else
++  |  bge >8
++  |.endif
++  |  lwz CARG1, SFSAVE_1
++  |  lwz CARG2, SFSAVE_2
++  |  b <5
++  |8:
++  |  lwz CARG1, SFSAVE_3
++  |  lwz CARG2, SFSAVE_4
++  |.endif
+   |  b <5
+   |7:  // Convert integer to number and continue above.
+-  |   lwz CARG2, 4(TMP1)
++  |   lwz CARG3, 4(SAVE0)
+   |  bne ->fff_fallback
+-  |  tonum_i FARG2, CARG2
++  |.if FPU
++  |  tonum_i FARG2, CARG3
++  |.else
++  |  bl ->vm_sfi2d_2
++  |.endif
+   |  b <6
+   |.else
+   |  .ffunc_n name
+@@ -2237,28 +2542,37 @@ static void build_subroutines(BuildCtx *
+   |
+   |.macro .ffunc_bit_op, name, ins
+   |  .ffunc_bit name
+-  |  addi TMP1, BASE, 8
+-  |  add TMP2, BASE, NARGS8:RC
++  |  addi SAVE0, BASE, 8
++  |  add SAVE1, BASE, NARGS8:RC
+   |1:
+-  |  lwz CARG4, 0(TMP1)
+-  |   cmplw cr1, TMP1, TMP2
++  |  lwz CARG4, 0(SAVE0)
++  |   cmplw cr1, SAVE0, SAVE1
+   |.if DUALNUM
+-  |  lwz CARG2, 4(TMP1)
++  |  lwz CARG2, 4(SAVE0)
+   |.else
+-  |  lfd FARG1, 0(TMP1)
++  |  lfd FARG1, 0(SAVE0)
+   |.endif
+   |   bgey cr1, ->fff_resi
+   |  checknum CARG4
+   |.if DUALNUM
++  |.if FPU
+   |  bnel ->fff_bitop_fb
+   |.else
++  |  beq >3
++  |  stw CARG1, SFSAVE_1
++  |  bl ->fff_bitop_fb
++  |  mr CARG2, CARG1
++  |  lwz CARG1, SFSAVE_1
++  |3:
++  |.endif
++  |.else
+   |  fadd FARG1, FARG1, TOBIT
+   |  bge ->fff_fallback
+   |  stfd FARG1, TMPD
+   |  lwz CARG2, TMPD_LO
+   |.endif
+   |  ins CARG1, CARG1, CARG2
+-  |   addi TMP1, TMP1, 8
++  |   addi SAVE0, SAVE0, 8
+   |  b <1
+   |.endmacro
+   |
+@@ -2280,7 +2594,14 @@ static void build_subroutines(BuildCtx *
+   |.macro .ffunc_bit_sh, name, ins, shmod
+   |.if DUALNUM
+   |  .ffunc_2 bit_..name
++  |.if FPU
+   |  checknum CARG3; bnel ->fff_tobit_fb
++  |.else
++  |  checknum CARG3; beq >1
++  |  bl ->fff_tobit_fb
++  |  lwz CARG2, 12(BASE)      // Conversion polluted CARG2.
++  |1:
++  |.endif
+   |  // Note: no inline conversion from number for 2nd argument!
+   |  checknum CARG4; bne ->fff_fallback
+   |.else
+@@ -2317,27 +2638,77 @@ static void build_subroutines(BuildCtx *
+   |->fff_resn:
+   |  lwz PC, FRAME_PC(BASE)
+   |  la RA, -8(BASE)
++  |.if FPU
+   |  stfd FARG1, -8(BASE)
++  |.else
++  |  stw CARG1, -8(BASE)
++  |  stw CARG2, -4(BASE)
++  |.endif
+   |  b ->fff_res1
+   |
+   |// Fallback FP number to bit conversion.
+   |->fff_tobit_fb:
+   |.if DUALNUM
++  |.if FPU
+   |  lfd FARG1, 0(BASE)
+   |  bgt ->fff_fallback
+   |  fadd FARG1, FARG1, TOBIT
+   |  stfd FARG1, TMPD
+   |  lwz CARG1, TMPD_LO
+   |  blr
++  |.else
++  |  bgt ->fff_fallback
++  |  mr CARG2, CARG1
++  |  mr CARG1, CARG3
++  |// Modifies: CARG1, CARG2, TMP0, TMP1, TMP2.
++  |->vm_tobit:
++  |  slwi TMP2, CARG1, 1
++  |  addis TMP2, TMP2, 0x0020
++  |  cmpwi TMP2, 0
++  |  bge >2
++  |   li TMP1, 0x3e0
++  |  srawi TMP2, TMP2, 21
++  |   not TMP1, TMP1
++  |  sub. TMP2, TMP1, TMP2
++  |    cmpwi cr7, CARG1, 0
++  |  blt >1
++  |   slwi TMP1, CARG1, 11
++  |    srwi TMP0, CARG2, 21
++  |   oris TMP1, TMP1, 0x8000
++  |   or TMP1, TMP1, TMP0
++  |   srw CARG1, TMP1, TMP2
++  |  bclr 4, 28                       // Return if cr7[lt] == 0, no hint.
++  |   neg CARG1, CARG1
++  |  blr
++  |1:
++  |  addi TMP2, TMP2, 21
++  |  srw TMP1, CARG2, TMP2
++  |   slwi CARG2, CARG1, 12
++  |  subfic TMP2, TMP2, 20
++  |   slw TMP0, CARG2, TMP2
++  |   or CARG1, TMP1, TMP0
++  |  bclr 4, 28                       // Return if cr7[lt] == 0, no hint.
++  |   neg CARG1, CARG1
++  |  blr
++  |2:
++  |  li CARG1, 0
++  |  blr
++  |.endif
+   |.endif
+   |->fff_bitop_fb:
+   |.if DUALNUM
+-  |  lfd FARG1, 0(TMP1)
++  |.if FPU
++  |  lfd FARG1, 0(SAVE0)
+   |  bgt ->fff_fallback
+   |  fadd FARG1, FARG1, TOBIT
+   |  stfd FARG1, TMPD
+   |  lwz CARG2, TMPD_LO
+   |  blr
++  |.else
++  |  bgt ->fff_fallback
++  |  mr CARG1, CARG4
++  |  b ->vm_tobit
++  |.endif
+   |.endif
+   |
+   |//-----------------------------------------------------------------------
+@@ -2530,10 +2901,21 @@ static void build_subroutines(BuildCtx *
+   |  decode_RA8 RC, INS                       // Call base.
+   |   beq >2
+   |1:  // Move results down.
++  |.if FPU
+   |  lfd f0, 0(RA)
++  |.else
++  |  lwz CARG1, 0(RA)
++  |  lwz CARG2, 4(RA)
++  |.endif
+   |   addic. TMP1, TMP1, -8
+   |    addi RA, RA, 8
++  |.if FPU
+   |  stfdx f0, BASE, RC
++  |.else
++  |  add CARG3, BASE, RC
++  |  stw CARG1, 0(CARG3)
++  |  stw CARG2, 4(CARG3)
++  |.endif
+   |    addi RC, RC, 8
+   |   bne <1
+   |2:
+@@ -2586,10 +2968,12 @@ static void build_subroutines(BuildCtx *
+   |//-----------------------------------------------------------------------
+   |
+   |.macro savex_, a, b, c, d
++  |.if FPU
+   |  stfd f..a, 16+a*8(sp)
+   |  stfd f..b, 16+b*8(sp)
+   |  stfd f..c, 16+c*8(sp)
+   |  stfd f..d, 16+d*8(sp)
++  |.endif
+   |.endmacro
+   |
+   |->vm_exit_handler:
+@@ -2661,16 +3045,16 @@ static void build_subroutines(BuildCtx *
+   |  lwz KBASE, PC2PROTO(k)(TMP1)
+   |  // Setup type comparison constants.
+   |  li TISNUM, LJ_TISNUM
+-  |  lus TMP3, 0x59c0                 // TOBIT = 2^52 + 2^51 (float).
+-  |  stw TMP3, TMPD
++  |  .FPU lus TMP3, 0x59c0            // TOBIT = 2^52 + 2^51 (float).
++  |  .FPU stw TMP3, TMPD
+   |  li ZERO, 0
+-  |  ori TMP3, TMP3, 0x0004           // TONUM = 2^52 + 2^51 + 2^31 (float).
+-  |  lfs TOBIT, TMPD
+-  |  stw TMP3, TMPD
+-  |  lus TMP0, 0x4338                 // Hiword of 2^52 + 2^51 (double)
++  |  .FPU ori TMP3, TMP3, 0x0004      // TONUM = 2^52 + 2^51 + 2^31 (float).
++  |  .FPU lfs TOBIT, TMPD
++  |  .FPU stw TMP3, TMPD
++  |  .FPU lus TMP0, 0x4338                    // Hiword of 2^52 + 2^51 (double)
+   |    li TISNIL, LJ_TNIL
+-  |  stw TMP0, TONUM_HI
+-  |  lfs TONUM, TMPD
++  |  .FPU stw TMP0, TONUM_HI
++  |  .FPU lfs TONUM, TMPD
+   |  // Modified copy of ins_next which handles function header dispatch, too.
+   |  lwz INS, 0(PC)
+   |   addi PC, PC, 4
+@@ -2715,7 +3099,35 @@ static void build_subroutines(BuildCtx *
+   |//-- Math helper functions ----------------------------------------------
+   |//-----------------------------------------------------------------------
+   |
+-  |// NYI: Use internal implementations of floor, ceil, trunc.
++  |// NYI: Use internal implementations of floor, ceil, trunc, sfcmp.
++  |
++  |.macro sfi2d, AHI, ALO
++  |.if not FPU
++  |  mr. AHI, ALO
++  |  bclr 12, 2                               // Handle zero first.
++  |  srawi TMP0, ALO, 31
++  |  xor TMP1, ALO, TMP0
++  |  sub TMP1, TMP1, TMP0             // Absolute value in TMP1.
++  |  cntlzw AHI, TMP1
++  |  andix. TMP0, TMP0, 0x800         // Mask sign bit.
++  |  slw TMP1, TMP1, AHI              // Align mantissa left with leading 1.
++  |  subfic AHI, AHI, 0x3ff+31-1      // Exponent -1 in AHI.
++  |  slwi ALO, TMP1, 21
++  |  or AHI, AHI, TMP0                        // Sign | Exponent.
++  |  srwi TMP1, TMP1, 11
++  |  slwi AHI, AHI, 20                        // Align left.
++  |  add AHI, AHI, TMP1                       // Add mantissa, increment exponent.
++  |  blr
++  |.endif
++  |.endmacro
++  |
++  |// Input: CARG2. Output: CARG1, CARG2. Temporaries: TMP0, TMP1.
++  |->vm_sfi2d_1:
++  |  sfi2d CARG1, CARG2
++  |
++  |// Input: CARG4. Output: CARG3, CARG4. Temporaries: TMP0, TMP1.
++  |->vm_sfi2d_2:
++  |  sfi2d CARG3, CARG4
+   |
+   |->vm_modi:
+   |  divwo. TMP0, CARG1, CARG2
+@@ -2783,21 +3195,21 @@ static void build_subroutines(BuildCtx *
+   |   addi DISPATCH, r12, GG_G2DISP
+   |  stw r11, CTSTATE->cb.slot
+   |  stw r3, CTSTATE->cb.gpr[0]
+-  |   stfd f1, CTSTATE->cb.fpr[0]
++  |   .FPU stfd f1, CTSTATE->cb.fpr[0]
+   |  stw r4, CTSTATE->cb.gpr[1]
+-  |   stfd f2, CTSTATE->cb.fpr[1]
++  |   .FPU stfd f2, CTSTATE->cb.fpr[1]
+   |  stw r5, CTSTATE->cb.gpr[2]
+-  |   stfd f3, CTSTATE->cb.fpr[2]
++  |   .FPU stfd f3, CTSTATE->cb.fpr[2]
+   |  stw r6, CTSTATE->cb.gpr[3]
+-  |   stfd f4, CTSTATE->cb.fpr[3]
++  |   .FPU stfd f4, CTSTATE->cb.fpr[3]
+   |  stw r7, CTSTATE->cb.gpr[4]
+-  |   stfd f5, CTSTATE->cb.fpr[4]
++  |   .FPU stfd f5, CTSTATE->cb.fpr[4]
+   |  stw r8, CTSTATE->cb.gpr[5]
+-  |   stfd f6, CTSTATE->cb.fpr[5]
++  |   .FPU stfd f6, CTSTATE->cb.fpr[5]
+   |  stw r9, CTSTATE->cb.gpr[6]
+-  |   stfd f7, CTSTATE->cb.fpr[6]
++  |   .FPU stfd f7, CTSTATE->cb.fpr[6]
+   |  stw r10, CTSTATE->cb.gpr[7]
+-  |   stfd f8, CTSTATE->cb.fpr[7]
++  |   .FPU stfd f8, CTSTATE->cb.fpr[7]
+   |  addi TMP0, sp, CFRAME_SPACE+8
+   |  stw TMP0, CTSTATE->cb.stack
+   |   mr CARG1, CTSTATE
+@@ -2808,21 +3220,21 @@ static void build_subroutines(BuildCtx *
+   |  lp BASE, L:CRET1->base
+   |     li TISNUM, LJ_TISNUM          // Setup type comparison constants.
+   |  lp RC, L:CRET1->top
+-  |     lus TMP3, 0x59c0              // TOBIT = 2^52 + 2^51 (float).
++  |     .FPU lus TMP3, 0x59c0         // TOBIT = 2^52 + 2^51 (float).
+   |     li ZERO, 0
+   |   mr L, CRET1
+-  |     stw TMP3, TMPD
+-  |     lus TMP0, 0x4338              // Hiword of 2^52 + 2^51 (double)
++  |     .FPU stw TMP3, TMPD
++  |     .FPU lus TMP0, 0x4338         // Hiword of 2^52 + 2^51 (double)
+   |  lwz LFUNC:RB, FRAME_FUNC(BASE)
+-  |     ori TMP3, TMP3, 0x0004                // TONUM = 2^52 + 2^51 + 2^31 (float).
+-  |     stw TMP0, TONUM_HI
++  |     .FPU ori TMP3, TMP3, 0x0004   // TONUM = 2^52 + 2^51 + 2^31 (float).
++  |     .FPU stw TMP0, TONUM_HI
+   |     li TISNIL, LJ_TNIL
+   |    li_vmstate INTERP
+-  |     lfs TOBIT, TMPD
+-  |     stw TMP3, TMPD
++  |     .FPU lfs TOBIT, TMPD
++  |     .FPU stw TMP3, TMPD
+   |  sub RC, RC, BASE
+   |    st_vmstate
+-  |     lfs TONUM, TMPD
++  |     .FPU lfs TONUM, TMPD
+   |  ins_callt
+   |.endif
+   |
+@@ -2836,7 +3248,7 @@ static void build_subroutines(BuildCtx *
+   |  mr CARG2, RA
+   |  bl extern lj_ccallback_leave     // (CTState *cts, TValue *o)
+   |  lwz CRET1, CTSTATE->cb.gpr[0]
+-  |  lfd FARG1, CTSTATE->cb.fpr[0]
++  |  .FPU lfd FARG1, CTSTATE->cb.fpr[0]
+   |  lwz CRET2, CTSTATE->cb.gpr[1]
+   |  b ->vm_leave_unw
+   |.endif
+@@ -2870,14 +3282,14 @@ static void build_subroutines(BuildCtx *
+   |  bge <1
+   |2:
+   |  bney cr1, >3
+-  |  lfd f1, CCSTATE->fpr[0]
+-  |  lfd f2, CCSTATE->fpr[1]
+-  |  lfd f3, CCSTATE->fpr[2]
+-  |  lfd f4, CCSTATE->fpr[3]
+-  |  lfd f5, CCSTATE->fpr[4]
+-  |  lfd f6, CCSTATE->fpr[5]
+-  |  lfd f7, CCSTATE->fpr[6]
+-  |  lfd f8, CCSTATE->fpr[7]
++  |  .FPU lfd f1, CCSTATE->fpr[0]
++  |  .FPU lfd f2, CCSTATE->fpr[1]
++  |  .FPU lfd f3, CCSTATE->fpr[2]
++  |  .FPU lfd f4, CCSTATE->fpr[3]
++  |  .FPU lfd f5, CCSTATE->fpr[4]
++  |  .FPU lfd f6, CCSTATE->fpr[5]
++  |  .FPU lfd f7, CCSTATE->fpr[6]
++  |  .FPU lfd f8, CCSTATE->fpr[7]
+   |3:
+   |   lp TMP0, CCSTATE->func
+   |  lwz CARG2, CCSTATE->gpr[1]
+@@ -2894,7 +3306,7 @@ static void build_subroutines(BuildCtx *
+   |  lwz TMP2, -4(r14)
+   |   lwz TMP0, 4(r14)
+   |  stw CARG1, CCSTATE:TMP1->gpr[0]
+-  |  stfd FARG1, CCSTATE:TMP1->fpr[0]
++  |  .FPU stfd FARG1, CCSTATE:TMP1->fpr[0]
+   |  stw CARG2, CCSTATE:TMP1->gpr[1]
+   |   mtlr TMP0
+   |  stw CARG3, CCSTATE:TMP1->gpr[2]
+@@ -2923,19 +3335,19 @@ static void build_ins(BuildCtx *ctx, BCO
+   case BC_ISLT: case BC_ISGE: case BC_ISLE: case BC_ISGT:
+     |  // RA = src1*8, RD = src2*8, JMP with RD = target
+     |.if DUALNUM
+-    |  lwzux TMP0, RA, BASE
++    |  lwzux CARG1, RA, BASE
+     |    addi PC, PC, 4
+     |   lwz CARG2, 4(RA)
+-    |  lwzux TMP1, RD, BASE
++    |  lwzux CARG3, RD, BASE
+     |    lwz TMP2, -4(PC)
+-    |  checknum cr0, TMP0
+-    |   lwz CARG3, 4(RD)
++    |  checknum cr0, CARG1
++    |   lwz CARG4, 4(RD)
+     |    decode_RD4 TMP2, TMP2
+-    |  checknum cr1, TMP1
+-    |    addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)
++    |  checknum cr1, CARG3
++    |    addis SAVE0, TMP2, -(BCBIAS_J*4 >> 16)
+     |  bne cr0, >7
+     |  bne cr1, >8
+-    |   cmpw CARG2, CARG3
++    |   cmpw CARG2, CARG4
+     if (op == BC_ISLT) {
+       |  bge >2
+     } else if (op == BC_ISGE) {
+@@ -2946,28 +3358,41 @@ static void build_ins(BuildCtx *ctx, BCO
+       |  ble >2
+     }
+     |1:
+-    |  add PC, PC, TMP2
++    |  add PC, PC, SAVE0
+     |2:
+     |  ins_next
+     |
+     |7:  // RA is not an integer.
+     |  bgt cr0, ->vmeta_comp
+     |  // RA is a number.
+-    |   lfd f0, 0(RA)
++    |   .FPU lfd f0, 0(RA)
+     |  bgt cr1, ->vmeta_comp
+     |  blt cr1, >4
+     |  // RA is a number, RD is an integer.
+-    |  tonum_i f1, CARG3
++    |.if FPU
++    |  tonum_i f1, CARG4
++    |.else
++    |  bl ->vm_sfi2d_2
++    |.endif
+     |  b >5
+     |
+     |8: // RA is an integer, RD is not an integer.
+     |  bgt cr1, ->vmeta_comp
+     |  // RA is an integer, RD is a number.
++    |.if FPU
+     |  tonum_i f0, CARG2
++    |.else
++    |  bl ->vm_sfi2d_1
++    |.endif
+     |4:
+-    |  lfd f1, 0(RD)
++    |  .FPU lfd f1, 0(RD)
+     |5:
++    |.if FPU
+     |  fcmpu cr0, f0, f1
++    |.else
++    |  blex __ledf2
++    |  cmpwi CRET1, 0
++    |.endif
+     if (op == BC_ISLT) {
+       |  bge <2
+     } else if (op == BC_ISGE) {
+@@ -3015,42 +3440,42 @@ static void build_ins(BuildCtx *ctx, BCO
+     vk = op == BC_ISEQV;
+     |  // RA = src1*8, RD = src2*8, JMP with RD = target
+     |.if DUALNUM
+-    |  lwzux TMP0, RA, BASE
++    |  lwzux CARG1, RA, BASE
+     |    addi PC, PC, 4
+     |   lwz CARG2, 4(RA)
+-    |  lwzux TMP1, RD, BASE
+-    |  checknum cr0, TMP0
+-    |    lwz TMP2, -4(PC)
+-    |  checknum cr1, TMP1
+-    |    decode_RD4 TMP2, TMP2
+-    |   lwz CARG3, 4(RD)
++    |  lwzux CARG3, RD, BASE
++    |  checknum cr0, CARG1
++    |    lwz SAVE0, -4(PC)
++    |  checknum cr1, CARG3
++    |    decode_RD4 SAVE0, SAVE0
++    |   lwz CARG4, 4(RD)
+     |  cror 4*cr7+gt, 4*cr0+gt, 4*cr1+gt
+-    |    addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)
++    |    addis SAVE0, SAVE0, -(BCBIAS_J*4 >> 16)
+     if (vk) {
+       |  ble cr7, ->BC_ISEQN_Z
+     } else {
+       |  ble cr7, ->BC_ISNEN_Z
+     }
+     |.else
+-    |  lwzux TMP0, RA, BASE
+-    |   lwz TMP2, 0(PC)
++    |  lwzux CARG1, RA, BASE
++    |   lwz SAVE0, 0(PC)
+     |    lfd f0, 0(RA)
+     |   addi PC, PC, 4
+-    |  lwzux TMP1, RD, BASE
+-    |  checknum cr0, TMP0
+-    |   decode_RD4 TMP2, TMP2
++    |  lwzux CARG3, RD, BASE
++    |  checknum cr0, CARG1
++    |   decode_RD4 SAVE0, SAVE0
+     |    lfd f1, 0(RD)
+-    |  checknum cr1, TMP1
+-    |   addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)
++    |  checknum cr1, CARG3
++    |   addis SAVE0, SAVE0, -(BCBIAS_J*4 >> 16)
+     |  bge cr0, >5
+     |  bge cr1, >5
+     |  fcmpu cr0, f0, f1
+     if (vk) {
+       |  bne >1
+-      |  add PC, PC, TMP2
++      |  add PC, PC, SAVE0
+     } else {
+       |  beq >1
+-      |  add PC, PC, TMP2
++      |  add PC, PC, SAVE0
+     }
+     |1:
+     |  ins_next
+@@ -3058,36 +3483,36 @@ static void build_ins(BuildCtx *ctx, BCO
+     |5:  // Either or both types are not numbers.
+     |.if not DUALNUM
+     |    lwz CARG2, 4(RA)
+-    |    lwz CARG3, 4(RD)
++    |    lwz CARG4, 4(RD)
+     |.endif
+     |.if FFI
+-    |  cmpwi cr7, TMP0, LJ_TCDATA
+-    |  cmpwi cr5, TMP1, LJ_TCDATA
++    |  cmpwi cr7, CARG1, LJ_TCDATA
++    |  cmpwi cr5, CARG3, LJ_TCDATA
+     |.endif
+-    |   not TMP3, TMP0
+-    |  cmplw TMP0, TMP1
+-    |   cmplwi cr1, TMP3, ~LJ_TISPRI          // Primitive?
++    |   not TMP2, CARG1
++    |  cmplw CARG1, CARG3
++    |   cmplwi cr1, TMP2, ~LJ_TISPRI          // Primitive?
+     |.if FFI
+     |  cror 4*cr7+eq, 4*cr7+eq, 4*cr5+eq
+     |.endif
+-    |   cmplwi cr6, TMP3, ~LJ_TISTABUD                // Table or userdata?
++    |   cmplwi cr6, TMP2, ~LJ_TISTABUD                // Table or userdata?
+     |.if FFI
+     |  beq cr7, ->vmeta_equal_cd
+     |.endif
+-    |    cmplw cr5, CARG2, CARG3
++    |    cmplw cr5, CARG2, CARG4
+     |  crandc 4*cr0+gt, 4*cr0+eq, 4*cr1+gt    // 2: Same type and primitive.
+     |  crorc 4*cr0+lt, 4*cr5+eq, 4*cr0+eq     // 1: Same tv or different type.
+     |  crand 4*cr0+eq, 4*cr0+eq, 4*cr5+eq     // 0: Same type and same tv.
+-    |   mr SAVE0, PC
++    |   mr SAVE1, PC
+     |  cror 4*cr0+eq, 4*cr0+eq, 4*cr0+gt      // 0 or 2.
+     |  cror 4*cr0+lt, 4*cr0+lt, 4*cr0+gt      // 1 or 2.
+     if (vk) {
+       |  bne cr0, >6
+-      |  add PC, PC, TMP2
++      |  add PC, PC, SAVE0
+       |6:
+     } else {
+       |  beq cr0, >6
+-      |  add PC, PC, TMP2
++      |  add PC, PC, SAVE0
+       |6:
+     }
+     |.if DUALNUM
+@@ -3102,6 +3527,7 @@ static void build_ins(BuildCtx *ctx, BCO
+     |
+     |  // Different tables or userdatas. Need to check __eq metamethod.
+     |  // Field metatable must be at same offset for GCtab and GCudata!
++    |   mr CARG3, CARG4
+     |  lwz TAB:TMP2, TAB:CARG2->metatable
+     |   li CARG4, 1-vk                        // ne = 0 or 1.
+     |  cmplwi TAB:TMP2, 0
+@@ -3109,7 +3535,7 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  lbz TMP2, TAB:TMP2->nomm
+     |  andix. TMP2, TMP2, 1<<MM_eq
+     |  bne <1                         // Or 'no __eq' flag set?
+-    |  mr PC, SAVE0                   // Restore old PC.
++    |  mr PC, SAVE1                   // Restore old PC.
+     |  b ->vmeta_equal                        // Handle __eq metamethod.
+     break;
+@@ -3150,16 +3576,16 @@ static void build_ins(BuildCtx *ctx, BCO
+     vk = op == BC_ISEQN;
+     |  // RA = src*8, RD = num_const*8, JMP with RD = target
+     |.if DUALNUM
+-    |  lwzux TMP0, RA, BASE
++    |  lwzux CARG1, RA, BASE
+     |    addi PC, PC, 4
+     |   lwz CARG2, 4(RA)
+-    |  lwzux TMP1, RD, KBASE
+-    |  checknum cr0, TMP0
+-    |    lwz TMP2, -4(PC)
+-    |  checknum cr1, TMP1
+-    |    decode_RD4 TMP2, TMP2
+-    |   lwz CARG3, 4(RD)
+-    |    addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)
++    |  lwzux CARG3, RD, KBASE
++    |  checknum cr0, CARG1
++    |    lwz SAVE0, -4(PC)
++    |  checknum cr1, CARG3
++    |    decode_RD4 SAVE0, SAVE0
++    |   lwz CARG4, 4(RD)
++    |    addis SAVE0, SAVE0, -(BCBIAS_J*4 >> 16)
+     if (vk) {
+       |->BC_ISEQN_Z:
+     } else {
+@@ -3167,7 +3593,7 @@ static void build_ins(BuildCtx *ctx, BCO
+     }
+     |  bne cr0, >7
+     |  bne cr1, >8
+-    |   cmpw CARG2, CARG3
++    |   cmpw CARG2, CARG4
+     |4:
+     |.else
+     if (vk) {
+@@ -3175,20 +3601,20 @@ static void build_ins(BuildCtx *ctx, BCO
+     } else {
+       |->BC_ISNEN_Z:  // Dummy label.
+     }
+-    |  lwzx TMP0, BASE, RA
++    |  lwzx CARG1, BASE, RA
+     |    addi PC, PC, 4
+     |   lfdx f0, BASE, RA
+-    |    lwz TMP2, -4(PC)
++    |    lwz SAVE0, -4(PC)
+     |  lfdx f1, KBASE, RD
+-    |    decode_RD4 TMP2, TMP2
+-    |  checknum TMP0
+-    |    addis TMP2, TMP2, -(BCBIAS_J*4 >> 16)
++    |    decode_RD4 SAVE0, SAVE0
++    |  checknum CARG1
++    |    addis SAVE0, SAVE0, -(BCBIAS_J*4 >> 16)
+     |  bge >3
+     |  fcmpu cr0, f0, f1
+     |.endif
+     if (vk) {
+       |  bne >1
+-      |  add PC, PC, TMP2
++      |  add PC, PC, SAVE0
+       |1:
+       |.if not FFI
+       |3:
+@@ -3199,13 +3625,13 @@ static void build_ins(BuildCtx *ctx, BCO
+       |.if not FFI
+       |3:
+       |.endif
+-      |  add PC, PC, TMP2
++      |  add PC, PC, SAVE0
+       |2:
+     }
+     |  ins_next
+     |.if FFI
+     |3:
+-    |  cmpwi TMP0, LJ_TCDATA
++    |  cmpwi CARG1, LJ_TCDATA
+     |  beq ->vmeta_equal_cd
+     |  b <1
+     |.endif
+@@ -3213,18 +3639,31 @@ static void build_ins(BuildCtx *ctx, BCO
+     |7:  // RA is not an integer.
+     |  bge cr0, <3
+     |  // RA is a number.
+-    |   lfd f0, 0(RA)
++    |   .FPU lfd f0, 0(RA)
+     |  blt cr1, >1
+     |  // RA is a number, RD is an integer.
+-    |  tonum_i f1, CARG3
++    |.if FPU
++    |  tonum_i f1, CARG4
++    |.else
++    |  bl ->vm_sfi2d_2
++    |.endif
+     |  b >2
+     |
+     |8: // RA is an integer, RD is a number.
++    |.if FPU
+     |  tonum_i f0, CARG2
++    |.else
++    |  bl ->vm_sfi2d_1
++    |.endif
+     |1:
+-    |  lfd f1, 0(RD)
++    |  .FPU lfd f1, 0(RD)
+     |2:
++    |.if FPU
+     |  fcmpu cr0, f0, f1
++    |.else
++    |  blex __ledf2
++    |  cmpwi CRET1, 0
++    |.endif
+     |  b <4
+     |.endif
+     break;
+@@ -3279,7 +3718,12 @@ static void build_ins(BuildCtx *ctx, BCO
+       |  add PC, PC, TMP2
+     } else {
+       |  li TMP1, LJ_TFALSE
++      |.if FPU
+       |   lfdx f0, BASE, RD
++      |.else
++      |   lwzux CARG1, RD, BASE
++      |   lwz CARG2, 4(RD)
++      |.endif
+       |  cmplw TMP0, TMP1
+       if (op == BC_ISTC) {
+       |  bge >1
+@@ -3288,7 +3732,12 @@ static void build_ins(BuildCtx *ctx, BCO
+       }
+       |  addis PC, PC, -(BCBIAS_J*4 >> 16)
+       |  decode_RD4 TMP2, INS
++      |.if FPU
+       |   stfdx f0, BASE, RA
++      |.else
++      |   stwux CARG1, RA, BASE
++      |   stw CARG2, 4(RA)
++      |.endif
+       |  add PC, PC, TMP2
+       |1:
+     }
+@@ -3323,8 +3772,15 @@ static void build_ins(BuildCtx *ctx, BCO
+   case BC_MOV:
+     |  // RA = dst*8, RD = src*8
+     |  ins_next1
++    |.if FPU
+     |  lfdx f0, BASE, RD
+     |  stfdx f0, BASE, RA
++    |.else
++    |  lwzux TMP0, RD, BASE
++    |  lwz TMP1, 4(RD)
++    |  stwux TMP0, RA, BASE
++    |  stw TMP1, 4(RA)
++    |.endif
+     |  ins_next2
+     break;
+   case BC_NOT:
+@@ -3426,44 +3882,65 @@ static void build_ins(BuildCtx *ctx, BCO
+     ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
+     ||switch (vk) {
+     ||case 0:
+-    |   lwzx TMP1, BASE, RB
++    |   lwzx CARG1, BASE, RB
+     |   .if DUALNUM
+-    |     lwzx TMP2, KBASE, RC
++    |     lwzx CARG3, KBASE, RC
+     |   .endif
++    |   .if FPU
+     |    lfdx f14, BASE, RB
+     |    lfdx f15, KBASE, RC
++    |   .else
++    |    add TMP1, BASE, RB
++    |    add TMP2, KBASE, RC
++    |    lwz CARG2, 4(TMP1)
++    |    lwz CARG4, 4(TMP2)
++    |   .endif
+     |   .if DUALNUM
+-    |     checknum cr0, TMP1
+-    |     checknum cr1, TMP2
++    |     checknum cr0, CARG1
++    |     checknum cr1, CARG3
+     |     crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
+     |     bge ->vmeta_arith_vn
+     |   .else
+-    |     checknum TMP1; bge ->vmeta_arith_vn
++    |     checknum CARG1; bge ->vmeta_arith_vn
+     |   .endif
+     ||  break;
+     ||case 1:
+-    |   lwzx TMP1, BASE, RB
++    |   lwzx CARG1, BASE, RB
+     |   .if DUALNUM
+-    |     lwzx TMP2, KBASE, RC
++    |     lwzx CARG3, KBASE, RC
+     |   .endif
++    |   .if FPU
+     |    lfdx f15, BASE, RB
+     |    lfdx f14, KBASE, RC
++    |   .else
++    |    add TMP1, BASE, RB
++    |    add TMP2, KBASE, RC
++    |    lwz CARG2, 4(TMP1)
++    |    lwz CARG4, 4(TMP2)
++    |   .endif
+     |   .if DUALNUM
+-    |     checknum cr0, TMP1
+-    |     checknum cr1, TMP2
++    |     checknum cr0, CARG1
++    |     checknum cr1, CARG3
+     |     crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
+     |     bge ->vmeta_arith_nv
+     |   .else
+-    |     checknum TMP1; bge ->vmeta_arith_nv
++    |     checknum CARG1; bge ->vmeta_arith_nv
+     |   .endif
+     ||  break;
+     ||default:
+-    |   lwzx TMP1, BASE, RB
+-    |   lwzx TMP2, BASE, RC
++    |   lwzx CARG1, BASE, RB
++    |   lwzx CARG3, BASE, RC
++    |   .if FPU
+     |    lfdx f14, BASE, RB
+     |    lfdx f15, BASE, RC
+-    |   checknum cr0, TMP1
+-    |   checknum cr1, TMP2
++    |   .else
++    |    add TMP1, BASE, RB
++    |    add TMP2, BASE, RC
++    |    lwz CARG2, 4(TMP1)
++    |    lwz CARG4, 4(TMP2)
++    |   .endif
++    |   checknum cr0, CARG1
++    |   checknum cr1, CARG3
+     |   crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
+     |   bge ->vmeta_arith_vv
+     ||  break;
+@@ -3497,48 +3974,78 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  fsub a, b, a                   // b - floor(b/c)*c
+     |.endmacro
+     |
++    |.macro sfpmod
++    |->BC_MODVN_Z:
++    |  stw CARG1, SFSAVE_1
++    |  stw CARG2, SFSAVE_2
++    |  mr SAVE0, CARG3
++    |  mr SAVE1, CARG4
++    |  blex __divdf3
++    |  blex floor
++    |  mr CARG3, SAVE0
++    |  mr CARG4, SAVE1
++    |  blex __muldf3
++    |  mr CARG3, CRET1
++    |  mr CARG4, CRET2
++    |  lwz CARG1, SFSAVE_1
++    |  lwz CARG2, SFSAVE_2
++    |  blex __subdf3
++    |.endmacro
++    |
+     |.macro ins_arithfp, fpins
+     |  ins_arithpre
+     |.if "fpins" == "fpmod_"
+     |  b ->BC_MODVN_Z                 // Avoid 3 copies. It's slow anyway.
+-    |.else
++    |.elif FPU
+     |  fpins f0, f14, f15
+     |  ins_next1
+     |  stfdx f0, BASE, RA
+     |  ins_next2
++    |.else
++    |  blex __divdf3                  // Only soft-float div uses this macro.
++    |  ins_next1
++    |  stwux CRET1, RA, BASE
++    |  stw CRET2, 4(RA)
++    |  ins_next2
+     |.endif
+     |.endmacro
+     |
+-    |.macro ins_arithdn, intins, fpins
++    |.macro ins_arithdn, intins, fpins, fpcall
+     |  // RA = dst*8, RB = src1*8, RC = src2*8 | num_const*8
+     ||vk = ((int)op - BC_ADDVN) / (BC_ADDNV-BC_ADDVN);
+     ||switch (vk) {
+     ||case 0:
+-    |   lwzux TMP1, RB, BASE
+-    |   lwzux TMP2, RC, KBASE
+-    |    lwz CARG1, 4(RB)
+-    |   checknum cr0, TMP1
+-    |    lwz CARG2, 4(RC)
++    |   lwzux CARG1, RB, BASE
++    |   lwzux CARG3, RC, KBASE
++    |    lwz CARG2, 4(RB)
++    |   checknum cr0, CARG1
++    |    lwz CARG4, 4(RC)
++    |   checknum cr1, CARG3
+     ||  break;
+     ||case 1:
+-    |   lwzux TMP1, RB, BASE
+-    |   lwzux TMP2, RC, KBASE
+-    |    lwz CARG2, 4(RB)
+-    |   checknum cr0, TMP1
+-    |    lwz CARG1, 4(RC)
++    |   lwzux CARG3, RB, BASE
++    |   lwzux CARG1, RC, KBASE
++    |    lwz CARG4, 4(RB)
++    |   checknum cr0, CARG3
++    |    lwz CARG2, 4(RC)
++    |   checknum cr1, CARG1
+     ||  break;
+     ||default:
+-    |   lwzux TMP1, RB, BASE
+-    |   lwzux TMP2, RC, BASE
+-    |    lwz CARG1, 4(RB)
+-    |   checknum cr0, TMP1
+-    |    lwz CARG2, 4(RC)
++    |   lwzux CARG1, RB, BASE
++    |   lwzux CARG3, RC, BASE
++    |    lwz CARG2, 4(RB)
++    |   checknum cr0, CARG1
++    |    lwz CARG4, 4(RC)
++    |   checknum cr1, CARG3
+     ||  break;
+     ||}
+-    |  checknum cr1, TMP2
+     |  bne >5
+     |  bne cr1, >5
+-    |  intins CARG1, CARG1, CARG2
++    |.if "intins" == "intmod"
++    |  mr CARG1, CARG2
++    |  mr CARG2, CARG4
++    |.endif
++    |  intins CARG1, CARG2, CARG4
+     |  bso >4
+     |1:
+     |  ins_next1
+@@ -3550,29 +4057,40 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  checkov TMP0, <1                       // Ignore unrelated overflow.
+     |  ins_arithfallback b
+     |5:  // FP variant.
++    |.if FPU
+     ||if (vk == 1) {
+     |  lfd f15, 0(RB)
+-    |   crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
+     |  lfd f14, 0(RC)
+     ||} else {
+     |  lfd f14, 0(RB)
+-    |   crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
+     |  lfd f15, 0(RC)
+     ||}
++    |.endif
++    |  crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
+     |   ins_arithfallback bge
+     |.if "fpins" == "fpmod_"
+     |  b ->BC_MODVN_Z                 // Avoid 3 copies. It's slow anyway.
+     |.else
++    |.if FPU
+     |  fpins f0, f14, f15
+-    |  ins_next1
+     |  stfdx f0, BASE, RA
++    |.else
++    |.if "fpcall" == "sfpmod"
++    |  sfpmod
++    |.else
++    |  blex fpcall
++    |.endif
++    |  stwux CRET1, RA, BASE
++    |  stw CRET2, 4(RA)
++    |.endif
++    |  ins_next1
+     |  b <2
+     |.endif
+     |.endmacro
+     |
+-    |.macro ins_arith, intins, fpins
++    |.macro ins_arith, intins, fpins, fpcall
+     |.if DUALNUM
+-    |  ins_arithdn intins, fpins
++    |  ins_arithdn intins, fpins, fpcall
+     |.else
+     |  ins_arithfp fpins
+     |.endif
+@@ -3587,9 +4105,9 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  addo. TMP0, TMP0, TMP3
+     |  add y, a, b
+     |.endmacro
+-    |  ins_arith addo32., fadd
++    |  ins_arith addo32., fadd, __adddf3
+     |.else
+-    |  ins_arith addo., fadd
++    |  ins_arith addo., fadd, __adddf3
+     |.endif
+     break;
+   case BC_SUBVN: case BC_SUBNV: case BC_SUBVV:
+@@ -3601,36 +4119,48 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  subo. TMP0, TMP0, TMP3
+     |  sub y, a, b
+     |.endmacro
+-    |  ins_arith subo32., fsub
++    |  ins_arith subo32., fsub, __subdf3
+     |.else
+-    |  ins_arith subo., fsub
++    |  ins_arith subo., fsub, __subdf3
+     |.endif
+     break;
+   case BC_MULVN: case BC_MULNV: case BC_MULVV:
+-    |  ins_arith mullwo., fmul
++    |  ins_arith mullwo., fmul, __muldf3
+     break;
+   case BC_DIVVN: case BC_DIVNV: case BC_DIVVV:
+     |  ins_arithfp fdiv
+     break;
+   case BC_MODVN:
+-    |  ins_arith intmod, fpmod
++    |  ins_arith intmod, fpmod, sfpmod
+     break;
+   case BC_MODNV: case BC_MODVV:
+-    |  ins_arith intmod, fpmod_
++    |  ins_arith intmod, fpmod_, sfpmod
+     break;
+   case BC_POW:
+     |  // NYI: (partial) integer arithmetic.
+-    |  lwzx TMP1, BASE, RB
++    |  lwzx CARG1, BASE, RB
++    |  lwzx CARG3, BASE, RC
++    |.if FPU
+     |   lfdx FARG1, BASE, RB
+-    |  lwzx TMP2, BASE, RC
+     |   lfdx FARG2, BASE, RC
+-    |  checknum cr0, TMP1
+-    |  checknum cr1, TMP2
++    |.else
++    |   add TMP1, BASE, RB
++    |   add TMP2, BASE, RC
++    |   lwz CARG2, 4(TMP1)
++    |   lwz CARG4, 4(TMP2)
++    |.endif
++    |  checknum cr0, CARG1
++    |  checknum cr1, CARG3
+     |  crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
+     |  bge ->vmeta_arith_vv
+     |  blex pow
+     |  ins_next1
++    |.if FPU
+     |  stfdx FARG1, BASE, RA
++    |.else
++    |  stwux CARG1, RA, BASE
++    |  stw CARG2, 4(RA)
++    |.endif
+     |  ins_next2
+     break;
+@@ -3650,8 +4180,15 @@ static void build_ins(BuildCtx *ctx, BCO
+     |   lp BASE, L->base
+     |  bne ->vmeta_binop
+     |  ins_next1
++    |.if FPU
+     |  lfdx f0, BASE, SAVE0           // Copy result from RB to RA.
+     |  stfdx f0, BASE, RA
++    |.else
++    |  lwzux TMP0, SAVE0, BASE
++    |  lwz TMP1, 4(SAVE0)
++    |  stwux TMP0, RA, BASE
++    |  stw TMP1, 4(RA)
++    |.endif
+     |  ins_next2
+     break;
+@@ -3714,8 +4251,15 @@ static void build_ins(BuildCtx *ctx, BCO
+   case BC_KNUM:
+     |  // RA = dst*8, RD = num_const*8
+     |  ins_next1
++    |.if FPU
+     |  lfdx f0, KBASE, RD
+     |  stfdx f0, BASE, RA
++    |.else
++    |  lwzux TMP0, RD, KBASE
++    |  lwz TMP1, 4(RD)
++    |  stwux TMP0, RA, BASE
++    |  stw TMP1, 4(RA)
++    |.endif
+     |  ins_next2
+     break;
+   case BC_KPRI:
+@@ -3748,8 +4292,15 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  lwzx UPVAL:RB, LFUNC:RB, RD
+     |  ins_next1
+     |  lwz TMP1, UPVAL:RB->v
++    |.if FPU
+     |  lfd f0, 0(TMP1)
+     |  stfdx f0, BASE, RA
++    |.else
++    |  lwz TMP2, 0(TMP1)
++    |  lwz TMP3, 4(TMP1)
++    |  stwux TMP2, RA, BASE
++    |  stw TMP3, 4(RA)
++    |.endif
+     |  ins_next2
+     break;
+   case BC_USETV:
+@@ -3757,14 +4308,24 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  lwz LFUNC:RB, FRAME_FUNC(BASE)
+     |    srwi RA, RA, 1
+     |    addi RA, RA, offsetof(GCfuncL, uvptr)
++    |.if FPU
+     |   lfdux f0, RD, BASE
++    |.else
++    |   lwzux CARG1, RD, BASE
++    |   lwz CARG3, 4(RD)
++    |.endif
+     |  lwzx UPVAL:RB, LFUNC:RB, RA
+     |  lbz TMP3, UPVAL:RB->marked
+     |   lwz CARG2, UPVAL:RB->v
+     |  andix. TMP3, TMP3, LJ_GC_BLACK // isblack(uv)
+     |    lbz TMP0, UPVAL:RB->closed
+     |   lwz TMP2, 0(RD)
++    |.if FPU
+     |   stfd f0, 0(CARG2)
++    |.else
++    |   stw CARG1, 0(CARG2)
++    |   stw CARG3, 4(CARG2)
++    |.endif
+     |    cmplwi cr1, TMP0, 0
+     |   lwz TMP1, 4(RD)
+     |  cror 4*cr0+eq, 4*cr0+eq, 4*cr1+eq
+@@ -3820,11 +4381,21 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  lwz LFUNC:RB, FRAME_FUNC(BASE)
+     |   srwi RA, RA, 1
+     |   addi RA, RA, offsetof(GCfuncL, uvptr)
++    |.if FPU
+     |    lfdx f0, KBASE, RD
++    |.else
++    |    lwzux TMP2, RD, KBASE
++    |    lwz TMP3, 4(RD)
++    |.endif
+     |  lwzx UPVAL:RB, LFUNC:RB, RA
+     |  ins_next1
+     |  lwz TMP1, UPVAL:RB->v
++    |.if FPU
+     |  stfd f0, 0(TMP1)
++    |.else
++    |  stw TMP2, 0(TMP1)
++    |  stw TMP3, 4(TMP1)
++    |.endif
+     |  ins_next2
+     break;
+   case BC_USETP:
+@@ -3972,11 +4543,21 @@ static void build_ins(BuildCtx *ctx, BCO
+     |.endif
+     |  ble ->vmeta_tgetv              // Integer key and in array part?
+     |  lwzx TMP0, TMP1, TMP2
++    |.if FPU
+     |   lfdx f14, TMP1, TMP2
++    |.else
++    |   lwzux SAVE0, TMP1, TMP2
++    |   lwz SAVE1, 4(TMP1)
++    |.endif
+     |  checknil TMP0; beq >2
+     |1:
+     |  ins_next1
++    |.if FPU
+     |   stfdx f14, BASE, RA
++    |.else
++    |   stwux SAVE0, RA, BASE
++    |   stw SAVE1, 4(RA)
++    |.endif
+     |  ins_next2
+     |
+     |2:  // Check for __index if table value is nil.
+@@ -4052,12 +4633,22 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  lwz TMP1, TAB:RB->asize
+     |   lwz TMP2, TAB:RB->array
+     |  cmplw TMP0, TMP1; bge ->vmeta_tgetb
++    |.if FPU
+     |  lwzx TMP1, TMP2, RC
+     |   lfdx f0, TMP2, RC
++    |.else
++    |  lwzux TMP1, TMP2, RC
++    |   lwz TMP3, 4(TMP2)
++    |.endif
+     |  checknil TMP1; beq >5
+     |1:
+     |  ins_next1
++    |.if FPU
+     |   stfdx f0, BASE, RA
++    |.else
++    |   stwux TMP1, RA, BASE
++    |   stw TMP3, 4(RA)
++    |.endif
+     |  ins_next2
+     |
+     |5:  // Check for __index if table value is nil.
+@@ -4087,10 +4678,20 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  cmplw TMP0, CARG2
+     |   slwi TMP2, CARG2, 3
+     |  ble ->vmeta_tgetr              // In array part?
++    |.if FPU
+     |   lfdx f14, TMP1, TMP2
++    |.else
++    |   lwzux SAVE0, TMP2, TMP1
++    |   lwz SAVE1, 4(TMP2)
++    |.endif
+     |->BC_TGETR_Z:
+     |  ins_next1
++    |.if FPU
+     |   stfdx f14, BASE, RA
++    |.else
++    |   stwux SAVE0, RA, BASE
++    |   stw SAVE1, 4(RA)
++    |.endif
+     |  ins_next2
+     break;
+@@ -4131,11 +4732,22 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  ble ->vmeta_tsetv              // Integer key and in array part?
+     |   lwzx TMP2, TMP1, TMP0
+     |  lbz TMP3, TAB:RB->marked
++    |.if FPU
+     |    lfdx f14, BASE, RA
++    |.else
++    |    add SAVE1, BASE, RA
++    |    lwz SAVE0, 0(SAVE1)
++    |    lwz SAVE1, 4(SAVE1)
++    |.endif
+     |   checknil TMP2; beq >3
+     |1:
+     |  andix. TMP2, TMP3, LJ_GC_BLACK // isblack(table)
++    |.if FPU
+     |    stfdx f14, TMP1, TMP0
++    |.else
++    |    stwux SAVE0, TMP1, TMP0
++    |    stw SAVE1, 4(TMP1)
++    |.endif
+     |  bne >7
+     |2:
+     |  ins_next
+@@ -4176,7 +4788,13 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  lwz NODE:TMP2, TAB:RB->node
+     |    stb ZERO, TAB:RB->nomm               // Clear metamethod cache.
+     |  and TMP1, TMP1, TMP0           // idx = str->hash & tab->hmask
++    |.if FPU
+     |    lfdx f14, BASE, RA
++    |.else
++    |    add CARG2, BASE, RA
++    |    lwz SAVE0, 0(CARG2)
++    |    lwz SAVE1, 4(CARG2)
++    |.endif
+     |  slwi TMP0, TMP1, 5
+     |  slwi TMP1, TMP1, 3
+     |  sub TMP1, TMP0, TMP1
+@@ -4192,7 +4810,12 @@ static void build_ins(BuildCtx *ctx, BCO
+     |    checknil CARG2; beq >4               // Key found, but nil value?
+     |2:
+     |  andix. TMP0, TMP3, LJ_GC_BLACK // isblack(table)
++    |.if FPU
+     |    stfd f14, NODE:TMP2->val
++    |.else
++    |    stw SAVE0, NODE:TMP2->val.u32.hi
++    |    stw SAVE1, NODE:TMP2->val.u32.lo
++    |.endif
+     |  bne >7
+     |3:
+     |  ins_next
+@@ -4231,7 +4854,12 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  bl extern lj_tab_newkey                // (lua_State *L, GCtab *t, TValue *k)
+     |  // Returns TValue *.
+     |  lp BASE, L->base
++    |.if FPU
+     |  stfd f14, 0(CRET1)
++    |.else
++    |  stw SAVE0, 0(CRET1)
++    |  stw SAVE1, 4(CRET1)
++    |.endif
+     |  b <3                           // No 2nd write barrier needed.
+     |
+     |7:  // Possible table write barrier for the value. Skip valiswhite check.
+@@ -4248,13 +4876,24 @@ static void build_ins(BuildCtx *ctx, BCO
+     |   lwz TMP2, TAB:RB->array
+     |    lbz TMP3, TAB:RB->marked
+     |  cmplw TMP0, TMP1
++    |.if FPU
+     |   lfdx f14, BASE, RA
++    |.else
++    |   add CARG2, BASE, RA
++    |   lwz SAVE0, 0(CARG2)
++    |   lwz SAVE1, 4(CARG2)
++    |.endif
+     |  bge ->vmeta_tsetb
+     |  lwzx TMP1, TMP2, RC
+     |  checknil TMP1; beq >5
+     |1:
+     |  andix. TMP0, TMP3, LJ_GC_BLACK // isblack(table)
++    |.if FPU
+     |   stfdx f14, TMP2, RC
++    |.else
++    |   stwux SAVE0, RC, TMP2
++    |   stw SAVE1, 4(RC)
++    |.endif
+     |  bne >7
+     |2:
+     |  ins_next
+@@ -4294,10 +4933,20 @@ static void build_ins(BuildCtx *ctx, BCO
+     |2:
+     |  cmplw TMP0, CARG3
+     |   slwi TMP2, CARG3, 3
++    |.if FPU
+     |   lfdx f14, BASE, RA
++    |.else
++    |  lwzux SAVE0, RA, BASE
++    |  lwz SAVE1, 4(RA)
++    |.endif
+     |  ble ->vmeta_tsetr              // In array part?
+     |  ins_next1
++    |.if FPU
+     |   stfdx f14, TMP1, TMP2
++    |.else
++    |   stwux SAVE0, TMP1, TMP2
++    |   stw SAVE1, 4(TMP1)
++    |.endif
+     |  ins_next2
+     |
+     |7:  // Possible table write barrier for the value. Skip valiswhite check.
+@@ -4327,10 +4976,20 @@ static void build_ins(BuildCtx *ctx, BCO
+     |   add TMP1, TMP1, TMP0
+     |    andix. TMP0, TMP3, LJ_GC_BLACK       // isblack(table)
+     |3:  // Copy result slots to table.
++    |.if FPU
+     |   lfd f0, 0(RA)
++    |.else
++    |   lwz SAVE0, 0(RA)
++    |   lwz SAVE1, 4(RA)
++    |.endif
+     |  addi RA, RA, 8
+     |  cmpw cr1, RA, TMP2
++    |.if FPU
+     |   stfd f0, 0(TMP1)
++    |.else
++    |   stw SAVE0, 0(TMP1)
++    |   stw SAVE1, 4(TMP1)
++    |.endif
+     |    addi TMP1, TMP1, 8
+     |  blt cr1, <3
+     |  bne >7
+@@ -4397,9 +5056,20 @@ static void build_ins(BuildCtx *ctx, BCO
+     |    beq cr1, >3
+     |2:
+     |  addi TMP3, TMP2, 8
++    |.if FPU
+     |   lfdx f0, RA, TMP2
++    |.else
++    |   add CARG3, RA, TMP2
++    |   lwz CARG1, 0(CARG3)
++    |   lwz CARG2, 4(CARG3)
++    |.endif
+     |  cmplw cr1, TMP3, NARGS8:RC
++    |.if FPU
+     |   stfdx f0, BASE, TMP2
++    |.else
++    |   stwux CARG1, TMP2, BASE
++    |   stw CARG2, 4(TMP2)
++    |.endif
+     |  mr TMP2, TMP3
+     |  bne cr1, <2
+     |3:
+@@ -4432,14 +5102,28 @@ static void build_ins(BuildCtx *ctx, BCO
+     |  add BASE, BASE, RA
+     |  lwz TMP1, -24(BASE)
+     |   lwz LFUNC:RB, -20(BASE)
++    |.if FPU
+     |    lfd f1, -8(BASE)
+     |    lfd f0, -16(BASE)
++    |.else
++    |    lwz CARG1, -8(BASE)
++    |    lwz CARG2, -4(BASE)
++    |    lwz CARG3, -16(BASE)
++    |    lwz CARG4, -12(BASE)
++    |.endif
+     |  stw TMP1, 0(BASE)              // Copy callable.
+     |   stw LFUNC:RB, 4(BASE)
+     |  checkfunc TMP1
+-    |    stfd f1, 16(BASE)            // Copy control var.
+     |     li NARGS8:RC, 16            // Iterators get 2 arguments.
++    |.if FPU
++    |    stfd f1, 16(BASE)            // Copy control var.
+     |    stfdu f0, 8(BASE)            // Copy state.
++    |.else
++    |    stw CARG1, 16(BASE)          // Copy control var.
++    |    stw CARG2, 20(BASE)
++    |    stwu CARG3, 8(BASE)          // Copy state.
++    |    stw CARG4, 4(BASE)
++    |.endif
+     |  bne ->vmeta_call
+     |  ins_call
+     break;
+@@ -4460,7 +5144,12 @@ static void build_ins(BuildCtx *ctx, BCO
+     |   slwi TMP3, RC, 3
+     |  bge >5                         // Index points after array part?
+     |  lwzx TMP2, TMP1, TMP3
++    |.if FPU
+     |   lfdx f0, TMP1, TMP3
++    |.else
++    |   lwzux CARG1, TMP3, TMP1
++    |   lwz CARG2, 4(TMP3)
++    |.endif
+     |  checknil TMP2
+     |     lwz INS, -4(PC)
+     |  beq >4
+@@ -4472,7 +5161,12 @@ static void build_ins(BuildCtx *ctx, BCO
+     |.endif
+     |    addi RC, RC, 1
+     |     addis TMP3, PC, -(BCBIAS_J*4 >> 16)
++    |.if FPU
+     |  stfd f0, 8(RA)
++    |.else
++    |  stw CARG1, 8(RA)
++    |  stw CARG2, 12(RA)
++    |.endif
+     |     decode_RD4 TMP1, INS
+     |    stw RC, -4(RA)                       // Update control var.
+     |     add PC, TMP1, TMP3
+@@ -4497,17 +5191,38 @@ static void build_ins(BuildCtx *ctx, BCO
+     |   slwi RB, RC, 3
+     |   sub TMP3, TMP3, RB
+     |  lwzx RB, TMP2, TMP3
++    |.if FPU
+     |  lfdx f0, TMP2, TMP3
++    |.else
++    |  add CARG3, TMP2, TMP3
++    |  lwz CARG1, 0(CARG3)
++    |  lwz CARG2, 4(CARG3)
++    |.endif
+     |   add NODE:TMP3, TMP2, TMP3
+     |  checknil RB
+     |     lwz INS, -4(PC)
+     |  beq >7
++    |.if FPU
+     |   lfd f1, NODE:TMP3->key
++    |.else
++    |   lwz CARG3, NODE:TMP3->key.u32.hi
++    |   lwz CARG4, NODE:TMP3->key.u32.lo
++    |.endif
+     |     addis TMP2, PC, -(BCBIAS_J*4 >> 16)
++    |.if FPU
+     |  stfd f0, 8(RA)
++    |.else
++    |  stw CARG1, 8(RA)
++    |  stw CARG2, 12(RA)
++    |.endif
+     |    add RC, RC, TMP0
+     |     decode_RD4 TMP1, INS
++    |.if FPU
+     |   stfd f1, 0(RA)
++    |.else
++    |   stw CARG3, 0(RA)
++    |   stw CARG4, 4(RA)
++    |.endif
+     |    addi RC, RC, 1
+     |     add PC, TMP1, TMP2
+     |    stw RC, -4(RA)                       // Update control var.
+@@ -4573,9 +5288,19 @@ static void build_ins(BuildCtx *ctx, BCO
+     |   subi TMP2, TMP2, 16
+     |   ble >2                                // No vararg slots?
+     |1:  // Copy vararg slots to destination slots.
++    |.if FPU
+     |  lfd f0, 0(RC)
++    |.else
++    |  lwz CARG1, 0(RC)
++    |  lwz CARG2, 4(RC)
++    |.endif
+     |   addi RC, RC, 8
++    |.if FPU
+     |  stfd f0, 0(RA)
++    |.else
++    |  stw CARG1, 0(RA)
++    |  stw CARG2, 4(RA)
++    |.endif
+     |  cmplw RA, TMP2
+     |   cmplw cr1, RC, TMP3
+     |  bge >3                         // All destination slots filled?
+@@ -4598,9 +5323,19 @@ static void build_ins(BuildCtx *ctx, BCO
+     |   addi MULTRES, TMP1, 8
+     |  bgt >7
+     |6:
++    |.if FPU
+     |  lfd f0, 0(RC)
++    |.else
++    |  lwz CARG1, 0(RC)
++    |  lwz CARG2, 4(RC)
++    |.endif
+     |   addi RC, RC, 8
++    |.if FPU
+     |  stfd f0, 0(RA)
++    |.else
++    |  stw CARG1, 0(RA)
++    |  stw CARG2, 4(RA)
++    |.endif
+     |  cmplw RC, TMP3
+     |   addi RA, RA, 8
+     |  blt <6                         // More vararg slots?
+@@ -4651,14 +5386,38 @@ static void build_ins(BuildCtx *ctx, BCO
+     |   li TMP1, 0
+     |2:
+     |  addi TMP3, TMP1, 8
++    |.if FPU
+     |   lfdx f0, RA, TMP1
++    |.else
++    |   add CARG3, RA, TMP1
++    |   lwz CARG1, 0(CARG3)
++    |   lwz CARG2, 4(CARG3)
++    |.endif
+     |  cmpw TMP3, RC
++    |.if FPU
+     |   stfdx f0, TMP2, TMP1
++    |.else
++    |   add CARG3, TMP2, TMP1
++    |   stw CARG1, 0(CARG3)
++    |   stw CARG2, 4(CARG3)
++    |.endif
+     |  beq >3
+     |  addi TMP1, TMP3, 8
++    |.if FPU
+     |   lfdx f1, RA, TMP3
++    |.else
++    |   add CARG3, RA, TMP3
++    |   lwz CARG1, 0(CARG3)
++    |   lwz CARG2, 4(CARG3)
++    |.endif
+     |  cmpw TMP1, RC
++    |.if FPU
+     |   stfdx f1, TMP2, TMP3
++    |.else
++    |   add CARG3, TMP2, TMP3
++    |   stw CARG1, 0(CARG3)
++    |   stw CARG2, 4(CARG3)
++    |.endif
+     |  bne <2
+     |3:
+     |5:
+@@ -4700,8 +5459,15 @@ static void build_ins(BuildCtx *ctx, BCO
+     |   subi TMP2, BASE, 8
+     |  decode_RB8 RB, INS
+     if (op == BC_RET1) {
++      |.if FPU
+       |  lfd f0, 0(RA)
+       |  stfd f0, 0(TMP2)
++      |.else
++      |  lwz CARG1, 0(RA)
++      |  lwz CARG2, 4(RA)
++      |  stw CARG1, 0(TMP2)
++      |  stw CARG2, 4(TMP2)
++      |.endif
+     }
+     |5:
+     |  cmplw RB, RD
+@@ -4762,11 +5528,11 @@ static void build_ins(BuildCtx *ctx, BCO
+       |4:
+       |  stw CARG1, FORL_IDX*8+4(RA)
+     } else {
+-      |  lwz TMP3, FORL_STEP*8(RA)
++      |  lwz SAVE0, FORL_STEP*8(RA)
+       |   lwz CARG3, FORL_STEP*8+4(RA)
+       |  lwz TMP2, FORL_STOP*8(RA)
+       |   lwz CARG2, FORL_STOP*8+4(RA)
+-      |  cmplw cr7, TMP3, TISNUM
++      |  cmplw cr7, SAVE0, TISNUM
+       |  cmplw cr1, TMP2, TISNUM
+       |  crand 4*cr0+eq, 4*cr0+eq, 4*cr7+eq
+       |  crand 4*cr0+eq, 4*cr0+eq, 4*cr1+eq
+@@ -4809,41 +5575,80 @@ static void build_ins(BuildCtx *ctx, BCO
+     if (vk) {
+       |.if DUALNUM
+       |9:  // FP loop.
++      |.if FPU
+       |  lfd f1, FORL_IDX*8(RA)
+       |.else
++      |  lwz CARG1, FORL_IDX*8(RA)
++      |  lwz CARG2, FORL_IDX*8+4(RA)
++      |.endif
++      |.else
+       |  lfdux f1, RA, BASE
+       |.endif
++      |.if FPU
+       |  lfd f3, FORL_STEP*8(RA)
+       |  lfd f2, FORL_STOP*8(RA)
+-      |   lwz TMP3, FORL_STEP*8(RA)
+       |  fadd f1, f1, f3
+       |  stfd f1, FORL_IDX*8(RA)
++      |.else
++      |  lwz CARG3, FORL_STEP*8(RA)
++      |  lwz CARG4, FORL_STEP*8+4(RA)
++      |  mr SAVE1, RD
++      |  blex __adddf3
++      |  mr RD, SAVE1
++      |  stw CRET1, FORL_IDX*8(RA)
++      |  stw CRET2, FORL_IDX*8+4(RA)
++      |  lwz CARG3, FORL_STOP*8(RA)
++      |  lwz CARG4, FORL_STOP*8+4(RA)
++      |.endif
++      |   lwz SAVE0, FORL_STEP*8(RA)
+     } else {
+       |.if DUALNUM
+       |9:  // FP loop.
+       |.else
+       |  lwzux TMP1, RA, BASE
+-      |  lwz TMP3, FORL_STEP*8(RA)
++      |  lwz SAVE0, FORL_STEP*8(RA)
+       |  lwz TMP2, FORL_STOP*8(RA)
+       |  cmplw cr0, TMP1, TISNUM
+-      |  cmplw cr7, TMP3, TISNUM
++      |  cmplw cr7, SAVE0, TISNUM
+       |  cmplw cr1, TMP2, TISNUM
+       |.endif
++      |.if FPU
+       |   lfd f1, FORL_IDX*8(RA)
++      |.else
++      |   lwz CARG1, FORL_IDX*8(RA)
++      |   lwz CARG2, FORL_IDX*8+4(RA)
++      |.endif
+       |  crand 4*cr0+lt, 4*cr0+lt, 4*cr7+lt
+       |  crand 4*cr0+lt, 4*cr0+lt, 4*cr1+lt
++      |.if FPU
+       |   lfd f2, FORL_STOP*8(RA)
++      |.else
++      |   lwz CARG3, FORL_STOP*8(RA)
++      |   lwz CARG4, FORL_STOP*8+4(RA)
++      |.endif
+       |  bge ->vmeta_for
+     }
+-    |  cmpwi cr6, TMP3, 0
++    |  cmpwi cr6, SAVE0, 0
+     if (op != BC_JFORL) {
+       |  srwi RD, RD, 1
+     }
++    |.if FPU
+     |   stfd f1, FORL_EXT*8(RA)
++    |.else
++    |   stw CARG1, FORL_EXT*8(RA)
++    |   stw CARG2, FORL_EXT*8+4(RA)
++    |.endif
+     if (op != BC_JFORL) {
+       |  add RD, PC, RD
+     }
++    |.if FPU
+     |  fcmpu cr0, f1, f2
++    |.else
++    |  mr SAVE1, RD
++    |  blex __ledf2
++    |  cmpwi CRET1, 0
++    |  mr RD, SAVE1
++    |.endif
+     if (op == BC_JFORI) {
+       |  addis PC, RD, -(BCBIAS_J*4 >> 16)
+     }
diff --git a/lang/luajit/patches/050-ppc-softfloat.patch b/lang/luajit/patches/050-ppc-softfloat.patch
new file mode 100644 (file)
index 0000000..68215bb
--- /dev/null
@@ -0,0 +1,744 @@
+From 71b7bc88341945f13f3951e2bb5fd247b639ff7a Mon Sep 17 00:00:00 2001
+From: Mike Pall <mike>
+Date: Sun, 3 Sep 2017 23:20:53 +0200
+Subject: [PATCH] PPC: Add soft-float support to JIT compiler backend.
+
+Contributed by Djordje Kovacevic and Stefan Pejic from RT-RK.com.
+Sponsored by Cisco Systems, Inc.
+---
+ src/lj_arch.h    |   1 -
+ src/lj_asm_ppc.h | 321 ++++++++++++++++++++++++++++++++++++++++-------
+ 2 files changed, 278 insertions(+), 44 deletions(-)
+
+--- a/src/lj_arch.h
++++ b/src/lj_arch.h
+@@ -273,7 +273,6 @@
+ #endif
+ #if LJ_ABI_SOFTFP
+-#define LJ_ARCH_NOJIT         1  /* NYI */
+ #define LJ_ARCH_NUMMODE               LJ_NUMMODE_DUAL
+ #else
+ #define LJ_ARCH_NUMMODE               LJ_NUMMODE_DUAL_SINGLE
+--- a/src/lj_asm_ppc.h
++++ b/src/lj_asm_ppc.h
+@@ -226,6 +226,7 @@ static void asm_fusexrefx(ASMState *as,
+   emit_tab(as, pi, rt, left, right);
+ }
++#if !LJ_SOFTFP
+ /* Fuse to multiply-add/sub instruction. */
+ static int asm_fusemadd(ASMState *as, IRIns *ir, PPCIns pi, PPCIns pir)
+ {
+@@ -245,6 +246,7 @@ static int asm_fusemadd(ASMState *as, IR
+   }
+   return 0;
+ }
++#endif
+ /* -- Calls --------------------------------------------------------------- */
+@@ -253,13 +255,17 @@ static void asm_gencall(ASMState *as, co
+ {
+   uint32_t n, nargs = CCI_XNARGS(ci);
+   int32_t ofs = 8;
+-  Reg gpr = REGARG_FIRSTGPR, fpr = REGARG_FIRSTFPR;
++  Reg gpr = REGARG_FIRSTGPR;
++#if !LJ_SOFTFP
++  Reg fpr = REGARG_FIRSTFPR;
++#endif
+   if ((void *)ci->func)
+     emit_call(as, (void *)ci->func);
+   for (n = 0; n < nargs; n++) {  /* Setup args. */
+     IRRef ref = args[n];
+     if (ref) {
+       IRIns *ir = IR(ref);
++#if !LJ_SOFTFP
+       if (irt_isfp(ir->t)) {
+       if (fpr <= REGARG_LASTFPR) {
+         lua_assert(rset_test(as->freeset, fpr));  /* Already evicted. */
+@@ -271,7 +277,9 @@ static void asm_gencall(ASMState *as, co
+         emit_spstore(as, ir, r, ofs);
+         ofs += irt_isnum(ir->t) ? 8 : 4;
+       }
+-      } else {
++      } else
++#endif
++      {
+       if (gpr <= REGARG_LASTGPR) {
+         lua_assert(rset_test(as->freeset, gpr));  /* Already evicted. */
+         ra_leftov(as, gpr, ref);
+@@ -290,8 +298,10 @@ static void asm_gencall(ASMState *as, co
+     }
+     checkmclim(as);
+   }
++#if !LJ_SOFTFP
+   if ((ci->flags & CCI_VARARG))  /* Vararg calls need to know about FPR use. */
+     emit_tab(as, fpr == REGARG_FIRSTFPR ? PPCI_CRXOR : PPCI_CREQV, 6, 6, 6);
++#endif
+ }
+ /* Setup result reg/sp for call. Evict scratch regs. */
+@@ -299,8 +309,10 @@ static void asm_setupresult(ASMState *as
+ {
+   RegSet drop = RSET_SCRATCH;
+   int hiop = ((ir+1)->o == IR_HIOP && !irt_isnil((ir+1)->t));
++#if !LJ_SOFTFP
+   if ((ci->flags & CCI_NOFPRCLOBBER))
+     drop &= ~RSET_FPR;
++#endif
+   if (ra_hasreg(ir->r))
+     rset_clear(drop, ir->r);  /* Dest reg handled below. */
+   if (hiop && ra_hasreg((ir+1)->r))
+@@ -308,7 +320,7 @@ static void asm_setupresult(ASMState *as
+   ra_evictset(as, drop);  /* Evictions must be performed first. */
+   if (ra_used(ir)) {
+     lua_assert(!irt_ispri(ir->t));
+-    if (irt_isfp(ir->t)) {
++    if (!LJ_SOFTFP && irt_isfp(ir->t)) {
+       if ((ci->flags & CCI_CASTU64)) {
+       /* Use spill slot or temp slots. */
+       int32_t ofs = ir->s ? sps_scale(ir->s) : SPOFS_TMP;
+@@ -377,6 +389,7 @@ static void asm_retf(ASMState *as, IRIns
+ /* -- Type conversions ---------------------------------------------------- */
++#if !LJ_SOFTFP
+ static void asm_tointg(ASMState *as, IRIns *ir, Reg left)
+ {
+   RegSet allow = RSET_FPR;
+@@ -409,15 +422,23 @@ static void asm_tobit(ASMState *as, IRIn
+   emit_fai(as, PPCI_STFD, tmp, RID_SP, SPOFS_TMP);
+   emit_fab(as, PPCI_FADD, tmp, left, right);
+ }
++#endif
+ static void asm_conv(ASMState *as, IRIns *ir)
+ {
+   IRType st = (IRType)(ir->op2 & IRCONV_SRCMASK);
++#if !LJ_SOFTFP
+   int stfp = (st == IRT_NUM || st == IRT_FLOAT);
++#endif
+   IRRef lref = ir->op1;
+-  lua_assert(irt_type(ir->t) != st);
+   lua_assert(!(irt_isint64(ir->t) ||
+              (st == IRT_I64 || st == IRT_U64))); /* Handled by SPLIT. */
++#if LJ_SOFTFP
++  /* FP conversions are handled by SPLIT. */
++  lua_assert(!irt_isfp(ir->t) && !(st == IRT_NUM || st == IRT_FLOAT));
++  /* Can't check for same types: SPLIT uses CONV int.int + BXOR for sfp NEG. */
++#else
++  lua_assert(irt_type(ir->t) != st);
+   if (irt_isfp(ir->t)) {
+     Reg dest = ra_dest(as, ir, RSET_FPR);
+     if (stfp) {  /* FP to FP conversion. */
+@@ -476,7 +497,9 @@ static void asm_conv(ASMState *as, IRIns
+       emit_fb(as, PPCI_FCTIWZ, tmp, left);
+       }
+     }
+-  } else {
++  } else
++#endif
++  {
+     Reg dest = ra_dest(as, ir, RSET_GPR);
+     if (st >= IRT_I8 && st <= IRT_U16) {  /* Extend to 32 bit integer. */
+       Reg left = ra_alloc1(as, ir->op1, RSET_GPR);
+@@ -496,17 +519,41 @@ static void asm_strto(ASMState *as, IRIn
+ {
+   const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_strscan_num];
+   IRRef args[2];
+-  int32_t ofs;
++  int32_t ofs = SPOFS_TMP;
++#if LJ_SOFTFP
++  ra_evictset(as, RSET_SCRATCH);
++  if (ra_used(ir)) {
++    if (ra_hasspill(ir->s) && ra_hasspill((ir+1)->s) &&
++      (ir->s & 1) == LJ_BE && (ir->s ^ 1) == (ir+1)->s) {
++      int i;
++      for (i = 0; i < 2; i++) {
++      Reg r = (ir+i)->r;
++      if (ra_hasreg(r)) {
++        ra_free(as, r);
++        ra_modified(as, r);
++        emit_spload(as, ir+i, r, sps_scale((ir+i)->s));
++      }
++      }
++      ofs = sps_scale(ir->s & ~1);
++    } else {
++      Reg rhi = ra_dest(as, ir+1, RSET_GPR);
++      Reg rlo = ra_dest(as, ir, rset_exclude(RSET_GPR, rhi));
++      emit_tai(as, PPCI_LWZ, rhi, RID_SP, ofs);
++      emit_tai(as, PPCI_LWZ, rlo, RID_SP, ofs+4);
++    }
++  }
++#else
+   RegSet drop = RSET_SCRATCH;
+   if (ra_hasreg(ir->r)) rset_set(drop, ir->r);  /* Spill dest reg (if any). */
+   ra_evictset(as, drop);
++  if (ir->s) ofs = sps_scale(ir->s);
++#endif
+   asm_guardcc(as, CC_EQ);
+   emit_ai(as, PPCI_CMPWI, RID_RET, 0);  /* Test return status. */
+   args[0] = ir->op1;      /* GCstr *str */
+   args[1] = ASMREF_TMP1;  /* TValue *n  */
+   asm_gencall(as, ci, args);
+   /* Store the result to the spill slot or temp slots. */
+-  ofs = ir->s ? sps_scale(ir->s) : SPOFS_TMP;
+   emit_tai(as, PPCI_ADDI, ra_releasetmp(as, ASMREF_TMP1), RID_SP, ofs);
+ }
+@@ -530,7 +577,10 @@ static void asm_tvptr(ASMState *as, Reg
+       Reg src = ra_alloc1(as, ref, allow);
+       emit_setgl(as, src, tmptv.gcr);
+     }
+-    type = ra_allock(as, irt_toitype(ir->t), allow);
++    if (LJ_SOFTFP && (ir+1)->o == IR_HIOP)
++      type = ra_alloc1(as, ref+1, allow);
++    else
++      type = ra_allock(as, irt_toitype(ir->t), allow);
+     emit_setgl(as, type, tmptv.it);
+   }
+ }
+@@ -574,11 +624,27 @@ static void asm_href(ASMState *as, IRIns
+   Reg tisnum = RID_NONE, tmpnum = RID_NONE;
+   IRRef refkey = ir->op2;
+   IRIns *irkey = IR(refkey);
++  int isk = irref_isk(refkey);
+   IRType1 kt = irkey->t;
+   uint32_t khash;
+   MCLabel l_end, l_loop, l_next;
+   rset_clear(allow, tab);
++#if LJ_SOFTFP
++  if (!isk) {
++    key = ra_alloc1(as, refkey, allow);
++    rset_clear(allow, key);
++    if (irkey[1].o == IR_HIOP) {
++      if (ra_hasreg((irkey+1)->r)) {
++      tmpnum = (irkey+1)->r;
++      ra_noweak(as, tmpnum);
++      } else {
++      tmpnum = ra_allocref(as, refkey+1, allow);
++      }
++      rset_clear(allow, tmpnum);
++    }
++  }
++#else
+   if (irt_isnum(kt)) {
+     key = ra_alloc1(as, refkey, RSET_FPR);
+     tmpnum = ra_scratch(as, rset_exclude(RSET_FPR, key));
+@@ -588,6 +654,7 @@ static void asm_href(ASMState *as, IRIns
+     key = ra_alloc1(as, refkey, allow);
+     rset_clear(allow, key);
+   }
++#endif
+   tmp2 = ra_scratch(as, allow);
+   rset_clear(allow, tmp2);
+@@ -610,7 +677,7 @@ static void asm_href(ASMState *as, IRIns
+     asm_guardcc(as, CC_EQ);
+   else
+     emit_condbranch(as, PPCI_BC|PPCF_Y, CC_EQ, l_end);
+-  if (irt_isnum(kt)) {
++  if (!LJ_SOFTFP && irt_isnum(kt)) {
+     emit_fab(as, PPCI_FCMPU, 0, tmpnum, key);
+     emit_condbranch(as, PPCI_BC, CC_GE, l_next);
+     emit_ab(as, PPCI_CMPLW, tmp1, tisnum);
+@@ -620,7 +687,10 @@ static void asm_href(ASMState *as, IRIns
+       emit_ab(as, PPCI_CMPW, tmp2, key);
+       emit_condbranch(as, PPCI_BC, CC_NE, l_next);
+     }
+-    emit_ai(as, PPCI_CMPWI, tmp1, irt_toitype(irkey->t));
++    if (LJ_SOFTFP && ra_hasreg(tmpnum))
++      emit_ab(as, PPCI_CMPW, tmp1, tmpnum);
++    else
++      emit_ai(as, PPCI_CMPWI, tmp1, irt_toitype(irkey->t));
+     if (!irt_ispri(kt))
+       emit_tai(as, PPCI_LWZ, tmp2, dest, (int32_t)offsetof(Node, key.gcr));
+   }
+@@ -629,19 +699,19 @@ static void asm_href(ASMState *as, IRIns
+           (((char *)as->mcp-(char *)l_loop) & 0xffffu);
+   /* Load main position relative to tab->node into dest. */
+-  khash = irref_isk(refkey) ? ir_khash(irkey) : 1;
++  khash = isk ? ir_khash(irkey) : 1;
+   if (khash == 0) {
+     emit_tai(as, PPCI_LWZ, dest, tab, (int32_t)offsetof(GCtab, node));
+   } else {
+     Reg tmphash = tmp1;
+-    if (irref_isk(refkey))
++    if (isk)
+       tmphash = ra_allock(as, khash, allow);
+     emit_tab(as, PPCI_ADD, dest, dest, tmp1);
+     emit_tai(as, PPCI_MULLI, tmp1, tmp1, sizeof(Node));
+     emit_asb(as, PPCI_AND, tmp1, tmp2, tmphash);
+     emit_tai(as, PPCI_LWZ, dest, tab, (int32_t)offsetof(GCtab, node));
+     emit_tai(as, PPCI_LWZ, tmp2, tab, (int32_t)offsetof(GCtab, hmask));
+-    if (irref_isk(refkey)) {
++    if (isk) {
+       /* Nothing to do. */
+     } else if (irt_isstr(kt)) {
+       emit_tai(as, PPCI_LWZ, tmp1, key, (int32_t)offsetof(GCstr, hash));
+@@ -651,13 +721,19 @@ static void asm_href(ASMState *as, IRIns
+       emit_asb(as, PPCI_XOR, tmp1, tmp1, tmp2);
+       emit_rotlwi(as, tmp1, tmp1, (HASH_ROT2+HASH_ROT1)&31);
+       emit_tab(as, PPCI_SUBF, tmp2, dest, tmp2);
+-      if (irt_isnum(kt)) {
++      if (LJ_SOFTFP ? (irkey[1].o == IR_HIOP) : irt_isnum(kt)) {
++#if LJ_SOFTFP
++      emit_asb(as, PPCI_XOR, tmp2, key, tmp1);
++      emit_rotlwi(as, dest, tmp1, HASH_ROT1);
++      emit_tab(as, PPCI_ADD, tmp1, tmpnum, tmpnum);
++#else
+       int32_t ofs = ra_spill(as, irkey);
+       emit_asb(as, PPCI_XOR, tmp2, tmp2, tmp1);
+       emit_rotlwi(as, dest, tmp1, HASH_ROT1);
+       emit_tab(as, PPCI_ADD, tmp1, tmp1, tmp1);
+       emit_tai(as, PPCI_LWZ, tmp2, RID_SP, ofs+4);
+       emit_tai(as, PPCI_LWZ, tmp1, RID_SP, ofs);
++#endif
+       } else {
+       emit_asb(as, PPCI_XOR, tmp2, key, tmp1);
+       emit_rotlwi(as, dest, tmp1, HASH_ROT1);
+@@ -784,8 +860,8 @@ static PPCIns asm_fxloadins(IRIns *ir)
+   case IRT_U8: return PPCI_LBZ;
+   case IRT_I16: return PPCI_LHA;
+   case IRT_U16: return PPCI_LHZ;
+-  case IRT_NUM: return PPCI_LFD;
+-  case IRT_FLOAT: return PPCI_LFS;
++  case IRT_NUM: lua_assert(!LJ_SOFTFP); return PPCI_LFD;
++  case IRT_FLOAT: if (!LJ_SOFTFP) return PPCI_LFS;
+   default: return PPCI_LWZ;
+   }
+ }
+@@ -795,8 +871,8 @@ static PPCIns asm_fxstoreins(IRIns *ir)
+   switch (irt_type(ir->t)) {
+   case IRT_I8: case IRT_U8: return PPCI_STB;
+   case IRT_I16: case IRT_U16: return PPCI_STH;
+-  case IRT_NUM: return PPCI_STFD;
+-  case IRT_FLOAT: return PPCI_STFS;
++  case IRT_NUM: lua_assert(!LJ_SOFTFP); return PPCI_STFD;
++  case IRT_FLOAT: if (!LJ_SOFTFP) return PPCI_STFS;
+   default: return PPCI_STW;
+   }
+ }
+@@ -839,7 +915,8 @@ static void asm_fstore(ASMState *as, IRI
+ static void asm_xload(ASMState *as, IRIns *ir)
+ {
+-  Reg dest = ra_dest(as, ir, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR);
++  Reg dest = ra_dest(as, ir,
++    (!LJ_SOFTFP && irt_isfp(ir->t)) ? RSET_FPR : RSET_GPR);
+   lua_assert(!(ir->op2 & IRXLOAD_UNALIGNED));
+   if (irt_isi8(ir->t))
+     emit_as(as, PPCI_EXTSB, dest, dest);
+@@ -857,7 +934,8 @@ static void asm_xstore_(ASMState *as, IR
+     Reg src = ra_alloc1(as, irb->op1, RSET_GPR);
+     asm_fusexrefx(as, PPCI_STWBRX, src, ir->op1, rset_exclude(RSET_GPR, src));
+   } else {
+-    Reg src = ra_alloc1(as, ir->op2, irt_isfp(ir->t) ? RSET_FPR : RSET_GPR);
++    Reg src = ra_alloc1(as, ir->op2,
++      (!LJ_SOFTFP && irt_isfp(ir->t)) ? RSET_FPR : RSET_GPR);
+     asm_fusexref(as, asm_fxstoreins(ir), src, ir->op1,
+                rset_exclude(RSET_GPR, src), ofs);
+   }
+@@ -871,10 +949,19 @@ static void asm_ahuvload(ASMState *as, I
+   Reg dest = RID_NONE, type = RID_TMP, tmp = RID_TMP, idx;
+   RegSet allow = RSET_GPR;
+   int32_t ofs = AHUREF_LSX;
++  if (LJ_SOFTFP && (ir+1)->o == IR_HIOP) {
++    t.irt = IRT_NUM;
++    if (ra_used(ir+1)) {
++      type = ra_dest(as, ir+1, allow);
++      rset_clear(allow, type);
++    }
++    ofs = 0;
++  }
+   if (ra_used(ir)) {
+-    lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t));
+-    if (!irt_isnum(t)) ofs = 0;
+-    dest = ra_dest(as, ir, irt_isnum(t) ? RSET_FPR : RSET_GPR);
++    lua_assert((LJ_SOFTFP ? 0 : irt_isnum(ir->t)) ||
++             irt_isint(ir->t) || irt_isaddr(ir->t));
++    if (LJ_SOFTFP || !irt_isnum(t)) ofs = 0;
++    dest = ra_dest(as, ir, (!LJ_SOFTFP && irt_isnum(t)) ? RSET_FPR : allow);
+     rset_clear(allow, dest);
+   }
+   idx = asm_fuseahuref(as, ir->op1, &ofs, allow);
+@@ -883,12 +970,13 @@ static void asm_ahuvload(ASMState *as, I
+     asm_guardcc(as, CC_GE);
+     emit_ab(as, PPCI_CMPLW, type, tisnum);
+     if (ra_hasreg(dest)) {
+-      if (ofs == AHUREF_LSX) {
++      if (!LJ_SOFTFP && ofs == AHUREF_LSX) {
+       tmp = ra_scratch(as, rset_exclude(rset_exclude(RSET_GPR,
+                                                      (idx&255)), (idx>>8)));
+       emit_fab(as, PPCI_LFDX, dest, (idx&255), tmp);
+       } else {
+-      emit_fai(as, PPCI_LFD, dest, idx, ofs);
++      emit_fai(as, LJ_SOFTFP ? PPCI_LWZ : PPCI_LFD, dest, idx,
++               ofs+4*LJ_SOFTFP);
+       }
+     }
+   } else {
+@@ -911,7 +999,7 @@ static void asm_ahustore(ASMState *as, I
+   int32_t ofs = AHUREF_LSX;
+   if (ir->r == RID_SINK)
+     return;
+-  if (irt_isnum(ir->t)) {
++  if (!LJ_SOFTFP && irt_isnum(ir->t)) {
+     src = ra_alloc1(as, ir->op2, RSET_FPR);
+   } else {
+     if (!irt_ispri(ir->t)) {
+@@ -919,11 +1007,14 @@ static void asm_ahustore(ASMState *as, I
+       rset_clear(allow, src);
+       ofs = 0;
+     }
+-    type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow);
++    if (LJ_SOFTFP && (ir+1)->o == IR_HIOP)
++      type = ra_alloc1(as, (ir+1)->op2, allow);
++    else
++      type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow);
+     rset_clear(allow, type);
+   }
+   idx = asm_fuseahuref(as, ir->op1, &ofs, allow);
+-  if (irt_isnum(ir->t)) {
++  if (!LJ_SOFTFP && irt_isnum(ir->t)) {
+     if (ofs == AHUREF_LSX) {
+       emit_fab(as, PPCI_STFDX, src, (idx&255), RID_TMP);
+       emit_slwi(as, RID_TMP, (idx>>8), 3);
+@@ -948,21 +1039,33 @@ static void asm_sload(ASMState *as, IRIn
+   IRType1 t = ir->t;
+   Reg dest = RID_NONE, type = RID_NONE, base;
+   RegSet allow = RSET_GPR;
++  int hiop = (LJ_SOFTFP && (ir+1)->o == IR_HIOP);
++  if (hiop)
++    t.irt = IRT_NUM;
+   lua_assert(!(ir->op2 & IRSLOAD_PARENT));  /* Handled by asm_head_side(). */
+-  lua_assert(irt_isguard(t) || !(ir->op2 & IRSLOAD_TYPECHECK));
++  lua_assert(irt_isguard(ir->t) || !(ir->op2 & IRSLOAD_TYPECHECK));
+   lua_assert(LJ_DUALNUM ||
+            !irt_isint(t) || (ir->op2 & (IRSLOAD_CONVERT|IRSLOAD_FRAME)));
++#if LJ_SOFTFP
++  lua_assert(!(ir->op2 & IRSLOAD_CONVERT));  /* Handled by LJ_SOFTFP SPLIT. */
++  if (hiop && ra_used(ir+1)) {
++    type = ra_dest(as, ir+1, allow);
++    rset_clear(allow, type);
++  }
++#else
+   if ((ir->op2 & IRSLOAD_CONVERT) && irt_isguard(t) && irt_isint(t)) {
+     dest = ra_scratch(as, RSET_FPR);
+     asm_tointg(as, ir, dest);
+     t.irt = IRT_NUM;  /* Continue with a regular number type check. */
+-  } else if (ra_used(ir)) {
++  } else
++#endif
++  if (ra_used(ir)) {
+     lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t));
+-    dest = ra_dest(as, ir, irt_isnum(t) ? RSET_FPR : RSET_GPR);
++    dest = ra_dest(as, ir, (!LJ_SOFTFP && irt_isnum(t)) ? RSET_FPR : allow);
+     rset_clear(allow, dest);
+     base = ra_alloc1(as, REF_BASE, allow);
+     rset_clear(allow, base);
+-    if ((ir->op2 & IRSLOAD_CONVERT)) {
++    if (!LJ_SOFTFP && (ir->op2 & IRSLOAD_CONVERT)) {
+       if (irt_isint(t)) {
+       emit_tai(as, PPCI_LWZ, dest, RID_SP, SPOFS_TMPLO);
+       dest = ra_scratch(as, RSET_FPR);
+@@ -994,10 +1097,13 @@ dotypecheck:
+     if ((ir->op2 & IRSLOAD_TYPECHECK)) {
+       Reg tisnum = ra_allock(as, (int32_t)LJ_TISNUM, allow);
+       asm_guardcc(as, CC_GE);
+-      emit_ab(as, PPCI_CMPLW, RID_TMP, tisnum);
++#if !LJ_SOFTFP
+       type = RID_TMP;
++#endif
++      emit_ab(as, PPCI_CMPLW, type, tisnum);
+     }
+-    if (ra_hasreg(dest)) emit_fai(as, PPCI_LFD, dest, base, ofs-4);
++    if (ra_hasreg(dest)) emit_fai(as, LJ_SOFTFP ? PPCI_LWZ : PPCI_LFD, dest,
++                                base, ofs-(LJ_SOFTFP?0:4));
+   } else {
+     if ((ir->op2 & IRSLOAD_TYPECHECK)) {
+       asm_guardcc(as, CC_NE);
+@@ -1119,6 +1225,7 @@ static void asm_obar(ASMState *as, IRIns
+ /* -- Arithmetic and logic operations ------------------------------------- */
++#if !LJ_SOFTFP
+ static void asm_fparith(ASMState *as, IRIns *ir, PPCIns pi)
+ {
+   Reg dest = ra_dest(as, ir, RSET_FPR);
+@@ -1146,13 +1253,17 @@ static void asm_fpmath(ASMState *as, IRI
+   else
+     asm_callid(as, ir, IRCALL_lj_vm_floor + ir->op2);
+ }
++#endif
+ static void asm_add(ASMState *as, IRIns *ir)
+ {
++#if !LJ_SOFTFP
+   if (irt_isnum(ir->t)) {
+     if (!asm_fusemadd(as, ir, PPCI_FMADD, PPCI_FMADD))
+       asm_fparith(as, ir, PPCI_FADD);
+-  } else {
++  } else
++#endif
++  {
+     Reg dest = ra_dest(as, ir, RSET_GPR);
+     Reg right, left = ra_hintalloc(as, ir->op1, dest, RSET_GPR);
+     PPCIns pi;
+@@ -1191,10 +1302,13 @@ static void asm_add(ASMState *as, IRIns
+ static void asm_sub(ASMState *as, IRIns *ir)
+ {
++#if !LJ_SOFTFP
+   if (irt_isnum(ir->t)) {
+     if (!asm_fusemadd(as, ir, PPCI_FMSUB, PPCI_FNMSUB))
+       asm_fparith(as, ir, PPCI_FSUB);
+-  } else {
++  } else
++#endif
++  {
+     PPCIns pi = PPCI_SUBF;
+     Reg dest = ra_dest(as, ir, RSET_GPR);
+     Reg left, right;
+@@ -1220,9 +1334,12 @@ static void asm_sub(ASMState *as, IRIns
+ static void asm_mul(ASMState *as, IRIns *ir)
+ {
++#if !LJ_SOFTFP
+   if (irt_isnum(ir->t)) {
+     asm_fparith(as, ir, PPCI_FMUL);
+-  } else {
++  } else
++#endif
++  {
+     PPCIns pi = PPCI_MULLW;
+     Reg dest = ra_dest(as, ir, RSET_GPR);
+     Reg right, left = ra_hintalloc(as, ir->op1, dest, RSET_GPR);
+@@ -1250,9 +1367,12 @@ static void asm_mul(ASMState *as, IRIns
+ static void asm_neg(ASMState *as, IRIns *ir)
+ {
++#if !LJ_SOFTFP
+   if (irt_isnum(ir->t)) {
+     asm_fpunary(as, ir, PPCI_FNEG);
+-  } else {
++  } else
++#endif
++  {
+     Reg dest, left;
+     PPCIns pi = PPCI_NEG;
+     if (as->flagmcp == as->mcp) {
+@@ -1563,9 +1683,40 @@ static void asm_bitshift(ASMState *as, I
+                      PPCI_RLWINM|PPCF_MB(0)|PPCF_ME(31))
+ #define asm_bror(as, ir)      lua_assert(0)
++#if LJ_SOFTFP
++static void asm_sfpmin_max(ASMState *as, IRIns *ir)
++{
++  CCallInfo ci = lj_ir_callinfo[IRCALL_softfp_cmp];
++  IRRef args[4];
++  MCLabel l_right, l_end;
++  Reg desthi = ra_dest(as, ir, RSET_GPR), destlo = ra_dest(as, ir+1, RSET_GPR);
++  Reg righthi, lefthi = ra_alloc2(as, ir, RSET_GPR);
++  Reg rightlo, leftlo = ra_alloc2(as, ir+1, RSET_GPR);
++  PPCCC cond = (IROp)ir->o == IR_MIN ? CC_EQ : CC_NE;
++  righthi = (lefthi >> 8); lefthi &= 255;
++  rightlo = (leftlo >> 8); leftlo &= 255;
++  args[0^LJ_BE] = ir->op1; args[1^LJ_BE] = (ir+1)->op1;
++  args[2^LJ_BE] = ir->op2; args[3^LJ_BE] = (ir+1)->op2;
++  l_end = emit_label(as);
++  if (desthi != righthi) emit_mr(as, desthi, righthi);
++  if (destlo != rightlo) emit_mr(as, destlo, rightlo);
++  l_right = emit_label(as);
++  if (l_end != l_right) emit_jmp(as, l_end);
++  if (desthi != lefthi) emit_mr(as, desthi, lefthi);
++  if (destlo != leftlo) emit_mr(as, destlo, leftlo);
++  if (l_right == as->mcp+1) {
++    cond ^= 4; l_right = l_end; ++as->mcp;
++  }
++  emit_condbranch(as, PPCI_BC, cond, l_right);
++  ra_evictset(as, RSET_SCRATCH);
++  emit_cmpi(as, RID_RET, 1);
++  asm_gencall(as, &ci, args);
++}
++#endif
++
+ static void asm_min_max(ASMState *as, IRIns *ir, int ismax)
+ {
+-  if (irt_isnum(ir->t)) {
++  if (!LJ_SOFTFP && irt_isnum(ir->t)) {
+     Reg dest = ra_dest(as, ir, RSET_FPR);
+     Reg tmp = dest;
+     Reg right, left = ra_alloc2(as, ir, RSET_FPR);
+@@ -1653,7 +1804,7 @@ static void asm_intcomp_(ASMState *as, I
+ static void asm_comp(ASMState *as, IRIns *ir)
+ {
+   PPCCC cc = asm_compmap[ir->o];
+-  if (irt_isnum(ir->t)) {
++  if (!LJ_SOFTFP && irt_isnum(ir->t)) {
+     Reg right, left = ra_alloc2(as, ir, RSET_FPR);
+     right = (left >> 8); left &= 255;
+     asm_guardcc(as, (cc >> 4));
+@@ -1674,6 +1825,44 @@ static void asm_comp(ASMState *as, IRIns
+ #define asm_equal(as, ir)     asm_comp(as, ir)
++#if LJ_SOFTFP
++/* SFP comparisons. */
++static void asm_sfpcomp(ASMState *as, IRIns *ir)
++{
++  const CCallInfo *ci = &lj_ir_callinfo[IRCALL_softfp_cmp];
++  RegSet drop = RSET_SCRATCH;
++  Reg r;
++  IRRef args[4];
++  args[0^LJ_BE] = ir->op1; args[1^LJ_BE] = (ir+1)->op1;
++  args[2^LJ_BE] = ir->op2; args[3^LJ_BE] = (ir+1)->op2;
++
++  for (r = REGARG_FIRSTGPR; r <= REGARG_FIRSTGPR+3; r++) {
++    if (!rset_test(as->freeset, r) &&
++      regcost_ref(as->cost[r]) == args[r-REGARG_FIRSTGPR])
++      rset_clear(drop, r);
++  }
++  ra_evictset(as, drop);
++  asm_setupresult(as, ir, ci);
++  switch ((IROp)ir->o) {
++  case IR_ULT:
++    asm_guardcc(as, CC_EQ);
++    emit_ai(as, PPCI_CMPWI, RID_RET, 0);
++  case IR_ULE:
++    asm_guardcc(as, CC_EQ);
++    emit_ai(as, PPCI_CMPWI, RID_RET, 1);
++    break;
++  case IR_GE: case IR_GT:
++    asm_guardcc(as, CC_EQ);
++    emit_ai(as, PPCI_CMPWI, RID_RET, 2);
++  default:
++    asm_guardcc(as, (asm_compmap[ir->o] & 0xf));
++    emit_ai(as, PPCI_CMPWI, RID_RET, 0);
++    break;
++  }
++  asm_gencall(as, ci, args);
++}
++#endif
++
+ #if LJ_HASFFI
+ /* 64 bit integer comparisons. */
+ static void asm_comp64(ASMState *as, IRIns *ir)
+@@ -1703,19 +1892,36 @@ static void asm_comp64(ASMState *as, IRI
+ /* Hiword op of a split 64 bit op. Previous op must be the loword op. */
+ static void asm_hiop(ASMState *as, IRIns *ir)
+ {
+-#if LJ_HASFFI
++#if LJ_HASFFI || LJ_SOFTFP
+   /* HIOP is marked as a store because it needs its own DCE logic. */
+   int uselo = ra_used(ir-1), usehi = ra_used(ir);  /* Loword/hiword used? */
+   if (LJ_UNLIKELY(!(as->flags & JIT_F_OPT_DCE))) uselo = usehi = 1;
+   if ((ir-1)->o == IR_CONV) {  /* Conversions to/from 64 bit. */
+     as->curins--;  /* Always skip the CONV. */
++#if LJ_HASFFI && !LJ_SOFTFP
+     if (usehi || uselo)
+       asm_conv64(as, ir);
+     return;
++#endif
+   } else if ((ir-1)->o <= IR_NE) {  /* 64 bit integer comparisons. ORDER IR. */
+     as->curins--;  /* Always skip the loword comparison. */
++#if LJ_SOFTFP
++    if (!irt_isint(ir->t)) {
++      asm_sfpcomp(as, ir-1);
++      return;
++    }
++#endif
++#if LJ_HASFFI
+     asm_comp64(as, ir);
++#endif
++    return;
++#if LJ_SOFTFP
++  } else if ((ir-1)->o == IR_MIN || (ir-1)->o == IR_MAX) {
++      as->curins--;  /* Always skip the loword min/max. */
++    if (uselo || usehi)
++      asm_sfpmin_max(as, ir-1);
+     return;
++#endif
+   } else if ((ir-1)->o == IR_XSTORE) {
+     as->curins--;  /* Handle both stores here. */
+     if ((ir-1)->r != RID_SINK) {
+@@ -1726,14 +1932,27 @@ static void asm_hiop(ASMState *as, IRIns
+   }
+   if (!usehi) return;  /* Skip unused hiword op for all remaining ops. */
+   switch ((ir-1)->o) {
++#if LJ_HASFFI
+   case IR_ADD: as->curins--; asm_add64(as, ir); break;
+   case IR_SUB: as->curins--; asm_sub64(as, ir); break;
+   case IR_NEG: as->curins--; asm_neg64(as, ir); break;
++#endif
++#if LJ_SOFTFP
++  case IR_SLOAD: case IR_ALOAD: case IR_HLOAD: case IR_ULOAD: case IR_VLOAD:
++  case IR_STRTO:
++    if (!uselo)
++      ra_allocref(as, ir->op1, RSET_GPR);  /* Mark lo op as used. */
++    break;
++#endif
+   case IR_CALLN:
++  case IR_CALLS:
+   case IR_CALLXS:
+     if (!uselo)
+       ra_allocref(as, ir->op1, RID2RSET(RID_RETLO));  /* Mark lo op as used. */
+     break;
++#if LJ_SOFTFP
++  case IR_ASTORE: case IR_HSTORE: case IR_USTORE: case IR_TOSTR:
++#endif
+   case IR_CNEWI:
+     /* Nothing to do here. Handled by lo op itself. */
+     break;
+@@ -1797,8 +2016,19 @@ static void asm_stack_restore(ASMState *
+     if ((sn & SNAP_NORESTORE))
+       continue;
+     if (irt_isnum(ir->t)) {
++#if LJ_SOFTFP
++      Reg tmp;
++      RegSet allow = rset_exclude(RSET_GPR, RID_BASE);
++      lua_assert(irref_isk(ref));  /* LJ_SOFTFP: must be a number constant. */
++      tmp = ra_allock(as, (int32_t)ir_knum(ir)->u32.lo, allow);
++      emit_tai(as, PPCI_STW, tmp, RID_BASE, ofs+(LJ_BE?4:0));
++      if (rset_test(as->freeset, tmp+1)) allow = RID2RSET(tmp+1);
++      tmp = ra_allock(as, (int32_t)ir_knum(ir)->u32.hi, allow);
++      emit_tai(as, PPCI_STW, tmp, RID_BASE, ofs+(LJ_BE?0:4));
++#else
+       Reg src = ra_alloc1(as, ref, RSET_FPR);
+       emit_fai(as, PPCI_STFD, src, RID_BASE, ofs);
++#endif
+     } else {
+       Reg type;
+       RegSet allow = rset_exclude(RSET_GPR, RID_BASE);
+@@ -1811,6 +2041,10 @@ static void asm_stack_restore(ASMState *
+       if ((sn & (SNAP_CONT|SNAP_FRAME))) {
+       if (s == 0) continue;  /* Do not overwrite link to previous frame. */
+       type = ra_allock(as, (int32_t)(*flinks--), allow);
++#if LJ_SOFTFP
++      } else if ((sn & SNAP_SOFTFPNUM)) {
++      type = ra_alloc1(as, ref+1, rset_exclude(RSET_GPR, RID_BASE));
++#endif
+       } else {
+       type = ra_allock(as, (int32_t)irt_toitype(ir->t), allow);
+       }
+@@ -1947,14 +2181,15 @@ static Reg asm_setup_call_slots(ASMState
+   int nslots = 2, ngpr = REGARG_NUMGPR, nfpr = REGARG_NUMFPR;
+   asm_collectargs(as, ir, ci, args);
+   for (i = 0; i < nargs; i++)
+-    if (args[i] && irt_isfp(IR(args[i])->t)) {
++    if (!LJ_SOFTFP && args[i] && irt_isfp(IR(args[i])->t)) {
+       if (nfpr > 0) nfpr--; else nslots = (nslots+3) & ~1;
+     } else {
+       if (ngpr > 0) ngpr--; else nslots++;
+     }
+   if (nslots > as->evenspill)  /* Leave room for args in stack slots. */
+     as->evenspill = nslots;
+-  return irt_isfp(ir->t) ? REGSP_HINT(RID_FPRET) : REGSP_HINT(RID_RET);
++  return (!LJ_SOFTFP && irt_isfp(ir->t)) ? REGSP_HINT(RID_FPRET) :
++                                         REGSP_HINT(RID_RET);
+ }
+ static void asm_setup_target(ASMState *as)
diff --git a/lang/luajit/patches/060-ppc-musl.patch b/lang/luajit/patches/060-ppc-musl.patch
new file mode 100644 (file)
index 0000000..119fedd
--- /dev/null
@@ -0,0 +1,112 @@
+From 195e0be62c0aa0f6aaf63a93ee322bb0a630576c Mon Sep 17 00:00:00 2001
+From: Clint Bland <bland.cr@gmail.com>
+Date: Wed, 13 Mar 2019 19:19:16 -0700
+Subject: [PATCH] Have powerpc use fake GOT like MIPS
+
+---
+ src/lj_dispatch.c | 15 +++++++++++++++
+ src/lj_dispatch.h | 29 ++++++++++++++++++++++++++++-
+ src/vm_ppc.dasc   |  9 ++++++++-
+ 3 files changed, 51 insertions(+), 2 deletions(-)
+
+--- a/src/lj_dispatch.c
++++ b/src/lj_dispatch.c
+@@ -56,6 +56,18 @@ static const ASMFunction dispatch_got[]
+ #undef GOTFUNC
+ #endif
++#if LJ_TARGET_PPC
++#include <math.h>
++LJ_FUNCA_NORET void LJ_FASTCALL lj_ffh_coroutine_wrap_err(lua_State *L,
++                                                        lua_State *co);
++
++#define GOTFUNC(name) (ASMFunction)name,
++static const ASMFunction dispatch_got[] = {
++  GOTDEF(GOTFUNC)
++};
++#undef GOTFUNC
++#endif
++
+ /* Initialize instruction dispatch table and hot counters. */
+ void lj_dispatch_init(GG_State *GG)
+ {
+@@ -77,6 +89,9 @@ void lj_dispatch_init(GG_State *GG)
+ #if LJ_TARGET_MIPS
+   memcpy(GG->got, dispatch_got, LJ_GOT__MAX*sizeof(ASMFunction *));
+ #endif
++#if LJ_TARGET_PPC
++  memcpy(GG->got, dispatch_got, LJ_GOT__MAX*4);
++#endif
+ }
+ #if LJ_HASJIT
+--- a/src/lj_dispatch.h
++++ b/src/lj_dispatch.h
+@@ -66,6 +66,33 @@ GOTDEF(GOTENUM)
+ };
+ #endif
++#if LJ_TARGET_PPC
++/* Need our own global offset table for the dreaded MIPS calling conventions. */
++#if LJ_SOFTFP
++#ifndef _LJ_IRCALL_H
++extern double __ledf2(double a, double b);
++extern double __adddf3(double a, double b);
++extern double __subdf3(double a, double b);
++extern double __muldf3(double a, double b);
++extern double __divdf3(double a, double b);
++#endif
++#define SFGOTDEF(_)   _(__ledf2) _(__adddf3) _(__subdf3) _(__muldf3) _(__divdf3)
++#else
++#define SFGOTDEF(_)
++#endif
++#define GOTDEF(_) \
++  _(floor) _(ceil) _(trunc) _(log) _(log10) _(exp) _(sin) _(cos) _(tan) \
++  _(asin) _(acos) _(atan) _(sinh) _(cosh) _(tanh) _(frexp) _(modf) _(atan2) \
++  _(pow) _(fmod) _(ldexp) _(sqrt) SFGOTDEF(_)
++
++enum {
++#define GOTENUM(name) LJ_GOT_##name,
++GOTDEF(GOTENUM)
++#undef GOTENUM
++  LJ_GOT__MAX
++};
++#endif
++
+ /* Type of hot counter. Must match the code in the assembler VM. */
+ /* 16 bits are sufficient. Only 0.0015% overhead with maximum slot penalty. */
+ typedef uint16_t HotCount;
+@@ -89,7 +116,7 @@ typedef uint16_t HotCount;
+ typedef struct GG_State {
+   lua_State L;                                /* Main thread. */
+   global_State g;                     /* Global state. */
+-#if LJ_TARGET_MIPS
++#if LJ_TARGET_MIPS || LJ_TARGET_PPC
+   ASMFunction got[LJ_GOT__MAX];               /* Global offset table. */
+ #endif
+ #if LJ_HASJIT
+--- a/src/vm_ppc.dasc
++++ b/src/vm_ppc.dasc
+@@ -59,7 +59,12 @@
+ |.define ENV_OFS,     8
+ |.endif
+ |.else  // No TOC.
+-|.macro blex, target; bl extern target@plt; .endmacro
++|.macro blex, target
++|  lwz TMP0, DISPATCH_GOT(target)(DISPATCH)
++|  mtctr TMP0
++|  bctrl
++|  //bl extern target@plt
++|.endmacro
+ |.macro .toc, a, b; .endmacro
+ |.endif
+ |.macro .tocenv, a, b; .if TOCENV; a, b; .endif; .endmacro
+@@ -482,6 +487,8 @@
+ |// Assumes DISPATCH is relative to GL.
+ #define DISPATCH_GL(field)    (GG_DISP2G + (int)offsetof(global_State, field))
+ #define DISPATCH_J(field)     (GG_DISP2J + (int)offsetof(jit_State, field))
++#define GG_DISP2GOT           (GG_OFS(got) - GG_OFS(dispatch))
++#define DISPATCH_GOT(name)    (GG_DISP2GOT + 4*LJ_GOT_##name)
+ |
+ #define PC2PROTO(field)  ((int)offsetof(GCproto, field)-(int)sizeof(GCproto))
+ |
index 12e8afde4aa7bdbc3d1d7007e2de4503a273172e..811e07269aa14ddd3d1844f5c24e0c336ddd8a03 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=node
-PKG_VERSION:=v16.15.1
+PKG_VERSION:=v16.16.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://nodejs.org/dist/$(PKG_VERSION)
-PKG_HASH:=d4e99d3c1f69711109a67525571058e6009cddbc228e7d723b8fb4a454169b7d
+PKG_HASH:=145151eff3b2aa5ebe73384009c52271a83740ae687a93c98c628cd7d52736eb
 
 PKG_MAINTAINER:=Hirokazu MORIKAWA <morikw2@gmail.com>, Adrian Panella <ianchi74@outlook.com>
 PKG_LICENSE:=MIT
index b95e0a6f0a2bdd3f97d6ab016a35c1bb6b2a94d4..7708b975badcb2014b55ee0b4b9d7ae7b6711efe 100644 (file)
@@ -16,7 +16,6 @@ PKG_SOURCE:=Parse-Yapp-$(PKG_VERSION).tar.gz
 PKG_HASH:=3810e998308fba2e0f4f26043035032b027ce51ce5c8a52a8b8e340ca65f13e5
 
 PKG_LICENSE:=GPL-1.0-or-later Artistic-1.0-Perl
-PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
 
 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/perl/Parse-Yapp-$(PKG_VERSION)
 HOST_BUILD_DEPENDS:=perl/host
index 4c4e123003dd791bb3b0995bd6c73c4329bcda2e..ad46f9984d4b63b743f4a2cd1447727bda4610ee 100644 (file)
@@ -6,7 +6,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=php
-PKG_VERSION:=8.1.6
+PKG_VERSION:=8.1.8
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
@@ -16,7 +16,7 @@ PKG_CPE_ID:=cpe:/a:php:php
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://www.php.net/distributions/
-PKG_HASH:=da38d65bb0d5dd56f711cd478204f2b62a74a2c2b0d2d523a78d6eb865b2364c
+PKG_HASH:=04c065515bc347bc68e0bb1ac7182669a98a731e4a17727e5731650ad3d8de4c
 
 PKG_BUILD_PARALLEL:=1
 PKG_USE_MIPS16:=0
@@ -270,7 +270,13 @@ else
 endif
 
 ifneq ($(SDK)$(CONFIG_PACKAGE_php8-mod-iconv),)
-  CONFIGURE_ARGS+= --with-iconv=shared,"$(ICONV_PREFIX)"
+  ifeq ($(CONFIG_BUILD_NLS),y)
+    CONFIGURE_VARS+= iconv_impl_name="gnu_libiconv"
+    CONFIGURE_ARGS+= --with-iconv=shared,"$(ICONV_PREFIX)"
+  else
+    CONFIGURE_VARS+= ac_cv_func_iconv=yes
+    CONFIGURE_ARGS+= --with-iconv=shared
+  endif
 else
   CONFIGURE_ARGS+= --without-iconv
 endif
@@ -485,7 +491,6 @@ endif
 CONFIGURE_VARS+= \
        ac_cv_c_bigendian_php=$(if $(CONFIG_BIG_ENDIAN),yes,no) \
        php_cv_cc_rpath="no" \
-       iconv_impl_name="gnu_libiconv" \
        ac_cv_php_xml2_config_path="$(STAGING_DIR)/host/bin/xml2-config" \
        ac_cv_u8t_decompose=yes \
        ac_cv_have_pcre2_jit=no
index f0ef34b05e9fa9616a29b6fac7cc441427c86b98..714ec54ad915ace6f04a53d3376c278033003f80 100644 (file)
@@ -8,11 +8,11 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=django
-PKG_VERSION:=4.0.5
+PKG_VERSION:=4.0.6
 PKG_RELEASE:=$(AUTORELEASE)
 
 PYPI_NAME:=Django
-PKG_HASH:=f7431a5de7277966f3785557c3928433347d998c1e6459324501378a291e5aab
+PKG_HASH:=a67a793ff6827fd373555537dca0da293a63a316fe34cb7f367f898ccca3c3ae
 
 PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>, Peter Stadler <peter.stadler@student.uibk.ac.at>
 PKG_LICENSE:=BSD-3-Clause
index 770c5a63b2f0e86e218d2c4657d0e6fc7f329839..773a719aa9da434bdb2f3e143723213ae5608eff 100644 (file)
@@ -7,11 +7,11 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pillow
-PKG_VERSION:=9.1.1
+PKG_VERSION:=9.2.0
 PKG_RELEASE:=$(AUTORELEASE)
 
 PYPI_NAME:=Pillow
-PKG_HASH:=7502539939b53d7565f3d11d87c78e7ec900d3c72945d4ee0e2f250d598309a0
+PKG_HASH:=75e636fd3e0fb872693f23ccb8a5ff2cd578801251f3a4f6854c6a5d437d3c04
 
 PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
 PKG_LICENSE:=HPND
index 438c3a6511253bec00d1c6db52aae9efad0244e5..27b53b79db7bedaf4bfd6de0305a8d010c7b91ad 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=python-chardet
-PKG_VERSION:=4.0.0
-PKG_RELEASE:=1
+PKG_VERSION:=5.0.0
+PKG_RELEASE:=$(AUTORELEASE)
 PKG_LICENSE:=LGPL-2.1
 
 PYPI_NAME:=chardet
-PKG_HASH:=0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa
+PKG_HASH:=0368df2bfd78b5fc20572bb4e9bb7fb53e2c094f60ae9993339e8671d0afb8aa
 
 include ../pypi.mk
 include $(INCLUDE_DIR)/package.mk
index 7284f2a1069ce1bfa149c5dad0d12d952f23c6b3..f9805d1b381d23c9e189677a1ab9d38f720b8109 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=python-cryptography
 PKG_VERSION:=3.4.8
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PYPI_NAME:=cryptography
 PKG_HASH:=94cc5ed4ceaefcbe5bf38c8fba6a21fc1d365bb8fb826ea1688e3370b2e24a1c
index b005851cb6e4ad3731abdeb802199c2c0efe01f3..81c45a44df6eef26d9b7afb0a40e4add5cbd240f 100644 (file)
@@ -9,9 +9,12 @@
  except ImportError:
      print(
          """
-@@ -45,7 +45,7 @@ setuptools_rust = "setuptools-rust>=0.11
+@@ -43,9 +43,9 @@ with open(os.path.join(src_dir, "cryptog
+ # `pyproject.toml`
+ setuptools_rust = "setuptools-rust>=0.11.4"
  install_requirements = ["cffi>=1.12"]
- setup_requirements = install_requirements + [setuptools_rust]
+-setup_requirements = install_requirements + [setuptools_rust]
++setup_requirements = install_requirements
  
 -if os.environ.get("CRYPTOGRAPHY_DONT_BUILD_RUST"):
 +if True:
index 316bfd6c5f473b218c4dbc847a1b91daea042e99..3c8d20f040c998df4fdbf7f75566bf6d2bdfc7b2 100644 (file)
@@ -1,11 +1,11 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=python-jsonschema
-PKG_VERSION:=4.6.0
+PKG_VERSION:=4.9.0
 PKG_RELEASE:=1
 
 PYPI_NAME:=jsonschema
-PKG_HASH:=9d6397ba4a6c0bf0300736057f649e3e12ecbc07d3e81a0dacb72de4e9801957
+PKG_HASH:=df10e65c8f3687a48e93d0d348ce0ce5f897b5a28e9bbcbbe8f7c7eaf019e850
 
 PKG_MAINTAINER:=Javier Marcet <javier@marcet.info>
 PKG_LICENSE:=MIT
index 4f84e20dfe38c8e1d17c8940a47e525775cdd30b..55cf73db3af1e3b9c45ddd065bcc9f4e510af8d6 100644 (file)
@@ -8,11 +8,11 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=python-lxml
-PKG_VERSION:=4.9.0
+PKG_VERSION:=4.9.1
 PKG_RELEASE:=$(AUTORELEASE)
 
 PYPI_NAME:=lxml
-PKG_HASH:=520461c36727268a989790aef08884347cd41f2d8ae855489ccf40b50321d8d7
+PKG_HASH:=fe749b052bb7233fe5d072fcb549221a8cb1a16725c47c37e42b0b9cb3ff2c3f
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSES.txt
index 5853897beee9ab025199239178f05eaee901b1c0..9fffa277f6f54d84b396db5c49feba5a56bf1ff1 100644 (file)
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=python-requests
-PKG_VERSION:=2.26.0
-PKG_RELEASE:=1
+PKG_VERSION:=2.28.1
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_MAINTAINER:=Josef Schlehofer <josef.schlehofer@nic.cz>, Alexandru Ardelean <ardeleanalex@gmail.com>
 PKG_LICENSE:=Apache-2.0
@@ -17,7 +17,7 @@ PKG_LICENSE_FILES:=LICENSE
 PKG_CPE_ID:=cpe:/a:python-requests:requests
 
 PYPI_NAME:=requests
-PKG_HASH:=b8aa58f8cf793ffd8782d3d8cb19e66ef36f7aba4353eec859e74678b01b07a7
+PKG_HASH:=7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983
 
 include ../pypi.mk
 include $(INCLUDE_DIR)/package.mk
index 713ec5ea77db2efc4b73087cfd5fecc678aeafd4..cf205ebf005f9b5da0f5e231d031f9360a7a91e4 100644 (file)
@@ -1,11 +1,11 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=python-websocket-client
-PKG_VERSION:=1.3.2
+PKG_VERSION:=1.3.3
 PKG_RELEASE:=1
 
 PYPI_NAME:=websocket-client
-PKG_HASH:=50b21db0058f7a953d67cc0445be4b948d7fc196ecbeb8083d68d94628e4abf6
+PKG_HASH:=d58c5f284d6a9bf8379dab423259fe8f85b70d5fa5d2916d5791a84594b122b1
 
 PKG_MAINTAINER:=Javier Marcet <javier@marcet.info>
 PKG_LICENSE:=Apache-2.0
index 7fbc84aa10aa96297280cdecfcbbb8d6912a2d8d..d3b043872f32c438359a4e356b2cb5345959713c 100644 (file)
@@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk
 include ../python3-version.mk
 
 PKG_NAME:=python3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_VERSION:=$(PYTHON3_VERSION).$(PYTHON3_VERSION_MICRO)
 
 PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
@@ -327,10 +327,6 @@ HOST_MAKE_VARS += \
        USE_PYTHON_CONFIG_PY=1
 endif
 
-# FIXME: remove when removing patch '028-host-python-support-ssl-with-libressl.patch'
-HOST_CFLAGS += \
-       -DOPENWRT_HOST_BUILD
-
 HOST_CONFIGURE_ARGS+= \
        --enable-optimizations \
        --with-ensurepip=upgrade \
index 9272f36a450e1c50a0c8597599372005be7948fc..b4c15ab80a11b822ce08052693127fc321606b38 100644 (file)
@@ -1,12 +1,47 @@
 --- a/Modules/_hashopenssl.c
 +++ b/Modules/_hashopenssl.c
-@@ -48,7 +48,9 @@
+@@ -45,10 +45,12 @@
+ #define MUNCH_SIZE INT_MAX
++#if !defined(LIBRESSL_VERSION_NUMBER)
  #define PY_OPENSSL_HAS_SCRYPT 1
  #define PY_OPENSSL_HAS_SHA3 1
  #define PY_OPENSSL_HAS_SHAKE 1
-+#ifndef OPENSSL_NO_BLAKE2
  #define PY_OPENSSL_HAS_BLAKE2 1
 +#endif
  
  #if OPENSSL_VERSION_NUMBER >= 0x30000000L
  #define PY_EVP_MD EVP_MD
+@@ -119,6 +121,7 @@ static const py_hashentry_t py_hashes[]
+     PY_HASH_ENTRY(Py_hash_sha256, "SHA256", SN_sha256, NID_sha256),
+     PY_HASH_ENTRY(Py_hash_sha384, "SHA384", SN_sha384, NID_sha384),
+     PY_HASH_ENTRY(Py_hash_sha512, "SHA512", SN_sha512, NID_sha512),
++#if !defined(LIBRESSL_VERSION_NUMBER)
+     /* truncated sha2 */
+     PY_HASH_ENTRY(Py_hash_sha512_224, "SHA512_224", SN_sha512_224, NID_sha512_224),
+     PY_HASH_ENTRY(Py_hash_sha512_256, "SHA512_256", SN_sha512_256, NID_sha512_256),
+@@ -133,6 +136,7 @@ static const py_hashentry_t py_hashes[]
+     /* blake2 digest */
+     PY_HASH_ENTRY(Py_hash_blake2s, "blake2s256", SN_blake2s256, NID_blake2s256),
+     PY_HASH_ENTRY(Py_hash_blake2b, "blake2b512", SN_blake2b512, NID_blake2b512),
++#endif
+     PY_HASH_ENTRY(NULL, NULL, NULL, 0),
+ };
+@@ -873,11 +877,15 @@ py_evp_fromname(PyObject *module, const
+         goto exit;
+     }
++#if defined(LIBRESSL_VERSION_NUMBER)
++    type = get_hashlib_state(module)->EVPtype;
++#else
+     if ((EVP_MD_flags(digest) & EVP_MD_FLAG_XOF) == EVP_MD_FLAG_XOF) {
+         type = get_hashlib_state(module)->EVPXOFtype;
+     } else {
+         type = get_hashlib_state(module)->EVPtype;
+     }
++#endif
+     self = newEVPobject(type);
+     if (self == NULL) {
index a831735bdc84a748a4d4b1af5616ae9e20e66dbf..7b47c111f943d96714e291ff392559a4dc57d1b2 100644 (file)
 --- a/Modules/_ssl.c
 +++ b/Modules/_ssl.c
-@@ -67,7 +67,18 @@
+@@ -67,6 +67,12 @@
  #  error "OPENSSL_THREADS is not defined, Python requires thread-safe OpenSSL"
  #endif
  
-+#ifdef OPENWRT_HOST_BUILD
-+#undef TLS1_3_VERSION
-+static STACK_OF(X509) *SSL_get0_verified_chain(const SSL *s)
-+{
-+    return NULL;
-+}
++#ifdef LIBRESSL_VERSION_NUMBER
 +static int SSL_CTX_get_security_level(const SSL_CTX *ctx)
 +{
-+    return 0;
++    return 1;
 +}
 +#endif
  
- struct py_ssl_error_code {
-     const char *mnemonic;
-@@ -291,8 +302,10 @@ typedef struct {
-     int post_handshake_auth;
- #endif
-     PyObject *msg_cb;
-+#ifndef OPENWRT_HOST_BUILD
-     PyObject *keylog_filename;
-     BIO *keylog_bio;
-+#endif
-     /* Cached module state, also used in SSLSocket and SSLSession code. */
-     _sslmodulestate *state;
- } PySSLContext;
-@@ -2358,8 +2371,14 @@ _ssl__SSLSocket_write_impl(PySSLSocket *
-     do {
-         PySSL_BEGIN_ALLOW_THREADS
-+#ifdef OPENWRT_HOST_BUILD
-+        retval = SSL_write(self->ssl, b->buf, (int)b->len);
-+        if (retval > 0) count = retval;
-+        err = _PySSL_errno(retval <= 0, self->ssl, retval);
-+#else
-         retval = SSL_write_ex(self->ssl, b->buf, (size_t)b->len, &count);
-         err = _PySSL_errno(retval == 0, self->ssl, retval);
-+#endif
-         PySSL_END_ALLOW_THREADS
-         self->err = err;
-@@ -2510,8 +2529,14 @@ _ssl__SSLSocket_read_impl(PySSLSocket *s
  
-     do {
-         PySSL_BEGIN_ALLOW_THREADS
-+#ifdef OPENWRT_HOST_BUILD
-+        retval = SSL_read(self->ssl, mem, len);
-+        if (retval > 0) count = retval;
-+        err = _PySSL_errno(retval <= 0, self->ssl, retval);
+ struct py_ssl_error_code {
+@@ -169,7 +175,11 @@ extern const SSL_METHOD *TLSv1_2_method(
+  * Based on Hynek's excellent blog post (update 2021-02-11)
+  * https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
+  */
++#ifndef LIBRESSL_VERSION_NUMBER
+   #define PY_SSL_DEFAULT_CIPHER_STRING "@SECLEVEL=2:ECDH+AESGCM:ECDH+CHACHA20:ECDH+AES:DHE+AES:!aNULL:!eNULL:!aDSS:!SHA1:!AESCCM"
 +#else
-         retval = SSL_read_ex(self->ssl, mem, (size_t)len, &count);
-         err = _PySSL_errno(retval == 0, self->ssl, retval);
-+#endif
-         PySSL_END_ALLOW_THREADS
-         self->err = err;
-@@ -3074,8 +3099,10 @@ _ssl__SSLContext_impl(PyTypeObject *type
-     self->hostflags = X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS;
-     self->protocol = proto_version;
-     self->msg_cb = NULL;
-+#ifndef OPENWRT_HOST_BUILD
-     self->keylog_filename = NULL;
-     self->keylog_bio = NULL;
-+#endif
-     self->alpn_protocols = NULL;
-     self->set_sni_cb = NULL;
-     self->state = get_ssl_state(module);
-@@ -3199,6 +3226,7 @@ context_clear(PySSLContext *self)
- {
-     Py_CLEAR(self->set_sni_cb);
-     Py_CLEAR(self->msg_cb);
-+#ifndef OPENWRT_HOST_BUILD
-     Py_CLEAR(self->keylog_filename);
-     if (self->keylog_bio != NULL) {
-         PySSL_BEGIN_ALLOW_THREADS
-@@ -3206,6 +3234,7 @@ context_clear(PySSLContext *self)
-         PySSL_END_ALLOW_THREADS
-         self->keylog_bio = NULL;
-     }
-+#endif
-     return 0;
- }
-@@ -4615,8 +4644,10 @@ static PyGetSetDef context_getsetlist[]
-                         (setter) set_minimum_version, NULL},
-     {"maximum_version", (getter) get_maximum_version,
-                         (setter) set_maximum_version, NULL},
-+#ifndef OPENWRT_HOST_BUILD
-     {"keylog_filename", (getter) _PySSLContext_get_keylog_filename,
-                         (setter) _PySSLContext_set_keylog_filename, NULL},
-+#endif
-     {"_msg_callback", (getter) _PySSLContext_get_msg_callback,
-                       (setter) _PySSLContext_set_msg_callback, NULL},
-     {"sni_callback", (getter) get_sni_callback,
---- a/Modules/_ssl/debughelpers.c
-+++ b/Modules/_ssl/debughelpers.c
-@@ -114,6 +114,8 @@ _PySSLContext_set_msg_callback(PySSLCont
-     return 0;
- }
-+#ifndef OPENWRT_HOST_BUILD
-+
- static void
- _PySSL_keylog_callback(const SSL *ssl, const char *line)
- {
-@@ -217,3 +219,5 @@ _PySSLContext_set_keylog_filename(PySSLC
-     SSL_CTX_set_keylog_callback(self->ctx, _PySSL_keylog_callback);
-     return 0;
- }
-+
++  #define PY_SSL_DEFAULT_CIPHER_STRING "ECDH+AESGCM:ECDH+CHACHA20:ECDH+AES:DHE+AES:!aNULL:!eNULL:!aDSS:!SHA1:!AESCCM"
 +#endif
+   #ifndef PY_SSL_MIN_PROTOCOL
+     #define PY_SSL_MIN_PROTOCOL TLS1_2_VERSION
+   #endif
diff --git a/lang/ruby/patches/001-fix-build-with-libressl-3.5.patch b/lang/ruby/patches/001-fix-build-with-libressl-3.5.patch
new file mode 100644 (file)
index 0000000..4bcf921
--- /dev/null
@@ -0,0 +1,20 @@
+From e25fb0d0d86da5a9398ebdc9216b2ea89f80fa3d Mon Sep 17 00:00:00 2001
+From: Jeremy Evans <code@jeremyevans.net>
+Date: Fri, 25 Mar 2022 13:11:31 -0700
+Subject: [PATCH] Fix build with LibreSSL 3.5
+
+---
+ ext/openssl/ossl_pkey.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/ext/openssl/ossl_pkey.c
++++ b/ext/openssl/ossl_pkey.c
+@@ -670,7 +670,7 @@ ossl_pkey_export_traditional(int argc, V
+       }
+     }
+     else {
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
++#if OSSL_OPENSSL_PREREQ(1, 1, 0) || OSSL_LIBRESSL_PREREQ(3, 5, 0)
+       if (!PEM_write_bio_PrivateKey_traditional(bio, pkey, enc, NULL, 0,
+                                                 ossl_pem_passwd_cb,
+                                                 (void *)pass)) {
diff --git a/lang/ruby/patches/002-fix-operator-precedence.patch b/lang/ruby/patches/002-fix-operator-precedence.patch
new file mode 100644 (file)
index 0000000..7c8b008
--- /dev/null
@@ -0,0 +1,28 @@
+From b02815271fcc295cb8b07ef740684b88a10f2760 Mon Sep 17 00:00:00 2001
+From: Jeremy Evans <code@jeremyevans.net>
+Date: Fri, 25 Mar 2022 13:39:45 -0700
+Subject: [PATCH] Fix operator precedence in OSSL_OPENSSL_PREREQ and
+ OSSL_LIBRESSL_PREREQ
+
+---
+ ext/openssl/ossl.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/ext/openssl/ossl.h
++++ b/ext/openssl/ossl.h
+@@ -43,13 +43,13 @@
+ #ifndef LIBRESSL_VERSION_NUMBER
+ # define OSSL_IS_LIBRESSL 0
+ # define OSSL_OPENSSL_PREREQ(maj, min, pat) \
+-      (OPENSSL_VERSION_NUMBER >= (maj << 28) | (min << 20) | (pat << 12))
++      (OPENSSL_VERSION_NUMBER >= ((maj << 28) | (min << 20) | (pat << 12)))
+ # define OSSL_LIBRESSL_PREREQ(maj, min, pat) 0
+ #else
+ # define OSSL_IS_LIBRESSL 1
+ # define OSSL_OPENSSL_PREREQ(maj, min, pat) 0
+ # define OSSL_LIBRESSL_PREREQ(maj, min, pat) \
+-      (LIBRESSL_VERSION_NUMBER >= (maj << 28) | (min << 20) | (pat << 12))
++      (LIBRESSL_VERSION_NUMBER >= ((maj << 28) | (min << 20) | (pat << 12)))
+ #endif
+ #if !defined(OPENSSL_NO_ENGINE) && !OSSL_OPENSSL_PREREQ(3, 0, 0)
index fd48fb79b3b9e4e6fd527a256b683fbf2c58acc6..d2a0e9601ff58dfe1bc5f0c4b79ad1396d648601 100644 (file)
@@ -15,7 +15,7 @@ PKG_NAME:=elektra
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE.md
 PKG_VERSION:=0.9.7
-PKG_RELEASE:=1
+PKG_RELEASE:=4
 
 # Use this for official releasees
 PKG_HASH:=12b7b046004db29317b7b937dc794abf719c400ba3115af8d41849127b562681
@@ -311,8 +311,6 @@ CMAKE_OPTIONS += \
        -DKDB_DEFAULT_STORAGE=toml \
        -DENABLE_OPTIMIZATIONS=OFF \
        -DPLUGINS="ALL;-gpgme;-multifile;-simpleini" \
-       -DIconv_INCLUDE_DIR="$(ICONV_PREFIX)/include" \
-       -DIconv_LIBRARY="$(ICONV_PREFIX)/lib/libiconv.$(if $(CONFIG_BUILD_NLS),so,a)" \
        -DBINDINGS="MAINTAINED;-intercept_env;-intercept_fs;-io_glib"
 
 define Package/libelektra-core/install
diff --git a/libs/elektra/patches/010-iconv.patch b/libs/elektra/patches/010-iconv.patch
new file mode 100644 (file)
index 0000000..96d5b72
--- /dev/null
@@ -0,0 +1,121 @@
+--- a/src/plugins/filecheck/CMakeLists.txt
++++ b/src/plugins/filecheck/CMakeLists.txt
+@@ -1,20 +1,46 @@
+ include (LibAddMacros)
+-if (DEPENDENCY_PHASE)
+-      find_package (Iconv QUIET)
+-
+-      if (NOT Iconv_FOUND)
+-              remove_plugin (filecheck "Cannot find iconv library")
+-      endif ()
++find_package (Iconv QUIET)
++if (DEPENDENCY_PHASE)
+       if (ENABLE_ASAN AND CMAKE_SYSTEM_NAME MATCHES FreeBSD)
+               # See also: https://cirrus-ci.com/task/5751822404288512?command=tests#L237-L239
+               remove_plugin (filecheck "the unit test of the plugin fails on FreeBSD if ASan is active")
+       endif (ENABLE_ASAN AND CMAKE_SYSTEM_NAME MATCHES FreeBSD)
+ endif ()
+-add_plugin (
+-      filecheck
+-      SOURCES filecheck.h filecheck.c
+-      INCLUDE_DIRECTORIES ${Iconv_INCLUDE_DIRS}
+-      LINK_LIBRARIES ${Iconv_LIBRARIES}
+-      ADD_TEST INSTALL_TEST_DATA COMPONENT libelektra${SO_VERSION}-extra)
++if(Iconv_FOUND)
++      add_plugin (
++              filecheck
++              SOURCES filecheck.h filecheck.c
++              INCLUDE_DIRECTORIES ${Iconv_INCLUDE_DIRS}
++              LINK_LIBRARIES ${Iconv_LIBRARIES}
++              ADD_TEST INSTALL_TEST_DATA COMPONENT libelektra${SO_VERSION}-extra)
++else()
++      # Sometime the build environment is not setup
++      # in a way CMake can find Iconv on its own by default.
++      # But if we simply link against iconv (-liconv), the build may succeed
++      # due to other compiler/link flags.
++      set(CMAKE_REQUIRED_LIBRARIES "iconv")
++      check_c_source_compiles("
++              #include <stddef.h>
++              #include <iconv.h>
++              int main() {
++                      char *a, *b;
++                      size_t i, j;
++                      iconv_t ic;
++                      ic = iconv_open(\"to\", \"from\");
++                      iconv(ic, &a, &i, &b, &j);
++                      iconv_close(ic);
++              }
++              "
++      Iconv_EXPLICITLY_AT_ENV)
++      if(Iconv_EXPLICITLY_AT_ENV)
++              add_plugin (
++                      filecheck
++                      SOURCES filecheck.h filecheck.c
++                      LINK_LIBRARIES iconv
++                      ADD_TEST INSTALL_TEST_DATA COMPONENT libelektra${SO_VERSION}-extra)
++      else()
++                      message(FATAL_ERROR "Cannot find iconv library")
++      endif()
++endif()
+--- a/src/plugins/iconv/CMakeLists.txt
++++ b/src/plugins/iconv/CMakeLists.txt
+@@ -1,19 +1,45 @@
+-if (DEPENDENCY_PHASE)
+-      find_package (Iconv QUIET)
++find_package (Iconv QUIET)
++if (DEPENDENCY_PHASE)
+       if (ENABLE_ASAN AND CMAKE_SYSTEM_NAME MATCHES FreeBSD)
+               # See also: https://cirrus-ci.com/task/5751822404288512?command=tests#L253-L255
+               remove_plugin (iconv "the unit test of the plugin fails on FreeBSD if ASan is active")
+       endif (ENABLE_ASAN AND CMAKE_SYSTEM_NAME MATCHES FreeBSD)
+-
+-      if (NOT Iconv_FOUND)
+-              remove_plugin (iconv "Cannot find iconv library")
+-      endif ()
+ endif ()
+-add_plugin (
+-      iconv
+-      SOURCES conv.h iconv.c
+-      INCLUDE_DIRECTORIES ${Iconv_INCLUDE_DIRS}
+-      LINK_LIBRARIES ${Iconv_LIBRARIES}
+-      ADD_TEST TEST_README COMPONENT libelektra${SO_VERSION}-extra)
++if(Iconv_FOUND)
++      add_plugin (
++              iconv
++              SOURCES conv.h iconv.c
++              INCLUDE_DIRECTORIES ${Iconv_INCLUDE_DIRS}
++              LINK_LIBRARIES ${Iconv_LIBRARIES}
++              ADD_TEST TEST_README COMPONENT libelektra${SO_VERSION}-extra)
++else()
++      # Sometime the build environment is not setup
++      # in a way CMake can find Iconv on its own by default.
++      # But if we simply link against iconv (-liconv), the build may succeed
++      # due to other compiler/link flags.
++      set(CMAKE_REQUIRED_LIBRARIES "iconv")
++      check_c_source_compiles("
++              #include <stddef.h>
++              #include <iconv.h>
++              int main() {
++                      char *a, *b;
++                      size_t i, j;
++                      iconv_t ic;
++                      ic = iconv_open(\"to\", \"from\");
++                      iconv(ic, &a, &i, &b, &j);
++                      iconv_close(ic);
++              }
++              "
++      Iconv_EXPLICITLY_AT_ENV)
++      if(Iconv_EXPLICITLY_AT_ENV)
++              add_plugin (
++                      iconv
++                      SOURCES conv.h iconv.c
++                      LINK_LIBRARIES iconv
++                      ADD_TEST TEST_README COMPONENT libelektra${SO_VERSION}-extra)
++      else()
++              message(FATAL_ERROR "Cannot find iconv library")
++      endif()
++endif()
index dd6f3907e31bc865d6045c6e1c2e741415b79478..c19e3d70d3c5652fafefd753fdd11c0b772b9f35 100644 (file)
@@ -22,9 +22,9 @@ PKG_CPE_ID:=cpe:/a:gnome:glib
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/glib-$(PKG_VERSION)
 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/glib-$(PKG_VERSION)
-PKG_BUILD_DEPENDS:=libiconv/host
-HOST_BUILD_DEPENDS:=libiconv/host libffi/host pcre/host
+HOST_BUILD_DEPENDS:=libffi/host pcre/host
 PKG_CONFIG_DEPENDS:=CONFIG_BUILD_NLS
+PKG_FORTIFY_SOURCE:=0
 
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
index 1fe5915b0e3c938fb2c453f23efa636d641d9974..ae3f9c75052f12e2aa90e8becc1539578248dcbf 100644 (file)
@@ -1,28 +1,28 @@
+# SPDX-Identifier-License: GPL-2.0-only
 #
 # Copyright (C) 2005-2016 OpenWrt.org
 #
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gnutls
-PKG_VERSION:=3.7.4
+PKG_VERSION:=3.7.6
 PKG_RELEASE:=$(AUTORELEASE)
 PKG_USE_MIPS16:=0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://www.gnupg.org/ftp/gcrypt/gnutls/v3.7
-PKG_HASH:=e6adbebcfbc95867de01060d93c789938cf89cc1d1f6ef9ef661890f6217451f
-PKG_FIXUP:=autoreconf gettext-version
+PKG_HASH:=77065719a345bfb18faa250134be4c53bef70c1bd61f6c0c23ceb8b44f0262ff
+
 PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
 PKG_LICENSE:=LGPL-2.1-or-later
+PKG_LICENSE_FILES:=LICENSE
 PKG_CPE_ID:=cpe:/a:gnu:gnutls
 
-PKG_INSTALL:=1
 PKG_BUILD_DEPENDS:=gettext-full/host
 PKG_BUILD_PARALLEL:=1
+PKG_FIXUP:=autoreconf gettext-version
+PKG_INSTALL:=1
 PKG_LIBTOOL_PATHS:=. lib
 
 PKG_CONFIG_DEPENDS:= \
@@ -104,7 +104,7 @@ endef
 define Package/libgnutls-dane
 $(call Package/gnutls/Default)
   TITLE+= (libgnutls-dane library)
-  DEPENDS:= +libgnutls +libunbound
+  DEPENDS:= +libgnutls +PACKAGE_libgnutls-dane:libunbound
 endef
 
 define Package/libgnutls/description
@@ -135,8 +135,9 @@ CONFIGURE_ARGS+= \
        --with-librt-prefix="$(LIBRT_ROOT_DIR)/" \
        --with-pic \
        --with-system-priority-file="" \
-       --without-libzstd \
-       --without-zlib
+       --without-brotli \
+       --without-zlib \
+       --without-zstd
 
 ifneq ($(CONFIG_GNUTLS_EXT_LIBTASN1),y)
 CONFIGURE_ARGS += --with-included-libtasn1
index b5e2b16a6c4bf58db7bbc239d7e35e9f1c3b05f9..59261bfeffa8aeb53c284807626fceadb740cee8 100644 (file)
@@ -8,29 +8,26 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hidapi
-PKG_VERSION:=0.10.1
+PKG_VERSION:=0.12.0
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/libusb/hidapi/tar.gz/$(PKG_NAME)-$(PKG_VERSION)?
-PKG_HASH:=f71dd8a1f46979c17ee521bc2117573872bbf040f8a4750e492271fc141f2644
+PKG_HASH:=28ec1451f0527ad40c1a4c92547966ffef96813528c8b184a665f03ecbb508bc
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_NAME)-$(PKG_VERSION)
 
 PKG_MAINTAINER:=Paul Fertser <fercerpav@gmail.com>
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE-bsd.txt
 
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-PKG_BUILD_PARALLEL:=1
-
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
+include $(INCLUDE_DIR)/cmake.mk
 
 define Package/hidapi
   SECTION:=libs
   CATEGORY:=Libraries
-  DEPENDS:=+libusb-1.0 +librt +libudev $(ICONV_DEPENDS)
+  DEPENDS:=+libusb-1.0 +libudev $(ICONV_DEPENDS)
   TITLE:=Library to talk to HID devices
   URL:=https://github.com/libusb/hidapi
 endef
@@ -43,19 +40,16 @@ can be embedded directly into a target application by adding a single source
 file (per platform) and a single header.
 endef
 
-CONFIGURE_ARGS += \
-       --disable-static
-
-TARGET_LDFLAGS += -liconv
-
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include/hidapi
        $(CP) $(PKG_INSTALL_DIR)/usr/include/hidapi/hidapi.h $(1)/usr/include/hidapi/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/hidapi/hidapi_libusb.h $(1)/usr/include/hidapi/
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhidapi-hidraw.so* $(1)/usr/lib/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib//libhidapi-libusb.so* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libhidapi-libusb.so* $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/hidapi-libusb.pc $(1)/usr/lib/pkgconfig/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/hidapi-hidraw.pc $(1)/usr/lib/pkgconfig/
 endef
 
 define Package/hidapi/install
diff --git a/libs/hidapi/patches/020-iconv.patch b/libs/hidapi/patches/020-iconv.patch
new file mode 100644 (file)
index 0000000..a30d540
--- /dev/null
@@ -0,0 +1,100 @@
+From cfcddf90ea6add9d4aaa99ee2decc5a9140bdf37 Mon Sep 17 00:00:00 2001
+From: Ihor Dutchak <ihor.youw@gmail.com>
+Date: Sat, 18 Jun 2022 15:58:31 +0300
+Subject: [PATCH 1/3] Ensure Iconv is found when provided via CFLAGS/LDFLAGS
+
+- by default find_file/find_library doesn't respect CFLAGS/LDFLAGS,
+and FindIconv fails to find Iconv;
+- by explicitly trying to link against `-liconv` - we're checking if library is available in such way;
+- additionally: if Iconv is detected as BUILT_IN, no need to explicitly depend on `Iconv::Iconv`;
+---
+ libusb/CMakeLists.txt | 41 +++++++++++++++++++++++++++++++++--------
+ src/CMakeLists.txt    |  3 ---
+ 2 files changed, 33 insertions(+), 11 deletions(-)
+
+--- a/libusb/CMakeLists.txt
++++ b/libusb/CMakeLists.txt
+@@ -22,11 +22,53 @@ target_link_libraries(hidapi_libusb PRIV
+ if(HIDAPI_NO_ICONV)
+     target_compile_definitions(hidapi_libusb PRIVATE NO_ICONV)
+ else()
+-    if(NOT ANDROID AND NOT CMAKE_VERSION VERSION_LESS 3.11)
+-        find_package(Iconv REQUIRED)
++    if(NOT ANDROID)
+         include(CheckCSourceCompiles)
+-        target_link_libraries(hidapi_libusb PRIVATE Iconv::Iconv)
+-        set(CMAKE_REQUIRED_LIBRARIES "Iconv::Iconv")
++
++        if(NOT CMAKE_VERSION VERSION_LESS 3.11)
++            message(STATUS "Check for Iconv")
++            find_package(Iconv)
++            if(Iconv_FOUND)
++                if(NOT Iconv_IS_BUILT_IN)
++                    target_link_libraries(hidapi_libusb PRIVATE Iconv::Iconv)
++                    set(CMAKE_REQUIRED_LIBRARIES "Iconv::Iconv")
++                    if(NOT BUILD_SHARED_LIBS)
++                        set(HIDAPI_NEED_EXPORT_ICONV TRUE PARENT_SCOPE)
++                    endif()
++                endif()
++            else()
++                message(STATUS "Iconv Explicitly check '-liconv'")
++                # Sometime the build environment is not setup
++                # in a way CMake can find Iconv on its own by default.
++                # But if we simply link against iconv (-liconv), the build may succeed
++                # due to other compiler/link flags.
++                set(CMAKE_REQUIRED_LIBRARIES "iconv")
++                check_c_source_compiles("
++                    #include <stddef.h>
++                    #include <iconv.h>
++                    int main() {
++                    char *a, *b;
++                    size_t i, j;
++                    iconv_t ic;
++                    ic = iconv_open(\"to\", \"from\");
++                    iconv(ic, &a, &i, &b, &j);
++                    iconv_close(ic);
++                    }
++                    "
++                    Iconv_EXPLICITLY_AT_ENV)
++                if(Iconv_EXPLICITLY_AT_ENV)
++                    message(STATUS "Iconv Explicitly check '-liconv' - Available")
++                    target_link_libraries(hidapi_libusb PRIVATE iconv)
++                else()
++                    message(FATAL_ERROR "Iconv is not found, make sure to provide it in the build environment")
++                endif()
++            endif()
++        else()
++            # otherwise there is 2 options:
++            # 1) iconv is provided by Standard C library and the build will be just fine
++            # 2) The _user_ has to provide additiona compilation options for this project/target
++        endif()
++
+         # check for error: "conflicting types for 'iconv'"
+         check_c_source_compiles("#include<iconv.h>
+             extern size_t iconv (iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
+@@ -35,11 +77,9 @@ else()
+         if(HIDAPI_ICONV_CONST)
+             target_compile_definitions(hidapi_libusb PRIVATE "ICONV_CONST=const")
+         endif()
++    else()
++        # On Android Iconv is disabled on the code level anyway, so no issue;
+     endif()
+-    # otherwise there is 3 options:
+-    # 1) On Android Iconv is disabled on the code level anyway, so no issue;
+-    # 2) iconv is provided by Standard C library and the build will be just fine;
+-    # 4) The _user_ has to provide additiona compilation options for this project/target.
+ endif()
+ set_target_properties(hidapi_libusb
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -148,9 +148,6 @@ else()
+             if(NOT TARGET usb-1.0)
+                 set(HIDAPI_NEED_EXPORT_LIBUSB TRUE)
+             endif()
+-            if(NOT HIDAPI_NO_ICONV AND NOT ANDROID AND NOT CMAKE_VERSION VERSION_LESS 3.11)
+-                set(HIDAPI_NEED_EXPORT_ICONV TRUE)
+-            endif()
+         endif()
+     elseif(NOT TARGET hidapi_hidraw)
+         message(FATAL_ERROR "Select at least one option to build: HIDAPI_WITH_LIBUSB or HIDAPI_WITH_HIDRAW")
index 23d6341b197f014b62faf345b7c133129f800f57..d871e88d0a76367d06f5af437c879ac2b84864de 100644 (file)
@@ -104,6 +104,14 @@ else
        CMAKE_OPTIONS += -DENABLE_OPENSSL=ON
 endif
 
+EXTRA_CFLAGS += "-I$(PKG_BUILD_DIR)/extra-includes"
+
+define Build/Configure
+       $(INSTALL_DIR) $(PKG_BUILD_DIR)/extra-includes/
+       $(CP) -R $(STAGING_DIR_HOST)/include/ext2fs $(PKG_BUILD_DIR)/extra-includes/
+       $(Build/Configure/Default)
+endef
+
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
index ad9e17f52c0433676f166a46d052f3d19931ae45..d01ef29bcb2bf2cab4c671d53271219a0db61f90 100644 (file)
@@ -20,6 +20,7 @@ PKG_LICENSE:=GPL-3.0-or-later
 PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 
+PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 PKG_CONFIG_DEPENDS:= \
@@ -65,9 +66,6 @@ CONFIGURE_ARGS += \
 CONFIGURE_VARS += \
        ac_cv_lib_jpeg_jpeg_mem_src=yes
 
-TARGET_LDFLAGS += \
-       -liconv
-
 define Package/libextractor
        SECTION:=libs
        CATEGORY:=Libraries
index f4cee55a9ebc337bdbbfb77b0c62e4128e53e36e..4562337149b32781f712cb5f0e15fa6ded35d612 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libfmt
-PKG_VERSION:=8.1.1
+PKG_VERSION:=9.0.0
 PKG_RELEASE:=1
 
 PKG_SOURCE_NAME:=fmt
 PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/fmtlib/$(PKG_SOURCE_NAME)/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=3d794d3cf67633b34b2771eb9f073bde87e846e0d395d254df7b211ef1ec7346
+PKG_HASH:=9a1e0e9e843a356d65c7604e2c8bf9402b50fe294c355de0095ebd42fb9bd2c5
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
 
 PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch>
index 59e24a3cf6f95876de9536bff40a98341271e3f0..2319795750a659e77c78a6e4a7c9c5c96b414ff7 100644 (file)
@@ -8,35 +8,23 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libmad
-PKG_VERSION:=0.15.1b
-PKG_RELEASE:=5
+PKG_VERSION:=0.16.2
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/mad \
-       ftp://ftp.mars.org/pub/mpeg/
-PKG_HASH:=bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690
-PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+PKG_SOURCE_URL:=https://codeload.github.com/tenacityteam/libmad/tar.gz/$(PKG_VERSION)?
+PKG_HASH:=6c14c2f4dcf7fd32e447eef99d6c53faded52e22f95e223e6f58844030851b99
 
-PKG_LICENSE:=GPLv2
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+PKG_LICENSE:=GPL-2.0-or-later
 PKG_LICENSE_FILES:=COPYING
 PKG_CPE_ID:=cpe:/a:underbit:mad_libmad
 
-PKG_FIXUP:=autoreconf
-
-PKG_INSTALL:=1
+CMAKE_INSTALL:=1
+PKG_USE_MIPS16:=0
 
 include $(INCLUDE_DIR)/package.mk
-
-FPM:=default
-ifeq ($(ARCH),armeb)
-  FPM:=arm
-endif
-ifeq ($(ARCH),i386)
-  FPM:=intel
-endif
-ifeq ($(ARCH),mipsel)
-  FPM:=mips
-endif
+include $(INCLUDE_DIR)/cmake.mk
 
 define Package/libmad
   SECTION:=libs
@@ -52,24 +40,10 @@ define Package/libmad/description
        Layer I, Layer II, and Layer III (i.e. MP3) - are fully implemented.
 endef
 
-TARGET_CFLAGS += $(FPIC)
+CMAKE_OPTIONS += \
+       -DOPTIMIZE=SPEED
 
-CONFIGURE_ARGS+= \
-       --enable-shared \
-       --enable-static \
-       --enable-fpm="$(FPM)" \
-       --disable-debugging \
-       --enable-speed \
-
-MAKE_FLAGS+= \
-       CFLAGS="$(TARGET_CFLAGS)" \
-
-define Build/InstallDev
-       $(INSTALL_DIR) $(1)/usr/include
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/mad.h $(1)/usr/include/
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmad.{a,so*} $(1)/usr/lib/
-endef
+TARGET_CFLAGS:= $(filter-out -O%,$(TARGET_CFLAGS)) -O2
 
 define Package/libmad/install
        $(INSTALL_DIR) $(1)/usr/lib
diff --git a/libs/libmad/patches/001-mips_removal_h_constraint.patch b/libs/libmad/patches/001-mips_removal_h_constraint.patch
deleted file mode 100644 (file)
index 6b129c1..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
---- a/fixed.h
-+++ b/fixed.h
-@@ -299,6 +299,23 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t
- # elif defined(FPM_MIPS)
-+/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
-+#if defined (__GNUC__) && defined (__GNUC_MINOR__)
-+#define __GNUC_PREREQ(maj, min) \
-+      ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
-+#else
-+#define __GNUC_PREREQ(maj, min)  0
-+#endif
-+
-+#if __GNUC_PREREQ(4,4)
-+  typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
-+# define MAD_F_MLX(hi, lo, x, y) \
-+   do { \
-+      u64_di_t __ll = (u64_di_t) (x) * (y); \
-+      hi = __ll >> 32; \
-+      lo = __ll; \
-+   } while (0) 
-+#else
- /*
-  * This MIPS version is fast and accurate; the disposition of the least
-  * significant bit depends on OPT_ACCURACY via mad_f_scale64().
-@@ -328,6 +345,7 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t
-        : "%r" ((x) >> 12), "r" ((y) >> 16))
- #  define MAD_F_MLZ(hi, lo)  ((mad_fixed_t) (lo))
- # endif
-+#endif /* __GNU_PREREQ(4,4) */
- # if defined(OPT_SPEED)
- #  define mad_f_scale64(hi, lo)  \
---- a/mad.h
-+++ b/mad.h
-@@ -344,6 +344,23 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t
- # elif defined(FPM_MIPS)
-+/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
-+#if defined (__GNUC__) && defined (__GNUC_MINOR__)
-+#define __GNUC_PREREQ(maj, min) \
-+      ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
-+#else
-+#define __GNUC_PREREQ(maj, min)  0
-+#endif
-+
-+#if __GNUC_PREREQ(4,4)
-+  typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
-+# define MAD_F_MLX(hi, lo, x, y) \
-+   do { \
-+      u64_di_t __ll = (u64_di_t) (x) * (y); \
-+      hi = __ll >> 32; \
-+      lo = __ll; \
-+   } while (0) 
-+#else
- /*
-  * This MIPS version is fast and accurate; the disposition of the least
-  * significant bit depends on OPT_ACCURACY via mad_f_scale64().
-@@ -373,6 +390,7 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t
-        : "%r" ((x) >> 12), "r" ((y) >> 16))
- #  define MAD_F_MLZ(hi, lo)  ((mad_fixed_t) (lo))
- # endif
-+#endif /* __GNU_PREREQ(4,4) */
- # if defined(OPT_SPEED)
- #  define mad_f_scale64(hi, lo)  \
diff --git a/libs/libmad/patches/010-aarch64.patch b/libs/libmad/patches/010-aarch64.patch
new file mode 100644 (file)
index 0000000..8563d17
--- /dev/null
@@ -0,0 +1,21 @@
+From 9ec2efa6ba4bfaed7805867077d3a67daa022331 Mon Sep 17 00:00:00 2001
+From: Daniel Engberg <daniel.engberg.lists@pyret.net>
+Date: Mon, 27 Jun 2022 01:58:45 +0200
+Subject: [PATCH] cmake: Add aarch64 as valid match for 64-bit (#5)
+
+Allow aarch64 aka arm64 to use 64-bit fixed point math
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -78,7 +78,7 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES ".
+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES ".(ppc|PPC).*")
+   message(STATUS "Using PowerPC fixed point math")
+   option(FPM_PPC "PowerPC fixed point math" ON)
+-elseif(CMAKE_SYSTEM_PROCESSOR MATCHES ".*(x86_64|x86-64|x64|AMD64|amd64).*")
++elseif(CMAKE_SYSTEM_PROCESSOR MATCHES ".*(x86_64|x86-64|x64|AMD64|amd64|aarch64).*")
+   message(STATUS "Using 64 bit fixed point math")
+   option(FPM_64BIT "64 bit fixed point math" ON)
+ else()
diff --git a/libs/libmad/patches/101-CVE-2017-8374-length-check.patch b/libs/libmad/patches/101-CVE-2017-8374-length-check.patch
deleted file mode 100644 (file)
index 872a43e..0000000
+++ /dev/null
@@ -1,809 +0,0 @@
-From: Kurt Roeckx <kurt@roeckx.be>
-Date: Sun, 28 Jan 2018 19:26:36 +0100
-Subject: Check the size before reading with mad_bit_read
-
-There are various cases where it attemps to read past the end of the buffer
-using mad_bit_read(). Most functions didn't even know the size of the buffer
-they were reading from.
-
---- a/bit.c
-+++ b/bit.c
-@@ -138,6 +138,9 @@ unsigned long mad_bit_read(struct mad_bi
- {
-   register unsigned long value;
-+  if (len == 0)
-+    return 0;
-+
-   if (bitptr->left == CHAR_BIT)
-     bitptr->cache = *bitptr->byte;
---- a/frame.c
-+++ b/frame.c
-@@ -120,11 +120,18 @@ static
- int decode_header(struct mad_header *header, struct mad_stream *stream)
- {
-   unsigned int index;
-+  struct mad_bitptr bufend_ptr;
-   header->flags        = 0;
-   header->private_bits = 0;
-+  mad_bit_init(&bufend_ptr, stream->bufend);
-+
-   /* header() */
-+  if (mad_bit_length(&stream->ptr, &bufend_ptr) < 32) {
-+    stream->error = MAD_ERROR_BUFLEN;
-+    return -1;
-+  }
-   /* syncword */
-   mad_bit_skip(&stream->ptr, 11);
-@@ -225,8 +232,13 @@ int decode_header(struct mad_header *hea
-   /* error_check() */
-   /* crc_check */
--  if (header->flags & MAD_FLAG_PROTECTION)
-+  if (header->flags & MAD_FLAG_PROTECTION) {
-+    if (mad_bit_length(&stream->ptr, &bufend_ptr) < 16) {
-+      stream->error = MAD_ERROR_BUFLEN;
-+      return -1;
-+    }
-     header->crc_target = mad_bit_read(&stream->ptr, 16);
-+  }
-   return 0;
- }
-@@ -338,7 +350,7 @@ int mad_header_decode(struct mad_header
-       stream->error = MAD_ERROR_BUFLEN;
-       goto fail;
-     }
--    else if (!(ptr[0] == 0xff && (ptr[1] & 0xe0) == 0xe0)) {
-+    else if ((end - ptr >= 2) && !(ptr[0] == 0xff && (ptr[1] & 0xe0) == 0xe0)) {
-       /* mark point where frame sync word was expected */
-       stream->this_frame = ptr;
-       stream->next_frame = ptr + 1;
-@@ -361,6 +373,8 @@ int mad_header_decode(struct mad_header
-     ptr = mad_bit_nextbyte(&stream->ptr);
-   }
-+  stream->error = MAD_ERROR_NONE;
-+
-   /* begin processing */
-   stream->this_frame = ptr;
-   stream->next_frame = ptr + 1;  /* possibly bogus sync word */
-@@ -413,7 +427,7 @@ int mad_header_decode(struct mad_header
-     /* check that a valid frame header follows this frame */
-     ptr = stream->next_frame;
--    if (!(ptr[0] == 0xff && (ptr[1] & 0xe0) == 0xe0)) {
-+    if ((end - ptr >= 2) && !(ptr[0] == 0xff && (ptr[1] & 0xe0) == 0xe0)) {
-       ptr = stream->next_frame = stream->this_frame + 1;
-       goto sync;
-     }
---- a/layer12.c
-+++ b/layer12.c
-@@ -72,10 +72,18 @@ mad_fixed_t const linear_table[14] = {
-  * DESCRIPTION:       decode one requantized Layer I sample from a bitstream
-  */
- static
--mad_fixed_t I_sample(struct mad_bitptr *ptr, unsigned int nb)
-+mad_fixed_t I_sample(struct mad_bitptr *ptr, unsigned int nb, struct mad_stream *stream)
- {
-   mad_fixed_t sample;
-+  struct mad_bitptr frameend_ptr;
-+  mad_bit_init(&frameend_ptr, stream->next_frame);
-+
-+  if (mad_bit_length(ptr, &frameend_ptr) < nb) {
-+    stream->error = MAD_ERROR_LOSTSYNC;
-+    stream->sync = 0;
-+    return 0;
-+  }
-   sample = mad_bit_read(ptr, nb);
-   /* invert most significant bit, extend sign, then scale to fixed format */
-@@ -106,6 +114,10 @@ int mad_layer_I(struct mad_stream *strea
-   struct mad_header *header = &frame->header;
-   unsigned int nch, bound, ch, s, sb, nb;
-   unsigned char allocation[2][32], scalefactor[2][32];
-+  struct mad_bitptr bufend_ptr, frameend_ptr;
-+
-+  mad_bit_init(&bufend_ptr, stream->bufend);
-+  mad_bit_init(&frameend_ptr, stream->next_frame);
-   nch = MAD_NCHANNELS(header);
-@@ -118,6 +130,11 @@ int mad_layer_I(struct mad_stream *strea
-   /* check CRC word */
-   if (header->flags & MAD_FLAG_PROTECTION) {
-+    if (mad_bit_length(&stream->ptr, &bufend_ptr)
-+              < 4 * (bound * nch + (32 - bound))) {
-+      stream->error = MAD_ERROR_BADCRC;
-+      return -1;
-+    }
-     header->crc_check =
-       mad_bit_crc(stream->ptr, 4 * (bound * nch + (32 - bound)),
-                 header->crc_check);
-@@ -133,6 +150,11 @@ int mad_layer_I(struct mad_stream *strea
-   for (sb = 0; sb < bound; ++sb) {
-     for (ch = 0; ch < nch; ++ch) {
-+      if (mad_bit_length(&stream->ptr, &frameend_ptr) < 4) {
-+      stream->error = MAD_ERROR_LOSTSYNC;
-+      stream->sync = 0;
-+      return -1;
-+      }
-       nb = mad_bit_read(&stream->ptr, 4);
-       if (nb == 15) {
-@@ -145,6 +167,11 @@ int mad_layer_I(struct mad_stream *strea
-   }
-   for (sb = bound; sb < 32; ++sb) {
-+    if (mad_bit_length(&stream->ptr, &frameend_ptr) < 4) {
-+      stream->error = MAD_ERROR_LOSTSYNC;
-+      stream->sync = 0;
-+      return -1;
-+    }
-     nb = mad_bit_read(&stream->ptr, 4);
-     if (nb == 15) {
-@@ -161,6 +188,11 @@ int mad_layer_I(struct mad_stream *strea
-   for (sb = 0; sb < 32; ++sb) {
-     for (ch = 0; ch < nch; ++ch) {
-       if (allocation[ch][sb]) {
-+        if (mad_bit_length(&stream->ptr, &frameend_ptr) < 6) {
-+        stream->error = MAD_ERROR_LOSTSYNC;
-+        stream->sync = 0;
-+        return -1;
-+      }
-       scalefactor[ch][sb] = mad_bit_read(&stream->ptr, 6);
- # if defined(OPT_STRICT)
-@@ -185,8 +217,10 @@ int mad_layer_I(struct mad_stream *strea
-       for (ch = 0; ch < nch; ++ch) {
-       nb = allocation[ch][sb];
-       frame->sbsample[ch][s][sb] = nb ?
--        mad_f_mul(I_sample(&stream->ptr, nb),
-+        mad_f_mul(I_sample(&stream->ptr, nb, stream),
-                   sf_table[scalefactor[ch][sb]]) : 0;
-+      if (stream->error != 0)
-+        return -1;
-       }
-     }
-@@ -194,7 +228,14 @@ int mad_layer_I(struct mad_stream *strea
-       if ((nb = allocation[0][sb])) {
-       mad_fixed_t sample;
--      sample = I_sample(&stream->ptr, nb);
-+      if (mad_bit_length(&stream->ptr, &frameend_ptr) < nb) {
-+        stream->error = MAD_ERROR_LOSTSYNC;
-+        stream->sync = 0;
-+          return -1;
-+      }
-+      sample = I_sample(&stream->ptr, nb, stream);
-+        if (stream->error != 0)
-+        return -1;
-       for (ch = 0; ch < nch; ++ch) {
-         frame->sbsample[ch][s][sb] =
-@@ -280,13 +321,21 @@ struct quantclass {
- static
- void II_samples(struct mad_bitptr *ptr,
-               struct quantclass const *quantclass,
--              mad_fixed_t output[3])
-+              mad_fixed_t output[3], struct mad_stream *stream)
- {
-   unsigned int nb, s, sample[3];
-+  struct mad_bitptr frameend_ptr;
-+
-+  mad_bit_init(&frameend_ptr, stream->next_frame);
-   if ((nb = quantclass->group)) {
-     unsigned int c, nlevels;
-+    if (mad_bit_length(ptr, &frameend_ptr) < quantclass->bits) {
-+      stream->error = MAD_ERROR_LOSTSYNC;
-+      stream->sync = 0;
-+      return;
-+    }
-     /* degrouping */
-     c = mad_bit_read(ptr, quantclass->bits);
-     nlevels = quantclass->nlevels;
-@@ -299,8 +348,14 @@ void II_samples(struct mad_bitptr *ptr,
-   else {
-     nb = quantclass->bits;
--    for (s = 0; s < 3; ++s)
-+    for (s = 0; s < 3; ++s) {
-+      if (mad_bit_length(ptr, &frameend_ptr) < nb) {
-+      stream->error = MAD_ERROR_LOSTSYNC;
-+      stream->sync = 0;
-+      return;
-+      }
-       sample[s] = mad_bit_read(ptr, nb);
-+    }
-   }
-   for (s = 0; s < 3; ++s) {
-@@ -336,6 +391,9 @@ int mad_layer_II(struct mad_stream *stre
-   unsigned char const *offsets;
-   unsigned char allocation[2][32], scfsi[2][32], scalefactor[2][32][3];
-   mad_fixed_t samples[3];
-+  struct mad_bitptr frameend_ptr;
-+
-+  mad_bit_init(&frameend_ptr, stream->next_frame);
-   nch = MAD_NCHANNELS(header);
-@@ -402,13 +460,24 @@ int mad_layer_II(struct mad_stream *stre
-   for (sb = 0; sb < bound; ++sb) {
-     nbal = bitalloc_table[offsets[sb]].nbal;
--    for (ch = 0; ch < nch; ++ch)
-+    for (ch = 0; ch < nch; ++ch) {
-+      if (mad_bit_length(&stream->ptr, &frameend_ptr) < nbal) {
-+      stream->error = MAD_ERROR_LOSTSYNC;
-+      stream->sync = 0;
-+      return -1;
-+      }
-       allocation[ch][sb] = mad_bit_read(&stream->ptr, nbal);
-+    }
-   }
-   for (sb = bound; sb < sblimit; ++sb) {
-     nbal = bitalloc_table[offsets[sb]].nbal;
-+    if (mad_bit_length(&stream->ptr, &frameend_ptr) < nbal) {
-+      stream->error = MAD_ERROR_LOSTSYNC;
-+      stream->sync = 0;
-+      return -1;
-+    }
-     allocation[0][sb] =
-     allocation[1][sb] = mad_bit_read(&stream->ptr, nbal);
-   }
-@@ -417,8 +486,14 @@ int mad_layer_II(struct mad_stream *stre
-   for (sb = 0; sb < sblimit; ++sb) {
-     for (ch = 0; ch < nch; ++ch) {
--      if (allocation[ch][sb])
-+      if (allocation[ch][sb]) {
-+      if (mad_bit_length(&stream->ptr, &frameend_ptr) < 2) {
-+        stream->error = MAD_ERROR_LOSTSYNC;
-+        stream->sync = 0;
-+        return -1;
-+      }
-       scfsi[ch][sb] = mad_bit_read(&stream->ptr, 2);
-+      }
-     }
-   }
-@@ -441,6 +516,11 @@ int mad_layer_II(struct mad_stream *stre
-   for (sb = 0; sb < sblimit; ++sb) {
-     for (ch = 0; ch < nch; ++ch) {
-       if (allocation[ch][sb]) {
-+      if (mad_bit_length(&stream->ptr, &frameend_ptr) < 6) {
-+        stream->error = MAD_ERROR_LOSTSYNC;
-+        stream->sync = 0;
-+        return -1;
-+      }
-       scalefactor[ch][sb][0] = mad_bit_read(&stream->ptr, 6);
-       switch (scfsi[ch][sb]) {
-@@ -451,11 +531,21 @@ int mad_layer_II(struct mad_stream *stre
-         break;
-       case 0:
-+        if (mad_bit_length(&stream->ptr, &frameend_ptr) < 6) {
-+          stream->error = MAD_ERROR_LOSTSYNC;
-+          stream->sync = 0;
-+          return -1;
-+        }
-         scalefactor[ch][sb][1] = mad_bit_read(&stream->ptr, 6);
-         /* fall through */
-       case 1:
-       case 3:
-+        if (mad_bit_length(&stream->ptr, &frameend_ptr) < 6) {
-+          stream->error = MAD_ERROR_LOSTSYNC;
-+          stream->sync = 0;
-+          return -1;
-+        }
-         scalefactor[ch][sb][2] = mad_bit_read(&stream->ptr, 6);
-       }
-@@ -487,7 +577,9 @@ int mad_layer_II(struct mad_stream *stre
-       if ((index = allocation[ch][sb])) {
-         index = offset_table[bitalloc_table[offsets[sb]].offset][index - 1];
--        II_samples(&stream->ptr, &qc_table[index], samples);
-+        II_samples(&stream->ptr, &qc_table[index], samples, stream);
-+        if (stream->error != 0)
-+            return -1;
-         for (s = 0; s < 3; ++s) {
-           frame->sbsample[ch][3 * gr + s][sb] =
-@@ -505,7 +597,9 @@ int mad_layer_II(struct mad_stream *stre
-       if ((index = allocation[0][sb])) {
-       index = offset_table[bitalloc_table[offsets[sb]].offset][index - 1];
--      II_samples(&stream->ptr, &qc_table[index], samples);
-+      II_samples(&stream->ptr, &qc_table[index], samples, stream);
-+      if (stream->error != 0)
-+          return -1;
-       for (ch = 0; ch < nch; ++ch) {
-         for (s = 0; s < 3; ++s) {
---- a/layer3.c
-+++ b/layer3.c
-@@ -598,7 +598,8 @@ enum mad_error III_sideinfo(struct mad_b
- static
- unsigned int III_scalefactors_lsf(struct mad_bitptr *ptr,
-                                 struct channel *channel,
--                                struct channel *gr1ch, int mode_extension)
-+                                struct channel *gr1ch, int mode_extension,
-+                                unsigned int bits_left, unsigned int *part2_length)
- {
-   struct mad_bitptr start;
-   unsigned int scalefac_compress, index, slen[4], part, n, i;
-@@ -644,8 +645,12 @@ unsigned int III_scalefactors_lsf(struct
-     n = 0;
-     for (part = 0; part < 4; ++part) {
--      for (i = 0; i < nsfb[part]; ++i)
-+      for (i = 0; i < nsfb[part]; ++i) {
-+      if (bits_left < slen[part])
-+        return MAD_ERROR_BADSCFSI;
-       channel->scalefac[n++] = mad_bit_read(ptr, slen[part]);
-+      bits_left -= slen[part];
-+      }
-     }
-     while (n < 39)
-@@ -690,7 +695,10 @@ unsigned int III_scalefactors_lsf(struct
-       max = (1 << slen[part]) - 1;
-       for (i = 0; i < nsfb[part]; ++i) {
-+      if (bits_left < slen[part])
-+        return MAD_ERROR_BADSCFSI;
-       is_pos = mad_bit_read(ptr, slen[part]);
-+      bits_left -= slen[part];
-       channel->scalefac[n] = is_pos;
-       gr1ch->scalefac[n++] = (is_pos == max);
-@@ -703,7 +711,8 @@ unsigned int III_scalefactors_lsf(struct
-     }
-   }
--  return mad_bit_length(&start, ptr);
-+  *part2_length = mad_bit_length(&start, ptr);
-+  return MAD_ERROR_NONE;
- }
- /*
-@@ -712,7 +721,8 @@ unsigned int III_scalefactors_lsf(struct
-  */
- static
- unsigned int III_scalefactors(struct mad_bitptr *ptr, struct channel *channel,
--                            struct channel const *gr0ch, unsigned int scfsi)
-+                            struct channel const *gr0ch, unsigned int scfsi,
-+                            unsigned int bits_left, unsigned int *part2_length)
- {
-   struct mad_bitptr start;
-   unsigned int slen1, slen2, sfbi;
-@@ -728,12 +738,20 @@ unsigned int III_scalefactors(struct mad
-     sfbi = 0;
-     nsfb = (channel->flags & mixed_block_flag) ? 8 + 3 * 3 : 6 * 3;
--    while (nsfb--)
-+    while (nsfb--) {
-+      if (bits_left < slen1)
-+      return MAD_ERROR_BADSCFSI;
-       channel->scalefac[sfbi++] = mad_bit_read(ptr, slen1);
-+      bits_left -= slen1;
-+    }
-     nsfb = 6 * 3;
--    while (nsfb--)
-+    while (nsfb--) {
-+      if (bits_left < slen2)
-+      return MAD_ERROR_BADSCFSI;
-       channel->scalefac[sfbi++] = mad_bit_read(ptr, slen2);
-+      bits_left -= slen2;
-+    }
-     nsfb = 1 * 3;
-     while (nsfb--)
-@@ -745,8 +763,12 @@ unsigned int III_scalefactors(struct mad
-       channel->scalefac[sfbi] = gr0ch->scalefac[sfbi];
-     }
-     else {
--      for (sfbi = 0; sfbi < 6; ++sfbi)
-+      for (sfbi = 0; sfbi < 6; ++sfbi) {
-+      if (bits_left < slen1)
-+        return MAD_ERROR_BADSCFSI;
-       channel->scalefac[sfbi] = mad_bit_read(ptr, slen1);
-+      bits_left -= slen1;
-+      }
-     }
-     if (scfsi & 0x4) {
-@@ -754,8 +776,12 @@ unsigned int III_scalefactors(struct mad
-       channel->scalefac[sfbi] = gr0ch->scalefac[sfbi];
-     }
-     else {
--      for (sfbi = 6; sfbi < 11; ++sfbi)
-+      for (sfbi = 6; sfbi < 11; ++sfbi) {
-+      if (bits_left < slen1)
-+        return MAD_ERROR_BADSCFSI;
-       channel->scalefac[sfbi] = mad_bit_read(ptr, slen1);
-+      bits_left -= slen1;
-+      }
-     }
-     if (scfsi & 0x2) {
-@@ -763,8 +789,12 @@ unsigned int III_scalefactors(struct mad
-       channel->scalefac[sfbi] = gr0ch->scalefac[sfbi];
-     }
-     else {
--      for (sfbi = 11; sfbi < 16; ++sfbi)
-+      for (sfbi = 11; sfbi < 16; ++sfbi) {
-+      if (bits_left < slen2)
-+        return MAD_ERROR_BADSCFSI;
-       channel->scalefac[sfbi] = mad_bit_read(ptr, slen2);
-+      bits_left -= slen2;
-+      }
-     }
-     if (scfsi & 0x1) {
-@@ -772,14 +802,19 @@ unsigned int III_scalefactors(struct mad
-       channel->scalefac[sfbi] = gr0ch->scalefac[sfbi];
-     }
-     else {
--      for (sfbi = 16; sfbi < 21; ++sfbi)
-+      for (sfbi = 16; sfbi < 21; ++sfbi) {
-+      if (bits_left < slen2)
-+        return MAD_ERROR_BADSCFSI;
-       channel->scalefac[sfbi] = mad_bit_read(ptr, slen2);
-+      bits_left -= slen2;
-+      }
-     }
-     channel->scalefac[21] = 0;
-   }
--  return mad_bit_length(&start, ptr);
-+  *part2_length = mad_bit_length(&start, ptr);
-+  return MAD_ERROR_NONE;
- }
- /*
-@@ -933,19 +968,17 @@ static
- enum mad_error III_huffdecode(struct mad_bitptr *ptr, mad_fixed_t xr[576],
-                             struct channel *channel,
-                             unsigned char const *sfbwidth,
--                            unsigned int part2_length)
-+                            signed int part3_length)
- {
-   signed int exponents[39], exp;
-   signed int const *expptr;
-   struct mad_bitptr peek;
--  signed int bits_left, cachesz;
-+  signed int bits_left, cachesz, fakebits;
-   register mad_fixed_t *xrptr;
-   mad_fixed_t const *sfbound;
-   register unsigned long bitcache;
--  bits_left = (signed) channel->part2_3_length - (signed) part2_length;
--  if (bits_left < 0)
--    return MAD_ERROR_BADPART3LEN;
-+  bits_left = part3_length;
-   III_exponents(channel, sfbwidth, exponents);
-@@ -956,8 +989,12 @@ enum mad_error III_huffdecode(struct mad
-   cachesz  = mad_bit_bitsleft(&peek);
-   cachesz += ((32 - 1 - 24) + (24 - cachesz)) & ~7;
-+  if (bits_left < cachesz) {
-+    cachesz = bits_left;
-+  }
-   bitcache   = mad_bit_read(&peek, cachesz);
-   bits_left -= cachesz;
-+  fakebits = 0;
-   xrptr = &xr[0];
-@@ -986,7 +1023,7 @@ enum mad_error III_huffdecode(struct mad
-     big_values = channel->big_values;
--    while (big_values-- && cachesz + bits_left > 0) {
-+    while (big_values-- && cachesz + bits_left - fakebits > 0) {
-       union huffpair const *pair;
-       unsigned int clumpsz, value;
-       register mad_fixed_t requantized;
-@@ -1023,10 +1060,19 @@ enum mad_error III_huffdecode(struct mad
-       unsigned int bits;
-       bits       = ((32 - 1 - 21) + (21 - cachesz)) & ~7;
-+      if (bits_left < bits) {
-+        bits = bits_left;
-+      }
-       bitcache   = (bitcache << bits) | mad_bit_read(&peek, bits);
-       cachesz   += bits;
-       bits_left -= bits;
-       }
-+      if (cachesz < 21) {
-+      unsigned int bits = 21 - cachesz;
-+      bitcache <<= bits;
-+      cachesz += bits;
-+      fakebits += bits;
-+      }
-       /* hcod (0..19) */
-@@ -1041,6 +1087,8 @@ enum mad_error III_huffdecode(struct mad
-       }
-       cachesz -= pair->value.hlen;
-+      if (cachesz < fakebits)
-+      return MAD_ERROR_BADHUFFDATA;
-       if (linbits) {
-       /* x (0..14) */
-@@ -1054,10 +1102,15 @@ enum mad_error III_huffdecode(struct mad
-       case 15:
-         if (cachesz < linbits + 2) {
--          bitcache   = (bitcache << 16) | mad_bit_read(&peek, 16);
--          cachesz   += 16;
--          bits_left -= 16;
-+          unsigned int bits = 16;
-+          if (bits_left < 16)
-+            bits = bits_left;
-+          bitcache   = (bitcache << bits) | mad_bit_read(&peek, bits);
-+          cachesz   += bits;
-+          bits_left -= bits;
-         }
-+        if (cachesz - fakebits < linbits)
-+          return MAD_ERROR_BADHUFFDATA;
-         value += MASK(bitcache, cachesz, linbits);
-         cachesz -= linbits;
-@@ -1074,6 +1127,8 @@ enum mad_error III_huffdecode(struct mad
-         }
-       x_final:
-+        if (cachesz - fakebits < 1)
-+          return MAD_ERROR_BADHUFFDATA;
-         xrptr[0] = MASK1BIT(bitcache, cachesz--) ?
-           -requantized : requantized;
-       }
-@@ -1089,10 +1144,15 @@ enum mad_error III_huffdecode(struct mad
-       case 15:
-         if (cachesz < linbits + 1) {
--          bitcache   = (bitcache << 16) | mad_bit_read(&peek, 16);
--          cachesz   += 16;
--          bits_left -= 16;
-+          unsigned int bits = 16;
-+          if (bits_left < 16)
-+            bits = bits_left;
-+          bitcache   = (bitcache << bits) | mad_bit_read(&peek, bits);
-+          cachesz   += bits;
-+          bits_left -= bits;
-         }
-+        if (cachesz - fakebits < linbits)
-+          return MAD_ERROR_BADHUFFDATA;
-         value += MASK(bitcache, cachesz, linbits);
-         cachesz -= linbits;
-@@ -1109,6 +1169,8 @@ enum mad_error III_huffdecode(struct mad
-         }
-       y_final:
-+        if (cachesz - fakebits < 1)
-+          return MAD_ERROR_BADHUFFDATA;
-         xrptr[1] = MASK1BIT(bitcache, cachesz--) ?
-           -requantized : requantized;
-       }
-@@ -1128,6 +1190,8 @@ enum mad_error III_huffdecode(struct mad
-           requantized = reqcache[value] = III_requantize(value, exp);
-         }
-+        if (cachesz - fakebits < 1)
-+          return MAD_ERROR_BADHUFFDATA;
-         xrptr[0] = MASK1BIT(bitcache, cachesz--) ?
-           -requantized : requantized;
-       }
-@@ -1146,6 +1210,8 @@ enum mad_error III_huffdecode(struct mad
-           requantized = reqcache[value] = III_requantize(value, exp);
-         }
-+        if (cachesz - fakebits < 1)
-+          return MAD_ERROR_BADHUFFDATA;
-         xrptr[1] = MASK1BIT(bitcache, cachesz--) ?
-           -requantized : requantized;
-       }
-@@ -1155,9 +1221,6 @@ enum mad_error III_huffdecode(struct mad
-     }
-   }
--  if (cachesz + bits_left < 0)
--    return MAD_ERROR_BADHUFFDATA;  /* big_values overrun */
--
-   /* count1 */
-   {
-     union huffquad const *table;
-@@ -1167,15 +1230,24 @@ enum mad_error III_huffdecode(struct mad
-     requantized = III_requantize(1, exp);
--    while (cachesz + bits_left > 0 && xrptr <= &xr[572]) {
-+    while (cachesz + bits_left - fakebits > 0 && xrptr <= &xr[572]) {
-       union huffquad const *quad;
-       /* hcod (1..6) */
-       if (cachesz < 10) {
--      bitcache   = (bitcache << 16) | mad_bit_read(&peek, 16);
--      cachesz   += 16;
--      bits_left -= 16;
-+      unsigned int bits = 16;
-+      if (bits_left < 16)
-+        bits = bits_left;
-+      bitcache   = (bitcache << bits) | mad_bit_read(&peek, bits);
-+      cachesz   += bits;
-+      bits_left -= bits;
-+      }
-+      if (cachesz < 10) {
-+      unsigned int bits = 10 - cachesz;
-+      bitcache <<= bits;
-+      cachesz += bits;
-+      fakebits += bits;
-       }
-       quad = &table[MASK(bitcache, cachesz, 4)];
-@@ -1188,6 +1260,11 @@ enum mad_error III_huffdecode(struct mad
-                     MASK(bitcache, cachesz, quad->ptr.bits)];
-       }
-+      if (cachesz - fakebits < quad->value.hlen + quad->value.v
-+        + quad->value.w + quad->value.x + quad->value.y)
-+      /* We don't have enough bits to read one more entry, consider them
-+       * stuffing bits. */
-+      break;
-       cachesz -= quad->value.hlen;
-       if (xrptr == sfbound) {
-@@ -1236,22 +1313,8 @@ enum mad_error III_huffdecode(struct mad
-       xrptr += 2;
-     }
--
--    if (cachesz + bits_left < 0) {
--# if 0 && defined(DEBUG)
--      fprintf(stderr, "huffman count1 overrun (%d bits)\n",
--            -(cachesz + bits_left));
--# endif
--
--      /* technically the bitstream is misformatted, but apparently
--       some encoders are just a bit sloppy with stuffing bits */
--
--      xrptr -= 4;
--    }
-   }
--  assert(-bits_left <= MAD_BUFFER_GUARD * CHAR_BIT);
--
- # if 0 && defined(DEBUG)
-   if (bits_left < 0)
-     fprintf(stderr, "read %d bits too many\n", -bits_left);
-@@ -2348,10 +2411,11 @@ void III_freqinver(mad_fixed_t sample[18
-  */
- static
- enum mad_error III_decode(struct mad_bitptr *ptr, struct mad_frame *frame,
--                        struct sideinfo *si, unsigned int nch)
-+                        struct sideinfo *si, unsigned int nch, unsigned int md_len)
- {
-   struct mad_header *header = &frame->header;
-   unsigned int sfreqi, ngr, gr;
-+  int bits_left = md_len * CHAR_BIT;
-   {
-     unsigned int sfreq;
-@@ -2383,6 +2447,7 @@ enum mad_error III_decode(struct mad_bit
-     for (ch = 0; ch < nch; ++ch) {
-       struct channel *channel = &granule->ch[ch];
-       unsigned int part2_length;
-+      unsigned int part3_length;
-       sfbwidth[ch] = sfbwidth_table[sfreqi].l;
-       if (channel->block_type == 2) {
-@@ -2391,18 +2456,30 @@ enum mad_error III_decode(struct mad_bit
-       }
-       if (header->flags & MAD_FLAG_LSF_EXT) {
--      part2_length = III_scalefactors_lsf(ptr, channel,
-+      error = III_scalefactors_lsf(ptr, channel,
-                                           ch == 0 ? 0 : &si->gr[1].ch[1],
--                                          header->mode_extension);
-+                                          header->mode_extension, bits_left, &part2_length);
-       }
-       else {
--      part2_length = III_scalefactors(ptr, channel, &si->gr[0].ch[ch],
--                                      gr == 0 ? 0 : si->scfsi[ch]);
-+      error = III_scalefactors(ptr, channel, &si->gr[0].ch[ch],
-+                                      gr == 0 ? 0 : si->scfsi[ch], bits_left, &part2_length);
-       }
-+      if (error)
-+        return error;
-+
-+      bits_left -= part2_length;
--      error = III_huffdecode(ptr, xr[ch], channel, sfbwidth[ch], part2_length);
-+      if (part2_length > channel->part2_3_length)
-+        return MAD_ERROR_BADPART3LEN;
-+
-+      part3_length = channel->part2_3_length - part2_length;
-+      if (part3_length > bits_left)
-+        return MAD_ERROR_BADPART3LEN;
-+
-+      error = III_huffdecode(ptr, xr[ch], channel, sfbwidth[ch], part3_length);
-       if (error)
-       return error;
-+      bits_left -= part3_length;
-     }
-     /* joint stereo processing */
-@@ -2519,11 +2596,13 @@ int mad_layer_III(struct mad_stream *str
-   unsigned int nch, priv_bitlen, next_md_begin = 0;
-   unsigned int si_len, data_bitlen, md_len;
-   unsigned int frame_space, frame_used, frame_free;
--  struct mad_bitptr ptr;
-+  struct mad_bitptr ptr, bufend_ptr;
-   struct sideinfo si;
-   enum mad_error error;
-   int result = 0;
-+  mad_bit_init(&bufend_ptr, stream->bufend);
-+
-   /* allocate Layer III dynamic structures */
-   if (stream->main_data == 0) {
-@@ -2587,14 +2666,15 @@ int mad_layer_III(struct mad_stream *str
-     unsigned long header;
-     mad_bit_init(&peek, stream->next_frame);
-+    if (mad_bit_length(&peek, &bufend_ptr) >= 57) {
-+      header = mad_bit_read(&peek, 32);
-+      if ((header & 0xffe60000L) /* syncword | layer */ == 0xffe20000L) {
-+        if (!(header & 0x00010000L))  /* protection_bit */
-+        mad_bit_skip(&peek, 16);  /* crc_check */
--    header = mad_bit_read(&peek, 32);
--    if ((header & 0xffe60000L) /* syncword | layer */ == 0xffe20000L) {
--      if (!(header & 0x00010000L))  /* protection_bit */
--      mad_bit_skip(&peek, 16);  /* crc_check */
--
--      next_md_begin =
--      mad_bit_read(&peek, (header & 0x00080000L) /* ID */ ? 9 : 8);
-+        next_md_begin =
-+        mad_bit_read(&peek, (header & 0x00080000L) /* ID */ ? 9 : 8);
-+      }
-     }
-     mad_bit_finish(&peek);
-@@ -2645,7 +2725,7 @@ int mad_layer_III(struct mad_stream *str
-   /* decode main_data */
-   if (result == 0) {
--    error = III_decode(&ptr, frame, &si, nch);
-+    error = III_decode(&ptr, frame, &si, nch, md_len);
-     if (error) {
-       stream->error = error;
-       result = -1;
diff --git a/libs/libmad/patches/102-CVE-2017-8373-CVE-2017-8372-md-size.patch b/libs/libmad/patches/102-CVE-2017-8373-CVE-2017-8372-md-size.patch
deleted file mode 100644 (file)
index bedc865..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-From: Kurt Roeckx <kurt@roeckx.be>
-Date: Sun, 28 Jan 2018 15:44:08 +0100
-Subject: Check the size of the main data
-
-The main data to decode a frame can come from the current frame and part of the
-previous frame, the so called bit reservoir. si.main_data_begin is the part of
-the previous frame we need for this frame. frame_space is the amount of main
-data that can be in this frame, and next_md_begin is the part of this frame that
-is going to be used for the next frame.
-
-The maximum amount of data from a previous frame that the format allows is 511
-bytes. The maximum frame size for the defined bitrates is at MPEG 2.5 layer 2
-at 320 kbit/s and 8 kHz sample rate which gives 72 * (320000 / 8000) + 1 = 2881.
-So those defines are not large enough:
- # define MAD_BUFFER_GUARD      8
- # define MAD_BUFFER_MDLEN      (511 + 2048 + MAD_BUFFER_GUARD)
-
-There is also support for a "free" bitrate which allows you to create any frame
-size, which can be larger than the buffer.
-
-Changing the defines is not an option since it's part of the ABI, so we check
-that the main data fits in the bufer.
-
-The previous frame data is stored in *stream->main_data and contains
-stream->md_len bytes. If stream->md_len is larger than the data we
-need from the previous frame (si.main_data_begin) it still wouldn't fit
-in the buffer, so just keep the data that we need.
-
---- a/layer3.c
-+++ b/layer3.c
-@@ -2688,6 +2688,11 @@ int mad_layer_III(struct mad_stream *str
-     next_md_begin = 0;
-   md_len = si.main_data_begin + frame_space - next_md_begin;
-+  if (md_len + MAD_BUFFER_GUARD > MAD_BUFFER_MDLEN) {
-+    stream->error = MAD_ERROR_LOSTSYNC;
-+    stream->sync = 0;
-+    return -1;
-+  }
-   frame_used = 0;
-@@ -2705,8 +2710,11 @@ int mad_layer_III(struct mad_stream *str
-       }
-     }
-     else {
--      mad_bit_init(&ptr,
--                 *stream->main_data + stream->md_len - si.main_data_begin);
-+      memmove(stream->main_data,
-+      *stream->main_data + stream->md_len - si.main_data_begin,
-+      si.main_data_begin);
-+      stream->md_len = si.main_data_begin;
-+      mad_bit_init(&ptr, *stream->main_data);
-       if (md_len > si.main_data_begin) {
-       assert(stream->md_len + md_len -
index 558099a87cc42414a2d96e6bc124262f13b4cbdf..a4142c66d5e2b4f292db255222a0b6a1f4b010d9 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libndpi
-PKG_VERSION:=4.2
+PKG_VERSION:=4.4
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/ntop/nDPI/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=e54ce8fe13adc5d747be7553513657fae78f796e0bd459e122c280cc06ce4daf
+PKG_HASH:=5df3a7bc251e3838079c403707334c1cd93f20c17b33e31e090f30a16adb3702
 PKG_BUILD_DIR:=$(BUILD_DIR)/nDPI-$(PKG_VERSION)
 
 PKG_MAINTAINER:=Banglang Huang <banglang.huang@foxmail.com>, Toni Uhlig <matzeton@googlemail.com>
@@ -27,11 +27,15 @@ PKG_BUILD_PARALLEL:=1
 
 include $(INCLUDE_DIR)/package.mk
 
+ifeq ($(LIBNDPI_NDPIREADER),)
+CONFIGURE_ARGS += --with-only-libndpi
+endif
+
 ifneq ($(CONFIG_LIBNDPI_GCRYPT),)
 CONFIGURE_ARGS += --with-local-libgcrypt
 endif
 
-ifneq ($(CONFIG_LIBNDPI_PCRE2),)
+ifneq ($(CONFIG_LIBNDPI_PCRE),)
 CONFIGURE_ARGS += --with-pcre
 endif
 
@@ -44,7 +48,7 @@ define Package/libndpi
   CATEGORY:=Libraries
   TITLE:=Library for deep-packet inspection
   URL:=https://github.com/ntop/nDPI
-  DEPENDS:=+LIBNDPI_GCRYPT:libgcrypt +LIBNDPI_PCRE2:libpcre2 +LIBNDPI_MAXMINDDB:libmaxminddb +libpcap +libjson-c
+  DEPENDS:=+LIBNDPI_GCRYPT:libgcrypt +LIBNDPI_PCRE:libpcre +LIBNDPI_MAXMINDDB:libmaxminddb +LIBNDPI_NDPIREADER:libpcap
 endef
 
 define Package/libndpi/description
@@ -53,16 +57,26 @@ define Package/libndpi/description
 endef
 
 define Package/libndpi/config
+config LIBNDPI_NDPIREADER
+       bool "Enable ndpiReader"
+       depends on PACKAGE_libndpi
+       default n
+       help
+         This option builds and installs ndpiReader,
+         an example application that show some nDPI features.
+
 config LIBNDPI_GCRYPT
-       bool "GCrypt support"
+       bool "Use host GCrypt"
        depends on PACKAGE_libndpi
        default n
        help
-         This option enables QUIC client hello decryption.
+         This option enables the use of libgcrypt to decrypt QUIC client hello's.
+         If disabled, nDPI will use a builtin lightweight libgcrypt version to
+         decrypt QUIC client hello's.
          Disabled by default.
 
-config LIBNDPI_PCRE2
-       bool "pcre2 support"
+config LIBNDPI_PCRE
+       bool "pcre support"
        depends on PACKAGE_libndpi
        default n
        help
@@ -99,8 +113,10 @@ define Package/libndpi/install
        $(CP) $(PKG_BUILD_DIR)/src/lib/libndpi.so* \
                $(1)/usr/lib/
        $(INSTALL_DIR) $(1)/usr/bin/
+ifneq ($(LIBNDPI_NDPIREADER),)
        $(CP) $(PKG_BUILD_DIR)/example/ndpiReader \
                $(1)/usr/bin/
+endif
 endef
 
 $(eval $(call BuildPackage,libndpi))
index 402966ad4d4a95aea6881c0cbc3c132c1c021395..44480b8f989493228900c5a862e719adb78e2a4d 100644 (file)
@@ -1,12 +1,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libnpupnp
-PKG_VERSION:=4.2.1
+PKG_VERSION:=4.2.3
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://www.lesbonscomptes.com/upmpdcli/downloads
-PKG_HASH:=e0e59eb2d3d024e827050428e0e7eb228355912a38c85eb30bfeb2f0926eca4c
+PKG_HASH:=fdf053c47acbbae104ffd8743fcd662634cf2e4fe7e3a81c3a1a8c5934d10d0e
 
 PKG_MAINTAINER:=
 PKG_LICENSE:=LGPL-2.1-or-later
index 7862670a9008f163e11c94ed4d1628c6248d030c..5dd3651ff8f41620fa0781477bc7c4eca1e519d1 100644 (file)
@@ -6,12 +6,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=liborcania
-PKG_VERSION:=2.2.1
+PKG_VERSION:=2.3.0
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/babelouest/orcania/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=a9f16856aa311b8926cba2075d5245e94f30436f8a762a7e897ee7c8d335c59e
+PKG_HASH:=b1b5550523164eca0f59099e843177684c5017c6088284123880cffd4c6dbbde
 
 PKG_MAINTAINER:=Toni Uhlig <matzeton@googlemail.com>
 PKG_LICENSE:=LGPL-2.1-or-later
@@ -35,10 +35,4 @@ define Package/liborcania/description
   Potluck with different functions for different purposes that can be shared among C programs.
 endef
 
-define Package/liborcania/install
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liborcania.so.* \
-               $(1)/usr/lib/
-endef
-
 $(eval $(call BuildPackage,liborcania))
index 8e57a5547dfb4fbb98903b286f1247f7b294cb3a..325822ae1f71b5dbec6eb96cf911475e77e249cc 100644 (file)
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libowfat
 PKG_VERSION:=0.32
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://www.fefe.de/libowfat
diff --git a/libs/libowfat/patches/020-cflags.patch b/libs/libowfat/patches/020-cflags.patch
new file mode 100644 (file)
index 0000000..78ff583
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/Makefile
++++ b/Makefile
+@@ -37,8 +37,8 @@ OPT_PLUS=-O3 $(NATIVE)
+ DEFINE=-D_REENTRANT
+-CFLAGS=-pipe $(WARN) $(DEFINE) $(OPT_REG)
+-CFLAGS_OPT=-pipe $(WARN) $(DEFINE) $(OPT_PLUS)
++CFLAGS+=-pipe $(WARN) $(DEFINE) $(OPT_REG)
++CFLAGS_OPT+=-pipe $(WARN) $(DEFINE) $(OPT_PLUS)
+ #CFLAGS=-pipe -Os -march=pentiumpro -mcpu=pentiumpro -fomit-frame-pointer -fschedule-insns2 -Wall
index 792d09d02ee1f76627732085e47a88e6c0e89cb4..f3a7dc0e942386e5199dc9a19f833dc5ba2cd92b 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libradcli
-PKG_VERSION:=1.2.11
+PKG_VERSION:=1.3.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=radcli-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/radcli/radcli/releases/download/$(PKG_VERSION)
-PKG_HASH:=b6210e4c7deae235bb8c4e9df20c4f82c8bc2bda6d6214d50c5667660ab38548
+PKG_HASH:=20ddc8429d5912dfa2e71fafc93881844ce98e898c041b1dd7f757b9ddc8fcfd
 PKG_BUILD_DIR:=$(BUILD_DIR)/radcli-$(PKG_VERSION)
 
 PKG_INSTALL:=1
index e8bb72425f18816ef4e7e57423b55611b247bf98..8104dd6a48416121f7eaafeeb96bfd41f127191d 100644 (file)
@@ -8,7 +8,6 @@ PKG_SOURCE_URL:=@SF/libtirpc
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_HASH:=e24eb88b8ce7db3b7ca6eb80115dd1284abc5ec32a8deccfed2224fc2532b9fd
 
-PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=COPYING
 
index 93c1ef81f86260a7b0b0f22680c394463bb30604..07ba49cc39f742075333213d5a216ec83a3708e0 100644 (file)
@@ -1,12 +1,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libulfius
-PKG_VERSION:=2.7.3
+PKG_VERSION:=2.7.10
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/babelouest/ulfius/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=a20f575b3e81924c4ddb72c4ccdced134b5756a86b017f4a38b51608610628c5
+PKG_HASH:=616c5df99584071461a1285dd7155883f7d2b94abf0931038feeebd3da3a6def
 
 PKG_MAINTAINER:=Toni Uhlig <matzeton@googlemail.com>
 PKG_LICENSE:=LGPL-2.1-or-later
@@ -42,13 +42,8 @@ $(call Package/libulfius/default)
   PROVIDES:=libulfius
 endef
 
-define Package/libulfius-$(BUILD_VARIANT)/install
-       $(INSTALL_DIR) $(1)/usr/lib/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libulfius.so.* \
-               $(1)/usr/lib/
-endef
-
 CMAKE_OPTIONS += \
+       -D_GNU_SOURCE=ON \
        -DDOWNLOAD_DEPENDENCIES=OFF \
        -DBUILD_WEBSOCKET=OFF \
        -DSEARCH_ORCANIA_U=ON \
diff --git a/libs/libulfius/patches/0001-cmake-pc-orcania-found.patch b/libs/libulfius/patches/0001-cmake-pc-orcania-found.patch
new file mode 100644 (file)
index 0000000..b95b8c0
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -257,7 +257,7 @@ if (SEARCH_ORCANIA_U)
+     set(Orcania_FIND_QUIETLY ON) # force to find Orcania quietly
+     include(FindOrcania)
+     find_package(Orcania ${ORCANIA_VERSION_REQUIRED} QUIET) # try to find orcania
+-    if (NOT ORCANIA_FOUND)
++    if (NOT ORCANIA_FOUND AND NOT PC_ORCANIA_FOUND)
+         if (DOWNLOAD_DEPENDENCIES)
+             include(DownloadProject)
+             download_project(PROJ orcania # ... otherwise, download archive
index 5748cd3c79ca72d22588f96c3c6f33d818c982fa..93274a5826103df343b5ce844bf86cb28323b2c8 100644 (file)
@@ -1,12 +1,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=liburing
-PKG_VERSION:=2.1
+PKG_VERSION:=2.2
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://git.kernel.dk/cgit/liburing/snapshot
-PKG_HASH:=707faff561f6a57ddf4188a98737a80e460b24c1295cd303be39c819da0df1d1
+PKG_HASH:=f52bad18e3ff11185165d52d2d7391e90a0fce8f33f2ee611ad9a8ce1feaf914
 
 PKG_MAINTAINER:=Christian Lachner <gladiac@gmail.com>
 PKG_LICENSE:=MIT
diff --git a/libs/libuwsc/patches/100-cmake-fix-wolfssl-detection.patch b/libs/libuwsc/patches/100-cmake-fix-wolfssl-detection.patch
new file mode 100644 (file)
index 0000000..7f63f33
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/src/ssl.c
++++ b/src/ssl.c
+@@ -54,6 +54,7 @@ struct uwsc_ssl_ctx {
+ #include <openssl/err.h>
+ #elif UWSC_HAVE_WOLFSSL
+ #define WC_NO_HARDEN
++#include <wolfssl/options.h>
+ #include <wolfssl/openssl/ssl.h>
+ #include <wolfssl/openssl/err.h>
+ #endif
index c8615b4670745d96399fbf6a4d465238e3adcc11..60bac1d2b0074e00efb1bd6c65f15294ce958665 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=v4l-utils
 PKG_VERSION:=1.20.0
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://www.linuxtv.org/downloads/v4l-utils
@@ -64,7 +64,7 @@ define Package/v4l-utils
   SECTION:=utils
   CATEGORY:=Utilities
   TITLE+= utilities
-  DEPENDS:= +libudev-zero +libv4l +libstdcpp $(ICONV_DEPENDS) $(INTL_DEPENDS)
+  DEPENDS:= +libudev +libv4l +libstdcpp $(ICONV_DEPENDS) $(INTL_DEPENDS)
   LICENSE:=GPL-2.0-or-later
   LICENSE_FILES:=COPYING
 endef
index 4e0885063e163c05804297cf527bb45b4953a732..18a37ff60384a6c9f8cb81961932a08e7ae9fcbf 100644 (file)
@@ -1,12 +1,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libwebp
-PKG_VERSION:=1.2.1
+PKG_VERSION:=1.2.3
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://storage.googleapis.com/downloads.webmproject.org/releases/webp
-PKG_HASH:=808b98d2f5b84e9b27fdef6c5372dac769c3bda4502febbfa5031bd3c4d7d018
+PKG_HASH:=f5d7ab2390b06b8a934a4fc35784291b3885b557780d099bd32f09241f9d83f9
 
 PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
 PKG_LICENSE:=BSD-3-Clause
diff --git a/libs/libwebp/patches/001-fix-cmake-webpmux-linking.patch b/libs/libwebp/patches/001-fix-cmake-webpmux-linking.patch
deleted file mode 100644 (file)
index 85917a5..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -471,19 +471,18 @@ endif()
- if(WEBP_BUILD_LIBWEBPMUX)
-   parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/mux "WEBP_MUX_SRCS" "")
--  add_library(libwebpmux ${WEBP_MUX_SRCS})
--  target_link_libraries(libwebpmux webp)
--  target_include_directories(libwebpmux
-+  add_library(webpmux ${WEBP_MUX_SRCS})
-+  target_link_libraries(webpmux webp)
-+  target_include_directories(webpmux
-                              PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
-                                      ${CMAKE_CURRENT_SOURCE_DIR})
--  set_version(mux/Makefile.am libwebpmux webpmux)
--  set_target_properties(libwebpmux
-+  set_version(mux/Makefile.am webpmux webpmux)
-+  set_target_properties(webpmux
-                         PROPERTIES PUBLIC_HEADER
-                                    "${CMAKE_CURRENT_SOURCE_DIR}/src/webp/mux.h;\
- ${CMAKE_CURRENT_SOURCE_DIR}/src/webp/mux_types.h;\
- ${CMAKE_CURRENT_SOURCE_DIR}/src/webp/types.h;")
--  set_target_properties(libwebpmux PROPERTIES OUTPUT_NAME webpmux)
--  list(APPEND INSTALLED_LIBRARIES libwebpmux)
-+  list(APPEND INSTALLED_LIBRARIES webpmux)
-   configure_pkg_config("src/mux/libwebpmux.pc")
- endif()
-@@ -497,7 +496,7 @@ if(WEBP_BUILD_GIF2WEBP)
-                         exampleutil
-                         imageioutil
-                         webp
--                        libwebpmux
-+                        webpmux
-                         ${WEBP_DEP_GIF_LIBRARIES})
-   target_include_directories(gif2webp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
-   install(TARGETS gif2webp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
-@@ -514,7 +513,7 @@ if(WEBP_BUILD_IMG2WEBP)
-                         imagedec
-                         imageioutil
-                         webp
--                        libwebpmux)
-+                        webpmux)
-   target_include_directories(img2webp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
-   install(TARGETS img2webp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
- endif()
-@@ -563,7 +562,7 @@ if(WEBP_BUILD_WEBPMUX)
-   parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/examples "WEBPMUX_SRCS"
-                     "webpmux")
-   add_executable(webpmux ${WEBPMUX_SRCS})
--  target_link_libraries(webpmux exampleutil imageioutil libwebpmux webp)
-+  target_link_libraries(webpmux exampleutil imageioutil webpmux webp)
-   target_include_directories(webpmux PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
-   install(TARGETS webpmux RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
- endif()
index 4746006cd4be0eb24922e904bf35c0cf48a3f4a2..021bb44844015d06bbbe69e698966ab20a1e2ad5 100644 (file)
@@ -1,11 +1,11 @@
---- a/src/dsp/dsp.h
-+++ b/src/dsp/dsp.h
-@@ -128,7 +128,7 @@ extern "C" {
+--- a/src/dsp/cpu.h
++++ b/src/dsp/cpu.h
+@@ -106,7 +106,7 @@
  #define WEBP_HAVE_NEON
  #endif
  
--#if defined(__mips__) && !defined(__mips64) && \
-+#if defined(__mips__) && !defined(__mips16) && !defined(__mips64) && \
-     defined(__mips_isa_rev) && (__mips_isa_rev >= 1) && (__mips_isa_rev < 6)
+-#if defined(__mips__) && !defined(__mips64) && defined(__mips_isa_rev) && \
++#if defined(__mips__) && !defined(__mips16) && !defined(__mips64) && defined(__mips_isa_rev) && \
+     (__mips_isa_rev >= 1) && (__mips_isa_rev < 6)
  #define WEBP_USE_MIPS32
  #if (__mips_isa_rev >= 2)
index 3f75b3df4b62ba304b4be9e49802e6766d77781b..fb1bc3c937a46da8d9c0daa18087abcb5b9dbf49 100644 (file)
@@ -1,18 +1,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libxcrypt
-PKG_VERSION:=4.4.17
-PKG_RELEASE:=1
+PKG_VERSION:=4.4.28
+PKG_RELEASE:=$(AUTORELEASE)
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/besser82/libxcrypt/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=7665168d0409574a03f7b484682e68334764c29c21ca5df438955a381384ca07
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/besser82/libxcrypt/releases/download/v$(PKG_VERSION)
+PKG_HASH:=9e936811f9fad11dbca33ca19bd97c55c52eb3ca15901f27ade046cc79e69e87
 
 PKG_MAINTAINER:=
 PKG_LICENSE:=LGPL-2.1-or-later
 PKG_LICENSE_FILES:=COPYING.LIB
 
-PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 
@@ -41,7 +40,8 @@ CONFIGURE_ARGS += \
        --disable-failure-tokens \
        --disable-xcrypt-compat-files \
        --disable-obsolete-api \
-       --enable-hashes=solaris
+       --enable-hashes=solaris \
+       --with-pic
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
index 28e53667e3b7d781ed15b21d805b7036551027e4..05fadde1aca74d845b6a309594c9fe805ce41017 100644 (file)
@@ -100,6 +100,7 @@ CONFIGURE_ARGS += \
        --with-xpath \
        --with-xptr \
        --with-zlib=$(STAGING_DIR)/usr \
+       --with-iconv$(if $(ICONV_PREFIX),="$(ICONV_PREFIX)") \
        --without-lzma
 
 HOST_CONFIGURE_ARGS += \
index c3b650b61aaaccde1dfa8e3529ea86dd27b110e4..f5eb84c34b9996f8456ef3beada03e4e0641820d 100644 (file)
@@ -7,16 +7,19 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=opusfile
 PKG_VERSION:=0.12
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://downloads.xiph.org/releases/opus/
 PKG_HASH:=118d8601c12dd6a44f52423e68ca9083cc9f2bfe72da7a8c1acb22a80ae3550b
+
+PKG_MAINTAINER:=Eduardo Abinader <eduardoabinader@gmail.com>
 PKG_LICENSE:=BSD-2-Clause
 PKG_LICENSE_FILES:=COPYING
-PKG_MAINTAINER:=Eduardo Abinader <eduardoabinader@gmail.com>
 
+PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
 
 include $(INCLUDE_DIR)/package.mk
 
index 4e75a1cda97f04c448713c6188393a086c09773d..1bd6d27599e651fcb3dd45ac5e890f675521a924 100644 (file)
@@ -25,6 +25,8 @@ PKG_CONFIG_DEPENDS:=\
        CONFIG_PACKAGE_libpcre2-32 \
        CONFIG_PCRE2_JIT_ENABLED
 
+PKG_BUILD_DEPENDS:=zlib
+
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
 
index bf9bb0f09736709568819119be030803a76b7b78..4a668d2b4652c5bc0910fe4a8774de6eaef5a8ae 100644 (file)
@@ -8,7 +8,6 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://github.com/thkukuk/rpcsvc-proto/releases/download/v$(PKG_VERSION)
 PKG_HASH:=69315e94430f4e79c74d43422f4a36e6259e97e67e2677b2c7d7060436bd99b1
 
-PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
 PKG_LICENSE:=BSD-3-clause
 PKG_LICENSE_FILES:=COPYING
 
index fcb0793ed63fdc0c584eef53f9b6f667c552cd96..28affd96c27687a9336377eb56050624e5ba141a 100644 (file)
@@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=slang
 PKG_VERSION:=2.3.2
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://www.jedsoft.org/releases/slang \
@@ -23,6 +23,7 @@ PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
 
 PKG_BUILD_PARALLEL:=0
+PKG_CONFIG_DEPENDS:=CONFIG_BUILD_NLS
 
 SLANG_MODULES:= base64 chksum csv fcntl fork histogram iconv json onig pcre \
        png rand select slsmg socket stats sysconf termios varray zlib
@@ -114,7 +115,7 @@ CONFIGURE_ARGS+= \
        --enable-warnings \
        --with-terminfo=default \
        --with-readline=slang \
-       --with-iconv="$(ICONV_PREFIX)" \
+       $(if $(CONFIG_BUILD_NLS),--with-iconv=$(ICONV_PREFIX)) \
        --with-onig="$(STAGING_DIR)/usr" \
        --with-pcre="$(STAGING_DIR)/usr" \
        --with-png="$(STAGING_DIR)/usr" \
index d5ac6dc569bb1e88d8ce3ee62ae9fd3b998b6920..08a56b669ea8bb4fa1cad0d9154d05407cc3c638 100644 (file)
@@ -26,7 +26,7 @@ include $(INCLUDE_DIR)/meson.mk
 define Package/totem-pl-parser
   SECTION:=libs
   CATEGORY:=Libraries
-  DEPENDS:=+glib2 +libxml2
+  DEPENDS:=+glib2 +libxml2 +shared-mime-info
   TITLE:=totem-pl-parser
   URL:=https://gitlab.gnome.org/GNOME/totem-pl-parser
 endef
index 5e80f72340cbe374768640621b2920e4ec663f2e..25266b981def782f8bd0e0649c3d2e190a2e5777 100644 (file)
@@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zeromq
 PKG_VERSION:=4.3.4
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/zeromq/libzmq/releases/download/v$(PKG_VERSION)
@@ -32,7 +32,7 @@ define Package/libzmq/default
   URL:=http://www.zeromq.org/
   SECTION:=libs
   CATEGORY:=Libraries
-  DEPENDS:=+libuuid +libpthread +librt +libstdcpp +USE_GLIBC:libbsd
+  DEPENDS:=+libuuid +libstdcpp
   PROVIDES:=libzmq
 endef
 
@@ -87,8 +87,7 @@ CMAKE_OPTIONS += \
        -DENABLE_EVENTFD=ON \
        -DPOLLER=epoll \
        -DRT_LIBRARY=OFF \
-       -DZMQ_BUILD_TESTS=OFF \
-       -DWITH_LIBBSD=O$(if $(CONFIG_USE_GLIBC),N,FF)
+       -DZMQ_BUILD_TESTS=OFF
 
 ifeq ($(BUILD_VARIANT),curve)
        CMAKE_OPTIONS += -DWITH_LIBSODIUM=ON
diff --git a/libs/zmq/patches/020-no-libbsd.patch b/libs/zmq/patches/020-no-libbsd.patch
new file mode 100644 (file)
index 0000000..0ed0039
--- /dev/null
@@ -0,0 +1,232 @@
+From 872a773fac1e2880428d82e9f589ff16a5fde727 Mon Sep 17 00:00:00 2001
+From: Guilherme Janczak <guilherme.janczak@yandex.com>
+Date: Fri, 6 May 2022 18:42:52 +0000
+Subject: [PATCH] remove libbsd
+
+libbsd is only used once and as part of a larger, incorrect function.
+I rewrote the code that used it without the need for it.
+---
+ CMakeLists.txt               | 41 ++++++-----------------------
+ Makefile.am                  | 12 ++++-----
+ builds/cmake/platform.hpp.in |  2 --
+ configure.ac                 | 39 +--------------------------
+ packaging/debian/control     |  2 --
+ packaging/debian/zeromq.dsc  |  2 +-
+ packaging/redhat/zeromq.spec |  2 +-
+ src/compat.hpp               | 51 +++++++++++++++++++++++-------------
+ 8 files changed, 50 insertions(+), 101 deletions(-)
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -240,19 +240,6 @@ if(NOT ZMQ_USE_GNUTLS)
+   endif()
+ endif()
+-if(NOT MSVC)
+-  option(WITH_LIBBSD "Use libbsd instead of builtin strlcpy" ON)
+-  if(WITH_LIBBSD)
+-    pkg_check_modules(LIBBSD "libbsd")
+-    if(LIBBSD_FOUND)
+-      message(STATUS "Using libbsd")
+-      set(pkg_config_names_private "${pkg_config_names_private} libbsd")
+-      set(ZMQ_HAVE_LIBBSD 1)
+-    endif()
+-  endif()
+-  check_cxx_symbol_exists(strlcpy string.h ZMQ_HAVE_STRLCPY)
+-endif()
+-
+ # Select curve encryption library, defaults to tweetnacl To use libsodium instead, use --with-libsodium(must be
+ # installed) To disable curve, use --disable-curve
+@@ -1437,10 +1424,6 @@ if(BUILD_SHARED)
+     target_link_libraries(libzmq ${NSS3_LIBRARIES})
+   endif()
+-  if(LIBBSD_FOUND)
+-    target_link_libraries(libzmq ${LIBBSD_LIBRARIES})
+-  endif()
+-
+   if(SODIUM_FOUND)
+     target_link_libraries(libzmq ${SODIUM_LIBRARIES})
+     # On Solaris, libsodium depends on libssp
+@@ -1482,10 +1465,6 @@ if(BUILD_STATIC)
+     target_link_libraries(libzmq-static ${GNUTLS_LIBRARIES})
+   endif()
+-  if(LIBBSD_FOUND)
+-    target_link_libraries(libzmq-static ${LIBBSD_LIBRARIES})
+-  endif()
+-
+   if(NSS3_FOUND)
+     target_link_libraries(libzmq-static ${NSS3_LIBRARIES})
+   endif()
+@@ -1550,10 +1529,6 @@ if(BUILD_SHARED)
+         target_link_libraries(${perf-tool} ${GNUTLS_LIBRARIES})
+       endif()
+-      if(LIBBSD_FOUND)
+-        target_link_libraries(${perf-tool} ${LIBBSD_LIBRARIES})
+-      endif()
+-
+       if(NSS3_FOUND)
+         target_link_libraries(${perf-tool} ${NSS3_LIBRARIES})
+       endif()
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -351,11 +351,11 @@ if HAVE_VSCRIPT_COMPLEX
+ src_libzmq_la_LDFLAGS += $(VSCRIPT_LDFLAGS),$(srcdir)/src/libzmq.vers
+ endif
+-src_libzmq_la_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) $(LIBUNWIND_CFLAGS) $(LIBBSD_CFLAGS)
+-src_libzmq_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(LIBUNWIND_CFLAGS) $(LIBBSD_CFLAGS)
++src_libzmq_la_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) $(LIBUNWIND_CFLAGS)
++src_libzmq_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(LIBUNWIND_CFLAGS)
+ src_libzmq_la_CXXFLAGS = @LIBZMQ_EXTRA_CXXFLAGS@ $(CODE_COVERAGE_CXXFLAGS) \
+-      $(LIBUNWIND_CFLAGS) $(LIBBSD_CFLAGS)
+-src_libzmq_la_LIBADD = $(CODE_COVERAGE_LDFLAGS) $(LIBUNWIND_LIBS) $(LIBBSD_LIBS)
++      $(LIBUNWIND_CFLAGS)
++src_libzmq_la_LIBADD = $(CODE_COVERAGE_LDFLAGS) $(LIBUNWIND_LIBS)
+ if USE_NSS
+ src_libzmq_la_CPPFLAGS += ${NSS3_CFLAGS}
+@@ -849,10 +849,10 @@ tests_test_security_curve_SOURCES += \
+ endif
+ tests_test_security_curve_LDADD = \
+-        ${TESTUTIL_LIBS} src/libzmq.la $(LIBUNWIND_LIBS) $(LIBBSD_LIBS)
++        ${TESTUTIL_LIBS} src/libzmq.la $(LIBUNWIND_LIBS)
+ tests_test_security_curve_CPPFLAGS = \
+         ${TESTUTIL_CPPFLAGS} \
+-      ${LIBUNWIND_CFLAGS}  ${LIBBSD_CFLAGS}
++      ${LIBUNWIND_CFLAGS}
+ if USE_LIBSODIUM
+ tests_test_security_curve_CPPFLAGS += \
+--- a/builds/cmake/platform.hpp.in
++++ b/builds/cmake/platform.hpp.in
+@@ -52,8 +52,6 @@
+ #cmakedefine ZMQ_HAVE_PTHREAD_SET_AFFINITY
+ #cmakedefine HAVE_ACCEPT4
+ #cmakedefine HAVE_STRNLEN
+-#cmakedefine ZMQ_HAVE_STRLCPY
+-#cmakedefine ZMQ_HAVE_LIBBSD
+ #cmakedefine ZMQ_HAVE_IPC
+--- a/configure.ac
++++ b/configure.ac
+@@ -12,7 +12,7 @@ AC_CONFIG_AUX_DIR(config)
+ AC_CONFIG_MACRO_DIR(config)
+ AC_CONFIG_HEADERS([src/platform.hpp])
+ AM_INIT_AUTOMAKE(foreign subdir-objects tar-ustar dist-zip)
+-# Allow "configure --disable-maintainer-mode" to disable timestamp checking 
++# Allow "configure --disable-maintainer-mode" to disable timestamp checking
+ AM_MAINTAINER_MODE([enable])
+ m4_pattern_allow([AC_PROG_CC_C99])
+@@ -806,43 +806,6 @@ AC_COMPILE_IFELSE(
+     ],[
+         AC_MSG_RESULT([no])
+ ])
+-
+-AC_ARG_ENABLE([libbsd],
+-    [AS_HELP_STRING([--enable-libbsd],
+-        [enable libbsd [default=auto]])],
+-    [enable_libbsd=$enableval],
+-    [enable_libbsd="auto"])
+-
+-if test "x$enable_libbsd" != "xno"; then
+-    PKG_CHECK_MODULES(LIBBSD, [libbsd],
+-        [
+-            AC_DEFINE(ZMQ_HAVE_LIBBSD, 1, [The libbsd library is to be used])
+-            AC_SUBST([LIBBSD_CFLAGS])
+-            AC_SUBST([LIBBSD_LIBS])
+-            PKGCFG_NAMES_PRIVATE="$PKGCFG_NAMES_PRIVATE libbsd"
+-            found_libbsd="yes"
+-        ],
+-        [
+-            found_libbsd="no"
+-            if test "x$enable_libbsd" = "xyes"; then
+-                AC_MSG_ERROR([Cannot find libbsd])
+-            else
+-                AC_MSG_WARN([Cannot find libbsd])
+-            fi
+-        ])
+-fi
+-AC_MSG_CHECKING([whether strlcpy is available])
+-AC_COMPILE_IFELSE(
+-    [AC_LANG_PROGRAM(
+-        [[#include <string.h>]],
+-        [[char buf [100]; size_t bar = strlcpy (buf, "foo", 100); (void)bar; return 0;]])
+-    ],[
+-        AC_MSG_RESULT([yes])
+-        AC_DEFINE(ZMQ_HAVE_STRLCPY, [1],
+-            [strlcpy is available])
+-    ],[
+-        AC_MSG_RESULT([no])
+-])
+ # pthread_setname is non-posix, and there are at least 4 different implementations
+ AC_MSG_CHECKING([whether signature of pthread_setname_np() has 1 argument])
+--- a/src/compat.hpp
++++ b/src/compat.hpp
+@@ -37,26 +37,41 @@
+ #define strcasecmp _stricmp
+ #define strtok_r strtok_s
+ #else
+-#ifndef ZMQ_HAVE_STRLCPY
+-#ifdef ZMQ_HAVE_LIBBSD
+-#include <bsd/string.h>
+-#else
+-static inline size_t
+-strlcpy (char *dest_, const char *src_, const size_t dest_size_)
+-{
+-    size_t remain = dest_size_;
+-    for (; remain && *src_; --remain, ++src_, ++dest_) {
+-        *dest_ = *src_;
+-    }
+-    return dest_size_ - remain;
+-}
+-#endif
+-#endif
++/*
++ * https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strcpy-s-wcscpy-s-mbscpy-s?view=msvc-170
++ */
+ template <size_t size>
+-static inline int strcpy_s (char (&dest_)[size], const char *const src_)
++static inline int strcpy_s (char (&dst)[size], const char *const src)
+ {
+-    const size_t res = strlcpy (dest_, src_, size);
+-    return res >= size ? ERANGE : 0;
++    size_t i;
++
++    if (src == NULL) {
++        /*
++         * XXX:
++         * Microsoft's documentation is ambiguous.
++         *
++         * How does Microsoft handle size == 0 when src is NULL?
++         * Do they return ERANGE?
++         *
++         * How does Microsoft handle size == 0 when src is non-NULL?
++         * Do they write a '\0' to *dst anyway?
++         */
++        if (size > 0)
++            *dst = '\0';
++        return (errno = EINVAL);
++    }
++
++    for (i = 0;; i++) {
++        if (i >= size) {
++            if (size > 0)
++                *dst = '\0';
++            return (errno = ERANGE);
++        }
++        dst[i] = src[i];
++        if (src[i] == '\0')
++            return 0;
++    }
++    /* NOTREACHED */
+ }
+ #endif
index 89ccf4ae25e1ca39d5b8a4d6a4aa6e6f87f02424..12b75ffd5b69d0987805db72a7d03f1317857768 100644 (file)
@@ -24,6 +24,14 @@ PKG_CPE_ID:=cpe:/a:mutt:mutt
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_MUTT_POP \
+       CONFIG_MUTT_IMAP \
+       CONFIG_MUTT_SMTP \
+       CONFIG_MUTT_HCACHE \
+       CONFIG_MUTT_SASL \
+       CONFIG_MUTT_GNUTLS \
+       CONFIG_MUTT_OPENSSL
 
 include $(INCLUDE_DIR)/package.mk
 
index aba96ca917160107d247d3099fd0e76dade5f5be..4f9119e6aa97f0ab14bf76d35a81b0eea3b4d6f2 100644 (file)
@@ -13,7 +13,7 @@ PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= \
-       https://cdn.postfix.johnriley.me/mirrors/postfix-release/official/ \
+       https://de.postfix.org/ftpmirror/official/ \
        http://ftp.porcupine.org/mirrors/postfix-release/official/
 PKG_HASH:=22582628cf3edc18c5155c9ff44543dd95a9435fb68135d76a99f572cb07456f
 
index b7e1ae437c63b5240923d8023edb10f33be68f66..bc4b4a91ae362c0e09d3475ee33435798db7fe5a 100644 (file)
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ffmpeg
-PKG_VERSION:=5.0.1
+PKG_VERSION:=5.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://ffmpeg.org/releases/
-PKG_HASH:=ef2efae259ce80a240de48ec85ecb062cecca26e4352ffb3fda562c21a93007b
+PKG_HASH:=55eb6aab5ee235550fa54a33eaf8bf1b4ec66c01453182b12f6a993d75698b03
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
                Ian Leonard <antonlacon@gmail.com>
 
index c4f0dda724b399e2098ba94fa35d3562b592cbc7..25eba2aea0b0ca061022a73df6546d5743424a25 100644 (file)
@@ -1,10 +1,11 @@
 --- a/libavcodec/wmv2dsp.c
 +++ b/libavcodec/wmv2dsp.c
-@@ -264,6 +264,6 @@ av_cold void ff_wmv2dsp_init(WMV2DSPCont
+@@ -264,7 +264,7 @@ av_cold void ff_wmv2dsp_init(WMV2DSPCont
      c->put_mspel_pixels_tab[6] = put_mspel8_mc22_c;
      c->put_mspel_pixels_tab[7] = put_mspel8_mc32_c;
  
--    if (ARCH_MIPS)
-+    if (ARCH_MIPS64)
-         ff_wmv2dsp_init_mips(c);
+-#if ARCH_MIPS
++#if ARCH_MIPS64
+     ff_wmv2dsp_init_mips(c);
+ #endif
  }
diff --git a/multimedia/ttymidi-sysex/patches/100-add-support-for-System-Realtime-and-System-Common.patch b/multimedia/ttymidi-sysex/patches/100-add-support-for-System-Realtime-and-System-Common.patch
new file mode 100644 (file)
index 0000000..e8886f4
--- /dev/null
@@ -0,0 +1,240 @@
+From 4589f663862d8e7a062b356db3034992a56ed1c9 Mon Sep 17 00:00:00 2001
+From: Daniel Golle <daniel@makrotopia.org>
+Date: Fri, 17 Jun 2022 17:36:31 +0100
+Subject: [PATCH] add support System Realtime and System Common
+
+https://github.com/cchaussat/ttymidi-sysex/pull/2
+
+Add input and output support for MIDI System Common and System Realtime operations.
+---
+ ttymidi-sysex.c | 194 ++++++++++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 181 insertions(+), 13 deletions(-)
+
+diff --git a/ttymidi-sysex.c b/ttymidi-sysex.c
+index ceaeaa9..fc39f49 100644
+--- a/ttymidi-sysex.c
++++ b/ttymidi-sysex.c
+@@ -338,18 +338,103 @@ void parse_midi_command(snd_seq_t* seq, int port_out_id, unsigned char *buf, int
+                       break;
+               case 0xF0:  // *new*
+-                      if (buf[0] == 0xF0) {
+-                              if (!arguments.silent && arguments.verbose) {
+-                                      printf("Serial  %02X Sysex len = %04X   ", operation, buflen);  // *new*
+-                                      int i;
+-                                      for (i=0; i < buflen; i++) {
+-                                              printf("%02X ", buf[i]);
++                      switch (channel) {
++                              case 0x0:
++                                      if (!arguments.silent && arguments.verbose) {
++                                              printf("Serial  %02X Sysex len = %04X   ", operation, buflen);  // *new*
++                                              int i;
++                                              for (i=0; i < buflen; i++) {
++                                                      printf("%02X ", buf[i]);
++                                              }
++                                              printf("\n");
++                                              fflush(stdout);  // *new*
+                                       }
+-                                      printf("\n");
+-                                      fflush(stdout);  // *new*
+-                              }
+-                              // Send sysex message
+-                              snd_seq_ev_set_sysex(&ev, buflen, buf);
++                                      // Send sysex message
++                                      snd_seq_ev_set_sysex(&ev, buflen, buf);
++                                      break;
++                              case 0x1: // MTC Quarter Frame package
++                                      if (!arguments.silent && arguments.verbose) {
++                                              printf("Serial  MTC Quarter Frame       %02x\n", param1);
++                                              fflush(stdout);  // *new*
++                                      }
++                                      snd_seq_ev_set_fixed(&ev);
++                                      ev.data.control.value = param1;
++                                      ev.type = SND_SEQ_EVENT_QFRAME;
++                                      break;
++                              case 0x2: // Song Position
++                                      int_param1 = (int) (param1 & 0x7F) + ((param2 & 0x7F) << 7);  // *new*
++                                      if (!arguments.silent && arguments.verbose) {
++                                              printf("Serial  Song Position           %04x\n", int_param1);
++                                              fflush(stdout);  // *new*
++                                      }
++                                      snd_seq_ev_set_fixed(&ev);
++                                      ev.data.control.value = int_param1;
++                                      ev.type = SND_SEQ_EVENT_SONGPOS;
++                                      break;
++                              case 0x3: // Song Select
++                                      if (!arguments.silent && arguments.verbose) {
++                                              printf("Serial  Song Select             %02x\n", param1);
++                                              fflush(stdout);  // *new*
++                                      }
++                                      snd_seq_ev_set_fixed(&ev);
++                                      ev.data.control.value = param1;
++                                      ev.type = SND_SEQ_EVENT_SONGSEL;
++                                      break;
++                              case 0x6: // Tune Request
++                                      if (!arguments.silent && arguments.verbose) {
++                                              printf("Serial  Tune Request\n");
++                                              fflush(stdout);  // *new*
++                                      }
++                                      snd_seq_ev_set_fixed(&ev);
++                                      ev.type = SND_SEQ_EVENT_TUNE_REQUEST;
++                                      break;
++                              case 0x8: // Clock
++                                      if (!arguments.silent && arguments.verbose) {
++                                              printf("Serial  Clock\n");
++                                              fflush(stdout);  // *new*
++                                      }
++                                      snd_seq_ev_set_fixed(&ev);
++                                      ev.type = SND_SEQ_EVENT_CLOCK;
++                                      break;
++                              case 0xA: // Start
++                                      if (!arguments.silent && arguments.verbose) {
++                                              printf("Serial  Start\n");
++                                              fflush(stdout);  // *new*
++                                      }
++                                      snd_seq_ev_set_fixed(&ev);
++                                      ev.type = SND_SEQ_EVENT_START;
++                                      break;
++                              case 0xB: // Continue
++                                      if (!arguments.silent && arguments.verbose) {
++                                              printf("Serial  Continue\n");
++                                              fflush(stdout);  // *new*
++                                      }
++                                      snd_seq_ev_set_fixed(&ev);
++                                      ev.type = SND_SEQ_EVENT_CONTINUE;
++                                      break;
++                              case 0xC: // Stop
++                                      if (!arguments.silent && arguments.verbose) {
++                                              printf("Serial  Stop\n");
++                                              fflush(stdout);  // *new*
++                                      }
++                                      snd_seq_ev_set_fixed(&ev);
++                                      ev.type = SND_SEQ_EVENT_STOP;
++                                      break;
++                              case 0xE: // Active sense
++                                      if (!arguments.silent && arguments.verbose) {
++                                              printf("Serial  Active sense\n");
++                                              fflush(stdout);  // *new*
++                                      }
++                                      snd_seq_ev_set_fixed(&ev);
++                                      ev.type = SND_SEQ_EVENT_SENSING;
++                                      break;
++
++                              default:
++                                      if (!arguments.silent) {  // *new*
++                                              printf("Serial  %02X Unknown MIDI System cmd\n", buf[0] & 0xFF);  // *new*
++                                              fflush(stdout);  // *new*
++                                      }
++                                      break;
+                       }
+                       break;
+@@ -464,6 +549,83 @@ void write_midi_action_to_serial_port(snd_seq_t* seq_handle)
+                               }
+                               break;
++                      case SND_SEQ_EVENT_QFRAME:
++                              bytes[0] = 0xF1;
++                              bytes[1] = ev->data.control.value;
++                              if (!arguments.silent && arguments.verbose) {
++                                      printf("Alsa    %02X MTC Quarter Frame      %02X\n", bytes[0], bytes[1]);
++                                      fflush(stdout);  // *new*
++                              }
++                              break;
++
++                      case SND_SEQ_EVENT_SONGPOS:
++                              bytes[0] = 0xF2;
++                              ev->data.control.value += 8192;
++                              bytes[1] = (unsigned char)(ev->data.control.value & 0x7F);
++                              bytes[2] = (unsigned char)(ev->data.control.value >> 7);
++                              if (!arguments.silent && arguments.verbose) {
++                                      printf("Alsa    %02X Song Position      %04X\n", bytes[0], ev->data.control.value);
++                                      fflush(stdout);  // *new*
++                              }
++                              break;
++
++                      case SND_SEQ_EVENT_SONGSEL:
++                              bytes[0] = 0xF3;
++                              bytes[1] = ev->data.control.value;
++                              if (!arguments.silent && arguments.verbose) {
++                                      printf("Alsa    %02X Song Select        %02X\n", bytes[0], bytes[1]);
++                                      fflush(stdout);  // *new*
++                              }
++                              break;
++
++                      case SND_SEQ_EVENT_TUNE_REQUEST:
++                              bytes[0] = 0xF6;
++                              if (!arguments.silent && arguments.verbose) {
++                                      printf("Alsa    %02X Tune Request\n", bytes[0]);
++                                      fflush(stdout);  // *new*
++                              }
++                              break;
++
++                      case SND_SEQ_EVENT_CLOCK:
++                              bytes[0] = 0xF8;
++                              if (!arguments.silent && arguments.verbose) {
++                                      printf("Alsa    %02X Clock\n", bytes[0]);
++                                      fflush(stdout);  // *new*
++                              }
++                              break;
++
++                      case SND_SEQ_EVENT_START:
++                              bytes[0] = 0xFA;
++                              if (!arguments.silent && arguments.verbose) {
++                                      printf("Alsa    %02X Start\n", bytes[0]);
++                                      fflush(stdout);  // *new*
++                              }
++                              break;
++
++                      case SND_SEQ_EVENT_CONTINUE:
++                              bytes[0] = 0xFB;
++                              if (!arguments.silent && arguments.verbose) {
++                                      printf("Alsa    %02X Continue\n", bytes[0]);
++                                      fflush(stdout);  // *new*
++                              }
++                              break;
++
++                      case SND_SEQ_EVENT_STOP:
++                              bytes[0] = 0xFC;
++                              if (!arguments.silent && arguments.verbose) {
++                                      printf("Alsa    %02X Stop\n", bytes[0]);
++                                      fflush(stdout);  // *new*
++                              }
++                              break;
++
++                      case SND_SEQ_EVENT_SENSING:
++                              bytes[0] = 0xFE;
++                              if (!arguments.silent && arguments.verbose) {
++                                      printf("Alsa    %02X Active Sense\n", bytes[0]);
++                                      fflush(stdout);  // *new*
++                              }
++                              break;
++
+                       default:
+                               if (!arguments.silent) {  // *new*
+                                       printf("Alsa    %02X Unknown MIDI cmd   %02X %02X %02X\n", bytes[0]&0xF0, bytes[0]&0x0F, bytes[1], bytes[2]);  // *new*
+@@ -484,8 +646,10 @@ void write_midi_action_to_serial_port(snd_seq_t* seq_handle)
+                       if (bytes[0]!=0x00)
+                       {
+                               bytes[1] = (bytes[1] & 0x7F); // just to be sure that one bit is really zero
+-                              if (bytes[2]==0xFF) {
++                              if (bytes[2]==0xFF || bytes[0]==0xF1 || bytes[0]==0xF3 || bytes[0]==0xF5)
+                                       write(serial, bytes, 2);
++                              else if (bytes[0]==0xF4 || bytes[0]==0xF6 || bytes[0]>=0xF8) {
++                                      write(serial, bytes, 1);
+                               } else {
+                                       bytes[2] = (bytes[2] & 0x7F);
+                                       write(serial, bytes, 3);
+@@ -570,7 +734,11 @@ void* read_midi_from_serial_port(void* seq)
+                                       break;
+                               }
+                               buf[0] = buf[i];
+-                              if(buf[0] != 0xF0)      //if not SysEx *new*
++                              if (buf[0] == 0xF1 || buf[0] == 0xF3 || buf[0] == 0xF5)
++                                      bytesleft = 1;
++                              else if (buf[0] >= 0xF4 || buf[0] >= 0xF6 || (buf[0] >= 0xF8 && buf[0] <= 0xFE))
++                                      bytesleft = 0;
++                              else if (buf[0] != 0xF0)        //if not SysEx *new*
+                                       bytesleft = 3;
+                               i = 1;
+                       } else {
index ac43933d9512daa63ff8cd4a307d442c1bc23539..d6fda03d997b749bae729c864dac11106782e545 100644 (file)
@@ -1,11 +1,11 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=yt-dlp
-PKG_VERSION:=2022.5.18
+PKG_VERSION:=2022.7.18
 PKG_RELEASE:=1
 
 PYPI_NAME:=yt-dlp
-PKG_HASH:=3a7b59d2fb4b39ce8ba8e0b9c5a37fe20e5624f46a2346b4ae66ab1320e35134
+PKG_HASH:=0e7b81fc6ac8d1b7d3fffa79f9044ca4163784422582c9a3593305da2a69ec02
 
 PKG_MAINTAINER:=Michal Vasilek <michal.vasilek@nic.cz>
 PKG_LICENSE:=Unlicense
index f6837cec410c192d2fdaad8dc5acb4410351188a..ea89ffdc6d11b67eb2e3d8664af5226290b7080d 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=apinger
 PKG_SOURCE_DATE:=2015-04-09
 PKG_SOURCE_VERSION:=78eb328721ba1a10571c19df95acddcb5f0c17c8
-PKG_RELEASE:=2
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/Jajcus/apinger
@@ -46,7 +46,8 @@ define Package/apinger/description
 endef
 
 define Package/apinger/conffiles
-/etc/apinger.conf
+/etc/config/apinger
+/etc/apinger.user
 endef
 
 define Package/apinger/install
@@ -56,7 +57,35 @@ define Package/apinger/install
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/apinger.conf $(1)/etc/apinger.conf
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/apinger.init $(1)/etc/init.d/apinger
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_DATA) ./files/apinger.config $(1)/etc/config/apinger
+       $(INSTALL_DIR) $(1)/usr/libexec
+       $(INSTALL_BIN) ./files/apinger-hotplug $(1)/usr/libexec/apinger-hotplug
+       $(INSTALL_DIR) $(1)/etc/hotplug.d/apinger
+       $(INSTALL_DATA) ./files/user.hotplug $(1)/etc/hotplug.d/apinger/01-user
+       $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
+       $(INSTALL_DATA) ./files/iface.hotplug $(1)/etc/hotplug.d/iface/25-apinger
+       $(INSTALL_DIR) $(1)/usr/libexec/rpcd
+       $(INSTALL_BIN) ./files/apinger.rpc $(1)/usr/libexec/rpcd/apinger
+endef
+
+define Package/apinger-rrd
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+apinger +rrdtool1 +rrdcgi1
+  TITLE:=Apinger RRD Graphs
+  URL:=https://github.com/Jajcus/apinger
+endef
+
+define Package/apinger-rrd/description
+       Generate RRD Graphs from Apinger Data
+endef
+
+define Package/apinger-rrd/install
+       $(INSTALL_DIR) $(1)/usr/libexec/apinger/rpc
+       $(INSTALL_DATA) ./files/graphs.sh $(1)/usr/libexec/apinger/rpc
 endef
 
 $(eval $(call BuildPackage,apinger))
+$(eval $(call BuildPackage,apinger-rrd))
 
diff --git a/net/apinger/files/apinger-hotplug b/net/apinger/files/apinger-hotplug
new file mode 100644 (file)
index 0000000..70a29da
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+usage_help()
+{
+       echo "$0 <action> <instance> <target> <srcip> <target_desc> <alarm> <alarmtype> <reason> <send> <recieved> <loss> <delay> <timestamp>"
+}
+
+export ACTION=$1
+export INSTANCE=$2
+export APINGER_TARGET=$3
+export APINGER_SRCIP=$4
+export APINGER_TARGET_ID=$5
+export APINGER_ALARM=$6
+export APINGER_ALARM_TYPE=$7
+export APINGER_ALARM_MESSAGE=$8
+export APINGER_PROBES_SENT=$9
+export APINGER_PROBES_RECEIVED=${10}
+export APINGER_LOSS=${11}
+export APINGER_DELAY=${12}
+export APINGER_TIMESTAMP=${13}
+
+exec /sbin/hotplug-call apinger $@
diff --git a/net/apinger/files/apinger.config b/net/apinger/files/apinger.config
new file mode 100644 (file)
index 0000000..40190b3
--- /dev/null
@@ -0,0 +1,28 @@
+config interface 'wan'
+       option debug '0'
+       option status_interval '5'
+
+#config interface 'wan2'
+#      option debug '0'
+#      option status_interval '5'
+
+# delay is in ms
+#config alarm_delay 'delay200'
+#      option delay_low '100'
+#      option delay_high '200'
+
+# loss is in %
+#config alarm_loss 'loss50'
+#      option percent_low '30'
+#      option percent_high '50'
+
+#config target 'target1'
+#      option interface 'wan'
+#      option address '8.8.8.8'
+#      option alarm_delay 'a1'
+#      option alarm_loss 'loss50'
+#      option probe_interval '5'
+
+#config target 'target2'
+#      option interface 'wan2'
+#      option address '8.8.8.8'
index 8caac386976ea7da9f0dcc4b590f22ea292ac54c..7a287c03b5d51b084524029b6eef447844bad990 100644 (file)
 # Copyright (C) 2006-2011 OpenWrt.org
 
 START=80
+USE_PROCD=1
+BIN=/usr/sbin/apinger
+APINGER_RRD=/apinger/rrd
 
-SERVICE_USE_PID=1
+. /lib/functions/network.sh
 
-start() {
-       service_start /usr/sbin/apinger
+set_config_file() {
+       export CONFIG_FILE="/var/run/apinger-$instance.conf"
 }
 
-stop() {
-       service_stop /usr/sbin/apinger
+set_status_file() {
+       export STATUS_FILE="/var/run/apinger-$instance.status"
 }
 
-reload() {
-       service_reload /usr/sbin/apinger
+write_config_block() {
+       local cfg_var="CONFIG_BLOCK_$instance"
+       eval echo -e "\$$cfg_var" >> "$CONFIG_FILE"
+}
+
+start_config_block() {
+       eval "export CONFIG_BLOCK_$instance=''"
+       append CONFIG_BLOCK_$instance "$* {" "\n"
+}
+
+close_config_block() {
+       append CONFIG_BLOCK_$instance "}" "\n"
+}
+
+append_config_line() {
+       append CONFIG_BLOCK_$instance "\t$*" "\n"
+}
+
+append_target() {
+       local target=$1
+       local interface address probe_interval srcip
+       local avg_delay_samples avg_loss_samples avg_loss_delay_samples 
+       local alarm_down alarm_delay alarm_loss alarms rrd
+
+       config_get interface              "$target" interface wan
+       [ "$interface" != "$instance" ] && return 0
+
+       config_get address                "$target" address
+       config_get probe_interval         "$target" probe_interval
+       config_get avg_delay_samples      "$target" avg_delay_samples
+       config_get avg_loss_samples       "$target" avg_loss_samples
+       config_get avg_loss_delay_samples "$target" avg_loss_delay_samples
+       config_get alarm_down             "$target" alarm_down
+       config_get alarm_delay            "$target" alarm_delay
+       config_get alarm_loss             "$target" alarm_loss
+       config_get_bool rrd               "$target" rrd 0
+
+       [ -z "$address" ] && return 0
+
+       srcip=$(uci_get network "$interface" ipaddr)
+       [ -z "$srcip" ] && network_get_ipaddr srcip "$interface"
+       srcip="${srcip:-0.0.0.0}"
+
+       alarms=${alarm_down:+\"${alarm_down}\"}
+       alarms=${alarm_delay:+${alarms:+${alarms}, }}${alarm_delay:+\"${alarm_delay}\"}
+       alarms=${alarm_loss:+${alarms:+${alarms}, }}${alarm_loss:+\"${alarm_loss}\"}
+
+       start_config_block "target \"$address\""
+       append_config_line "srcip \"$srcip\""
+       append_config_line "description \"$target\""
+
+       [ -n "$probe_interval" ]          && append_config_line "interval ${probe_interval}s"
+       [ -n "$avg_delay_samples" ]       && append_config_line "avg_delay_samples ${avg_delay_samples}"
+       [ -n "$avg_loss_samples" ]        && append_config_line "avg_loss_samples ${avg_loss_samples}"
+       [ -n "$avg_loss_delay_samples" ]  && append_config_line "avg_loss_delay_samples ${avg_loss_delay_samples}"
+       [ -n "$alarms" ]                  && append_config_line "alarms override ${alarms}"
+       [ "$rrd" = "1" ]                  && append_config_line "rrd file \"$APINGER_RRD/apinger-target-$target.rrd\""
+
+       close_config_block
+       write_config_block
+}
+
+append_alarm_down() {
+       local alarm=$1
+       local time
+
+       config_get time "$alarm" time 5
+
+       [ -z "$time" ] && return
+
+       start_config_block "alarm down \"$alarm\""
+       append_config_line "time ${time}s"
+       close_config_block
+       write_config_block
+}
+
+append_alarm_delay() {
+       local alarm=$1
+       local delay_low delay_high
+
+       config_get delay_low  "$alarm" delay_low
+       config_get delay_high "$alarm" delay_high
+
+       if [ -z "$delay_low" ] || [ -z "$delay_high" ]; then
+               return
+       fi
+
+       start_config_block "alarm delay \"$alarm\""
+       append_config_line "delay_low ${delay_low}ms"
+       append_config_line "delay_high ${delay_high}ms"
+       close_config_block
+       write_config_block
+}
+
+append_alarm_loss() {
+       local alarm=$1
+       local percent_low percent_high
+
+       config_get percent_low  "$alarm" percent_low
+       config_get percent_high "$alarm" percent_low
+
+       if [ -z "$percent_low" ] || [ -z "$percent_high" ]; then
+               return
+       fi
+
+       start_config_block "alarm loss \"$alarm\""
+       append_config_line "percent_low ${percent_low}"
+       append_config_line "percent_high ${percent_high}"
+       close_config_block
+       write_config_block
+}
+
+init_apinger_config() {
+       local debug status_interval rrd_interval instance
+       instance=$1
+
+       config_get_bool debug             apinger debug 0
+       config_get      status_interval   apinger status_interval 1
+       config_get      rrd_interval      apinger rrd_interval 30
+
+       [ "$debug" = "1" ] && debug=on || debug=off
+
+       set_config_file
+       set_status_file
+
+       cat << EOF > "$CONFIG_FILE"
+user "root"
+group "root"
+debug ${debug}
+
+rrd interval ${rrd_interval}s
+
+status {
+       scriptformat on
+       file "$STATUS_FILE"
+       interval ${status_interval}s
+}
+alarm down "down" {
+       time 30s
+}
+alarm delay "delay" {
+       delay_low 5ms
+       delay_high 20ms
+}
+alarm loss "loss" {
+       percent_low 3
+       percent_high 5
+}
+alarm default {
+       command on "/usr/libexec/apinger-hotplug up $instance '%t' '%i' '%T' '%a' '%A' '%r' '%p' '%P' '%l' '%d' '%s'"
+       command off "/usr/libexec/apinger-hotplug down $instance '%t' '%i' '%T' '%a' '%A' '%r' '%p' '%P' '%l' '%d' '%s'"
+}
+target default {
+       interval 1s
+       avg_delay_samples 10
+       avg_loss_samples 50
+       avg_loss_delay_samples 20
+       alarms "down", "delay", "loss"
+}
+EOF
+}
+
+start_instance() {
+       export instance=$1
+
+       local enabled
+       config_get_bool enabled     "$instance" enabled 1
+       [ "$enabled" != "1" ] && return 0
+
+       init_apinger_config "$instance"
+       config_foreach append_alarm_down alarm_down
+       config_foreach append_alarm_delay alarm_delay
+       config_foreach append_alarm_loss alarm_loss
+       config_foreach append_target target
+
+       procd_open_instance "$instance"
+       procd_set_param command $BIN -f -c $CONFIG_FILE
+       procd_set_param stderr 1
+       procd_close_instance
+}
+
+start_service() {
+       local instance=$1
+
+       config_load apinger
+
+       [ ! -d "$APINGER_RRD" ] && mkdir -p "$APINGER_RRD"
+
+       if [ -n "$instance" ]; then
+               start_instance "$instance"
+       else
+               config_foreach start_instance interface
+       fi
+}
+
+service_triggers() {
+       procd_add_reload_trigger apinger
+}
+
+clean_instance() {
+       local instance=$1
+
+       set_config_file
+       set_status_file
+
+       [ -e $CONFIG_FILE ] && rm -f $CONFIG_FILE
+       [ -e $STATUS_FILE ] && rm -f $STATUS_FILE
+}
+
+service_stopped() {
+       local instance=$1
+
+       config_load apinger
+
+       if [ -n "$instance" ]; then
+               clean_instance "$instance"
+       else
+               config_foreach clean_instance interface
+       fi
+}
+
+reload_service() {
+       restart
 }
diff --git a/net/apinger/files/apinger.rpc b/net/apinger/files/apinger.rpc
new file mode 100644 (file)
index 0000000..0be6e16
--- /dev/null
@@ -0,0 +1,117 @@
+#!/bin/sh
+
+. /lib/functions.sh
+. /usr/share/libubox/jshn.sh
+
+RPC_SCRIPTS=/usr/libexec/apinger/rpc
+
+[ -d $RPC_SCRIPTS ] && include $RPC_SCRIPTS
+
+__function__() {
+    type "$1" > /dev/null 2>&1
+}
+
+foreach_extra() {
+       local file obj
+
+       [ ! -d $RPC_SCRIPTS ] && return
+       
+       for file in $RPC_SCRIPTS/*; do
+               obj="${file##*/}"
+               $1 "${obj%%.*}"
+       done
+}
+
+apinger_status() {
+       interface_list() {
+               append iface_list $1
+       }
+       config_load apinger
+       config_foreach interface_list interface
+
+       json_init
+       json_add_array targets
+
+       for iface in $iface_list; do
+               local status_file="/var/run/apinger-$iface.status"
+
+               if [ -f "$status_file" ]; then
+                       _IFS="$IFS"
+                       IFS="|"
+                       while read -r address srcip target received sent timestamp latency loss alarm; do
+                               json_add_object targets
+                               json_add_string interface "$iface"
+                               json_add_string target "$target"
+                               json_add_string address "$address"
+                               json_add_string srcip "$srcip"
+                               json_add_int sent "$sent"
+                               json_add_int received "$received"
+                               json_add_string latency "$latency"
+                               json_add_string loss "$loss"
+                               json_add_string alarm "$alarm"
+                               json_add_int timestamp "$timestamp"
+                               json_close_object
+                       done < "$status_file"
+                       IFS="$_IFS"
+               fi
+       done
+
+       json_close_array
+       json_dump
+}
+
+call_extra() {
+       if __function__ "$1"; then
+               $1
+       else
+               json_init
+               json_add_string error "invalid call $1"
+               json_dump
+       fi
+}
+
+call_method() {
+       case "$1" in
+               status)
+                       apinger_status
+                       ;;
+               *)
+                       call_extra $1
+                       ;;
+       esac
+}
+
+list_extra() {
+       if __function__ "${1}_help"; then
+               ${1}_help
+       else
+               json_add_object "$1"
+               json_close_object
+       fi
+}
+
+list_methods() {
+       local file
+
+       json_init
+
+       json_add_object status
+       json_close_object
+
+       foreach_extra list_extra ${1}
+
+       json_dump
+} 
+
+main () {
+       case "$1" in
+               list)
+                       list_methods
+                       ;;
+               call)
+                       call_method $2
+                       ;;
+       esac
+}
+
+main "$@"
diff --git a/net/apinger/files/graphs.sh b/net/apinger/files/graphs.sh
new file mode 100644 (file)
index 0000000..442dfbe
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+. /lib/functions.sh
+. /usr/share/libubox/jshn.sh
+
+APINGER="/usr/sbin/apinger"
+RRDCGI="/www/cgi-bin/apinger"
+GRAPH_DIR="/apinger/graphs"
+WWW_LOCATION="/www${GRAPH_DIR}"
+
+update_interface_graphs() {
+       local iface cfg cmd
+
+       iface=$1
+       cfg=/var/run/apinger-$iface.conf
+
+       [ ! -f $cfg ] && return
+
+       cmd="$APINGER -c $cfg -g $WWW_LOCATION -l $GRAPH_DIR"
+
+       if [ -x $RRDCGI ]; then
+               $cmd 2>/dev/null | sed -e '/\(HTML\|TITLE\|H1\|H2\|by\|^#\)/d' >> $RRDCGI
+       else
+               $cmd 2>/dev/null | sed -e '/\(HTML\|TITLE\|H1\|H2\|by\)/d' > $RRDCGI
+               chmod 755 $RRDCGI
+       fi
+}
+
+update_graphs() {
+       [ ! -d $WWW_LOCATION ] && mkdir -p $WWW_LOCATION
+       [ -e $RRDCGI ] && rm -f $RRDCGI
+
+       config_load apinger
+       config_foreach update_interface_graphs interface
+
+       json_init
+       json_add_string rrdcgi "$RRDCGI"
+       json_dump
+}
+
+graphs_help() {
+       json_add_object update_graphs
+       json_close_object
+}
diff --git a/net/apinger/files/iface.hotplug b/net/apinger/files/iface.hotplug
new file mode 100644 (file)
index 0000000..f97de0a
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+. /lib/functions.sh
+
+/etc/init.d/apinger enabled && {
+       [ "$(uci_get apinger $INTERFACE)" == "interface" ] || exit 0
+
+       [ "$ACTION" = "ifup" ] && {
+               /etc/init.d/apinger restart $INTERFACE
+       }
+
+}
diff --git a/net/apinger/files/user.hotplug b/net/apinger/files/user.hotplug
new file mode 100644 (file)
index 0000000..50bee5e
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+[ -e /etc/apinger.user ] && {
+       sh /etc/apinger.user
+}
+
+exit 0
diff --git a/net/apinger/patches/030-apinger-no_exit.patch b/net/apinger/patches/030-apinger-no_exit.patch
new file mode 100644 (file)
index 0000000..d058b3d
--- /dev/null
@@ -0,0 +1,34 @@
+--- a/src/apinger.c
++++ b/src/apinger.c
+@@ -786,7 +786,6 @@ struct alarm_cfg *a;
+ time_t tm;
+ int i,qp,really_lost;
+ char *buf1,*buf2;
+-int err=0;
+       if (config->status_file==NULL) return;
+       
+@@ -849,12 +848,10 @@ int err=0;
+                       }
+               }
+               buf2[i]=0;
+-              fprintf(f,"Received packets buffer: %s %s\n",buf2,buf1);
+               if (t->recently_lost!=really_lost){
+-                      fprintf(f,"   lost packet count mismatch (%i!=%i)!\n",t->recently_lost,really_lost);
+-                      logit("%s: Lost packet count mismatch (%i!=%i)!",t->name,t->recently_lost,really_lost);
+-                      logit("%s: Received packets buffer: %s %s\n",t->name,buf2,buf1);
+-                      err=1;
++                      logit("Target \"%s\": Lost packet count mismatch (%i(recently_lost) != %i(really_lost))!",t->name,t->recently_lost,really_lost);
++                      logit("Target \"%s\": Received packets buffer: %s %s\n",t->name,buf2,buf1);
++                      t->recently_lost = really_lost = 0;
+               }
+               free(buf1);
+               free(buf2);
+@@ -862,7 +859,6 @@ int err=0;
+               fprintf(f,"\n");
+       }
+       fclose(f);
+-      if (err) abort();
+ }
+ #ifdef FORKED_RECEIVER
diff --git a/net/apinger/patches/040-srcip.patch b/net/apinger/patches/040-srcip.patch
new file mode 100644 (file)
index 0000000..461201e
--- /dev/null
@@ -0,0 +1,564 @@
+--- a/src/apinger.c
++++ b/src/apinger.c
+@@ -161,6 +161,9 @@ time_t tim;
+               case 't':
+                       values[n]=t->name;
+                       break;
++              case 'i':
++                      values[n]=t->config->srcip;
++                      break;
+               case 'T':
+                       values[n]=t->description;
+                       break;
+@@ -276,6 +279,7 @@ time_t tm;
+       else
+               fprintf(f,"alarm canceled: %s\n",a->name);
+       fprintf(f,"Target: %s\n",t->name);
++      fprintf(f,"Source: %s\n",t->config->srcip);
+       fprintf(f,"Description: %s\n",t->description);
+       fprintf(f,"Probes sent: %i\n",t->last_sent+1);
+       fprintf(f,"Replies received: %i\n",t->received);
+@@ -645,7 +649,7 @@ void configure_targets(void){
+ struct target *t,*pt,*nt;
+ struct target_cfg *tc;
+ struct active_alarm_list *al,*nal;
+-union addr addr;
++union addr addr, srcaddr;
+ int r;
+ int l;
+@@ -665,6 +669,8 @@ int l;
+                               nal=al->next;
+                               free(al);
+                       }
++                      if (t->socket)
++                              close(t->socket);
+                       free(t->queue);
+                       free(t->rbuf);
+                       free(t->name);
+@@ -681,20 +687,16 @@ int l;
+                               break;
+               if (t==NULL) { /* new target */
+                       memset(&addr,0,sizeof(addr));
++                      logit("Checking target IP %s", tc->srcip);
+                       r=inet_pton(AF_INET,tc->name,&addr.addr4.sin_addr);
+                       if (r){
+-                              if (icmp_sock<0){
+-                                      logit("Sorry, IPv4 is not available\n");
+-                                      logit("Ignoring target %s\n",tc->name);
+-                                      continue;
+-                              }
+                               addr.addr.sa_family=AF_INET;
+                       }else{
+ #ifdef HAVE_IPV6
+                               r=inet_pton(AF_INET6,tc->name,&addr.addr6.sin6_addr);
+                               if (r==0){
+ #endif
+-                                      logit("Bad host address: %s\n",tc->name);
++                                      logit("Bad target IP address: %s\n",tc->name);
+                                       logit("Ignoring target %s\n",tc->name);
+                                       continue;
+ #ifdef HAVE_IPV6
+@@ -707,12 +709,38 @@ int l;
+                               addr.addr.sa_family=AF_INET6;
+ #endif
+                       }
++                      memset(&srcaddr,0,sizeof(srcaddr));
++                      logit("Checking source IP %s", tc->srcip);
++                      r=inet_pton(AF_INET,tc->srcip,&srcaddr.addr4.sin_addr);
++                      if (r){
++                              srcaddr.addr.sa_family=AF_INET;
++                      }else{
++#ifdef HAVE_IPV6
++                              r=inet_pton(AF_INET6,tc->srcip,&srcaddr.addr6.sin6_addr);
++                              if (r==0){
++#endif
++                                      logit("Bad source IP address %s for target %s\n", tc->srcip, tc->name);
++                                      logit("Ignoring target %s\n",tc->name);
++                                      continue;
++#ifdef HAVE_IPV6
++                              }
++                              if (icmp6_sock<0){
++                                      logit("Sorry, IPv6 is not available\n");
++                                      logit("Ignoring target %s\n",tc->name);
++                                      continue;
++                              }
++                              srcaddr.addr.sa_family=AF_INET6;
++#endif
++                      }
+                       t=NEW(struct target,1);
+                       memset(t,0,sizeof(struct target));
+                       t->name=strdup(tc->name);
+                       t->description=strdup(tc->description);
+                       t->addr=addr;
++                      t->ifaddr=srcaddr;
+                       t->next=targets;
++                      if(t->addr.addr.sa_family==AF_INET) make_icmp_socket(t);
++                      if(t->addr.addr.sa_family==AF_INET6) make_icmp6_socket(t);
+                       targets=t;
+               }
+               t->config=tc;
+@@ -752,6 +780,8 @@ struct active_alarm_list *al,*nal;
+                       nal=al->next;
+                       free(al);
+               }
++              if (t->socket)
++                      close(t->socket);
+               free(t->queue);
+               free(t->rbuf);
+               free(t->name);
+@@ -799,6 +829,7 @@ char *buf1,*buf2;
+       fprintf(f,"%s\n",ctime(&tm));
+       for(t=targets;t;t=t->next){
+               fprintf(f,"Target: %s\n",t->name);
++              fprintf(f,"Source: %s\n",t->config->srcip);
+               fprintf(f,"Description: %s\n",t->description);
+               fprintf(f,"Last reply received: #%i %s",t->last_received,
+                       ctime(&t->last_received_tv.tv_sec));
+@@ -909,7 +940,7 @@ int i;
+ void main_loop(void){
+ struct target *t;
+ struct timeval cur_time,next_status={0,0},tv,next_report={0,0},next_rrd_update={0,0};
+-struct pollfd pfd[2];
++struct pollfd pfd[1024];
+ int timeout;
+ int npfd=0;
+ int i;
+@@ -946,18 +977,8 @@ struct piped_info pi;
+       pfd[npfd].events=POLLIN|POLLERR|POLLHUP|POLLNVAL;
+       pfd[npfd].revents=0;
+       pfd[npfd++].fd=recv_pipe[0];
+-#else
+-      if (icmp_sock){
+-              pfd[npfd].events=POLLIN|POLLERR|POLLHUP|POLLNVAL;
+-              pfd[npfd].revents=0;
+-              pfd[npfd++].fd=icmp_sock;
+-      }
+-      if (icmp6_sock){
+-              pfd[npfd].events=POLLIN|POLLERR|POLLHUP|POLLNVAL;
+-              pfd[npfd++].fd=icmp6_sock;
+-              pfd[npfd].revents=0;
+-      }
+ #endif
++      memset(&pfd, '\0', sizeof pfd);
+       if (config->status_interval){
+               gettimeofday(&cur_time,NULL);
+               tv.tv_sec=config->status_interval/1000;
+@@ -965,10 +986,16 @@ struct piped_info pi;
+               timeradd(&cur_time,&tv,&next_status);
+       }
+       while(!interrupted_by){
++              npfd = 0;
+               gettimeofday(&cur_time,NULL);
+               if ( !timercmp(&next_probe,&cur_time,>) )
+                       timerclear(&next_probe);
+               for(t=targets;t;t=t->next){
++                      if (t->socket){
++                              pfd[npfd].events=POLLIN|POLLERR|POLLHUP|POLLNVAL;
++                              pfd[npfd].revents=0;
++                              pfd[npfd++].fd=t->socket;
++                      }
+                       for(al=t->config->alarms;al;al=nal){
+                               a=al->alarm;
+                               nal=al->next;
+@@ -1051,8 +1078,20 @@ struct piped_info pi;
+                                       analyze_reply(pi.recv_timestamp,pi.icmp_seq,&pi.ti);
+                       }
+ #else
+-                      if (pfd[i].fd==icmp_sock) recv_icmp();
+-                      else if (pfd[i].fd==icmp6_sock) recv_icmp6();
++                      for(t=targets;t;t=t->next){
++                              if (t->addr.addr.sa_family==AF_INET) {
++                                      if (t->socket == pfd[i].fd) {
++                                              recv_icmp(t);
++                                              break;
++                                      }
++                              }
++                              if (t->addr.addr.sa_family==AF_INET6) {
++                                      if (t->socket == pfd[i].fd) {
++                                              recv_icmp6(t);
++                                              break;
++                                      }
++                              }
++                      }
+ #endif
+                       pfd[i].revents=0;
+               }
+--- a/src/apinger.conf
++++ b/src/apinger.conf
+@@ -47,6 +47,7 @@ alarm default {
+       ## Following "macros" may be used in options below:
+       ##      %t - target name (address)
++      ##      %i - source name (address)
+       ##      %T - target description
+       ##      %a - alarm name
+       ##      %A - alarm type ("down"/"loss"/"delay")
+--- a/src/apinger.h
++++ b/src/apinger.h
+@@ -46,6 +46,8 @@
+ #endif
+ #include "conf.h"
++#include <ifaddrs.h>
++
+ union addr {
+       struct sockaddr addr;
+       struct sockaddr_in addr4;
+@@ -70,6 +72,7 @@ struct target {
+       char *queue;            /*
+                               contains info about recently sent packets
+                               "1" means it was received */
++      int socket;
+       int last_sent;          /* sequence number of the last ping sent */
+       int last_received;      /* sequence number of the last ping received */
+       struct timeval last_received_tv; /* timestamp of the last ping received */
+@@ -89,6 +92,7 @@ struct target {
+       struct target_cfg *config;
+       
+       struct target *next;
++      union addr ifaddr;      /* iface address */
+ };
+ #define AVG_DELAY_KNOWN(t) (t->upsent >= t->config->avg_delay_samples)
+@@ -118,16 +122,16 @@ extern char *config_file;
+ extern int icmp_sock;
+ extern int icmp6_sock;
+-extern int ident;
++extern uint16_t ident;
+ extern struct timeval next_probe;
+-int make_icmp_socket(void);
+-void recv_icmp(void);
++int make_icmp_socket(struct target *t);
++void recv_icmp(struct target *t);
+ void send_icmp_probe(struct target *t,int seq);
+-int make_icmp6_socket(void);
+-void recv_icmp6(void);
++int make_icmp6_socket(struct target *t);
++void recv_icmp6(struct target *t);
+ void send_icmp6_probe(struct target *t,int seq);
+ #ifdef FORKED_RECEIVER
+--- a/src/cfgparser1.y
++++ b/src/cfgparser1.y
+@@ -96,6 +96,7 @@ struct target_cfg *cur_target;
+ %token DELAY_HIGH
+ %token DESCRIPTION
++%token SRCIP
+ %token ALARMS
+ %token INTERVAL
+ %token AVG_DELAY_SAMPLES
+@@ -247,6 +248,8 @@ target:    TARGET getdeftarget DEFAULT '{'
+ targetcfg: /* */ 
+       | DESCRIPTION string 
+               { cur_target->description=$2; }
++      | SRCIP string
++              { cur_target->srcip = $2; }
+       | ALARMS alarmlist
+               { cur_target->alarms=$2; }
+       | ALARMS OVERRIDE alarmlist
+--- a/src/cfgparser2.l
++++ b/src/cfgparser2.l
+@@ -81,6 +81,7 @@ delay                { LOC; LOCINC; return DELAY; }
+ delay_high    { LOC; LOCINC; return DELAY_HIGH; }
+ delay_low     { LOC; LOCINC; return DELAY_LOW; }
+ description   { LOC; LOCINC; return DESCRIPTION; }
++srcip         { LOC; LOCINC; return SRCIP; }
+ down          { LOC; LOCINC; return DOWN; }
+ false         { LOC; LOCINC; return FALSE; }
+ file          { LOC; LOCINC; return FILE_; }
+--- a/src/conf.c
++++ b/src/conf.c
+@@ -174,6 +174,14 @@ int ret;
+                       }
+               }
+               for(t=cur_config.targets;t;t=t->next){
++                      if (t->name==NULL || strlen(t->name)==0){
++                              logit("Target name can't be empty.");
++                              return 1;
++                      }
++                      else if (t->srcip==NULL){
++                              logit("No source IP defined for target \"%s\".", t->name);
++                              return 1;
++                      }
+                       if (t->description==NULL)
+                               t->description=cur_config.target_defaults.description;
+                       if (t->interval<=0)
+--- a/src/conf.h
++++ b/src/conf.h
+@@ -71,6 +71,7 @@ struct alarm_list {
+ struct target_cfg {
+       char *name;
+       char *description;
++      char *srcip;
+       int interval;
+       int avg_delay_samples;
+       int avg_loss_delay_samples;
+--- a/src/icmp6.c
++++ b/src/icmp6.c
+@@ -112,14 +112,14 @@ int ret;
+       memcpy(p+1,&ti,sizeof(ti));
+       size=sizeof(*p)+sizeof(ti);
+-      ret=sendto(icmp6_sock,p,size,MSG_DONTWAIT,
++      ret=sendto(t->socket,p,size,MSG_DONTWAIT,
+                       (struct sockaddr *)&t->addr.addr6,sizeof(t->addr.addr6));
+       if (ret<0){
+               if (config->debug) myperror("sendto");
+       }
+ }
+-void recv_icmp6(void){
++void recv_icmp6(struct target *t){
+ int len,icmplen,datalen;
+ char buf[1024];
+ char abuf[100];
+@@ -133,6 +133,7 @@ char ans_data[4096];
+ struct iovec iov;
+ struct msghdr msg;
+ struct cmsghdr *c;
++reloophack6:
+       iov.iov_base=buf;
+       iov.iov_len=1000;
+@@ -142,12 +143,13 @@ struct cmsghdr *c;
+       msg.msg_iovlen=1;
+       msg.msg_control=ans_data;
+       msg.msg_controllen=sizeof(ans_data);
+-      len=recvmsg(icmp6_sock, &msg, MSG_DONTWAIT);
++      len=recvmsg(t->socket, &msg, MSG_DONTWAIT);
+ #else
+ socklen_t sl;
++reloophack6:
+       sl=sizeof(from);
+-      len=recvfrom(icmp6_sock,buf,1024,0,(struct sockaddr *)&from,&sl);
++      len=recvfrom(t->socket,buf,1024,0,(struct sockaddr *)&from,&sl);
+ #endif
+       if (len<0){
+               if (errno==EAGAIN) return;
+@@ -169,7 +171,7 @@ socklen_t sl;
+ #endif
+       if (time_recvp==NULL){
+ #ifdef SIOCGSTAMP
+-              if (!ioctl(icmp6_sock, SIOCGSTAMP, &time_recv)){
++              if (!ioctl(t->socket, SIOCGSTAMP, &time_recv)){
+                       debug("Got timestamp from ioctl()");
+               }else
+ #endif
+@@ -182,8 +184,11 @@ socklen_t sl;
+       icmplen=len;
+       icmp=(struct icmp6_hdr *)buf;
+       if (icmp->icmp6_type != ICMP6_ECHO_REPLY) return;
+-      if (icmp->icmp6_id != ident) return;
+-
++      if (icmp->icmp6_id != ident){
++              debug("Alien echo-reply received from xxx. Expected %i, received %i", ident, icmp->icmp6_id);
++              goto reloophack6;
++              return;
++      }
+       name=inet_ntop(AF_INET6,&from.sin6_addr,abuf,100);
+       debug("Ping reply from %s",name);
+       datalen=icmplen-sizeof(*icmp);
+@@ -199,33 +204,36 @@ socklen_t sl;
+ }
+-int make_icmp6_socket(void){
++int make_icmp6_socket(struct target *t){
+ int opt;
+-      icmp6_sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6);
+-      if (icmp6_sock<0)
++      t->socket = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6);
++      if (t->socket <0)
+               myperror("socket");
+       else {
+               opt=2;
+ #if defined(SOL_RAW) && defined(IPV6_CHECKSUM)
+-              if (setsockopt(icmp6_sock, SOL_RAW, IPV6_CHECKSUM, &opt, sizeof(int)))
++              if (setsockopt(t->socket, SOL_RAW, IPV6_CHECKSUM, &opt, sizeof(int)))
+                       myperror("setsockopt(IPV6_CHECKSUM)");
+ #endif
+ #ifdef SO_TIMESTAMP
+               opt=1;
+-              if (setsockopt(icmp6_sock, SOL_SOCKET, SO_TIMESTAMP, &opt, sizeof(opt)))
++              if (setsockopt(t->socket, SOL_SOCKET, SO_TIMESTAMP, &opt, sizeof(opt)))
+                       myperror("setsockopt(SO_TIMESTAMP)");
+ #endif
+               /*install_filter6();*/
+       }
+-      return icmp6_sock;
++      if (bind(t->socket, (struct sockaddr *)&t->ifaddr.addr6, sizeof(t->ifaddr.addr6)) < 0)
++              myperror("bind socket");
++
++      return t->socket;
+ }
+ #else /*HAVE_IPV6*/
+ #include "apinger.h"
+-int make_icmp6_socket(void){ return -1; }
+-void recv_icmp6(void){}
++int make_icmp6_socket(struct target *t){ return -1; }
++void recv_icmp6(struct target *t){}
+ void send_icmp6_probe(struct target *t,int seq){}
+ #endif /*HAVE_IPV6*/
+--- a/src/icmp.c
++++ b/src/icmp.c
+@@ -150,14 +150,14 @@ int ret;
+       size=sizeof(*p)+sizeof(ti);
+       p->icmp_cksum = in_cksum((u_short *)p,size,0);
+-      ret=sendto(icmp_sock,p,size,MSG_DONTWAIT,
++      ret=sendto(t->socket,p,size,MSG_DONTWAIT,
+                       (struct sockaddr *)&t->addr.addr4,sizeof(t->addr.addr4));
+       if (ret<0){
+               if (config->debug) myperror("sendto");
+       }
+ }
+-void recv_icmp(void){
++void recv_icmp(struct target *t){
+ int len,hlen,icmplen,datalen;
+ char buf[1024];
+ struct sockaddr_in from;
+@@ -170,6 +170,7 @@ char ans_data[4096];
+ struct iovec iov;
+ struct msghdr msg;
+ struct cmsghdr *c;
++reloophack:
+       iov.iov_base=buf;
+       iov.iov_len=1000;
+@@ -179,12 +180,13 @@ struct cmsghdr *c;
+       msg.msg_iovlen=1;
+       msg.msg_control=ans_data;
+       msg.msg_controllen=sizeof(ans_data);
+-      len=recvmsg(icmp_sock, &msg, MSG_DONTWAIT);
++      len=recvmsg(t->socket, &msg, MSG_DONTWAIT);
+ #else
+ socklen_t sl;
++reloophack:
+       sl=sizeof(from);
+-      len=recvfrom(icmp_sock,buf,1024,MSG_DONTWAIT,(struct sockaddr *)&from,&sl);
++      len=recvfrom(t->socket,buf,1024,MSG_DONTWAIT,(struct sockaddr *)&from,&sl);
+ #endif
+       if (len<0){
+               if (errno==EAGAIN) return;
+@@ -196,7 +198,7 @@ socklen_t sl;
+       debug("checking CMSG...");
+       for (c = CMSG_FIRSTHDR(&msg); c; c = CMSG_NXTHDR(&msg, c)) {
+               debug("CMSG level: %i type: %i",c->cmsg_level,c->cmsg_type);
+-              if (c->cmsg_level != SOL_SOCKET || c->cmsg_type != SO_TIMESTAMP)
++              if (c->cmsg_level != SOL_SOCKET || c->cmsg_type != SCM_TIMESTAMP)
+                       continue;
+               if (c->cmsg_len < CMSG_LEN(sizeof(struct timeval)))
+                       continue;
+@@ -206,7 +208,7 @@ socklen_t sl;
+ #endif
+       if (time_recvp==NULL){
+ #ifdef SIOCGSTAMP
+-              if (!ioctl(icmp_sock, SIOCGSTAMP, &time_recv)){
++              if (!ioctl(t->socket, SIOCGSTAMP, &time_recv)){
+                       debug("Got timestampt from ioctl()");
+               }else
+ #endif
+@@ -226,7 +228,8 @@ socklen_t sl;
+               return;
+       }
+       if (icmp->icmp_id != ident){
+-              debug("Alien echo-reply received");
++              debug("Alien echo-reply received from %s. Expected %i, received %i",inet_ntoa(from.sin_addr), ident, icmp->icmp_id);
++              goto reloophack;
+               return;
+       }
+       debug("Ping reply from %s",inet_ntoa(from.sin_addr));
+@@ -242,19 +245,23 @@ socklen_t sl;
+ #endif
+ }
+-int make_icmp_socket(void){
++int make_icmp_socket(struct target *t){
+ int on;
+-      icmp_sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
+-      if (icmp_sock<0)
++      t->socket = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP);
++      if (t->socket < 0)
+               myperror("socket");
+ #ifdef SO_TIMESTAMP
+       else{
+               on=1;
+-              if (setsockopt(icmp_sock, SOL_SOCKET, SO_TIMESTAMP, &on, sizeof(on)))
++              if (setsockopt(t->socket, SOL_SOCKET, SO_TIMESTAMP, &on, sizeof(on)))
+                       myperror("setsockopt(SO_TIMESTAMP)");
+       }
+ #endif
+-      return icmp_sock;
++
++      if (bind(t->socket, (struct sockaddr *)&t->ifaddr.addr4, sizeof(t->ifaddr.addr4)) < 0)
++                      myperror("bind socket");
++
++      return t->socket;
+ }
+--- a/src/main.c
++++ b/src/main.c
+@@ -71,6 +71,7 @@ struct config default_config={
+               {               /* target defaults */
+                               "default",      /* name */
+                               "",             /* description */
++                              "",             /* interface */
+                               1000,           /* interval */
+                               20,             /* avg_delay_samples */
+                               5,              /* avg_loss_delay_samples */
+@@ -95,7 +96,7 @@ char *config_file=CONFIG;
+ int icmp_sock;
+ int icmp6_sock;
+-int ident;
++uint16_t ident;
+ struct timeval next_probe={0,0};
+@@ -216,12 +217,6 @@ char *graph_location="/apinger/";
+               }
+       }
+-      make_icmp_socket();
+-      make_icmp6_socket();
+-      if (icmp6_sock<0 && icmp_sock<0){
+-              return 1;
+-      }
+-
+       pw=getpwnam(config->user);
+       if (!pw) {
+               debug("getpwnam(\"%s\") failed.",config->user);
+@@ -276,7 +271,7 @@ char *graph_location="/apinger/";
+               return 1;
+       }
+-      ident=getpid();
++      ident=getpid() & 0xFFFF;
+       signal(SIGTERM,signal_handler);
+       signal(SIGINT,signal_handler);
+       signal(SIGHUP,signal_handler);
+@@ -285,9 +280,8 @@ char *graph_location="/apinger/";
+ #ifdef FORKED_RECEIVER
+       signal(SIGCHLD,sigchld_handler);
+ #endif
++      logit("Starting Alarm Pinger, apinger(%i)", ident);
+       main_loop();
+-      if (icmp_sock>=0) close(icmp_sock);
+-      if (icmp6_sock>=0) close(icmp6_sock);
+       logit("Exiting on signal %i.",interrupted_by);
diff --git a/net/apinger/patches/050-statusformat.patch b/net/apinger/patches/050-statusformat.patch
new file mode 100644 (file)
index 0000000..dee865b
--- /dev/null
@@ -0,0 +1,126 @@
+--- a/src/apinger.c
++++ b/src/apinger.c
+@@ -826,26 +826,49 @@ char *buf1,*buf2;
+               return;
+       }
+       tm=time(NULL);
+-      fprintf(f,"%s\n",ctime(&tm));
++      if(!config->status_format) fprintf(f,"%s\n",ctime(&tm));
+       for(t=targets;t;t=t->next){
+-              fprintf(f,"Target: %s\n",t->name);
+-              fprintf(f,"Source: %s\n",t->config->srcip);
+-              fprintf(f,"Description: %s\n",t->description);
+-              fprintf(f,"Last reply received: #%i %s",t->last_received,
+-                      ctime(&t->last_received_tv.tv_sec));
+-              fprintf(f,"Average delay: %0.3fms\n",AVG_DELAY(t));
++              if(config->status_format){
++                      fprintf(f,"%s|%s|%s|%i|%i|%u|",t->name, t->config->srcip, t->description, t->last_sent+1,
++                               t->received, t->last_received_tv.tv_sec);
++                      fprintf(f,"%0.3fms|", AVG_DELAY(t));
++              }
++              else{
++                      fprintf(f,"Target: %s\n",t->name);
++                      fprintf(f,"Source: %s\n",t->config->srcip);
++                      fprintf(f,"Description: %s\n",t->description);
++                      fprintf(f,"Last reply received: #%i %s",t->last_received,
++                              ctime(&t->last_received_tv.tv_sec));
++                      fprintf(f,"Average delay: %0.3fms\n",AVG_DELAY(t));
++              }
+               if (AVG_LOSS_KNOWN(t)){
+-                      fprintf(f,"Average packet loss: %0.1f%%\n",AVG_LOSS(t));
++                      if(config->status_format){
++                              fprintf(f,"%0.1f%%",AVG_LOSS(t));
++                      }
++                      else{
++                              fprintf(f,"Average packet loss: %0.1f%%\n",AVG_LOSS(t));
++                      }
++              }
++              if(config->status_format){
++                      fprintf(f, "|");
++              }
++              else{
++                      fprintf(f,"Active alarms: ");
+               }
+-              fprintf(f,"Active alarms:");
+               if (t->active_alarms){
+                       for(al=t->active_alarms;al;al=al->next){
+                               a=al->alarm;
+-                              fprintf(f," \"%s\"",a->name);
++                              if(config->status_format){
++                                      fprintf(f,"%s",a->name);
++                              }
++                              else{
++                                      fprintf(f," \"%s\"",a->name);
++                              }
+                       }
+-                      fprintf(f,"\n");
++                      if(!config->status_format) fprintf(f,"\n");
+               }
+-              else fprintf(f," None\n");
++              else fprintf(f,"none");
++              if(!config->status_format) fprintf(f,"\n");
+               buf1=NEW(char,t->config->avg_loss_delay_samples+1);
+               buf2=NEW(char,t->config->avg_loss_samples+1);
+--- a/src/apinger.conf
++++ b/src/apinger.conf
+@@ -29,6 +29,10 @@ group "nogroup"
+ #     ## Interval between file updates
+ #     ## when 0 or not set, file is written only when SIGUSR1 is received
+ #     interval 5m
++#
++#     ## Create status file in script parseable format (on) or human
++#     ## readable format (off)
++#     scriptformat off
+ #}
+ ########################################
+--- a/src/cfgparser1.y
++++ b/src/cfgparser1.y
+@@ -104,6 +104,7 @@ struct target_cfg *cur_target;
+ %token AVG_LOSS_DELAY_SAMPLES
+ %token FILE_
++%token SCRIPTFORMAT
+ %token ERROR
+@@ -282,6 +283,8 @@ statuscfg: /* */
+               { cur_config.status_interval=$2; }
+       | INTERVAL TIME
+               { cur_config.status_interval=$2; }
++      | SCRIPTFORMAT boolean
++              { cur_config.status_format=$2; }
+       | statuscfg separator statuscfg
+ ;
+--- a/src/cfgparser2.l
++++ b/src/cfgparser2.l
+@@ -85,6 +85,7 @@ srcip                { LOC; LOCINC; return SRCIP; }
+ down          { LOC; LOCINC; return DOWN; }
+ false         { LOC; LOCINC; return FALSE; }
+ file          { LOC; LOCINC; return FILE_; }
++scriptformat  { LOC; LOCINC; return SCRIPTFORMAT; }
+ group         { LOC; LOCINC; return GROUP; }
+ interval      { LOC; LOCINC; return INTERVAL; }
+ loss          { LOC; LOCINC; return LOSS; }
+--- a/src/conf.h
++++ b/src/conf.h
+@@ -97,6 +97,7 @@ struct config {
+       char *pid_file;
+       char *status_file;
+       int status_interval;
++      int status_format;
+       char *timestamp_format;
+ };
+--- a/src/main.c
++++ b/src/main.c
+@@ -88,6 +88,7 @@ struct config default_config={
+       "/var/run/apinger.pid", /* pid file */
+       NULL,                   /* status file */
+       0,                      /* status interval */
++      0,                      /* status format */
+       "%b %d %H:%M:%S"        /* timestamp format */
+ };
diff --git a/net/apinger/patches/060-format-alarm-list.patch b/net/apinger/patches/060-format-alarm-list.patch
new file mode 100644 (file)
index 0000000..815202f
--- /dev/null
@@ -0,0 +1,12 @@
+--- a/src/apinger.c
++++ b/src/apinger.c
+@@ -860,6 +860,9 @@ char *buf1,*buf2;
+                               a=al->alarm;
+                               if(config->status_format){
+                                       fprintf(f,"%s",a->name);
++                                      if(al->next){
++                                              fprintf(f,",");
++                                      }
+                               }
+                               else{
+                                       fprintf(f," \"%s\"",a->name);
index 87fd91347e2396064313d296def992265398d71b..9889378f82f423c66e92eb27775d7295fc347710 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=autossh
 PKG_VERSION:=1.4g
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
 PKG_SOURCE_URL:=https://www.harding.motd.ca/autossh/
index 0e73cae4c33b9f9e5fd1547085cb23db99ee15f4..33701f3553aeb1129d523e7ab4c69a38edf62df4 100644 (file)
@@ -7,8 +7,4 @@
                /etc/init.d/autossh start
        }
 
-       [ "$ACTION" = "ifdown" ] && {
-               /etc/init.d/autossh stop
-       }
-
 }
index 9f6225bb081fd998bb2ca7ad8ea28935f5567d05..0e7b08666d4932b4a627c790a84e8bd3240437c7 100644 (file)
@@ -6,23 +6,74 @@ START=80
 
 start_instance() {
        local section="$1"
+       local forwarding
 
-       config_get ssh "$section" 'ssh'
-       config_get gatetime "$section" 'gatetime'
-       config_get monitorport "$section" 'monitorport'
-       config_get poll "$section" 'poll'
-       config_get_bool enabled "$section" 'enabled' '1'
+       config_get_bool enabled     "$section" enabled 1
+       [ "$enabled" != "1" ] && return 0
 
-       [ "$enabled" = 1 ] || exit 0
+       config_get ssh              "$section" ssh
+       if [ -z "$ssh" ]; then
+               echo "autossh: ssh option is required"
+               return 1
+       fi
 
-       procd_open_instance
-       procd_set_param command /usr/sbin/autossh -M ${monitorport:-20000} ${ssh}
+       config_get localhost       "$section" localhost localhost
+       config_get localport       "$section" localport
+       config_get remotehost      "$section" remotehost
+       config_get remoteport      "$section" remoteport
+       config_get monitorport     "$section" monitorport 20000
+       config_get poll            "$section" poll 600
+       config_get gatetime        "$section" gatetime 30
+       config_get first_poll      "$section" first_poll 
+       config_get loglevel        "$section" loglevel
+       config_get logfile         "$section" logfile
+       config_get maxlifetime     "$section" maxlifetime
+       config_get maxstart        "$section" maxstart
+       config_get message         "$section" message
+       config_get_bool ntservice  "$section" ntservice 0
+       config_get path            "$section" path
+       config_get pidfile         "$section" pidfile
+
+       if [ -z "$localport" ]; then
+               echo "autossh: localport option is required"
+               return 1
+       fi
+
+       if [ -n "$remotehost" ]; then
+               forwarding="-L ${localport}:${remotehost}:${remoteport}"
+       else
+               forwarding="-R ${remoteport}:${localhost}:${localport}"
+       fi
+
+       procd_open_instance "$section"
+       procd_set_param command /usr/sbin/autossh ${forwarding} ${ssh}
        procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
-       procd_set_param env AUTOSSH_GATETIME="${gatetime:-30}" AUTOSSH_POLL="${poll:-600}"
+       [ -n "$pidfile" ] && procd_set_param pidfile "$pidfile"
+
+       [ -n "$monitorport" ] && procd_append_param env "AUTOSSH_PORT=$monitorport"
+       [ -n "$poll" ] && procd_append_param env "AUTOSSH_POLL=$poll"
+       [ -n "$gatetime" ] && procd_append_param env "AUTOSSH_GATETIME=$gatetime"
+       [ -n "$first_poll" ] && procd_append_param env "AUTOSSH_FIRST_POLL=$first_poll"
+       [ -n "$loglevel" ] && procd_append_param env "AUTOSSH_LOGLEVEL=$loglevel"
+       [ -n "$logfile" ] && procd_append_param env "AUTOSSH_LOGFILE=$logfile"
+       [ -n "$maxlifetime" ] && procd_append_param env "AUTOSSH_MAXLIFETIME=$maxlifetime"
+       [ -n "$maxstart" ] && procd_append_param env "AUTOSSH_MAXSTART=$maxstart"
+       [ -n "$message" ] && procd_append_param env "AUTOSSH_MESSAGE=$message"
+       [ "$ntservice" == "1" ] && procd_append_param env "AUTOSSH_NTSERVICE=yes"
+       [ -n "$path" ] && procd_append_param env "AUTOSSH_PATH=$path"
+       [ -n "$pidfile" ] && procd_append_param env "AUTOSSH_PIDFILE=$pidfile"
+
        procd_close_instance
 }
 
 start_service() {
+       local instance=$1
+
        config_load 'autossh'
-       config_foreach start_instance 'autossh'
+
+       if [ -n "$instance" ]; then
+               start_instance "$1"
+       else
+               config_foreach start_instance 'autossh'
+       fi
 }
index 2e7b6bc197e4eb48997fdbba8b0bccf4a59953e8..779dc175968cb94aad1a113fddc9c2d5883e54ee 100644 (file)
@@ -9,7 +9,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bind
-PKG_VERSION:=9.18.1
+PKG_VERSION:=9.18.4
 PKG_RELEASE:=$(AUTORELEASE)
 USERID:=bind=57:bind=57
 
@@ -22,7 +22,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:= \
        https://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION) \
        https://ftp.isc.org/isc/bind9/$(PKG_VERSION)
-PKG_HASH:=57c7afd871694d615cb4defb1c1bd6ed023350943d7458414db8d493ef560427
+PKG_HASH:=f277ae50159a00c300eb926a9c5d51953038a936bd8242d6913dfb6eac42761d
 
 PKG_FIXUP:=autoreconf
 PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
index a5350a09797ddd00426feb5ee1fbe22f0e4cefbe..e4440e01c008a7aecc18d52a16b204db8d9b6045 100644 (file)
@@ -45,7 +45,7 @@ endef
 define Package/chrony-nts
 $(call Package/chrony/Default)
   TITLE+= (with NTS)
-  DEPENDS+= +libgnutls +ca-bundle
+  DEPENDS+= +PACKAGE_chrony-nts:libgnutls +PACKAGE_chrony-nts:ca-bundle
   VARIANT:=with-nts
 endef
 
index 6fb63aa67f2401b6f0ee78e2987bca529379f2ca..de53e6bf334d727651537e5a12b79b68f722bb2e 100644 (file)
@@ -70,8 +70,6 @@ CMAKE_OPTIONS += \
        -DENABLE_EXAMPLES=OFF \
        -DENABLE_UNRAR=OFF \
        -DENABLE_SYSTEMD=OFF \
-       -DIconv_INCLUDE_DIR=$(ICONV_PREFIX)/include \
-       -DIconv_LIBRARY=$(ICONV_PREFIX)/lib/libiconv.$(if $(ICONV_FULL),so,a) \
        -DHAVE_SYSTEM_LFS_FTS=O$(if $(CONFIG_USE_GLIBC),N,FF)
 
 TARGET_CXXFLAGS += -ffunction-sections -fdata-sections -fno-rtti -flto
diff --git a/net/clamav/patches/020-iconv.patch b/net/clamav/patches/020-iconv.patch
new file mode 100644 (file)
index 0000000..09cd491
--- /dev/null
@@ -0,0 +1,63 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -448,7 +448,7 @@ endif()
+ # libclamav feature dependencies
+ if(NOT WIN32)
+-    find_package(Iconv REQUIRED)
++    find_package(Iconv)
+     # Set variable required by libclamav to use iconv
+     set(HAVE_ICONV 1)
+ endif()
+--- a/libclamav/CMakeLists.txt
++++ b/libclamav/CMakeLists.txt
+@@ -536,10 +536,39 @@ if(ENABLE_SHARED_LIB)
+                 ClamAV::win32_compat
+                 wsock32 ws2_32 )
+     else()
++        if(Iconv_FOUND)
++            if(NOT Iconv_IS_BUILT_IN)
++                target_link_libraries(clamav PRIVATE Iconv::Iconv)
++                set(CMAKE_REQUIRED_LIBRARIES "Iconv::Iconv")
++            endif()
++        else()
++            # Sometime the build environment is not setup
++            # in a way CMake can find Iconv on its own by default.
++            # But if we simply link against iconv (-liconv), the build may succeed
++            # due to other compiler/link flags.
++            set(CMAKE_REQUIRED_LIBRARIES "iconv")
++            check_c_source_compiles("
++                #include <stddef.h>
++                #include <iconv.h>
++                int main() {
++                    char *a, *b;
++                    size_t i, j;
++                    iconv_t ic;
++                    ic = iconv_open(\"to\", \"from\");
++                    iconv(ic, &a, &i, &b, &j);
++                    iconv_close(ic);
++                }
++                "
++                Iconv_EXPLICITLY_AT_ENV)
++            if(Iconv_EXPLICITLY_AT_ENV)
++                target_link_libraries(clamav PRIVATE iconv)
++            else()
++                message(FATAL_ERROR "Iconv is not found, make sure to provide it in the build environment")
++            endif()
++        endif()
+         target_link_libraries( clamav
+             PUBLIC
+                 Threads::Threads
+-                Iconv::Iconv
+                 ${CMAKE_DL_LIBS}
+                 m )
+     endif()
+@@ -556,8 +585,6 @@ if(ENABLE_SHARED_LIB)
+     if(WIN32)
+         set_target_properties( clamav PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON )
+-    else()
+-        target_link_libraries( clamav PUBLIC Iconv::Iconv )
+     endif()
+     if(WIN32)
+         install( TARGETS clamav DESTINATION . COMPONENT libraries )
index bb45af1673eaedc71e62611f5b188367eae38c52..068e223776fccf046f2a60b167e66e6b3e1084a0 100644 (file)
@@ -5,12 +5,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cloudflared
-PKG_VERSION:=2022.6.2
+PKG_VERSION:=2022.7.1
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/cloudflare/cloudflared/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=599ea11ff7f6a8941eb2cdbc1eced0419eb3dec85104f3f7a6a8268f4d0e722a
+PKG_HASH:=3a822faaed7ae90be5ba4920f9226cd85367402d2c5a2bf2f0732c37cad6599d
 
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=LICENSE
index afb7f815190e6bbf794c7091b1d2398ad9271e2b..5e7e554d7b41c3b32ae4a9172f8edc8877ab348e 100644 (file)
@@ -4,7 +4,7 @@ comment "SSL support"
 
 choice
        prompt "Selected SSL library"
-       default LIBCURL_WOLFSSL
+       default LIBCURL_MBEDTLS
 
        config LIBCURL_MBEDTLS
                bool "mbed TLS"
diff --git a/net/curl/patches/100-wolfssl.patch b/net/curl/patches/100-wolfssl.patch
new file mode 100644 (file)
index 0000000..d395a07
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/m4/curl-wolfssl.m4
++++ b/m4/curl-wolfssl.m4
+@@ -93,6 +93,7 @@ if test "x$OPT_WOLFSSL" != xno; then
+    They are set up properly later if it is detected.  */
+ #undef SIZEOF_LONG
+ #undef SIZEOF_LONG_LONG
++#include <wolfssl/options.h>
+ #include <wolfssl/ssl.h>
+       ]],[[
+         return wolfSSL_Init();
index dce947c3f51b43d3a7e6151c1187ed32ed00a3ba..e2bc31642319cea48529490ea8ef1ed8a65a5b64 100644 (file)
@@ -5,13 +5,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dawn
-PKG_SOURCE_DATE:=2022-06-13
+PKG_SOURCE_DATE:=2022-07-24
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/berlin-open-wireless-lab/DAWN.git
-PKG_SOURCE_VERSION:=58861a1adba96574eee14d9d776ced102fcffe86
-PKG_MIRROR_HASH:=4fb5a455ae0ea1905762092f8add25c7e27fd72baf46c4bdc480d637f5fdca5b
+PKG_SOURCE_VERSION:=9e8060ea0908a1092cb07efead1226f494884a71
+PKG_MIRROR_HASH:=305538c6a03d4680c709af7801436a7bae2a811ea4f2f1bd41e42e56e71f2cc7
 
 PKG_MAINTAINER:=Nick Hainke <vincent@systemli.org>
 PKG_LICENSE:=GPL-2.0-only
index 6e6bdeb4acdcfdaf12d16ca57f5a91cb1945e64d..0f968136f9d21c2e1ae51e02f06bc9dee9712e6b 100644 (file)
@@ -16,6 +16,7 @@ config hostapd
        option hostapd_dir '/var/run/hostapd'
 
 config times
+       option con_timeout '60'
        option update_client '10'
        option remove_client '15'
        option remove_probe '30'
index 4d7da9ed3981fcfbd2b2b4ba554820e24b6321af..ed3fc73b37bba86a2c18a238473ae1ad40274d75 100644 (file)
@@ -115,7 +115,7 @@ define Package/dnsdist
          +libedit \
          +libstdcpp \
          +lmdb \
-         +liblua \
+         +luajit \
          +tinycdb
   URL:=https://dnsdist.org/
 endef
@@ -144,7 +144,7 @@ TARGET_CXX+=-std=c++17
 
 CONFIGURE_ARGS+= \
        --with-pic \
-       --with-lua=lua \
+       --with-lua=luajit \
        $(if $(CONFIG_DNSDIST_SODIUM),--enable-dnscrypt --with-libsodium,--disable-dnscrypt --without-libsodium) \
        $(if $(CONFIG_DNSDIST_DNSTAP),--enable-dnstap=yes,--enable-dnstap=no) \
        $(if $(CONFIG_DNSDIST_RE2),--with,--without)-re2 \
index dae13b1828c12ced0cbe7fbbf0b5aea075e7ba73..5775190997f85128417c7e20d8c6c48d93f9e3b9 100644 (file)
@@ -5,12 +5,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnslookup
-PKG_VERSION:=1.7.0
+PKG_VERSION:=1.7.1
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/ameshkov/dnslookup/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=1be8fa1b4d8e3b442dbfba9f463292e81b3c3fbd9a0cf3918a553b46a5014046
+PKG_HASH:=21a6905cb6a5acea09d110f35b3c0720fc8019fff17bc47e00cff7e7ac03d560
 
 PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
 PKG_LICENSE:=MIT
index 43d9ca83ae05c6fc6833b7f8afc34f7971d267d7..c6c4d8e4bae7cccb42a839e2b1b6212c9f095562 100644 (file)
@@ -7,16 +7,16 @@
 
 include $(TOPDIR)/rules.mk
 PKG_NAME:=frr
-PKG_VERSION:=8.2.2
+PKG_VERSION:=8.3.0
 PKG_RELEASE:=$(AUTORELEASE)
-PKG_SOURCE_DATE:=2022-03-22
+PKG_SOURCE_DATE:=2022-07-27
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_DATE).tar.gz
-PKG_SOURCE_VERSION:=830ba8bb25fb9968a4cd331a60344ad53ea0e300
+PKG_SOURCE_VERSION:=4a27375c965a7d9079b7aba1555df54df47f1ca4
 PKG_SOURCE_URL:=https://codeload.github.com/FRRouting/frr/tar.gz/$(PKG_SOURCE_VERSION)?
 
 
-PKG_HASH:=bf75b6443c65937d1b2713e75359c0d1e0f02c049c9ab5c7b9af4a0ce05f5700
+PKG_HASH:=d09fd6517b955f37418f0d260d0cd5fda0b3f4fd416e3121f270ce3934cdf6ba
 PKG_MAINTAINER:=Lucian Cristian <lucian.cristian@gmail.com>
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
index 9b38b238cdab1d3b879a1c48601d69cdbc3f2c55..96ef9e2bc076410dcae31bf8a6d0e6f008431b93 100644 (file)
@@ -1,6 +1,6 @@
 --- a/configure.ac
 +++ b/configure.ac
-@@ -816,7 +816,6 @@ fi
+@@ -833,7 +833,6 @@ fi
  #
  
  AS_IF([test "$host" = "$build"], [
index f3007e91ab89dc1eeef0032b7ac0de5d2a94d6b1..740c837459edb8a385ffe47ecfbbf6d339143d0e 100644 (file)
@@ -1,6 +1,6 @@
 --- a/lib/thread.c
 +++ b/lib/thread.c
-@@ -830,13 +830,9 @@ static void thread_free(struct thread_ma
+@@ -867,13 +867,9 @@ static void thread_free(struct thread_ma
        XFREE(MTYPE_THREAD, thread);
  }
  
@@ -16,7 +16,7 @@
        /*
         * If timer_wait is null here, that means poll() should block
         * indefinitely, unless the thread_master has overridden it by setting
-@@ -867,58 +863,15 @@ static int fd_poll(struct thread_master
+@@ -904,58 +900,15 @@ static int fd_poll(struct thread_master
        rcu_assert_read_unlocked();
  
        /* add poll pipe poker */
@@ -82,7 +82,7 @@
                while (read(m->io_pipe[0], &trash, sizeof(trash)) > 0)
                        ;
  
-@@ -1718,7 +1671,7 @@ struct thread *thread_fetch(struct threa
+@@ -1762,7 +1715,7 @@ struct thread *thread_fetch(struct threa
        struct timeval zerotime = {0, 0};
        struct timeval tv;
        struct timeval *tw = NULL;
@@ -91,7 +91,7 @@
        int num = 0;
  
        do {
-@@ -1794,14 +1747,14 @@ struct thread *thread_fetch(struct threa
+@@ -1838,14 +1791,14 @@ struct thread *thread_fetch(struct threa
  
                pthread_mutex_unlock(&m->mtx);
                {
index a94eb0e01cf35dcf735b92db0ce5c3378af18631..2744a2acca91fc4bb1472a0e5f75107b9ea0bd93 100644 (file)
@@ -33,6 +33,8 @@ PKG_CONFIG_DEPENDS:= \
        CONFIG_GENSIO_TCL \
        CONFIG_GENSIO_SSHD
 
+PKG_BUILD_DEPENDS:=PACKAGE_python3-gensio:swig
+
 include $(INCLUDE_DIR)/package.mk
 include ../../lang/python/python3-package.mk
 
@@ -130,8 +132,7 @@ $(call Package/gensio/Default)
   TITLE+= (Python3-bindings)
   SECTION:=lang
   CATEGORY:=Languages
-  BUILD_DEPENDS:=+swig +python3
-  DEPENDS:=+python3-light +libgensio
+  DEPENDS:=+PACKAGE_python3-gensio:python3-light +libgensio
 endef
 
 define Package/python3-gensio/description
@@ -146,7 +147,7 @@ $(call Package/gensio/Default)
   SECTION:=libs
   CATEGORY:=Libraries
   ABI_VERSION:=0
-  DEPENDS:=+libgensio +libstdcpp
+  DEPENDS:=+libgensio +PACKAGE_libgensiocpp:libstdcpp
 endef
 
 define Package/libgensiocpp/description
index a17cad8eda244e25f507c2dc9ef488f95f7eb518..373cf48eaec64b367424388babcba8c87acee5e5 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=go-ethereum
-PKG_VERSION:=1.9.25
+PKG_VERSION:=1.10.20
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/ethereum/go-ethereum/tar.gz/v${PKG_VERSION}?
-PKG_HASH:=d7b733aeef4eba97f5351ba435001fa7365f55adabffdfdda909700335e98b0e
+PKG_HASH:=15ff54f0a4444eb9faa7c1f6219d3a1db5d547178b4eef6679bb601abc681f9d
 
 PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
 PKG_LICENSE:=GPL-3.0-or-later LGPL-3.0-or-later
@@ -22,6 +22,7 @@ PKG_LICENSE_FILES:=COPYING COPYING.LESSER
 PKG_BUILD_DEPENDS:=golang/host
 PKG_BUILD_PARALLEL:=1
 PKG_USE_MIPS16:=0
+PKG_CONFIG_DEPENDS:=CONFIG_BUILD_NLS
 
 GO_PKG:=github.com/ethereum/go-ethereum
 GO_PKG_BUILD_PKG:=github.com/ethereum/go-ethereum/cmd/geth
@@ -44,7 +45,7 @@ that run exactly as programmed without possibility of downtime, censorship,
 fraud or third party interference.
 endef
 
-TARGET_LDFLAGS += -liconv
+TARGET_LDFLAGS += $(if $(ICONV_FULL),-liconv)
 
 define Package/geth/install
        $(call GoPackage/Package/Install/Bin,$(1))
diff --git a/net/gsocket/Makefile b/net/gsocket/Makefile
new file mode 100644 (file)
index 0000000..2c84f4e
--- /dev/null
@@ -0,0 +1,73 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gsocket
+PKG_VERSION:=1.4.37
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/hackerschoice/gsocket/releases/download/v$(PKG_VERSION)/
+PKG_HASH:=4f64f71a7d6b8be79754e7bf2109675ffc8a3e37a4a55b08c95a1b1d25e458e5
+
+PKG_MAINTAINER:=Ralf Kaiser <skyper@thc.org>
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/gsocket
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+libopenssl
+  TITLE:=Connect like there is no firewall
+  URL:=https://gsocket.io
+endef
+
+define Package/gsocket/description
+  Global Socket allows two workstations on different private networks to
+  communicate with each other. Through firewalls and through NAT - like
+  there is no firewall.
+
+  The TCP connection is secured with AES-256 and using OpenSSL's SRP
+  protocol (RFC 5054). It does not require a PKI and has forward
+  secrecy and (optional) TOR support.
+
+  The gsocket tools derive temporary session keys and IDs and connect
+  two TCP pipes through the Global Socket Relay Network (GSRN). This is 
+  done regardless and independent of the local IP Address or geographical
+  location.
+
+  The session keys (secrets) never leave the workstation. The GSRN sees only
+  the encrypted traffic.
+
+  The workhorse is 'gs-netcat' which opens a ssh-like interactive PTY
+  command shell to a remote workstation (which resides on a private and
+  remote network and/or behind a firewall).
+endef
+
+define Build/Configure
+ $(call Build/Configure/Default,--with-linux-headers=$(LINUX_DIR) --libdir=$(STAGING_DIR)/usr/lib --includedir=$(STAGING_DIR)/usr/include)
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+       LD="$(TARGET_CXX)" \
+       all
+endef
+
+define Package/gsocket/install
+       $(INSTALL_DIR)  $(1)/bin
+       $(INSTALL_DIR)  $(1)/share/gsocket
+       $(INSTALL_DIR)  $(1)/lib
+       $(INSTALL_DIR)  $(1)/etc
+       $(INSTALL_BIN)  $(PKG_BUILD_DIR)/tools/gs-sftp                    $(1)/bin/
+       $(INSTALL_BIN)  $(PKG_BUILD_DIR)/tools/gs-mount                   $(1)/bin/
+       $(INSTALL_BIN)  $(PKG_BUILD_DIR)/tools/blitz                      $(1)/bin/
+       $(INSTALL_BIN)  $(PKG_BUILD_DIR)/tools/gsocket                    $(1)/bin/
+       $(INSTALL_BIN)  $(PKG_BUILD_DIR)/tools/gs-netcat                  $(1)/bin/
+       $(INSTALL_BIN)  $(PKG_BUILD_DIR)/tools/gs_funcs                   $(1)/share/gsocket/
+       $(INSTALL_BIN)  $(PKG_BUILD_DIR)/tools/gsocket_uchroot_dso.so.0   $(1)/lib/
+       $(INSTALL_BIN)  $(PKG_BUILD_DIR)/tools/gsocket_dso.so.0           $(1)/lib/
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/tools/gsocket.conf               $(1)/etc/
+endef
+
+$(eval $(call BuildPackage,gsocket))
diff --git a/net/gsocket/test.sh b/net/gsocket/test.sh
new file mode 100755 (executable)
index 0000000..76843f2
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+gs-netcat -h 2>&1  | grep "$2"
index 727e1a0d4cb2d2c0e304e86fc958fa4431548f95..3b882d9543ac0c34073a3d7f415baa32f173552d 100644 (file)
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=haproxy
-PKG_VERSION:=2.4.17
+PKG_VERSION:=2.6.1
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://www.haproxy.org/download/2.4/src
-PKG_HASH:=416ca95d51bb57eaea0d6657c06a760faa63473dca10ac6f9e68b994088d73f4
+PKG_SOURCE_URL:=https://www.haproxy.org/download/2.6/src
+PKG_HASH:=915b351e6450d183342c4cdcda7771eac4f0f72bf90582adcd15a01c700d29b1
 
 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>, \
                Christian Lachner <gladiac@gmail.com>
index 45ba653a085f87e9ebc6c0d23bcc8e461a7e3caf..3f2ec3ada6f182f9533e90f7e36b75f363ebf3d2 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
-CLONEURL=https://git.haproxy.org/git/haproxy-2.4.git
-BASE_TAG=v2.4.17
+CLONEURL=https://git.haproxy.org/git/haproxy-2.6.git
+BASE_TAG=v2.6.1
 TMP_REPODIR=tmprepo
 PATCHESDIR=patches
 
index e3dcdfdd2387eefc4f676d5c8a9e6096ec69bcc2..e849a387d4820eda27f21692001092c34d289422 100755 (executable)
@@ -465,10 +465,11 @@ general_config() {
 
                cat <<EOF > $conf_local_file
 zone "$domain" {
-  type master;
-  file "$dyndir/db.$domain";
-  allow-update { key $session_key_name; };
-  allow-transfer { key $session_key_name; };
+       type master;
+       file "$dyndir/db.$domain";
+       update-policy {
+               grant $session_key_name zonesub any;
+       };
 };
 
 EOF
@@ -477,10 +478,11 @@ EOF
                        mynet="$(rev_str "$mynet" ".")"
                        cat <<EOF >> $conf_local_file
 zone "$mynet.in-addr.arpa" {
-  type master;
-  file "$dyndir/db.$mynet.in-addr.arpa";
-  allow-update { key $session_key_name; };
-  allow-transfer { key $session_key_name; };
+       type master;
+       file "$dyndir/db.$mynet.in-addr.arpa";
+       update-policy {
+               grant $session_key_name zonesub any;
+       };
 };
 
 EOF
@@ -504,7 +506,7 @@ include "$session_key_file";
 
 zone $domain. {
        primary 127.0.0.1;
-       key local-ddns;
+       key $session_key_name;
 }
 
 EOF
@@ -514,7 +516,7 @@ EOF
                        cat <<EOF
 zone $mynet.in-addr.arpa. {
        primary 127.0.0.1;
-       key local-ddns;
+       key $session_key_name;
 }
 
 EOF
index ee4bf88daec6ce0636bd8c371bcaae247f6249e0..0d63c38ab8e7b0ed01ac45d55792948e5c7e29ec 100755 (executable)
@@ -8,6 +8,8 @@ BIN_PATH="/usr/sbin"
 CONF_PATH="/etc/kea"
 
 start_service() {
+       mkdir -p /var/run/kea
+
        config_load "kea"
        config_foreach start_kea "service"
 }
index f02798f3a46cc86ca6d896ec2a826eed5573aa62..cb3773762d683ab18098a17c37e466ab8108100f 100644 (file)
@@ -10,12 +10,12 @@ PKG_RELRO_FULL:=0
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=knot-resolver
-PKG_VERSION:=5.4.3
+PKG_VERSION:=5.5.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://secure.nic.cz/files/knot-resolver
-PKG_HASH:=488729eb93190336b6bca10de0d78ecb7919f77fcab105debc0a644aa7d0a506
+PKG_HASH:=9bad1edfd6631446da2d2331bd869887d7fe502f6eeaf62b2e43e2c113f02b6d
 
 PKG_MAINTAINER:=Jan Pavlinec <jan.pavlinec1@gmail.com>
 PKG_LICENSE:=GPL-3.0-later
index 991dddd96977c84c3f1da4b9aa54f80026052cc2..70c6f81b064e68ba29cff47249f4dea0fb5e51eb 100644 (file)
@@ -2,7 +2,7 @@ This patch fixes the problem with forwarding in knot-resolver v4.3.0.
 It reintroduces a fix which enables  policy related hack (knot/knot-resolver#205 (comment 94566) )
 --- a/modules/policy/policy.lua
 +++ b/modules/policy/policy.lua
-@@ -1047,7 +1047,7 @@ policy.layer = {
+@@ -1098,7 +1098,7 @@ policy.layer = {
                if bit.band(state, bit.bor(kres.FAIL, kres.DONE)) ~= 0 then return state end
                local qry = req:initial() -- same as :current() but more descriptive
                return policy.evaluate(policy.rules, req, qry, state)
index f2bc17738d681112765c7fbb766351960a79ecb0..a4f118704c82f6fbc3ab1ca00f28053b8c8630d5 100644 (file)
@@ -8,7 +8,6 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/cifsd-team/ksmbd-tools/tar.gz/$(PKG_VERSION)?
 PKG_HASH:=e22e5bef29ffa2670fc82c490ad4dc6eb00963b4f963dd1852c811b437c77ee1
 
-PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
 PKG_LICENSE:=GPL-2.0-or-later
 PKG_LICENSE_FILES:=COPYING
 
@@ -93,8 +92,8 @@ TARGET_CFLAGS += -ffunction-sections -fdata-sections
 TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
 
 define Package/ksmbd-server/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ksmbd.mountd $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ksmbd.mountd $(1)/usr/sbin/
        $(INSTALL_DIR) $(1)/etc/config $(1)/etc/ksmbd $(1)/etc/init.d
        $(INSTALL_CONF) ./files/ksmbd.config $(1)/etc/config/ksmbd
        $(INSTALL_DATA) ./files/smb.conf.template $(1)/etc/ksmbd/
@@ -105,10 +104,10 @@ define Package/ksmbd-server/install
 endef
 
 define Package/ksmbd-utils/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ksmbd.adduser $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ksmbd.adduser $(1)/usr/sbin/
 ifeq ($(CONFIG_KSMBD_UTILS_SHAREADD),y)
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ksmbd.addshare $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ksmbd.addshare $(1)/usr/sbin/
 endif
 endef
 
index 33b4480952ffd71a00c7a19511b23b44df2f3dc0..2fffcd4ca386cf79437340d63ec59d3827dbc5b4 100644 (file)
@@ -1,4 +1,4 @@
-From a8ed6b5a752bd7e50940c9e198af3edc3af0d5f7 Mon Sep 17 00:00:00 2001
+From dc80281ba0d325e71ff6cd2c1d7d525c889b3996 Mon Sep 17 00:00:00 2001
 From: Rosen Penev <rosenp@gmail.com>
 Date: Sat, 2 Jan 2021 21:05:53 -0800
 Subject: [PATCH] add meson build
@@ -7,14 +7,14 @@ meson compiles faster and is simpler than autotools.
 
 Signed-off-by: Rosen Penev <rosenp@gmail.com>
 ---
- addshare/meson.build | 1++++++++++
- adduser/meson.build  | 1++++++++++++
- control/meson.build  |  ++++++++
+ addshare/meson.build | 11 +++++++++++
+ adduser/meson.build  | 13 +++++++++++++
+ control/meson.build  |  9 +++++++++
  lib/meson.build      | 18 ++++++++++++++++++
- meson.build          | 29 +++++++++++++++++++++++++++++
- meson_options.txt    |  +++
- mountd/meson.build   | 1++++++++++++++++
- 7 files changed, 96 insertions(+)
+ meson.build          | 33 +++++++++++++++++++++++++++++++++
+ meson_options.txt    |  4 ++++
+ mountd/meson.build   | 17 +++++++++++++++++
+ 7 files changed, 105 insertions(+)
  create mode 100644 addshare/meson.build
  create mode 100644 adduser/meson.build
  create mode 100644 control/meson.build
@@ -25,7 +25,7 @@ Signed-off-by: Rosen Penev <rosenp@gmail.com>
 
 --- /dev/null
 +++ b/addshare/meson.build
-@@ -0,0 +1,10 @@
+@@ -0,0 +1,11 @@
 +addshare = executable(
 +  'ksmbd.addshare',
 +  'share_admin.c',
@@ -35,10 +35,11 @@ Signed-off-by: Rosen Penev <rosenp@gmail.com>
 +  include_directories: tools_incdir,
 +  link_with: libksmbdtools,
 +  install: true,
++  install_dir: get_option('sbindir'),
 +)
 --- /dev/null
 +++ b/adduser/meson.build
-@@ -0,0 +1,12 @@
+@@ -0,0 +1,13 @@
 +adduser = executable(
 +  'ksmbd.adduser',
 +  'md4_hash.c',
@@ -50,10 +51,11 @@ Signed-off-by: Rosen Penev <rosenp@gmail.com>
 +  include_directories: tools_incdir,
 +  link_with: libksmbdtools,
 +  install: true,
++  install_dir: get_option('sbindir'),
 +)
 --- /dev/null
 +++ b/control/meson.build
-@@ -0,0 +1,8 @@
+@@ -0,0 +1,9 @@
 +control = executable(
 +  'ksmbd.control',
 +  'control.c',
@@ -61,6 +63,7 @@ Signed-off-by: Rosen Penev <rosenp@gmail.com>
 +  include_directories: tools_incdir,
 +  link_with: libksmbdtools,
 +  install: true,
++  install_dir: get_option('sbindir'),
 +)
 --- /dev/null
 +++ b/lib/meson.build
@@ -85,8 +88,11 @@ Signed-off-by: Rosen Penev <rosenp@gmail.com>
 +libksmbdtools = static_library('ksmbdtools', core_files, include_directories: tools_incdir, dependencies: [glib_dep, krb5_dep])
 --- /dev/null
 +++ b/meson.build
-@@ -0,0 +1,29 @@
-+project('ksmbsd-tools', 'c', version: '3.3.2', default_options: 'c_std=gnu99')
+@@ -0,0 +1,33 @@
++project('ksmbsd-tools', 'c',
++  version: run_command(find_program('awk'), '''/define KSMBD_TOOLS_VERSION / \
++    { gsub(/"/,"",$3); printf "%s", $3 }''', 'include/version.h', check: true).stdout(),
++  default_options: 'c_std=gnu99')
 +
 +tools_incdir = include_directories(['include', '.'])
 +
@@ -102,8 +108,9 @@ Signed-off-by: Rosen Penev <rosenp@gmail.com>
 +  cdata.set('CONFIG_KRB5', krb5_dep.found())
 +  cdata.set('HAVE_KRB5_KEYBLOCK_KEYVALUE', cc.has_member('krb5_keyblock', 'keyvalue', prefix: '#include <krb5.h>'))
 +  cdata.set('HAVE_KRB5_AUTHENTICATOR_CLIENT', cc.has_member('krb5_authenticator', 'client', prefix: '#include <krb5.h>'))
-+  cdata.set('HAVE_KRB5_AUTH_CON_GETRECVSUBKEY', cc.has_header_symbol('krb5.h', 'krb5_auth_con_getrecvsubkey'))
-+  cdata.set('HAVE_KRB5_AUTH_CON_GETAUTHENTICATOR_DOUBLE_POINTER', true)
++  cdata.set('HAVE_KRB5_AUTH_CON_GETRECVSUBKEY', cc.has_function('krb5_auth_con_getrecvsubkey', dependencies: krb5_dep))
++  cdata.set('HAVE_KRB5_AUTH_CON_GETAUTHENTICATOR_DOUBLE_POINTER', cc.compiles('''#include <krb5.h>
++    krb5_error_code krb5_auth_con_getauthenticator(krb5_context, krb5_auth_context, krb5_authenticator**);''', dependencies: krb5_dep))
 +endif
 +cfile = configure_file(
 +  output: 'config.h',
@@ -117,13 +124,14 @@ Signed-off-by: Rosen Penev <rosenp@gmail.com>
 +subdir('mountd')
 --- /dev/null
 +++ b/meson_options.txt
-@@ -0,0 +1,3 @@
+@@ -0,0 +1,4 @@
 +option('krb5', type : 'feature',
 +  description : 'Build with Kerberos support',
++  value : 'disabled',
 +)
 --- /dev/null
 +++ b/mountd/meson.build
-@@ -0,0 +1,16 @@
+@@ -0,0 +1,17 @@
 +mountd = executable(
 +  'ksmbd.mountd',
 +  'worker.c',
@@ -139,4 +147,5 @@ Signed-off-by: Rosen Penev <rosenp@gmail.com>
 +  include_directories: tools_incdir,
 +  link_with: libksmbdtools,
 +  install: true,
++  install_dir: get_option('sbindir'),
 +)
index e87231e31f56b0c5384cf80186dd891b72f0144c..ff46420190a036ceade8bbeb8ddac7f56bca4899 100644 (file)
@@ -12,7 +12,7 @@
 mkdir -m 0755 -p "${MODEMMANAGER_RUNDIR}"
 
 # Report network interface
-mm_log "${ACTION} network interface ${INTERFACE}: event processed"
+mm_log "info" "${ACTION} network interface ${INTERFACE}: event processed"
 mm_report_event "${ACTION}" "${INTERFACE}" "net" "/sys${DEVPATH}"
 
 # Look for an associated cdc-wdm interface
@@ -26,6 +26,6 @@ esac
 
 # Report cdc-wdm device, if any
 [ -n "${cdcwdm}" ] && {
-       mm_log "${ACTION} cdc interface ${cdcwdm}: custom event processed"
+       mm_log "info" "${ACTION} cdc interface ${cdcwdm}: custom event processed"
        mm_report_event "${ACTION}" "${cdcwdm}" "usbmisc" "/sys${DEVPATH}"
 }
index c13148a33dad382f0dd7a6a54323267b244bffe2..5d1042cdd25d46626c06530843045249ec2a8818 100644 (file)
@@ -12,5 +12,5 @@
 mkdir -m 0755 -p "${MODEMMANAGER_RUNDIR}"
 
 # Report TTY
-mm_log "${ACTION} serial interface ${DEVNAME}: event processed"
+mm_log "info" "${ACTION} serial interface ${DEVNAME}: event processed"
 mm_report_event "${ACTION}" "${DEVNAME}" "tty" "/sys${DEVPATH}"
index c4dc6b897da8ad2a07ea5ae5bdbb1a24049ed44f..b36ade478054ce22340a12835db0d485fde81156 100644 (file)
@@ -11,5 +11,5 @@
 mkdir -m 0755 -p "${MODEMMANAGER_RUNDIR}"
 
 # Report wwan
-mm_log "${ACTION} wwan control port ${DEVNAME}: event processed"
+mm_log "info" "${ACTION} wwan control port ${DEVNAME}: event processed"
 mm_report_event "${ACTION}" "${DEVNAME}" "wwan" "/sys${DEVPATH}"
index d24910b984f1498bafc5348b51757c0152ab4eee..855060f06e1cf1e86bb8b12d9a4dbb1ad3ca6a7b 100755 (executable)
@@ -515,7 +515,8 @@ proto_modemmanager_teardown() {
        modemstatus=$(mmcli --modem="${device}" --output-keyvalue)
        bearerpath=$(modemmanager_get_field "${modemstatus}" "modem.generic.bearers.value\[1\]")
        [ -n "${bearerpath}" ] || {
-               echo "couldn't load bearer path"
+               echo "couldn't load bearer path: disconnecting anyway"
+               mmcli --modem="${device}" --simple-disconnect >/dev/null 2>&1
                return
        }
 
index f7eba08ea1d03df9edab49b22d1fcd49d2976e6d..2fba0f3f8b98fbded204eaf631e36cff4d260290 100644 (file)
@@ -4,12 +4,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nebula
-PKG_VERSION:=1.5.0
+PKG_VERSION:=1.6.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/slackhq/nebula/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=f67684a8eba6da91de3601afc97567fddd0e198973bba950fcf15cded92cdc50
+PKG_HASH:=b16638b99d80a4ae6373f7757a0064dc0defd3f9e165617e7b5c3be9e64d3605
 
 PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
 PKG_LICENSE:=MIT
index d594a4edb34a879bfb6ad1cbc44f9a851caf0ee8..2da5a94f67f4ac6b4cba2aac6fc10dd3bb101b91 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh /etc/rc.common
-# Copyright 2021 Stan Grishin (stangri@melmac.net)
-# shellcheck disable=SC2039
+# Copyright 2021 Stan Grishin (stangri@melmac.ca)
+# shellcheck disable=SC2039,SC3043
 PKG_VERSION='dev-test'
 
 # shellcheck disable=SC2034
index a14a6941e5de6258f6d7a6919b53c6596be55ea0..a22c369c35146114268343a842d68fca5fe7c410 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2016-2021 eGloo, Incorporated
+# Copyright (C) 2016-2022 eGloo Incorporated
 #
 # This is free software, licensed under the GNU General Public License v2.
 
@@ -16,10 +16,10 @@ PKG_INSTALL:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://gitlab.com/netify.ai/public/netify-agent.git
-PKG_SOURCE_DATE:=2021-11-17
-PKG_SOURCE_VERSION:=v3.09
-#PKG_SOURCE_VERSION:=358ec2b0ac321e0608e78c75f6b7434ed1aec326
-PKG_MIRROR_HASH:=660079a75a17a07c638b25dab0ecc972c02fec2124930068bfcf15d28abf4121
+PKG_SOURCE_DATE:=2022-07-04
+PKG_SOURCE_VERSION:=v4.2.0
+#PKG_SOURCE_VERSION:=e3dc824d8f49ddc49a2b392b4960def267a01ba8
+PKG_MIRROR_HASH:=53b98bbc1c9442952c2cd3118de30100da9a366116ad253d14ba990671926a35
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -49,6 +49,7 @@ define Package/netifyd/conffiles
 /etc/netify.d/agent.uuid
 /etc/netify.d/serial.uuid
 /etc/netify.d/site.uuid
+/etc/netify.d/netify-categories.json
 endef
 
 TARGET_CFLAGS+=-ffunction-sections -fdata-sections -Wno-psabi
@@ -59,6 +60,7 @@ CONFIGURE_ARGS+= \
        --sharedstatedir=/var/run \
        --enable-lean-and-mean \
        --disable-libtcmalloc \
+       --disable-jemalloc \
        --without-systemdsystemunitdir \
        --without-tmpfilesdir
 
@@ -84,13 +86,12 @@ define Build/InstallDev
        $(CP) $(PKG_INSTALL_DIR)/usr/include/netifyd/pcap-compat/*.h $(1)/usr/include/netifyd/pcap-compat
        $(INSTALL_DIR) $(1)/usr/include/netifyd/nlohmann
        $(CP) $(PKG_INSTALL_DIR)/usr/include/netifyd/nlohmann/*.hpp $(1)/usr/include/netifyd/nlohmann
-       $(INSTALL_DIR) $(1)/usr/include/libndpi-2.9.0
-       $(INSTALL_DIR) $(1)/usr/include/libndpi-2.9.0/libndpi
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/libndpi-2.9.0/libndpi/*.h $(1)/usr/include/libndpi-2.9.0/libndpi
+       $(INSTALL_DIR) $(1)/usr/include/ndpi
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/ndpi/*.h $(1)/usr/include/ndpi
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetifyd.{a,so*} $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetifyd.{a,so*} $(1)/usr/lib
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnetifyd.pc $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnetifyd.pc $(1)/usr/lib/pkgconfig
 endef
 
 define Package/netifyd/install
@@ -103,9 +104,10 @@ define Package/netifyd/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/netifyd $(1)/usr/sbin
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetifyd.so.* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnetifyd.so.* $(1)/usr/lib
        $(INSTALL_DIR) $(1)/etc/netify.d
-       $(INSTALL_DATA) $(PKG_BUILD_DIR)/deploy/netify-sink.conf $(1)/etc/netify.d/netify-sink.conf
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/deploy/netify-apps.conf $(1)/etc/netify.d
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/deploy/netify-categories.json $(1)/etc/netify.d
        $(INSTALL_DIR) $(1)/usr/share/netifyd
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/deploy/functions.sh $(1)/usr/share/netifyd
 endef
index c5ecef8f442a510e0a508b7f5e8e623dd0bf56c3..4e04c515829633b968a41752732cff7fd6558970 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh /etc/rc.common
 #
-# Copyright (C) 2016-2021 eGloo, Incorporated
+# Copyright (C) 2016-2022 eGloo Incorporated
 #
 # This is free software, licensed under the GNU General Public License v2.
 
index 46eb0fdb365be19eea22ef32fd016128e8519819..0d34c985bd014051995b7dfa6ea36d063efc109f 100644 (file)
@@ -1,12 +1,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=netsniff-ng
-PKG_VERSION:=0.6.7
-PKG_RELEASE:=2
+PKG_VERSION:=0.6.8
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/netsniff-ng/netsniff-ng/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=030b0554206b43c5883e48a63575fb65d7835e275333372f55f7d615d419da05
+PKG_HASH:=4bbd8e286aee929d5f71788d226938e0ad6a7873f882412221a240faa2439a45
 
 PKG_MAINTAINER:=Toni Uhlig <matzeton@googlemail.com>
 PKG_LICENSE:=GPL-2.0-or-later
diff --git a/net/netsniff-ng/patches/010-uclibc.patch b/net/netsniff-ng/patches/010-uclibc.patch
deleted file mode 100644 (file)
index 89cdef5..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/cookie.c
-+++ b/cookie.c
-@@ -2,6 +2,7 @@
- #include <stdio.h>
- #include <string.h>
- #include <syslog.h>
-+#include <sys/types.h>
- #include "cookie.h"
index fae442a22a192b155cfee5096df809803a75b8fc..f9ec85620794424942ec22969d18baafb7bc0df4 100644 (file)
@@ -1,12 +1,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pdns-recursor
-PKG_VERSION:=4.7.0
+PKG_VERSION:=4.7.1
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://downloads.powerdns.com/releases/
-PKG_HASH:=e4872a1b11a35fc363f354d69ccb4ec88047bfc7d9308087497dc2ad3af3498c
+PKG_HASH:=d2f94573a6f0e63a1034ca2b301c27ebf2e1300a655ba669cc502d5ea8d6ec68
 
 PKG_MAINTAINER:=Peter van Dijk <peter.van.dijk@powerdns.com>
 PKG_LICENCE:=GPL-2.0-only
index 1b92dc6fd07cddff977989c26f4a976fad179d16..19ddbc93b421294f2a09181c2daf1e7ca529f6f8 100644 (file)
@@ -1,12 +1,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pdns
-PKG_VERSION:=4.6.2
+PKG_VERSION:=4.6.3
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://downloads.powerdns.com/releases/
-PKG_HASH:=f443848944bb11bbb4850221613b3a01ffb57febf2671da6caa57362ee0b19b8
+PKG_HASH:=acd06b89ca01d1adf61b906604614f0e1d77a1e94eeecade8ff5d53a16db7389
 
 PKG_MAINTAINER:=Peter van Dijk <peter.van.dijk@powerdns.com>
 PKG_LICENCE:=GPL-2.0-only
index 0f89fac019babff1b316b2e6cfb564b03e9521e3..eec4cebdf447a85daf766d664559dbd3a0b62fc9 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=radsecproxy
-PKG_VERSION:=1.9.0
-PKG_RELEASE:=3
+PKG_VERSION:=1.9.1
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/radsecproxy/radsecproxy/releases/download/$(PKG_VERSION)/
-PKG_HASH:=440624c53ae67c8e245b9b60ad4d29525471e957d923d94cf72945efc40f4a28
+PKG_HASH:=e08e4e04d188deafd0b55b2f66b1e7fff9bdb553fb170846590317d02c9dc5db
 
 PKG_MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
 PKG_LICENSE:=BSD-3-CLAUSE
diff --git a/net/radsecproxy/patches/100-fix-setstacksize-for-glibc-2.34.patch b/net/radsecproxy/patches/100-fix-setstacksize-for-glibc-2.34.patch
deleted file mode 100644 (file)
index 537fd11..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-From 241164a201e03acce363e902fb25e452827211f0 Mon Sep 17 00:00:00 2001
-From: Fabian Mauchle <fabian.mauchle@switch.ch>
-Date: Mon, 26 Jul 2021 14:12:15 +0200
-Subject: [PATCH] fix setstacksize for glibc 2.34 (fix #91)
-
----
- ChangeLog     |  1 +
- radsecproxy.c | 10 ++++++++--
- radsecproxy.h | 12 +++---------
- 3 files changed, 12 insertions(+), 11 deletions(-)
-
---- a/radsecproxy.c
-+++ b/radsecproxy.c
-@@ -3031,6 +3031,7 @@ int createpidfile(const char *pidfile) {
- int radsecproxy_main(int argc, char **argv) {
-     pthread_t sigth;
-     sigset_t sigset;
-+    size_t stacksize;
-     struct list_node *entry;
-     uint8_t foreground = 0, pretend = 0, loglevel = 0;
-     char *configfile = NULL, *pidfile = NULL;
-@@ -3042,8 +3043,13 @@ int radsecproxy_main(int argc, char **ar
-     if (pthread_attr_init(&pthread_attr))
-       debugx(1, DBG_ERR, "pthread_attr_init failed");
--    if (pthread_attr_setstacksize(&pthread_attr, PTHREAD_STACK_SIZE))
--      debugx(1, DBG_ERR, "pthread_attr_setstacksize failed");
-+#if defined(PTHREAD_STACK_MIN)
-+    stacksize = THREAD_STACK_SIZE > PTHREAD_STACK_MIN ? THREAD_STACK_SIZE : PTHREAD_STACK_MIN;
-+#else
-+    stacksize = THREAD_STACK_SIZE;
-+#endif
-+    if (pthread_attr_setstacksize(&pthread_attr, stacksize))
-+        debug(DBG_WARN, "pthread_attr_setstacksize failed! Using system default. Memory footprint might be increased!");
- #if defined(HAVE_MALLOPT)
-     if (mallopt(M_TRIM_THRESHOLD, 4 * 1024) != 1)
-       debugx(1, DBG_ERR, "mallopt failed");
---- a/radsecproxy.h
-+++ b/radsecproxy.h
-@@ -28,15 +28,9 @@
- #define STATUS_SERVER_PERIOD 25
- #define IDLE_TIMEOUT 300
--/* We want PTHREAD_STACK_SIZE to be 32768, but some platforms
-- * have a higher minimum value defined in PTHREAD_STACK_MIN. */
--#define PTHREAD_STACK_SIZE 32768
--#if defined(PTHREAD_STACK_MIN)
--#if PTHREAD_STACK_MIN > PTHREAD_STACK_SIZE
--#undef PTHREAD_STACK_SIZE
--#define PTHREAD_STACK_SIZE PTHREAD_STACK_MIN
--#endif
--#endif
-+/* Target value for stack size.
-+ * Some platforms might define higher minimums in PTHREAD_STACK_MIN. */
-+#define THREAD_STACK_SIZE 32768
- /* For systems that only support RFC 2292 Socket API, but not RFC 3542
-  * like Cygwin */
index 3d00aaba0c949c8901b6861809836b6ace027b25..54c18f35ad78afb9928919e2951cd1ef11bf22d9 100644 (file)
@@ -1,6 +1,6 @@
 --- a/radsecproxy.c
 +++ b/radsecproxy.c
-@@ -3073,15 +3073,13 @@ int radsecproxy_main(int argc, char **ar
+@@ -3075,15 +3075,13 @@ int radsecproxy_main(int argc, char **ar
        options.loglevel = loglevel;
      else if (options.loglevel)
        debug_set_level(options.loglevel);
index d967f4262463ba70c06cc1b8fcef77cdc8db9dbd..d1f931af574bf4771acef468fdc7b9825fbeef4f 100644 (file)
@@ -6,12 +6,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=rclone
-PKG_VERSION:=1.58.1
+PKG_VERSION:=1.59.0
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/rclone/rclone/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=b1fe94642547d63ce52cdc49a06696e8b478a04ca100ab4ab1c92ff7157177a9
+PKG_HASH:=01b2aa4f6dfafcda11026a5aa024dd86ae6bd337fa54269dfac97c80fe280d7a
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILE:=LICENSE
index ddc66f549cb69cc0bb6117fd2eadef4f8bb9aa1f..e33e46dcc6af74648e44ec784beaf40b6e91a17f 100644 (file)
@@ -1,17 +1,17 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=restic-rest-server
-PKG_VERSION:=0.9.7
-PKG_RELEASE:=5
+PKG_VERSION:=0.11.0
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/rest-server-$(PKG_VERSION)
 PKG_SOURCE:=rest-server-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/restic/rest-server/tar.gz/v${PKG_VERSION}?
-PKG_HASH:=922811cfc49879f7086fe559d25ec1bb4169b2c4a5df3559b499e6292f435661
+PKG_HASH:=cd9b35ad2224244207a967ebbc78d84f4298d725e95c1fa9341ed95a350ea68f
 
 PKG_LICENSE:=BSD-2-Clause
 PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Markus Weippert <markus@gekmihesg.de>
+PKG_MAINTAINER:=Tom Stöveken <tom@naaa.de>
 
 PKG_BUILD_DEPENDS:=golang/host
 PKG_BUILD_PARALLEL:=1
index 2492de6f7d0e3b5803a2a2bdb2fb11d65cd65694..c1ce7887ecf7c12a5c90ffcc2ba3edb04c2ee56c 100644 (file)
@@ -3,11 +3,16 @@ config rest-server
        option path '/mnt/backup'                       # data directory (default "/tmp/restic")
        #option append_only '1'                         # enable append only mode
        #option cpuprofile '/mnt/backup/cpuprofile'     # write CPU profile to file
-       #option debug '1'                               # output debug messages
+       #option debug '1'                                       # output debug messages
+       #option htpasswd_file '.htpasswd'       # location of .htpasswd file (default: "<data directory>/.htpasswd")
        #option listen ':8000'                          # listen address (default ":8000")
-       #option log '/mnt/backup/http.log'              # log HTTP requests in the combined log format
+       #option log '/mnt/backup/http.log'      # log HTTP requests in the combined log format
+       #option max_size '1000000'                      # the maximum size of the repository in bytes
+       #option no_auth '1'                                     # disable .htpasswd authentication
+       #option no_verify_upload '1'            # do not verify the integrity of uploaded data. DO NOT enable unless the rest-server runs on a very low-power device
        #option private_repos '1'                       # users can only access their private repo
        #option prometheus '1'                          # enable Prometheus metrics
-       #option tls '1'                                 # turn on TLS support
+       #option prometheus_no_auth '1'          # disable auth for Prometheus /metrics endpoint
+       #option tls '1'                                         # turn on TLS support
        #option tls_cert '/mnt/backup/public_key'       # TLS certificate path
        #option tls_key '/mnt/backup/private_key'       # TLS key path
index bdface2197ec84ee1e6fb047a4fa5c25bd8ecfef..616efec61df33fb84a24caf0725035d74eb4c617 100755 (executable)
@@ -15,11 +15,11 @@ start_instance() {
 
        procd_open_instance "$cfg"
        procd_set_param command "$PROG"
-       for var in append_only debug private_repos prometheus tls; do
+       for var in append_only debug no_auth no_verify_upload private_repos prometheus prometheus_no_auth tls; do
                config_get_bool val "$cfg" "$var" 0
                [ "$val" = 0 ] || procd_append_param command "--${var//_/-}"
        done
-       for var in cpuprofile listen log path tls_cert tls_key; do
+       for var in cpuprofile htpasswd_file listen log max_size path tls_cert tls_key; do
                config_get val "$cfg" "$var"
                [ -z "$val" ] || procd_append_param command "--${var//_/-}" "$val"
        done
@@ -29,7 +29,6 @@ start_instance() {
        procd_close_instance
 }
 
-
 service_triggers() {
        procd_add_reload_trigger restic-rest-server
 }
index d3b4bda270478f2f879e8cce35d05b6954286f59..9bdeec02f25cb97e96c743e2a78cf936b7be269c 100644 (file)
@@ -8,7 +8,6 @@ PKG_SOURCE_URL:=@SF/rpcbind
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_HASH:=5613746489cae5ae23a443bb85c05a11741a5f12c8f55d2bb5e83b9defeee8de
 
-PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
 PKG_LICENSE:=BSD-3-Clause
 PKG_CPE_ID:=cpe:/a:rpcbind_project:rpcbind
 
index 01da77a1c37eb3e706b0b71d5a00bc03ce41d485..e30fd470dc2b133e56d61d6c3e59f52766ae46ed 100644 (file)
@@ -15,7 +15,6 @@ PKG_SOURCE_URL:= \
                https://download.samba.org/pub/samba/stable/
 PKG_HASH:=155d9c2dfb06a18104422987590858bfe5e9783ebebe63882e7e7f07eaaa512d
 
-PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
 PKG_LICENSE:=GPL-3.0-only
 PKG_LICENSE_FILES:=COPYING
 PKG_CPE_ID:=cpe:/a:samba:samba
index 233a9c633edf4a2228b4dd68750938bdb25f3e3d..d3723073acabde9c6ce072dfe4d478ec1f91e153 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ser2net
 PKG_VERSION:=4.3.6
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/ser2net
index 7fd9d086fcbd4525d9984eaddb4603d05760e858..ca9915b908175b3dd90192bddcccead20bb40b2d 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2017 Michael Heimpold
 
-START=75
+START=99
 STOP=10
 
 USE_PROCD=1
@@ -189,4 +189,3 @@ start_service() {
 service_triggers() {
        procd_add_reload_trigger "ser2net"
 }
-
index d402da53cfa0ff6cb775b77a8ce352ef631f6a75..88e0a48077391d1721860291ecc6c4ecb32192ee 100644 (file)
@@ -24,12 +24,11 @@ PKG_LICENSE_FILES:=COPYING
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/v$(PKG_VERSION)
 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)/v$(PKG_VERSION)
 PKG_BUILD_DEPENDS:=softethervpn/host
-HOST_BUILD_DEPENDS:=readline/host libiconv/host
+HOST_BUILD_DEPENDS:=readline/host
 
 PKG_ASLR_PIE:=0
 HAMCORE_SE2:=$(STAGING_DIR_HOST)/share/softethervpn/hamcore.se2
 
-include $(INCLUDE_DIR)/nls.mk
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/host-build.mk
 
@@ -104,7 +103,7 @@ endef
 
 define Package/softethervpn-base
   $(Package/softethervpn/default)
-  DEPENDS:=+libpthread +librt +libreadline +libopenssl +libncurses +kmod-tun +zlib $(ICONV_DEPENDS)
+  DEPENDS:=+libpthread +librt +libreadline +libopenssl +libncurses +kmod-tun +zlib
   TITLE += (Base)
 endef
 
diff --git a/net/softethervpn/patches/130-iconv.patch b/net/softethervpn/patches/130-iconv.patch
deleted file mode 100644 (file)
index fd90a97..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
---- a/src/Mayaqua/Mayaqua.h
-+++ b/src/Mayaqua/Mayaqua.h
-@@ -284,7 +284,7 @@ int PASCAL WinMain(HINSTANCE hInst, HINS
- #include <ifaddrs.h>\r
- #endif        // MAYAQUA_SUPPORTS_GETIFADDRS\r
\r
--#ifdef        UNIX_LINUX\r
-+#if 0\r
- typedef void *iconv_t;\r
- iconv_t iconv_open (__const char *__tocode, __const char *__fromcode);\r
- size_t iconv (iconv_t __cd, char **__restrict __inbuf,\r
---- a/src/makefiles/linux_32bit.mak
-+++ b/src/makefiles/linux_32bit.mak
-@@ -68,7 +68,7 @@ OPTIONS_LINK_DEBUG=-g -fsigned-char -lm
- OPTIONS_COMPILE_RELEASE=-DNDEBUG -DVPN_SPEED -DUNIX -DUNIX_LINUX -D_REENTRANT -DREENTRANT -D_THREAD_SAFE -D_THREADSAFE -DTHREAD_SAFE -DTHREADSAFE -D_FILE_OFFSET_BITS=64 -I./src/ -I./src/Cedar/ -I./src/Mayaqua/ -O2 -fsigned-char
--OPTIONS_LINK_RELEASE=-O2 -fsigned-char -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz
-+OPTIONS_LINK_RELEASE=-O2 -fsigned-char -lm -ldl -lrt -liconv -lpthread -lssl -lcrypto -lreadline -lncurses -lz
- INSTALL_BINDIR=/usr/bin/
- INSTALL_VPNSERVER_DIR=/usr/vpnserver/
---- a/src/makefiles/linux_64bit.mak
-+++ b/src/makefiles/linux_64bit.mak
-@@ -68,7 +68,7 @@ OPTIONS_LINK_DEBUG=-g -fsigned-char -m64
- OPTIONS_COMPILE_RELEASE=-DNDEBUG -DVPN_SPEED -DUNIX -DUNIX_LINUX -DCPU_64 -D_REENTRANT -DREENTRANT -D_THREAD_SAFE -D_THREADSAFE -DTHREAD_SAFE -DTHREADSAFE -D_FILE_OFFSET_BITS=64 -I./src/ -I./src/Cedar/ -I./src/Mayaqua/ -O2 -fsigned-char
--OPTIONS_LINK_RELEASE=-O2 -fsigned-char -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz
-+OPTIONS_LINK_RELEASE=-O2 -fsigned-char -lm -ldl -lrt -liconv -lpthread -lssl -lcrypto -lreadline -lncurses -lz
- INSTALL_BINDIR=/usr/bin/
- INSTALL_VPNSERVER_DIR=/usr/vpnserver/
index 566d7beb10f9c351b89b78f99427defe3edc0d0c..350086dd126dd4a8bfc4466b188db92e5e934333 100644 (file)
@@ -6,7 +6,6 @@ PKG_NAME:=softethervpn5
 PKG_VERSION:=5.02.5180
 PKG_RELEASE:=$(AUTORELEASE)
 
-PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
 
index 32204028386258e3da03c262e611d64969f024ca..1cb4a1e7b2fa91f6945ee3f57e0b06009c214011 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=spoofer
-PKG_VERSION:=1.4.6
-PKG_RELEASE:=1
+PKG_VERSION:=1.4.8
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://www.caida.org/projects/spoofer/downloads
-PKG_HASH:=fb814d0beaccc48a155e55bb1e7057520d0fe0584dbcc4c0a89f5cee55d0eaf1
+PKG_HASH:=9e94810b8b84db6005d78bd1db13d7f4c1307e50c28824e27e0629c5abfd317c
 
 PKG_MAINTAINER:=Ken Keys <spoofer-info@caida.org>
 PKG_LICENSE:=GPL-3.0-or-later
index 87f9839edac143b7f8cb7a9a831ba54ac4f20227..6b275b3183b7c1a76f5e54afd58f9eadf10774ed 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=stunnel
-PKG_VERSION:=5.64
+PKG_VERSION:=5.65
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_LICENSE:=GPL-2.0-or-later
@@ -23,7 +23,7 @@ PKG_SOURCE_URL:= \
        https://www.usenix.org.uk/mirrors/stunnel/archive/$(word 1, $(subst .,$(space),$(PKG_VERSION))).x/
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_HASH:=eebe53ed116ba43b2e786762b0c2b91511e7b74857ad4765824e7199e6faf883
+PKG_HASH:=60c500063bd1feff2877f5726e38278c086f96c178f03f09d264a2012d6bf7fc
 
 PKG_FIXUP:=autoreconf
 PKG_FIXUP:=patch-libtool
index dbc790deb6fef9ca28e425832243293918fb082a..fe3f2f111c2168554b1461e2dd23c9e63628b2b8 100644 (file)
@@ -4,12 +4,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tgt
-PKG_VERSION:=1.0.82
+PKG_VERSION:=1.0.83
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/fujita/tgt/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=35156277465e0ced5f3ca7e301110a937a7a2b90bbb5aecbca1349b91ada1c2c
+PKG_HASH:=a9ddb0ff32d3396416df9639f9f398d14a6051f505b5772d7d196df99df8b8da
 
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
 PKG_LICENSE:=GPL-2.0-only
index 082407b386a63440097a6e110c6ba28e5141dfc8..69e5dbe0e24c79958fea893b33af47eded9b9dbf 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tor
-PKG_VERSION:=0.4.7.7
+PKG_VERSION:=0.4.7.8
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://dist.torproject.org/ \
        https://archive.torproject.org/tor-package-archive
-PKG_HASH:=3e131158b52b9435d7e43d1c47ef288b96d005342cc44b8c950bb403851a5b44
+PKG_HASH:=9e9a5c67ad2acdd5f0f8be14ed591fed076b1708abf8344066990a0fa66fe195
 PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de> \
                Peter Wagner <tripolar@gmx.at>
 PKG_LICENSE_FILES:=LICENSE
index b78e28c96a9979962ec112df11193340ccfad50f..4626c1b9650c0b26cfceb3c0ac1cdcc54b232403 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=transmission
 PKG_VERSION:=3.00
-PKG_RELEASE:=18
+PKG_RELEASE:=19
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GITHUB/transmission/transmission-releases/master
@@ -32,7 +32,6 @@ PKG_CONFIG_DEPENDS:= \
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/package-seccomp.mk
-include $(INCLUDE_DIR)/nls.mk
 
 define Package/transmission/template
   SUBMENU:=BitTorrent
@@ -40,7 +39,7 @@ define Package/transmission/template
   CATEGORY:=Network
   TITLE:=BitTorrent client
   URL:=https://www.transmissionbt.com
-  DEPENDS:=+libcurl +libevent2 +libminiupnpc +libnatpmp +libpthread +librt +zlib +LIBCURL_NOSSL:libmbedtls +LIBCURL_GNUTLS:libmbedtls $(ICONV_DEPENDS)
+  DEPENDS:=+libcurl +libevent2 +libminiupnpc +libnatpmp +libpthread +librt +zlib +LIBCURL_NOSSL:libmbedtls +LIBCURL_GNUTLS:libmbedtls
 endef
 
 define Package/transmission-daemon
@@ -89,7 +88,7 @@ define Package/transmission-daemon/conffiles
 endef
 
 TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -Wl,--gc-sections -Wl,--as-needed -liconv
+TARGET_LDFLAGS += -Wl,--gc-sections -Wl,--as-needed
 
 CONFIGURE_ARGS += \
        --enable-cli \
index 2b7f640d0c258348b26e8bbe895fd6a58e7f3c1e..5361bbc5c3c0ddbc9256cb488f445ad6678a33b0 100644 (file)
@@ -1,13 +1,13 @@
 #
-# Copyright (c) 2016-2021 Dirk Brenken (dev@brenken.org)
+# Copyright (c) 2016-2022 Dirk Brenken (dev@brenken.org)
 # This is free software, licensed under the GNU General Public License v3.
 #
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=travelmate
-PKG_VERSION:=2.0.7
-PKG_RELEASE:=3
+PKG_VERSION:=2.0.9
+PKG_RELEASE:=2
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
 
index e0a6b497716386dd2d3e8a81084f7f2c1a15bbc0..c1b52fd802d2ed791d00b1a67f89759b7bb3ec9f 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # travelmate, a wlan connection manager for travel router
-# Copyright (c) 2016-2021 Dirk Brenken (dev@brenken.org)
+# Copyright (c) 2016-2022 Dirk Brenken (dev@brenken.org)
 # This is free software, licensed under the GNU General Public License v3.
 
 # set (s)hellcheck exceptions
@@ -10,7 +10,7 @@ export LC_ALL=C
 export PATH="/usr/sbin:/usr/bin:/sbin:/bin"
 set -o pipefail
 
-trm_ver="2.0.7"
+trm_ver="2.0.9"
 trm_enabled="0"
 trm_debug="0"
 trm_iface=""
@@ -57,7 +57,7 @@ f_env() {
                return
        fi
 
-       unset trm_stalist trm_radiolist trm_uplinklist trm_uplinkcfg trm_wpaflags trm_activesta trm_opensta
+       unset trm_stalist trm_radiolist trm_uplinklist trm_vpnifacelist trm_uplinkcfg trm_wpaflags trm_activesta trm_opensta
 
        trm_sysver="$(ubus -S call system board 2>/dev/null | jsonfilter -q -e '@.model' -e '@.release.description' |
                awk 'BEGIN{RS="";FS="\n"}{printf "%s, %s",$1,$2}')"
@@ -113,12 +113,14 @@ f_env() {
        fi
 
        json_load_file "${trm_rtfile}" >/dev/null 2>&1
-
        if ! json_select data >/dev/null 2>&1; then
                : >"${trm_rtfile}"
                json_init
                json_add_object "data"
        fi
+       
+       config_load network
+       config_foreach f_getvpn "interface"
        f_log "debug" "f_env    ::: auto_sta: ${trm_opensta:-"-"}, wpa_flags: ${trm_wpaflags}, sys_ver: ${trm_sysver}"
 }
 
@@ -180,28 +182,51 @@ f_wifi() {
 # vpn helper function
 #
 f_vpn() {
-       local rc vpn vpn_service vpn_iface vpn_action="${1}"
+       local rc result iface vpn vpn_service vpn_iface vpn_status vpn_action="${1}"
 
        vpn="$(f_getval "vpn")"
        vpn_service="$(f_getval "vpnservice")"
        vpn_iface="$(f_getval "vpniface")"
-       [ -z "${vpn_action}" ] && { [ "${vpn}" = "1" ] && vpn_action="enable" || vpn_action="disable"; }
 
-       if [ -x "${trm_vpnpgm}" ] && [ -n "${vpn_service}" ] && [ -n "${vpn_iface}" ] && [ -f "${trm_ntpfile}" ]; then
-               if { [ "${vpn_action}" = "disable" ] && [ -f "${trm_vpnfile}" ]; } ||
-                       { [ "${vpn}" = "1" ] && [ "${vpn_action}" = "enable" ] && [ ! -f "${trm_vpnfile}" ]; } ||
-                       { [ "${vpn}" != "1" ] && [ "${vpn_action}" = "enable" ] && [ -f "${trm_vpnfile}" ]; }; then
-                       "${trm_vpnpgm}" "${vpn}" "${vpn_action}" "${vpn_service}" "${vpn_iface}" >/dev/null 2>&1
-                       rc="${?}"
+       if [ ! -f "${trm_vpnfile}" ] || { [ -f "${trm_vpnfile}" ] && [ "${vpn_action}" = "enable" ]; }; then
+               for iface in ${trm_vpnifacelist}; do
+                       vpn_status="$(ifstatus "${iface}" | jsonfilter -q -l1 -e '@.up')"
+                       if [ "${vpn_status}" = "true" ]; then
+                               ifdown "${iface}"
+                               f_log "info" "take down vpn interface '${iface}' (initial)"
+                       fi
+               done
+               [ -x "/etc/init.d/openvpn" ] && /etc/init.d/openvpn stop
+               if [ -f "/etc/init.d/sysntpd" ]; then
+                       /etc/init.d/sysntpd restart >/dev/null 2>&1
                fi
-               if [ "${vpn}" = "1" ] && [ "${vpn_action}" = "enable" ] && [ "${rc}" = "0" ]; then
-                       : >"${trm_vpnfile}"
-               elif { [ "${vpn}" != "1" ] || [ "${vpn_action}" = "disable" ]; } && [ -f "${trm_vpnfile}" ]; then
-                       rm -f "${trm_vpnfile}"
+               rm -f "${trm_vpnfile}"
+       elif [ "${vpn}" = "1" ] && [ -n "${vpn_iface}" ] && [ "${vpn_action}" = "enable_keep" ]; then
+               for iface in ${trm_vpnifacelist}; do
+                       vpn_status="$(ifstatus "${iface}" | jsonfilter -q -l1 -e '@.up')"
+                       if [ "${vpn_status}" = "true" ] && [ "${iface}" != "${vpn_iface}" ]; then
+                               ifdown "${iface}"
+                               [ -x "/etc/init.d/openvpn" ] && /etc/init.d/openvpn stop
+                               f_log "info" "take down vpn interface '${iface}' (switch)"
+                               rm -f "${trm_vpnfile}"
+                               break
+                       fi
+               done
+       fi
+       if [ -x "${trm_vpnpgm}" ] && [ -n "${vpn_service}" ] && [ -n "${vpn_iface}" ]; then
+               if { [ "${vpn_action}" = "disable" ] && [ -f "${trm_vpnfile}" ]; } ||
+                       { [ -f "${trm_ntpfile}" ] && {  [ "${vpn}" = "1" ] && [ "${vpn_action%_*}" = "enable" ] && [ ! -f "${trm_vpnfile}" ]; } ||
+                       { [ "${vpn}" != "1" ] && [ "${vpn_action%_*}" = "enable" ] && [ -f "${trm_vpnfile}" ]; }; }; then
+                               result="$(f_net)"
+                               if [ "${result}" = "net ok" ] || [ "${vpn_action}" = "disable" ]; then
+                                       f_log "info" "vpn call '${vpn:-"0"}/${vpn_action}/${vpn_service}/${vpn_iface}'"
+                                       "${trm_vpnpgm}" "${vpn:-"0"}" "${vpn_action%_*}" "${vpn_service}" "${vpn_iface}" >/dev/null 2>&1
+                                       rc="${?}"
+                               fi
                fi
                [ -n "${rc}" ] && f_jsnup
        fi
-       f_log "debug" "f_vpn    ::: enabled: ${vpn:-"-"}, action: ${vpn_action}, service: ${vpn_service:-"-"}, iface: ${vpn_iface:-"-"}, rc: ${rc:-"-"}, program: ${trm_vpnpgm}"
+       f_log "debug" "f_vpn    ::: enabled: ${vpn:-"-"}, action: ${vpn_action}, service: ${vpn_service:-"-"}, iface: ${vpn_iface:-"-"}, rc: ${rc:-"-"}"
 }
 
 # mac helper function
@@ -293,6 +318,18 @@ f_ctrack() {
        f_log "debug" "f_ctrack ::: action: ${action:-"-"}, uplink_config: ${trm_uplinkcfg:-"-"}"
 }
 
+# get logical vpn network interfaces
+#
+f_getvpn() {
+       local proto iface="${1}"
+
+       proto="$(uci_get "network" "${iface}" "proto")"
+       if [ "${proto}" = "none" ] || [ "${proto}" = "wireguard" ]; then
+               trm_vpnifacelist="$(f_trim "${trm_vpnifacelist} ${iface}")"
+       fi
+       f_log "debug" "f_getvpn ::: interface: ${iface:-"-"}, protocol: ${proto:-"-"}, vpn_interfacelist: ${trm_vpnifacelist:-"-"}"
+}
+
 # get wan gateway addresses
 #
 f_getgw() {
@@ -477,7 +514,7 @@ f_addsta() {
 # check net status
 #
 f_net() {
-       local err_msg raw html_raw html_cp json_raw json_ec json_rc json_cp json_ed result="net nok"
+       local err_msg raw json_raw html_raw html_cp js_cp json_ec json_rc json_cp json_ed result="net nok"
 
        raw="$(${trm_fetch} --user-agent "${trm_useragent}" --referer "http://www.example.com" --header "Cache-Control: no-cache, no-store, must-revalidate, max-age=0" --write-out "%{json}" --silent --max-time $((trm_maxwait / 6)) "${trm_captiveurl}")"
        json_raw="${raw#*\{}"
@@ -492,8 +529,11 @@ f_net() {
                        else
                                if [ "${json_rc}" = "200" ] || [ "${json_rc}" = "204" ]; then
                                        html_cp="$(printf "%s" "${html_raw}" | awk 'match(tolower($0),/^.*<meta[ \t]+http-equiv=['\''"]*refresh.*[ \t;]url=/){print substr(tolower($0),RLENGTH+1)}' | awk 'BEGIN{FS="[:/]"}{printf "%s",$4;exit}')"
+                                       js_cp="$(printf "%s" "${html_raw}" | awk 'match(tolower($0),/^.*location\.href=['\''"]*/){print substr(tolower($0),RLENGTH+1)}' | awk 'BEGIN{FS="[:/]"}{printf "%s",$4;exit}')"
                                        if [ -n "${html_cp}" ]; then
                                                result="net cp '${html_cp}'"
+                                       elif [ -n "${js_cp}" ]; then
+                                               result="net cp '${js_cp}'"
                                        else
                                                result="net ok"
                                        fi
@@ -514,7 +554,7 @@ f_net() {
                fi
        fi
        printf "%s" "${result}"
-       f_log "debug" "f_net    ::: fetch: ${trm_fetch}, timeout: $((trm_maxwait / 6)), cp (json/html): ${json_cp:-"-"}/${html_cp:-"-"}, result: ${result}, error (rc/msg): ${json_ec}/${err_msg:-"-"}, url: ${trm_captiveurl}, user_agent: ${trm_useragent}"
+       f_log "debug" "f_net    ::: fetch: ${trm_fetch}, timeout: $((trm_maxwait / 6)), cp (json/html/js): ${json_cp:-"-"}/${html_cp:-"-"}/${js_cp:-"-"}, result: ${result}, error (rc/msg): ${json_ec}/${err_msg:-"-"}, url: ${trm_captiveurl}, user_agent: ${trm_useragent}"
 }
 
 # check interface status
@@ -564,15 +604,20 @@ f_check() {
                                                if [ "${trm_ifstatus}" = "true" ]; then
                                                        result="$(f_net)"
                                                        if [ "${trm_captive}" = "1" ]; then
-                                                               cp_domain="$(printf "%s" "${result}" | awk -F '['\''| ]' '/^net cp/{printf "%s",$4}')"
-                                                               if [ -x "/etc/init.d/dnsmasq" ] && [ -f "/etc/config/dhcp" ] &&
-                                                                       [ -n "${cp_domain}" ] && ! uci_get "dhcp" "@dnsmasq[0]" "rebind_domain" | grep -q "${cp_domain}"; then
-                                                                       uci_add_list "dhcp" "@dnsmasq[0]" "rebind_domain" "${cp_domain}"
-                                                                       uci_commit "dhcp"
-                                                                       /etc/init.d/dnsmasq reload
-                                                                       f_log "info" "captive portal domain '${cp_domain}' added to to dhcp rebind whitelist"
-                                                               fi
-                                                               if [ -n "${cp_domain}" ] && [ "${trm_captive}" = "1" ]; then
+                                                               while true; do
+                                                                       cp_domain="$(printf "%s" "${result}" | awk -F '['\''| ]' '/^net cp/{printf "%s",$4}')"
+                                                                       if [ -x "/etc/init.d/dnsmasq" ] && [ -f "/etc/config/dhcp" ] &&
+                                                                               [ -n "${cp_domain}" ] && ! uci_get "dhcp" "@dnsmasq[0]" "rebind_domain" | grep -q "${cp_domain}"; then
+                                                                               uci_add_list "dhcp" "@dnsmasq[0]" "rebind_domain" "${cp_domain}"
+                                                                               uci_commit "dhcp"
+                                                                               /etc/init.d/dnsmasq reload
+                                                                               f_log "info" "captive portal domain '${cp_domain}' added to to dhcp rebind whitelist"
+                                                                       else 
+                                                                               break
+                                                                       fi
+                                                                       result="$(f_net)"
+                                                               done
+                                                               if [ -n "${cp_domain}" ]; then
                                                                        trm_connection="${result:-"-"}/${trm_ifquality}"
                                                                        f_jsnup
                                                                        login_script="$(f_getval "script")"
@@ -595,12 +640,14 @@ f_check() {
                                                                        fi
                                                                fi
                                                        fi
-                                                       if [ "${trm_netcheck}" = "1" ] && [ "${result}" = "net nok" ]; then
-                                                               f_log "info" "uplink has no internet"
+                                                       if [ "${result}" = "net nok" ]; then
                                                                f_vpn "disable"
-                                                               trm_ifstatus="${status}"
-                                                               f_jsnup
-                                                               break
+                                                               if [ "${trm_netcheck}" = "1" ]; then
+                                                                       f_log "info" "uplink has no internet"
+                                                                       trm_ifstatus="${status}"
+                                                                       f_jsnup
+                                                                       break
+                                                               fi
                                                        fi
                                                        trm_connection="${result:-"-"}/${trm_ifquality}"
                                                        f_jsnup
@@ -786,11 +833,11 @@ f_main() {
                                        if [ -n "${trm_connection}" ] && [ "${radio}" = "${config_radio}" ] && [ "${sta_radio}" = "${config_radio}" ] &&
                                                [ "${sta_essid}" = "${config_essid}" ] && [ "${sta_bssid}" = "${config_bssid}" ]; then
                                                f_ctrack "refresh"
-                                               f_log "info" "uplink still in range '${config_radio}/${config_essid}/${config_bssid:-"-"}' with mac '${sta_mac:-"-"}'"
-                                               f_vpn
+                                               f_vpn "enable_keep"
+                                               f_log "debug" "f_main-4 ::: config_radio: ${config_radio}, config_essid: ${config_essid}, config_bssid: ${config_bssid:-"-"}"
                                                return 0
                                        fi
-                                       f_log "debug" "f_main-4 ::: sta_radio: ${sta_radio}, sta_essid: \"${sta_essid}\", sta_bssid: ${sta_bssid:-"-"}"
+                                       f_log "debug" "f_main-5 ::: sta_radio: ${sta_radio}, sta_essid: \"${sta_essid}\", sta_bssid: ${sta_bssid:-"-"}"
                                fi
                                if [ -z "${scan_list}" ]; then
                                        scan_dev="$(ubus -S call network.wireless status 2>/dev/null | jsonfilter -q -l1 -e "@.${radio}.interfaces[0].ifname")"
@@ -798,7 +845,7 @@ f_main() {
                                                awk 'BEGIN{FS="[[:space:]]"}/Address:/{var1=$NF}/ESSID:/{var2="";for(i=12;i<=NF;i++)if(var2==""){var2=$i}else{var2=var2" "$i}}
                                                /Quality:/{split($NF,var0,"/")}/Encryption:/{if($NF=="none"){var3="+"}else{var3="-"};
                                                printf "%i %s %s %s\n",(var0[1]*100/var0[2]),var3,var1,var2}' | sort -rn | head -qn "${trm_maxscan}")"
-                                       f_log "debug" "f_main-5 ::: radio: ${radio}, scan_device: ${scan_dev}, scan_max: ${trm_maxscan}"
+                                       f_log "debug" "f_main-6 ::: radio: ${radio}, scan_device: ${scan_dev}, scan_max: ${trm_maxscan}"
                                        if [ -z "${scan_list}" ]; then
                                                f_log "info" "no scan results on '${radio}'"
                                                continue 2
@@ -809,7 +856,7 @@ f_main() {
                                #
                                while read -r scan_quality scan_open scan_bssid scan_essid; do
                                        if [ -n "${scan_quality}" ] && [ -n "${scan_open}" ] && [ -n "${scan_bssid}" ] && [ -n "${scan_essid}" ]; then
-                                               f_log "debug" "f_main-6 ::: radio(sta/scan): ${sta_radio}/${radio}, essid(sta/scan): \"${sta_essid}\"/${scan_essid}, bssid(sta/scan): ${sta_bssid}/${scan_bssid}, quality(min/scan): ${trm_minquality}/${scan_quality}, open: ${scan_open}"
+                                               f_log "debug" "f_main-7 ::: radio(sta/scan): ${sta_radio}/${radio}, essid(sta/scan): \"${sta_essid}\"/${scan_essid}, bssid(sta/scan): ${sta_bssid}/${scan_bssid}, quality(min/scan): ${trm_minquality}/${scan_quality}, open: ${scan_open}"
                                                if [ "${scan_quality}" -ge "${trm_minquality}" ]; then
                                                        if { { [ "${scan_essid}" = "\"${sta_essid}\"" ] && { [ -z "${sta_bssid}" ] || [ "${scan_bssid}" = "${sta_bssid}" ]; }; } ||
                                                                { [ "${scan_bssid}" = "${sta_bssid}" ] && [ "${scan_essid}" = "unknown" ]; }; } && [ "${radio}" = "${sta_radio}" ]; then
index 09ce503541bde0aef43a5be180ffe5db4b145694..230f5899e66e4ac6a7b4f2668c1965b9e0e7cd07 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # vpn handler called by travelmate
-# Copyright (c) 2020-2021 Dirk Brenken (dev@brenken.org)
+# Copyright (c) 2020-2022 Dirk Brenken (dev@brenken.org)
 # This is free software, licensed under the GNU General Public License v3.
 
 # set (s)hellcheck exceptions
@@ -23,6 +23,7 @@ trm_captiveurl="$(uci_get travelmate global trm_captiveurl "http://detectportal.
 trm_useragent="$(uci_get travelmate global trm_useragent "Mozilla/5.0 (Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0")"
 trm_logger="$(command -v logger)"
 trm_fetch="$(command -v curl)"
+trm_vpnfile="/var/state/travelmate.vpn"
 
 f_net() {
        local json_rc result="net nok"
@@ -35,51 +36,39 @@ f_net() {
 }
 
 vpn_status="$(ubus -S call network.interface."${vpn_iface}" status 2>/dev/null | jsonfilter -q -l1 -e '@.up')"
-case "${vpn_service}" in
-       "wireguard")
-               if [ "${vpn_action}" = "enable" ] && [ "${vpn_status:-"false"}" != "true" ]; then
-                       ubus call network.interface."${vpn_iface}" up
-               fi
-               if { [ "${vpn}" = "0" ] && [ "${vpn_action}" = "enable" ]; } || { [ "${vpn_action}" = "disable" ] && [ "${vpn_status}" = "true" ]; }; then
-                       ubus call network.interface."${vpn_iface}" down
-                       "${trm_logger}" -p "info" -t "trm-vpn  [${$}]" "${vpn_service} client connection disabled" 2>/dev/null
-               fi
-               ;;
-       "openvpn")
-               if [ "${vpn_action}" = "enable" ] && [ "${vpn_status:-"false"}" != "true" ]; then
-                       ubus call network.interface."${vpn_iface}" up
-                       /etc/init.d/openvpn restart >/dev/null 2>&1
-               fi
-               if { [ "${vpn}" = "0" ] && [ "${vpn_action}" = "enable" ]; } || { [ "${vpn_action}" = "disable" ] && [ "${vpn_status}" = "true" ]; }; then
-                       ubus call network.interface."${vpn_iface}" down
-                       /etc/init.d/openvpn stop >/dev/null 2>&1
-                       "${trm_logger}" -p "info" -t "trm-vpn  [${$}]" "${vpn_service} client connection disabled" 2>/dev/null
-               fi
-               ;;
-esac
-
-if [ "${vpn}" = "1" ] && [ "${vpn_action}" = "enable" ] && [ "${vpn_status:-"false"}" != "true" ]; then
+if [ "${vpn}" = "1" ] && [ "${vpn_action}" = "enable" ] && [ "${vpn_status}" != "true" ]; then
+       if [ "${vpn_service}" = "openvpn" ] && [ -x "/etc/init.d/openvpn" ]; then
+               /etc/init.d/openvpn start
+       fi
+       ifup "${vpn_iface}"
        cnt=0
        while true; do
                vpn_status="$(ubus -S call network.interface."${vpn_iface}" status 2>/dev/null | jsonfilter -q -l1 -e '@.up')"
                if [ "${vpn_status}" = "true" ]; then
                        net_status="$(f_net)"
                        if [ "${net_status}" = "net ok" ]; then
+                               : >"${trm_vpnfile}"
                                "${trm_logger}" -p "info" -t "trm-vpn  [${$}]" "${vpn_service} client connection enabled" 2>/dev/null
                                break
                        fi
                fi
-               if [ "${cnt}" -ge "$((trm_maxwait / 6))" ]; then
+               if [ "${cnt}" -ge "$((trm_maxwait / 3))" ]; then
+                       ifdown "${vpn_iface}"
+                       if [ "${vpn_service}" = "openvpn" ] && [ -x "/etc/init.d/openvpn" ]; then
+                               /etc/init.d/openvpn stop
+                       fi
+                       rm -f "${trm_vpnfile}"
                        "${trm_logger}" -p "info" -t "trm-vpn  [${$}]" "${vpn_service} client connection can't be established" 2>/dev/null
-                       ubus call network.interface."${vpn_iface}" down
                        exit 1
                fi
                sleep 1
                cnt="$((cnt + 1))"
        done
-fi
-if [ "${vpn_action}" = "enable" ] && [ "${vpn_status}" = "true" ]; then
-       if [ -f "/etc/init.d/sysntpd" ]; then
-               /etc/init.d/sysntpd restart >/dev/null 2>&1
+elif { [ "${vpn}" != "1" ] && [ "${vpn_action}" = "enable" ]; } || [ "${vpn_action}" = "disable" ]; then
+       ifdown "${vpn_iface}"
+       if [ "${vpn_service}" = "openvpn" ] && [ -x "/etc/init.d/openvpn" ]; then
+               /etc/init.d/openvpn stop
        fi
+       rm -f "${trm_vpnfile}"
+       "${trm_logger}" -p "info" -t "trm-vpn  [${$}]" "${vpn_service} client connection disabled" 2>/dev/null
 fi
index 534ffdee4961749b7b0e3d4d2927377c8ee13d8c..615f2fa57847c19cfd6d633a41a6c7e1f017b17e 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=unbound
-PKG_VERSION:=1.16.0
+PKG_VERSION:=1.16.1
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://nlnetlabs.nl/downloads/unbound
-PKG_HASH:=6701534c938eb019626601191edc6d012fc534c09d2418d5b92827db0cbe48a5
+PKG_HASH:=2fe4762abccd564a0738d5d502f57ead273e681e92d50d7fba32d11103174e9a
 
 PKG_MAINTAINER:=Eric Luehrsen <ericluehrsen@gmail.com>
 PKG_LICENSE:=BSD-3-Clause
index d148d16aaacc5fce7f073a2c408dd275aed4a01b..8effd5a276ff86d26d3a2622883a172f8e60f731 100644 (file)
@@ -3,7 +3,7 @@ Fix cross compile errors by inserting an environment variable for the
 target. Use "uname" on host only if "UNAME" variable is empty.
 --- a/configure.ac
 +++ b/configure.ac
-@@ -812,7 +812,7 @@ if test x_$ub_test_python != x_no; then
+@@ -813,7 +813,7 @@ if test x_$ub_test_python != x_no; then
     fi
  fi
  
index 26d10993d8d34b876831e3969a167f9fe95d6415..aa5c0c30e79d122bd57b75248be3f05cef3ea331 100644 (file)
@@ -3,13 +3,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=usteer
-PKG_SOURCE_DATE:=2022-05-17
-PKG_SOURCE_VERSION:=7afab9604b580266a81935fb1d9df4c3b33831a3
+PKG_SOURCE_DATE:=2022-07-21
+PKG_SOURCE_VERSION:=9059b9a537b165d96b85b19c51d48389a5a5432e
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=https://git.openwrt.org/project/usteer.git
-PKG_MIRROR_HASH:=c6982609698ed81da6e651613728e3a8edadd3e7f56ebfb8f0ea30c6c786866d
+PKG_MIRROR_HASH:=57113e31501add97bf22e42370db52cd6114072145b89a5f9f546861e05f8111
 
 PKG_MAINTAINER:=David Bauer <mail@david-bauer.net>
 PKG_LICENSE:=GPL-2.0-only
index 07cdbfd7df341468eaffc4e3b8521e8493a85733..900d8a6482185c900976b0ae8448e354591ee55f 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wifidog
 PKG_VERSION:=1.3.0
-PKG_RELEASE:=6
+PKG_RELEASE:=7
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/wifidog/wifidog-gateway
diff --git a/net/wifidog/patches/030-wolfssl-options.patch b/net/wifidog/patches/030-wolfssl-options.patch
new file mode 100644 (file)
index 0000000..3be051a
--- /dev/null
@@ -0,0 +1,18 @@
+--- a/src/simple_http.c
++++ b/src/simple_http.c
+@@ -28,6 +28,7 @@
+ #include <arpa/inet.h>
+ #include <errno.h>
+ #include <unistd.h>
++#include <pthread.h>
+ #include <string.h>
+ #include <syslog.h>
+@@ -37,6 +38,7 @@
+ #include "pstring.h"
+ #ifdef USE_CYASSL
++#include <cyassl/options.h>
+ #include <cyassl/ssl.h>
+ #include "conf.h"
+ /* For CYASSL_MAX_ERROR_SZ */
index b81c44f57dd57492c68458a1a577677ccb098ad7..038f93dd6a225d22b6fc181d0a4af771ecec4145 100644 (file)
@@ -9,7 +9,6 @@ PKG_SOURCE_DATE:=2021-10-22
 PKG_SOURCE_VERSION:=9831daf2e14e0e112b5ad95224e9167072d52aa3
 PKG_MIRROR_HASH:=403d7d20bf2ae67e898db4543c61cc07f337cedf038a11c84a2af5504cfb82e9
 
-PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
 PKG_LICENSE:=GPL-3.0-only
 PKG_LICENSE_FILES:=COPYING
 
index d1a9731a3319fe8c90c0aa0b1731ef2f4475625c..aeffcba6b1c4622533c1d88a4bb07c538c3ccf47 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=xfrpc
-PKG_VERSION:=1.05.561
+PKG_VERSION:=1.07.582
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/liudf0716/xfrpc.git
 PKG_SOURCE_VERSION:=$(PKG_VERSION)
-PKG_MIRROR_HASH:=21506e519212ff58230f2c88678a5d88676eb5d3657b6888492925188528258f
+PKG_MIRROR_HASH:=163d255e65bf516864bbd6db91f6f694fd42409d9cddcf08372ccfff650e5032
 
 PKG_MAINTAINER:=Dengfeng Liu <liudf0716@gmail.com>
 PKG_LICENSE:=GPL-3.0-or-later
index fc0053e2740b722bb0f523e5d92ff3876d00fd00..aa999bc68a253c26e83091aa780b92653e079d46 100755 (executable)
@@ -64,7 +64,7 @@ start_service() {
        config_load "$NAME"
 
        uci_validate_section xfrpc xfrp init \
-                       'disabled:bool:1' \
+                       'disabled:bool:0' \
                        'loglevel:uinteger:0'
 
        if [ $disabled = 1 ]; then
index 8c3de96b222b9efc2598ee2cc077a05612af8cdc..b8a06cfe47e52886e2316b1845ea00a0ff4173c1 100644 (file)
@@ -1,12 +1,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=xray-core
-PKG_VERSION:=1.5.7
+PKG_VERSION:=1.5.9
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/XTLS/Xray-core/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=6e1761b63da7fb17da98aa6cf74d224882467cd9825c12eb0ab28eacf8d92d19
+PKG_HASH:=ef61f80a32229f583c375ec8da79a1533ba5efae0fcb011e68a0ad0c913f6a87
 
 PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
 PKG_LICENSE:=MPL-2.0
@@ -78,22 +78,22 @@ define Package/xray-core/conffiles
 /etc/config/xray
 endef
 
-GEOIP_VER:=202205260055
+GEOIP_VER:=202207140057
 GEOIP_FILE:=geoip.dat.$(GEOIP_VER)
 define Download/geoip
   URL:=https://github.com/v2fly/geoip/releases/download/$(GEOIP_VER)/
   URL_FILE:=geoip.dat
   FILE:=$(GEOIP_FILE)
-  HASH:=c9eb7a4897a7bdafad5d4a71f966345674bd7f3f8ab487cb05599ed17b325106
+  HASH:=1c786d10e3a1f84b6088b6d2692cefa7bd34c1b4508de07708f8ecb81ff3cc7c
 endef
 
-GEOSITE_VER:=20220528180904
+GEOSITE_VER:=20220717025946
 GEOSITE_FILE:=dlc.dat.$(GEOSITE_VER)
 define Download/geosite
   URL:=https://github.com/v2fly/domain-list-community/releases/download/$(GEOSITE_VER)/
   URL_FILE:=dlc.dat
   FILE:=$(GEOSITE_FILE)
-  HASH:=d0c9f3cbf7925c33dfb8fb9578cdfa6733fc9f19c2ccfb4cba5a6415a14afe5c
+  HASH:=f719c27f6fa0f4995702ec03a5642d6ee31a59e3d9a4fe825b6a77479a707f3e
 endef
 
 define Build/Prepare
index e97d7f923b85683711bbe8d9426128bdb8ecc695..87b9afa6686c455135541e71efe0a2f385d97d41 100644 (file)
@@ -7,9 +7,9 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=xtables-addons
-PKG_VERSION:=3.20
+PKG_VERSION:=3.21
 PKG_RELEASE:=$(AUTORELEASE)
-PKG_HASH:=359d625658ecc2190b9f164e067d83070a949ac64f81fcddd484be5d14fa116e
+PKG_HASH:=2e09ac129a14f5e9c23b115ebcdfff4aa84e2aeba1268dbdf39b2d752bd71e19
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://inai.de/files/xtables-addons/
index 76e5f5772e03635db0d8263df14164640ad138a0..bf839440bb6b6114971ca14ead6cd4c49568a341 100644 (file)
@@ -6,12 +6,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zerotier
-PKG_VERSION:=1.8.9
+PKG_VERSION:=1.10.1
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/zerotier/ZeroTierOne/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=78fc0dda08d022b4fff9b88449d21a62016452304e930d4ee8393fe2930e65a8
+PKG_HASH:=1cc6b5da059486aff588fa6e6f43d20a7063569cc108bbe7254969f1cf72c968
 PKG_BUILD_DIR:=$(BUILD_DIR)/ZeroTierOne-$(PKG_VERSION)
 
 PKG_MAINTAINER:=Moritz Warning <moritzwarning@web.de>
index 493cd6c4da9d74a938604ffee41621be5a54962c..dada5f5fd17557cdf5498ffa271e08e966899800 100644 (file)
@@ -1,7 +1,7 @@
-From 2a867d408c7488a273022652c55e1b31545eba4c Mon Sep 17 00:00:00 2001
+From 2c513f0db50eaee5623d58ac024d62142f4ac782 Mon Sep 17 00:00:00 2001
 From: Moritz Warning <moritzwarning@web.de>
-Date: Tue, 8 Mar 2022 19:09:47 +0100
-Subject: [PATCH 1/3] fix makefile
+Date: Mon, 4 Jul 2022 00:09:24 +0200
+Subject: [PATCH 1/2] fix makefile
 
 ---
  make-linux.mk | 14 +++++++-------
@@ -21,7 +21,7 @@ Subject: [PATCH 1/3] fix makefile
        override DEFS+=-DZT_USE_SYSTEM_MINIUPNPC
        LDLIBS+=-lminiupnpc
 @@ -34,7 +34,7 @@ else
-       override DEFS+=-DMINIUPNP_STATICLIB -DMINIUPNPC_SET_SOCKET_TIMEOUT -DMINIUPNPC_GET_SRC_ADDR -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DOS_STRING=\"Linux\" -DMINIUPNPC_VERSION_STRING=\"2.0\" -DUPNP_VERSION_STRING=\"UPnP/1.1\" -DENABLE_STRNATPMPERR
+       override DEFS+=-DMINIUPNP_STATICLIB -DMINIUPNPC_SET_SOCKET_TIMEOUT -DMINIUPNPC_GET_SRC_ADDR -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DOS_STRING="\"Linux\"" -DMINIUPNPC_VERSION_STRING="\"2.0\"" -DUPNP_VERSION_STRING="\"UPnP/1.1\"" -DENABLE_STRNATPMPERR
        ONE_OBJS+=ext/miniupnpc/connecthostport.o ext/miniupnpc/igd_desc_parse.o ext/miniupnpc/minisoap.o ext/miniupnpc/minissdpc.o ext/miniupnpc/miniupnpc.o ext/miniupnpc/miniwget.o ext/miniupnpc/minixml.o ext/miniupnpc/portlistingparse.o ext/miniupnpc/receivedata.o ext/miniupnpc/upnpcommands.o ext/miniupnpc/upnpdev.o ext/miniupnpc/upnperrors.o ext/miniupnpc/upnpreplyparse.o
  endif
 -ifeq ($(wildcard /usr/include/natpmp.h),)
@@ -29,22 +29,16 @@ Subject: [PATCH 1/3] fix makefile
        ONE_OBJS+=ext/libnatpmp/natpmp.o ext/libnatpmp/getgateway.o
  else
        LDLIBS+=-lnatpmp
-@@ -66,11 +66,11 @@ ifeq ($(ZT_DEBUG),1)
-       # C25519 in particular is almost UNUSABLE in -O0 even on a 3ghz box!
- node/Salsa20.o node/SHA512.o node/C25519.o node/Poly1305.o: CXXFLAGS=-Wall -O2 -g -pthread $(INCLUDES) $(DEFS)
- else
--      CFLAGS?=-O3 -fstack-protector -fPIE
-+      CFLAGS?=-O3 -fstack-protector
+@@ -70,7 +70,7 @@ else
        override CFLAGS+=-Wall -Wno-deprecated -pthread $(INCLUDES) -DNDEBUG $(DEFS)
--      CXXFLAGS?=-O3 -fstack-protector -fPIE
-+      CXXFLAGS?=-O3 -fstack-protector
-       override CXXFLAGS+=-Wall -Wno-deprecated -std=c++11 -pthread $(INCLUDES) -DNDEBUG $(DEFS)
+       CXXFLAGS?=-O3 -fstack-protector
+       override CXXFLAGS+=-Wall -Wno-deprecated -std=c++17 -pthread $(INCLUDES) -DNDEBUG $(DEFS)
 -      LDFLAGS=-pie -Wl,-z,relro,-z,now
-+      LDFLAGS+=-Wl,-z,relro,-z,now
++      LDFLAGS=-Wl,-z,relro,-z,now
        RUSTFLAGS=--release
  endif
  
-@@ -310,7 +310,7 @@ ifeq ($(ZT_CONTROLLER),1)
+@@ -308,7 +308,7 @@ ifeq ($(ZT_CONTROLLER),1)
  endif
  
  # ARM32 hell -- use conservative CFLAGS
@@ -53,3 +47,14 @@ Subject: [PATCH 1/3] fix makefile
        ifeq ($(shell if [ -e /usr/bin/dpkg ]; then dpkg --print-architecture; fi),armel)
                override CFLAGS+=-march=armv5t -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm
                override CXXFLAGS+=-march=armv5t -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm
+@@ -335,8 +335,8 @@ ifeq ($(ZT_USE_ARM32_NEON_ASM_CRYPTO),1)
+ endif
+ # Position Independence
+-override CFLAGS+=-fPIC -fPIE
+-override CXXFLAGS+=-fPIC -fPIE
++#override CFLAGS+=-fPIC -fPIE
++#override CXXFLAGS+=-fPIC -fPIE
+ .PHONY: all
+ all:  one
index b45b916b2235df2eab06472bf3d1a49630aaf872..00fef6eb52b28213d6c7e36b6d4434a163f37834 100644 (file)
@@ -1,7 +1,7 @@
-From 1f03e3ddf714063da645cf62d9df08cbcb3ddfb3 Mon Sep 17 00:00:00 2001
+From 819232a2b5a09d7aa3cacb8dcf7c2e28afde1b06 Mon Sep 17 00:00:00 2001
 From: Moritz Warning <moritzwarning@web.de>
-Date: Mon, 30 Nov 2020 12:25:42 +0100
-Subject: [PATCH 2/3] fix compilation for arm_cortex-a7+neon
+Date: Mon, 4 Jul 2022 00:10:52 +0200
+Subject: [PATCH 2/2] fix compilation for arm_cortex-a7+neon
 
 Fixes "error: 'vrbitq_u8' was not declared in this scope"
 
index 04c1b43719d28ef0051052159009c990b7ab78a5..02838bd113322d955f5f7f03d1089a7b16adccc7 100644 (file)
@@ -6,18 +6,19 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mpd
-PKG_VERSION:=0.23.5
+PKG_VERSION:=0.23.8
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://www.musicpd.org/download/mpd/0.23
-PKG_HASH:=f22c2c25093a05f4566f9cd7207cfbcd8405af67ed29a989bcf8905f80b7a299
+PKG_HASH:=86bb569bf3b519821f36f6bb5564e484e85d2564411b34b200fe2cd3a04e78cf
 
 PKG_MAINTAINER:=
 PKG_LICENSE:=GPL-2.0-or-later
 PKG_LICENSE_FILES:=COPYING
 
 PKG_CONFIG_DEPENDS:= \
+       CONFIG_AUDIO_SUPPORT \
        CONFIG_BUILD_PATENTED \
        CONFIG_IPV6 \
 
@@ -180,7 +181,7 @@ ifeq ($(BUILD_VARIANT),full)
        -Dupnp=npupnp \
        -Dmms=enabled \
        -Dsoundcloud=enabled \
-       -Dffmpeg=$(if $(CONFIG_BUILD_PATENTED),en,dis)abled \
+       -Dffmpeg=enabled \
        -Dmad=$(if $(CONFIG_BUILD_PATENTED),dis,en)abled \
        -Dtremor=disabled \
        -Dvorbis=enabled \
index c1f1ffccad6cc02adba9ede9598e6fd69e53efc9..0e53cf6d4c39036d9103e9baa0428742099d809f 100644 (file)
@@ -18,24 +18,22 @@ Signed-off-by: Rosen Penev <rosenp@gmail.com>
 
 --- a/src/lib/icu/meson.build
 +++ b/src/lib/icu/meson.build
-@@ -18,8 +18,18 @@ if icu_dep.found()
+@@ -19,16 +19,8 @@ if icu_dep.found()
      'Init.cxx',
    ]
  elif not get_option('iconv').disabled()
--  have_iconv = compiler.has_function('iconv', prefix : '#include <iconv.h>')
+-  # an installed iconv library will make the builtin iconv() unavailable,
+-  # so search for the library first and pass it as (possible) dependency
+-  iconv_dep = compiler.find_library('libiconv', required: false)
+-  have_iconv = compiler.has_function('iconv', 
+-    dependencies: iconv_dep, 
+-    prefix : '#include <iconv.h>')
+-  if not have_iconv and get_option('iconv').enabled()
+-    error('iconv() not available')
+-  endif
 -  conf.set('HAVE_ICONV', have_iconv)
-+  have_iconv = c_compiler.has_header_symbol('iconv.h', 'iconv')
-+  if have_iconv
-+    libiconv = c_compiler.find_library('iconv', required : false)
-+    conf.set('HAVE_ICONV', have_iconv)
-+    libiconv_dep = static_library('iconv', icu_sources, include_directories: inc, dependencies: libiconv)
-+    icu_dep = declare_dependency(link_with: libiconv_dep, dependencies: util_dep)
-+  endif
-+  if not have_iconv and c_compiler.has_function('iconv')
-+    libiconv = []
-+    have_iconv = true
-+    conf.set('HAVE_ICONV', have_iconv)
-+  endif
-   if not have_iconv and get_option('iconv').enabled()
-     error('iconv() not available')
-   endif
++  iconv_dep = dependency('iconv')
++  conf.set('HAVE_ICONV', iconv_dep.found())
+ endif
+ icu = static_library(
index b8c0f368dc2023745f106077fb3b486e2d20fd37..05e21e109f78827602225df7bc16215d8ef506e1 100644 (file)
@@ -78,6 +78,52 @@ process_curl_page() {
        printf "\\t</Page>\n" >> "$COLLECTD_CONF"
 }
 
+process_write_http() {
+       printf "<Plugin write_http>\n" >> "$COLLECTD_CONF"
+       config_foreach process_write_http_node write_http_node
+       printf "</Plugin>\n\n" >> "$COLLECTD_CONF"
+}
+
+process_write_http_node() {
+       local cfg="$1"
+
+       local name URL Format User Password Timeout BufferSize
+
+       config_get name "$cfg" name
+       [ -z "$name" ] && {
+               $LOG notice "No name option in config $cfg defined"
+               return 0
+       }
+       config_get URL "$cfg" URL
+       [ -z "$URL" ] && {
+               $LOG notice "No URL option in config $cfg defined"
+               return 0
+       }
+       config_get Format "$cfg" Format
+       config_get User "$cfg" User
+       config_get Password "$cfg" Password
+       config_get Timeout "$cfg" Timeout
+       config_get BufferSize "$cfg" BufferSize
+       printf "\\t<Node \"%s\">\n" "${name}" >> "$COLLECTD_CONF"
+       printf "\\t\\tURL \"%s\"\n" "${URL}" >> "$COLLECTD_CONF"
+       [ -z "$Format" ] || {
+               printf "\\t\\tFormat \"%s\"\n" "${Format}" >> "$COLLECTD_CONF"
+       }
+       [ -z "$User" ] || {
+               printf "\\t\\tUser \"%s\"\n" "${User}" >> "$COLLECTD_CONF"
+       }
+       [ -z "$Password" ] || {
+               printf "\\t\\tPassword \"%s\"\n" "${Password}" >> "$COLLECTD_CONF"
+       }
+       [ -z "$Timeout" ] || {
+               printf "\\t\\tTimeout \%s\n" "${Timeout}" >> "$COLLECTD_CONF"
+       }
+       [ -z "$BufferSize" ] || {
+               printf "\\t\\tBufferSize \%s\n" "${BufferSize}" >> "$COLLECTD_CONF"
+       }
+       printf "\\t</Node>\n" >> "$COLLECTD_CONF"
+}
+
 process_network() {
        local cfg="$1"
 
@@ -277,6 +323,10 @@ process_plugins() {
                        CONFIG_STRING=""
                        process_iptables
                        ;;
+               write_http)
+                       CONFIG_STRING=""
+                       process_write_http
+                       ;;
                *)
                        CONFIG_STRING=""
                        process_generic "$cfg" "\\t" "/usr/share/collectd/plugin/$cfg.json"
index a716e93f0f828e255644c2af5dcd53b72cb15d0f..091dd9ae9254d860839f94cf28490595f49ab2e8 100644 (file)
@@ -213,3 +213,10 @@ config globals 'globals'
 #config plugin 'vmem'
 #      option enable '0'
 #      option Verbose '0'
+#
+#config plugin 'write_http'
+#      option enable '0'
+#
+#config write_http_node
+#      option name 'foo'
+#      option URL 'http://example.org/post-collectd'
index 29a4be11b39124490b7f3f9036a557c0f68f6a33..4811a6d17c4328403a2d57da24dc93cf4cee7000 100644 (file)
@@ -44,7 +44,7 @@ local line_vars = {
                type = "bitrate"
        },
        {
-               name = "latn",
+               name = "interleave_delay",
                type = "latency"
        }
 }
@@ -52,19 +52,19 @@ local line_vars = {
 local errors = {
        {
                name = "uas",
-               type = "gauge"
+               type = "count"
        },
        {
                name = "rx_corrupted",
-               type = "gauge"
+               type = "errors"
        },
        {
                name = "rx_retransmitted",
-               type = "gauge"
+               type = "errors"
        },
        {
                name = "tx_retransmitted",
-               type = "gauge"
+               type = "errors"
        }
 }
 
@@ -80,14 +80,6 @@ local erb_vars = {
 }
 
 local general_vars = {
-       {
-               name = "profile",
-               type = "gauge"
-       },
-       {
-               name = "mode",
-               type = "gauge"
-       },
        {
                name = "state_num",
                type = "gauge"
@@ -117,6 +109,13 @@ local function get_values(hostname, variables, metrics, direction)
                if metrics and metrics[name] ~= nil then
                        local value = metrics[name]
                        local metric = build_metric(name, direction)
+                       if information["type"] == "bool" then
+                               if metrics[name] == true then
+                                       value = 1
+                               else
+                                       value = 0
+                               end
+                       end
 
                        local t = {
                                host = host,
diff --git a/utils/collectd/files/usr/share/collectd/plugin/write_http.json b/utils/collectd/files/usr/share/collectd/plugin/write_http.json
new file mode 100644 (file)
index 0000000..2c63c08
--- /dev/null
@@ -0,0 +1,2 @@
+{
+}
index 8ddfa1a941c876909d07f5d2904eb74b34b6d0a7..138f881a2aede4c7cc2564974a3d25d7a5c93bfe 100644 (file)
@@ -1,14 +1,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=containerd
-PKG_VERSION:=1.6.4
+PKG_VERSION:=1.6.6
 PKG_RELEASE:=1
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=LICENSE
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/containerd/containerd/tar.gz/v${PKG_VERSION}?
-PKG_HASH:=f422e21e35705d1e741c1f3280813e43f811eaff4dcc5cdafac8b8952b15f468
+PKG_HASH:=27afb673c20d53aa5c31aec07b38eb7e4dc911e7e1f0c76fac9513bbf070bd24
 
 PKG_MAINTAINER:=Gerard Ryan <G.M0N3Y.2503@gmail.com>
 
index 80431d2e44ad7bd162c3b0097f006074302ce465..0a3113c4720a49d720aa4dba2fc8d0615c14b642 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=coremark
-PKG_SOURCE_DATE:=2022-01-03
-PKG_SOURCE_VERSION:=b24e397f7103061b3673261d292a0667bd3bc1b8
+PKG_SOURCE_DATE:=2022-07-27
+PKG_SOURCE_VERSION:=eefc986ebd3452d6adde22eafaff3e5c859f29e4
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_DATE).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/eembc/coremark/tar.gz/$(PKG_SOURCE_VERSION)?
-PKG_HASH:=1b8c36b202f39b4f8a872ed7d5db1dc4473ee27f7bc2885a9da20e72925c58c3
+PKG_HASH:=a5964bf215786d65d08941b6f9a9a4f4e50524f5391fa3826db2994c47d5e7f3
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
 
 PKG_MAINTAINER:=Lim Guo Wei <limguowei@gmail.com> \
index 4e53fbf9ef3adf0f74f4e6d7ae61ca6edd442e2a..d1af3ce962f1346c5077629ae3ae2dc402129334 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=coreutils
-PKG_VERSION:=9.0
-PKG_RELEASE:=2
+PKG_VERSION:=9.1
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/coreutils
-PKG_HASH:=ce30acdf4a41bc5bb30dd955e9eaa75fa216b4e3deb08889ed32433c7b3b97ce
+PKG_HASH:=61a1f410d78ba7e7f37a5a4f50e6d1320aca33375484a3255eddf17a38580423
 
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
 PKG_LICENSE:=GPL-3.0-or-later
index be4c28ca595ca914de0c31c8ec6fe64b80097a5f..e4feaf5cd9a45a3d029ff35f7821e8ab809f27d2 100644 (file)
@@ -18,7 +18,7 @@
 -include $(top_srcdir)/tests/local.mk
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -3232,11 +3232,7 @@ RECURSIVE_TARGETS = all-recursive check-
+@@ -4115,11 +4115,7 @@ RECURSIVE_TARGETS = all-recursive check-
        install-ps-recursive install-recursive installcheck-recursive \
        installdirs-recursive pdf-recursive ps-recursive \
        tags-recursive uninstall-recursive
@@ -31,7 +31,7 @@
  am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
  am__vpath_adj = case $$p in \
      $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
-@@ -3486,10 +3482,10 @@ am__DIST_COMMON = $(doc_coreutils_TEXINF
+@@ -4369,10 +4365,10 @@ am__DIST_COMMON = $(doc_coreutils_TEXINF
        $(top_srcdir)/build-aux/missing \
        $(top_srcdir)/build-aux/test-driver \
        $(top_srcdir)/build-aux/texinfo.tex \
@@ -46,7 +46,7 @@
        $(top_srcdir)/tests/local.mk ABOUT-NLS AUTHORS COPYING \
        ChangeLog INSTALL NEWS README THANKS TODO build-aux/compile \
        build-aux/config.guess build-aux/config.rpath \
-@@ -3596,7 +3592,7 @@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
+@@ -4479,7 +4475,7 @@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
  ERRNO_H = @ERRNO_H@
  ETAGS = @ETAGS@
  EXEEXT = @EXEEXT@
@@ -55,7 +55,7 @@
  FLOAT_H = @FLOAT_H@
  FNMATCH_H = @FNMATCH_H@
  GETADDRINFO_LIB = @GETADDRINFO_LIB@
-@@ -5158,7 +5154,7 @@ libexecdir = @libexecdir@
+@@ -6057,7 +6053,7 @@ libexecdir = @libexecdir@
  lispdir = @lispdir@
  localedir = @localedir@
  localstatedir = @localstatedir@
@@ -64,7 +64,7 @@
  mandir = @mandir@
  mkdir_p = @mkdir_p@
  oldincludedir = @oldincludedir@
-@@ -5181,7 +5177,7 @@ top_build_prefix = @top_build_prefix@
+@@ -6080,7 +6076,7 @@ top_build_prefix = @top_build_prefix@
  top_builddir = @top_builddir@
  top_srcdir = @top_srcdir@
  ALL_RECURSIVE_TARGETS = distcheck-hook check-root
@@ -73,7 +73,7 @@
  
  #if GNU_MAKE
  #     [nicer features that work only with GNU Make]
-@@ -7389,7 +7385,7 @@ all: $(BUILT_SOURCES)
+@@ -8272,7 +8268,7 @@ all: $(BUILT_SOURCES)
  .SUFFIXES: .1 .c .dvi .log .o .obj .pl .pl$(EXEEXT) .ps .sh .sh$(EXEEXT) .trs .x .xpl .xpl$(EXEEXT) .y
  am--refresh: Makefile
        @:
@@ -82,7 +82,7 @@
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
            *$$dep*) \
-@@ -7411,7 +7407,7 @@ Makefile: $(srcdir)/Makefile.in $(top_bu
+@@ -8294,7 +8290,7 @@ Makefile: $(srcdir)/Makefile.in $(top_bu
            echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
            cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
        esac;
diff --git a/utils/coreutils/patches/002-chmod-fix_exit_status_when_ignoring_sylinks.patch b/utils/coreutils/patches/002-chmod-fix_exit_status_when_ignoring_sylinks.patch
deleted file mode 100644 (file)
index 61e67af..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-From e8b56ebd536e82b15542a00c888109471936bfda Mon Sep 17 00:00:00 2001
-From: =?utf8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
-Date: Fri, 24 Sep 2021 20:57:41 +0100
-Subject: [PATCH] chmod: fix exit status when ignoring symlinks
-
-* src/chmod.c: Reorder enum so CH_NOT_APPLIED
-can be treated as a non error.
-* tests/chmod/ignore-symlink.sh: A new test.
-* tests/local.mk: Reference the new test.
-Fixes https://bugs.gnu.org/50784
----
- src/chmod.c                   |  4 ++--
- tests/chmod/ignore-symlink.sh | 31 +++++++++++++++++++++++++++++++
- tests/local.mk                |  1 +
- 4 files changed, 40 insertions(+), 2 deletions(-)
- create mode 100755 tests/chmod/ignore-symlink.sh
-
---- a/src/chmod.c
-+++ b/src/chmod.c
-@@ -44,8 +44,8 @@ struct change_status
-   enum
-     {
-       CH_NO_STAT,
--      CH_NOT_APPLIED,
-       CH_FAILED,
-+      CH_NOT_APPLIED,
-       CH_NO_CHANGE_REQUESTED,
-       CH_SUCCEEDED
-     }
-@@ -322,7 +322,7 @@ process_file (FTS *fts, FTSENT *ent)
-   if ( ! recurse)
-     fts_set (fts, ent, FTS_SKIP);
--  return CH_NO_CHANGE_REQUESTED <= ch.status;
-+  return CH_NOT_APPLIED <= ch.status;
- }
- /* Recursively change the modes of the specified FILES (the last entry
---- /dev/null
-+++ b/tests/chmod/ignore-symlink.sh
-@@ -0,0 +1,31 @@
-+#!/bin/sh
-+# Test for proper exit code of chmod on a processed symlink.
-+
-+# Copyright (C) 2021 Free Software Foundation, Inc.
-+
-+# This program is free software: you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation, either version 3 of the License, or
-+# (at your option) any later version.
-+
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+# GNU General Public License for more details.
-+
-+# You should have received a copy of the GNU General Public License
-+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
-+
-+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
-+print_ver_ chmod
-+
-+mkdir dir || framework_failure_
-+touch dir/f || framework_failure_
-+ln -s f dir/l || framework_failure_
-+
-+# This operation ignores symlinks but should succeed.
-+chmod u+w -R dir 2> out || fail=1
-+
-+compare /dev/null out || fail=1
-+
-+Exit $fail
---- a/tests/local.mk
-+++ b/tests/local.mk
-@@ -456,6 +456,7 @@ all_tests =                                        \
-   tests/chmod/c-option.sh                     \
-   tests/chmod/equal-x.sh                      \
-   tests/chmod/equals.sh                               \
-+  tests/chmod/ignore-symlink.sh                       \
-   tests/chmod/inaccessible.sh                 \
-   tests/chmod/octal.sh                                \
-   tests/chmod/setgid.sh                               \
index 283181bbfe873e3da9fcb37de37e52e3aedbb4df..1905da3027245e3276a2a151bfb72543ecc7cc43 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=crelay
-PKG_VERSION:=0.14
-PKG_RELEASE:=2
+PKG_VERSION:=0.14.1
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/ondrej1024/crelay/tar.gz/V$(PKG_VERSION)?
-PKG_HASH:=8e406ae8560d8a42b7dd7cf20193e6dce714747f71809e124deadddf78572590
+PKG_HASH:=291f51d60c3003ad594ac2c10f75b0c5d0b40e49b298f73caf6a47afe3279fde
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 PKG_LICENSE:=GPL-3.0-or-later
@@ -21,6 +21,7 @@ PKG_LICENSE_FILES:=LICENSE
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
+include $(INCLUDE_DIR)/meson.mk
 
 define Package/crelay
   SECTION:=utils
@@ -44,22 +45,9 @@ define Package/crelay/description
       - HID API compatible relay card
 endef
 
-TARGET_CFLAGS+= \
-       -I$(STAGING_DIR)/usr/include/libftdi1 \
-       -I$(STAGING_DIR)/usr/include/hidapi
-
-TARGET_LDFLAGS+= $(if $(ICONV_FULL),-liconv)
-
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR)/src \
-               CC="$(TARGET_CC)" \
-               CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
-               LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
-endef
-
 define Package/crelay/install
        $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/crelay $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/crelay $(1)/usr/bin/
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/crelay.init $(1)/etc/init.d/crelay
        $(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/crelay.conf $(1)/etc
diff --git a/utils/crelay/patches/010-link_with_ftdi1.patch b/utils/crelay/patches/010-link_with_ftdi1.patch
deleted file mode 100644 (file)
index 26b4c97..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -44,7 +44,7 @@ OPTS += -DDRV_CONRAD
- endif
- ifeq ($(DRV_SAINSMART), y)
- SRC   += relay_drv_sainsmart.c
--LIBS  += -lftdi
-+LIBS  += -lftdi1
- OPTS  += -DDRV_SAINSMART
- endif
- ifeq ($(DRV_SAINSMART16), y)
diff --git a/utils/crelay/patches/010-meson.patch b/utils/crelay/patches/010-meson.patch
new file mode 100644 (file)
index 0000000..8e1f230
--- /dev/null
@@ -0,0 +1,64 @@
+From 5e122c8adabb3305dd7524a24ec296bb8d1b7cac Mon Sep 17 00:00:00 2001
+From: Rosen Penev <rosenp@gmail.com>
+Date: Tue, 19 Jul 2022 01:07:57 -0700
+Subject: [PATCH] add meson
+
+Signed-off-by: Rosen Penev <rosenp@gmail.com>
+---
+ meson.build       | 34 ++++++++++++++++++++++++++++++++++
+ meson_options.txt | 11 +++++++++++
+ 2 files changed, 45 insertions(+)
+ create mode 100644 meson.build
+ create mode 100644 meson_options.txt
+
+--- /dev/null
++++ b/meson.build
+@@ -0,0 +1,34 @@
++project('crelay', 'c', version : '0.14.1')
++
++hidapi_dep = dependency('hidapi-libusb', required: get_option('hidapi'))
++ftdi_dep = dependency('libftdi1', required: get_option('sainsmart'))
++libusb_dep = dependency('libusb-1.0', required: get_option('conrad'))
++
++sources = files(
++  'src/config.c',
++  'src/crelay.c',
++  'src/relay_drv.c',
++  'src/relay_drv_gpio.c',
++)
++
++if hidapi_dep.found()
++  add_project_arguments('-DDRV_HIDAPI', language: 'c')
++  add_project_arguments('-DDRV_SAINSMART16', language: 'c')
++  sources += files('src/relay_drv_hidapi.c', 'src/relay_drv_sainsmart16.c',)
++endif
++
++if ftdi_dep.found()
++  add_project_arguments('-DDRV_SAINSMART', language: 'c')
++  sources += files('src/relay_drv_sainsmart.c')
++endif
++
++if libusb_dep.found()
++  add_project_arguments('-DDRV_CONRAD', language: 'c')
++  sources += files('src/relay_drv_conrad.c')
++endif
++
++executable('crelay',
++  sources,
++  dependencies: [ hidapi_dep, ftdi_dep, libusb_dep ],
++  install: true,
++)
+--- /dev/null
++++ b/meson_options.txt
+@@ -0,0 +1,11 @@
++option('hidapi', type : 'feature',
++  description: 'Enable HIDAPI driver',
++)
++
++option('sainsmart', type : 'feature',
++  description: 'Enable SAINSMART driver',
++)
++
++option('conrad', type : 'feature',
++  description: 'Enable CONRAD driver',
++)
diff --git a/utils/crelay/patches/011-support-gpio-with-number-bigger-than-255.patch b/utils/crelay/patches/011-support-gpio-with-number-bigger-than-255.patch
deleted file mode 100644 (file)
index 02e1faa..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-From 30a2323bc0a95cda4eca818fe1d523a2e5c031f3 Mon Sep 17 00:00:00 2001
-From: Pawel Dembicki <paweldembicki@gmail.com>
-Date: Mon, 2 Nov 2020 14:50:34 +0100
-Subject: [PATCH] support gpio with number bigger than 255
-
-Change 8-bit gpio value to 16-bit, which allow to use gpio >255.
-
-Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
----
- src/data_types.h     | 16 ++++++++--------
- src/relay_drv_gpio.c | 10 +++++-----
- 2 files changed, 13 insertions(+), 13 deletions(-)
-
---- a/src/data_types.h
-+++ b/src/data_types.h
-@@ -56,14 +56,14 @@ typedef struct
-     /* [GPIO drv] */
-     uint8_t gpio_num_relays;
-     uint8_t gpio_active_value;
--    uint8_t relay1_gpio_pin;
--    uint8_t relay2_gpio_pin;
--    uint8_t relay3_gpio_pin;
--    uint8_t relay4_gpio_pin;
--    uint8_t relay5_gpio_pin;
--    uint8_t relay6_gpio_pin;
--    uint8_t relay7_gpio_pin;
--    uint8_t relay8_gpio_pin;
-+    uint16_t relay1_gpio_pin;
-+    uint16_t relay2_gpio_pin;
-+    uint16_t relay3_gpio_pin;
-+    uint16_t relay4_gpio_pin;
-+    uint16_t relay5_gpio_pin;
-+    uint16_t relay6_gpio_pin;
-+    uint16_t relay7_gpio_pin;
-+    uint16_t relay8_gpio_pin;
-     
-     /* [Sainsmart drv] */
-     uint8_t sainsmart_num_relays;
---- a/src/relay_drv_gpio.c
-+++ b/src/relay_drv_gpio.c
-@@ -53,7 +53,7 @@
- #define GPIO_BASE_FILE GPIO_BASE_DIR"gpio"
--static uint8_t pins[] =
-+static uint16_t pins[] =
- {
-   0, // dummy
-   0, // pin 1
-@@ -85,7 +85,7 @@ int set_relay_generic_gpio(char* portnam
-  *         -1 - fail
-  *         -2 - already exported
-  *********************************************************/
--static int do_export(uint8_t pin)
-+static int do_export(uint16_t pin)
- {
-    int fd;
-    char b[64];
-@@ -151,7 +151,7 @@ static int do_export(uint8_t pin)
-  * Return:  0 - success
-  *         -1 - fail
-  *********************************************************/
--static int do_unexport(uint8_t pin)
-+static int do_unexport(uint16_t pin)
- {
-    int fd;
-    char b[64];
-@@ -261,7 +261,7 @@ int get_relay_generic_gpio(char* portnam
-    int fd;
-    char b[64];
-    char d[1];
--   uint8_t pin;
-+   uint16_t pin;
-    if (relay<FIRST_RELAY || relay>(FIRST_RELAY+g_num_relays-1))
-    {
-@@ -324,7 +324,7 @@ int set_relay_generic_gpio(char* portnam
-    int fd;
-    char b[64];
-    char d[1];
--   uint8_t pin;
-+   uint16_t pin;
-    
-    if (relay<FIRST_RELAY || relay>(FIRST_RELAY+g_num_relays-1))
-    {
index fed551a009ec30e15fd32bc1a439e563e3b0b9bc..06ef039d55af202627420a69efbc32ef590ba0b8 100644 (file)
@@ -19,6 +19,7 @@ PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_LICENSE:=GPL-2.0-or-later LGPL-2.1-or-later
 PKG_LICENSE_FILES:=COPYING COPYING.LGPL
 
+PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 
index 6633c53f9b15019fa005f2e8143ab10c2da3a796..c76fa641fed7b93a0d231a1870440c027e6432c6 100644 (file)
@@ -1,14 +1,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=compose
-PKG_VERSION:=2.6.0
+PKG_VERSION:=2.9.0
 PKG_RELEASE:=$(AUTORELEASE)
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=LICENSE
 
 PKG_SOURCE:=v$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/docker/compose/tar.gz/v${PKG_VERSION}?
-PKG_HASH:=b01b998dbc29478ec989a9df4ebaf4017b7406bba1847b061632f0a7a9841751
+PKG_HASH:=582f3dacb3e96e9a07ff3b9d137b508377a769309b84f6faa8722d7f5a226353
 
 PKG_MAINTAINER:=Javier Marcet <javier@marcet.info>
 
index dfb4684ea2ac5ac7105a9878c24067f7af43b934..2ca650e3a9a47c129de50e8e6ffde57ed2640805 100644 (file)
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=docker
-PKG_VERSION:=20.10.16
+PKG_VERSION:=20.10.17
 PKG_RELEASE:=$(AUTORELEASE)
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=LICENSE
@@ -10,8 +10,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_GIT_URL:=github.com/docker/cli
 PKG_GIT_REF:=v$(PKG_VERSION)
 PKG_SOURCE_URL:=https://codeload.$(PKG_GIT_URL)/tar.gz/$(PKG_GIT_REF)?
-PKG_HASH:=af34131b1f08a068906336092a4dc3dfd8921c8039528cb698b32491951c33e2
-PKG_GIT_SHORT_COMMIT:=aa7e414 # SHA1 used within the docker executables
+PKG_HASH:=ab2b59c2302017fea9ad2f70827e8a6f0204b557ce28e66bcb80fea262c9fbdc
+PKG_GIT_SHORT_COMMIT:=100c701 # SHA1 used within the docker executables
 
 PKG_MAINTAINER:=Gerard Ryan <G.M0N3Y.2503@gmail.com>
 
index 0b75ee90696c1cfb41a35a2ca8f0c1cf7606abe1..a19f5a34a45e0f2d4bf90b81cdb25e556a7bc10b 100644 (file)
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dockerd
-PKG_VERSION:=20.10.16
+PKG_VERSION:=20.10.17
 PKG_RELEASE:=$(AUTORELEASE)
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=LICENSE
@@ -10,8 +10,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_GIT_URL:=github.com/moby/moby
 PKG_GIT_REF:=v$(PKG_VERSION)
 PKG_SOURCE_URL:=https://codeload.$(PKG_GIT_URL)/tar.gz/$(PKG_GIT_REF)?
-PKG_HASH:=2cd69e2cc67053300aa8d78988c92fd63ea0d0d84fe2071597191a149d5548f8
-PKG_GIT_SHORT_COMMIT:=f756502 # SHA1 used within the docker executables
+PKG_HASH:=061cf8579aa3c813c353c80fa480744e2f6cca2e6392f546bd0942a6a10c7a14
+PKG_GIT_SHORT_COMMIT:=a89b842 # SHA1 used within the docker executables
 
 PKG_MAINTAINER:=Gerard Ryan <G.M0N3Y.2503@gmail.com>
 
index 8c0c129c2d3ae1b65a61f4e0e71d86cad786fbcb..0cf563170d52ea47c83adccd5bde6e62c20a6278 100644 (file)
@@ -7,7 +7,10 @@ PIDFILE=/var/run/domoticz.pid
 
 start_domoticz() {
        local section="$1"
-       local loglevel sslcert sslpass sslwww syslog userdata
+       local disabled loglevel sslcert sslpass sslwww syslog userdata
+
+       config_get_bool disabled "$section" "disabled" 0
+       [ "$disabled" -gt 0 ] && return
 
        config_get loglevel "$section" "loglevel"
        config_get sslcert "$section" "sslcert"
@@ -18,6 +21,11 @@ start_domoticz() {
        config_get syslog "$section" "syslog"
        config_get userdata "$section" "userdata" userdata /var/lib/domoticz
 
+       procd_open_instance
+       procd_set_param command "$PROG"
+       procd_append_param command -noupdates
+       procd_append_param command -approot /usr/share/domoticz/
+
        [ -n "$loglevel" ] && procd_append_param command -loglevel "$loglevel"
        [ -n "$syslog" ] && procd_append_param command -syslog "$syslog"
 
@@ -47,25 +55,16 @@ start_domoticz() {
                [ -n "$sslpass" ] && procd_append_param command -sslpass "$sslpass"
                [ -n "$ssldhparam" ] && procd_append_param command -ssldhparam "$ssldhparam"
        } || procd_append_param command -sslwww 0
-}
-
-start_service() {
-       procd_open_instance
-
-       procd_set_param command "$PROG"
-       procd_append_param command -noupdates
-       procd_append_param command -approot /usr/share/domoticz/
-
-       config_load "domoticz"
-       config_get_bool disabled "$section" "disabled" 0
-       [ "$disabled" -gt 0 ] && return 1
-       config_foreach start_domoticz domoticz
 
        procd_set_param pidfile "$PIDFILE"
        procd_set_param respawn
        procd_set_param stdout 0
        procd_set_param term_timeout 10
        procd_set_param user "domoticz"
-
        procd_close_instance
 }
+
+start_service() {
+       config_load "domoticz"
+       config_foreach start_domoticz domoticz
+}
index 389141b1172b77d567bb570b62314e8a0572aead..a4864ada160f2422895c3318d933d41d36e6cc36 100644 (file)
@@ -5,12 +5,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fish
-PKG_VERSION:=3.3.1
+PKG_VERSION:=3.5.0
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://github.com/fish-shell/fish-shell/releases/download/$(PKG_VERSION)
-PKG_HASH:=b5b4ee1a5269762cbbe993a4bd6507e675e4100ce9bbe84214a5eeb2b19fae89
+PKG_HASH:=291e4ec7c6c3fea54dc1aed057ce3d42b356fa6f70865627b2c7dfcecaefd210
 
 PKG_MAINTAINER:=Curtis Jiang <jqqqqqqqqqq@gmail.com>, Hao Dong <halbertdong@gmail.com>
 PKG_LICENSE:=GPL-2.0-only
@@ -25,7 +25,7 @@ define Package/fish
   CATEGORY:=Utilities
   SUBMENU:=Shells
   TITLE:=A smart and user-friendly command line shell
-  DEPENDS:=+libncurses +libstdcpp +libatomic +librt +libpcre2-32 @!USE_UCLIBC
+  DEPENDS:=+libncurses +libstdcpp +libatomic +libpcre2-32
   URL:=https://fishshell.com
 endef
 
@@ -36,7 +36,9 @@ define Package/fish/description
   configuration required.
 endef
 
-CMAKE_OPTIONS += -DBUILD_DOCS=NO
+CMAKE_OPTIONS += \
+       -DBUILD_DOCS=FALSE \
+       -DWITH_GETTEXT=FALSE
 
 define Package/fish/install
        $(INSTALL_DIR) $(1)/usr/bin
index 7a326d019ed33b0b3399a23abfafeef66f0497da..fd4b00b098cb8947fe940d3185b323919904e0a7 100644 (file)
@@ -28,7 +28,7 @@ define Package/hfsprogs/Default
   SECTION:=utils
   CATEGORY:=Utilities
   SUBMENU:=Filesystem
-  DEPENDS:=+libopenssl +USE_GLIBC:libbsd
+  DEPENDS:=+libopenssl
 endef
 
 define Package/hfsfsck
@@ -60,7 +60,7 @@ define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) \
                $(TARGET_CONFIGURE_OPTS) \
                CFLAGS+="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -I$(PKG_BUILD_DIR)/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -D LINUX=1 -D BSD=1 -D VERSION=\\\"$(PKG_VERSION)\\\"" \
-               LDFLAGS+="$(TARGET_LDFLAGS) $(if $(CONFIG_USE_GLIBC),-lbsd)" \
+               LDFLAGS+="$(TARGET_LDFLAGS)" \
                all
 endef
 
index 6347ee15361bca50137aea29008fc80c9b29165d..09a744a6ee6b4791413240a4a318a955dc44a7d9 100644 (file)
@@ -8,24 +8,18 @@ PKG_NAME:=irqbalance
 PKG_VERSION:=1.9.0
 PKG_RELEASE:=$(AUTORELEASE)
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/Irqbalance/irqbalance.git
-PKG_SOURCE_VERSION:=80d5fbb947debe221e4c23c0ee0f4f2b89a99443
+PKG_SOURCE_VERSION:=v$(PKG_VERSION)
 PKG_MIRROR_HASH:=9af2e51d2696bc51400223dee2009071bee5f12b3a5050f18c7de23632e2190d
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_LICENSE:=GPLv2
 
 PKG_MAINTAINER:=Hannu Nyman <hannu.nyman@iki.fi>
-
-PKG_FIXUP:=autoreconf
-PKG_REMOVE_FILES:=autogen.sh
-
-PKG_BUILD_PARALLEL:=1
-
-include $(INCLUDE_DIR)/nls.mk
+PKG_LICENSE:=GPL-2.0-or-later
+PKG_LICENSE_FILES:=COPYING
 
 include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+include $(INCLUDE_DIR)/meson.mk
 
 PKG_BUILD_DEPENDS += glib2
 
@@ -43,34 +37,17 @@ define Package/irqbalance/description
  increase performance.
 endef
 
-CONFIGURE_ARGS+= \
-       --disable-numa \
-       --with-libcap_ng=no \
-       --with-systemd=no \
-       --without-irqbalance-ui \
-       --enable-static=glib2
-
-GLIB2_LIBS="$(STAGING_DIR)/usr/lib/libglib-2.0.a"
-
-ifeq ($(CONFIG_BUILD_NLS),y)
-       GLIB2_LIBS += $(INTL_LDFLAGS) -lintl
-endif
-
-ifeq ($(CONFIG_USE_GLIBC),y)
-       GLIB2_LIBS += -lpthread
-endif
-
-CONFIGURE_VARS += \
-       GLIB2_LIBS="$(GLIB2_LIBS) \
-               $(ICONV_LDFLAGS) -liconv"
-
 define Package/irqbalance/conffiles
 /etc/config/irqbalance
 endef
 
+MESON_ARGS += \
+       -Dcapng=disabled \
+       -Dui=disabled
+
 define Package/irqbalance/install
        $(INSTALL_DIR) $(1)/usr/sbin
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/irqbalance $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/irqbalance $(1)/usr/sbin/
        $(INSTALL_DIR) $(1)/etc/init.d
        $(INSTALL_BIN) ./files/irqbalance.init $(1)/etc/init.d/irqbalance
        $(INSTALL_DIR) $(1)/etc/config
index cc9382d612abcfa03645c96579b024ad2d9fb650..b2afb7ed27859bcb0773740b72801819cbdf62bc 100644 (file)
@@ -1,6 +1,10 @@
 config irqbalance 'irqbalance'
        option enabled '0'
 
+       # Level at which irqbalance partitions cache domains.
+       # Default is 2 (L2$).
+       #option deepestcache '2'
+
        # The default value is 10 seconds
        #option interval '10'
 
index 638dcb39f65ae4973424495926f795da6b74b366..a221de08b93b3b2a33e24f0b8d89c7596802c632 100644 (file)
@@ -16,6 +16,9 @@ start_service() {
        config_get_bool enabled irqbalance enabled 0
        [ "$enabled" -gt 0 ] || return 0
 
+       # 2 is the default
+       config_get deepestcache irqbalance deepestcache 2
+
        # 10 is the default
        config_get interval irqbalance interval 10
 
@@ -28,7 +31,7 @@ start_service() {
        config_list_foreach irqbalance banirq handle_banirq_value
 
        procd_open_instance "irqbalance"
-       procd_set_param command /usr/sbin/irqbalance -f -t "$interval" "$banirq"
+       procd_set_param command /usr/sbin/irqbalance -f -c "$deepestcache" -t "$interval" "$banirq"
        procd_set_param respawn
        procd_close_instance
 }
diff --git a/utils/irqbalance/patches/010-meson.patch b/utils/irqbalance/patches/010-meson.patch
new file mode 100644 (file)
index 0000000..7e3ae36
--- /dev/null
@@ -0,0 +1,73 @@
+From 35072fc06b9efe923f6ac1bd73b67c33d3ae619b Mon Sep 17 00:00:00 2001
+From: Rosen Penev <rosenp@gmail.com>
+Date: Fri, 10 Jun 2022 23:14:27 -0700
+Subject: [PATCH] add meson
+
+Signed-off-by: Rosen Penev <rosenp@gmail.com>
+---
+ meson.build       | 43 +++++++++++++++++++++++++++++++++++++++++++
+ meson_options.txt | 11 +++++++++++
+ 2 files changed, 54 insertions(+)
+ create mode 100644 meson.build
+ create mode 100644 meson_options.txt
+
+--- /dev/null
++++ b/meson.build
+@@ -0,0 +1,43 @@
++project('irqbalance', 'c',
++  version : '1.9.0',
++  default_options : ['warning_level=1']
++)
++
++cc = meson.get_compiler('c')
++
++glib_dep = dependency('glib-2.0', static: true)
++m_dep = cc.find_library('m', required: false)
++capng_dep = dependency('libcap-ng', required: get_option('capng'))
++ncurses_dep = dependency('curses', required: get_option('ui'))
++systemd_dep = dependency('libsystemd', required: get_option('systemd'))
++
++cdata = configuration_data()
++cdata.set('HAVE_GETOPT_LONG', cc.has_function('getopt_long'))
++cdata.set('HAVE_IRQBALANCEUI', ncurses_dep.found())
++cdata.set('HAVE_NUMA_H', cc.has_header('numa.h'))
++cdata.set('HAVE_LIBCAP_NG', capng_dep.found())
++cdata.set('HAVE_LIBSYSTEMD', systemd_dep.found())
++cdata.set_quoted('VERSION', meson.project_version())
++cfile = configure_file(
++  output: 'config.h',
++  configuration: cdata
++)
++
++if cdata.get('HAVE_IRQBALANCEUI')
++  add_project_arguments('-D_GNU_SOURCE', language: 'c')
++endif
++
++
++executable('irqbalance',
++  'activate.c',
++  'bitmap.c',
++  'classify.c',
++  'cputree.c',
++  'irqbalance.c',
++  'irqlist.c',
++  'numa.c',
++  'placement.c',
++  'procinterrupts.c',
++  dependencies: [ glib_dep, m_dep, capng_dep, ncurses_dep, systemd_dep ],
++  install : true
++)
+--- /dev/null
++++ b/meson_options.txt
+@@ -0,0 +1,11 @@
++option('capng', type : 'feature',
++  description : 'Build with libcap-ng support',
++)
++
++option('systemd', type : 'feature',
++  description : 'Build with systemd support',
++)
++
++option('ui', type : 'feature',
++  description : 'Build the UI component',
++)
index 91bc3a4b5432599fae99035fa988ac84011e7fa3..fa5d9edcea560a18ad8000ff4077ad28d65bc720 100644 (file)
@@ -11,7 +11,7 @@ PKG_NAME:=kitty-terminfo
 PKG_VERSION:=0.24.4
 PKG_RELEASE:=$(AUTORELEASE)
 
-PKG_LICENSE:=GPL-3.0-or-later
+PKG_LICENSE:=GPL-3.0-only
 
 PKG_SOURCE:=kitty-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/kovidgoyal/kitty/tar.gz/v$(PKG_VERSION)?
index 34ea2e1b65448ed4d56211399c2fc1eb8d828ae4..b91245edafe4e327920e83247d83649fd69d5f0f 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lcdproc
 PKG_VERSION:=0.5.9
-PKG_RELEASE:=6
+PKG_RELEASE:=7
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/lcdproc/lcdproc/releases/download/v$(PKG_VERSION)/
@@ -23,9 +23,12 @@ PKG_CPE_ID:=cpe:/a:lcdproc:lcdproc
 
 include $(INCLUDE_DIR)/package.mk
 
+DISABLE_NLS:=
+
 define Package/lcdproc/Default
   SECTION:=utils
   CATEGORY:=Utilities
+  DEPENDS:=@(TARGET_x86||TARGET_x86_64)
   URL:=http://lcdproc.org/
 endef
 
@@ -60,7 +63,7 @@ endef
 define Package/lcdproc-server
   $(call Package/lcdproc/Default)
   TITLE:=LCD Display server
-  DEPENDS:=+libpthread
+  DEPENDS+= +libpthread
 endef
 
 define LCDPROC_CORE_DRIVERS_TEXT
@@ -88,7 +91,7 @@ endef
 define Package/lcdproc-drivers
   $(call Package/lcdproc/Default)
   TITLE:=LCD Display extra drivers
-  DEPENDS:=+lcdproc-server +libncurses +libusb-1.0 +libusb-compat +libftdi1 \
+  DEPENDS+= +lcdproc-server +libncurses +libusb-1.0 +libusb-compat +libftdi1 \
        +GPIO_SUPPORT:libugpio +serdisplib
 endef
 
@@ -110,7 +113,8 @@ $(LCDPROC_OTHER_DRIVERS_TEXT)
 endef
 
 CONFIGURE_VARS += \
-       ac_cv_mtab_file="/etc/mtab"
+       ac_cv_mtab_file="/etc/mtab" \
+       ac_cv_port_have_lpt="yes"
 
 CONFIGURE_ARGS += \
        --disable-libX11 \
index fef9b185de4334609f2c381422dd783dca4314ad..4bd865c2e847c66c9556c71dce4577b648945d90 100644 (file)
@@ -12,9 +12,9 @@ GO_PKG_BUILD_PKG:= \
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://$(GO_PKG)
-PKG_SOURCE_VERSION:=339b972b464ee3d401b5788b2af9e31d09d6b7da
-PKG_SOURCE_DATE:=2022-03-16
-PKG_MIRROR_HASH:=0f99357acc839619d108d358da09e288fd741f299fe5cf500bb5e8267f64aad1
+PKG_SOURCE_VERSION:=f6ccccb1c082a432c2a5814aaedaca56af33d9ea
+PKG_SOURCE_DATE:=2022-06-02
+PKG_MIRROR_HASH:=92a23ff620c3cf3b05bc01a06721a9f78dfb6bc5b048dbcf70ea9542cec8e7a2
 
 PKG_MAINTAINER:=Gerard Ryan <G.M0N3Y.2503@gmail.com>
 
index 19fd00f5ec49456a12b9d1f3630af69076ec06f2..b87bfe9992d20dd9b62770c5903ea52448fb503c 100644 (file)
@@ -61,6 +61,10 @@ define Package/lxc-auto
   DEPENDS+=+lxc-start +lxc-stop
 endef
 
+define Package/lxc-auto/postinst
+[ -n "$${IPKG_INSTROOT}" ] || [ "$${PKG_UPGRADE}" = 1 ] || /etc/init.d/lxc-auto boot
+endef
+
 define Package/lxc-auto/description
  LXC is the userspace control package for Linux Containers, a lightweight
  virtual system mechanism sometimes described as "chroot on steroids".
index b6b72a2bc5f18d6a3b261ded9d355daae7ecb142..aaec7f65a227d762e68184d5284f9f596d933674 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nano
-PKG_VERSION:=6.3
+PKG_VERSION:=6.4
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/nano
-PKG_HASH:=eb532da4985672730b500f685dbaab885a466d08fbbf7415832b95805e6f8687
+PKG_HASH:=4199ae8ca78a7796de56de1a41b821dc47912c0307e9816b56cc317df34661c0
 
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_LICENSE_FILES:=COPYING
index 6a93def8731cc62c72fd8d7e8d3386233778147a..1b1e4f16d5269578f34ef7d616664cf7768b9a92 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ncdu
-PKG_VERSION:=1.16
+PKG_VERSION:=1.17
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://dev.yorhel.nl/download
-PKG_HASH:=2b915752a183fae014b5e5b1f0a135b4b408de7488c716e325217c2513980fd4
+PKG_HASH:=810745a8ed1ab3788c87d3aea4cc1a14edf6ee226f764bcc383e024ba56adbf1
 
 PKG_MAINTAINER:=Charles E. Lehner <cel@celehner.com>
 PKG_LICENSE:=MIT
diff --git a/utils/ncdu/patches/900-use-alternative-color.patch b/utils/ncdu/patches/900-use-alternative-color.patch
new file mode 100644 (file)
index 0000000..f804af4
--- /dev/null
@@ -0,0 +1,26 @@
+--- a/src/util.h
++++ b/src/util.h
+@@ -36,18 +36,18 @@
+   C(DEFAULT,     _,_,0  ,    _,      _,    0,    WHITE,  BLACK,0)\
+   C(BOX_TITLE,   _,_,B  ,    BLUE,   _,    B,    BLUE,   BLACK,B)\
+   C(HD,          _,_,R  ,    BLACK,  CYAN, 0,    BLACK,  CYAN, 0)    /* header & footer */\
+-  C(SEL,         _,_,R  ,    WHITE,  GREEN,B,    WHITE,  GREEN,B)\
++  C(SEL,         _,_,R  ,    WHITE,   BLUE,B,    WHITE,  GREEN,B)\
+   C(NUM,         _,_,0  ,    YELLOW, _,    B,    YELLOW, BLACK,B)\
+   C(NUM_HD,      _,_,R  ,    YELLOW, CYAN, B,    YELLOW, CYAN, B)\
+-  C(NUM_SEL,     _,_,R  ,    YELLOW, GREEN,B,    YELLOW, GREEN,B)\
++  C(NUM_SEL,     _,_,R  ,    YELLOW,  BLUE,B,    YELLOW, GREEN,B)\
+   C(KEY,         _,_,B  ,    YELLOW, _,    B,    YELLOW, BLACK,B)\
+   C(KEY_HD,      _,_,B|R,    YELLOW, CYAN, B,    YELLOW, CYAN, B)\
+   C(DIR,         _,_,0  ,    BLUE,   _,    B,    BLUE,   BLACK,B)\
+-  C(DIR_SEL,     _,_,R  ,    BLUE,   GREEN,B,    BLUE,   GREEN,B)\
++  C(DIR_SEL,     _,_,R  ,    BLUE,    BLUE,B,    BLUE,   GREEN,B)\
+   C(FLAG,        _,_,0  ,    RED,    _,    0,    RED,    BLACK,0)\
+-  C(FLAG_SEL,    _,_,R  ,    RED,    GREEN,0,    RED,    GREEN,0)\
++  C(FLAG_SEL,    _,_,R  ,    RED,     BLUE,0,    RED,    GREEN,0)\
+   C(GRAPH,       _,_,0  ,    MAGENTA,_,    0,    MAGENTA,BLACK,0)\
+-  C(GRAPH_SEL,   _,_,R  ,    MAGENTA,GREEN,0,    MAGENTA,GREEN,0)
++  C(GRAPH_SEL,   _,_,R  ,    MAGENTA, BLUE,0,    MAGENTA,GREEN,0)
+ enum ui_coltype {
+ #define C(name, ...) UIC_##name,
index c54dbcbadca69fdca4aca5cd700a14e4002b3df2..406fe6e4b0655e805dd86c4f8797e1e1c63f1c07 100644 (file)
@@ -79,7 +79,7 @@ CONFIGURE_ARGS+= \
        --without-xerces \
        --enable-resolutionkms=no
 
-TARGET_LDFLAGS += -liconv
+TARGET_LDFLAGS+=$(if $(ICONV_FULL),-liconv)
 
 define Build/Prepare
        $(call Build/Prepare/Default)
diff --git a/utils/realtek-poe/Makefile b/utils/realtek-poe/Makefile
new file mode 100644 (file)
index 0000000..aecbb49
--- /dev/null
@@ -0,0 +1,35 @@
+## SPDX-License-Identifier: GPL-2.0-or-later
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=realtek-poe
+PKG_RELEASE:=$(AUTORELEASE)
+PKG_LICENSE:=GPL-2.0
+PKG_MAINTAINER:=Martin Kennedy <hurricos@gmail.com>
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/Hurricos/realtek-poe.git
+PKG_SOURCE_VERSION:=382c60e7549948399b4244f7149cf76eaf5f0a7d
+PKG_MIRROR_HASH:=442a01521c9a056e137e010be492ed5be0a39c3b68a2fa0ca0f0dbb765d9c74c
+CMAKE_SOURCE_SUBDIR:=src
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/realtek-poe
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Realtek PoE Switch Port daemon
+  DEPENDS:=@TARGET_realtek +libubox +libubus +libuci
+endef
+
+define Package/realtek-poe/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/realtek-poe $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/init.d/poe $(1)/etc/init.d/
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/files/etc/config/poe $(1)/etc/config/
+endef
+
+$(eval $(call BuildPackage,realtek-poe))
index 2eb67853ce96371522be12b500ff29ca3cb4be6f..8c1bec59e161104e5e67201b4499c90be9ba226a 100644 (file)
@@ -1,16 +1,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=restic
-PKG_VERSION:=0.9.6
-PKG_RELEASE:=2
+PKG_VERSION:=0.13.1
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/restic/restic/tar.gz/v${PKG_VERSION}?
-PKG_HASH:=1cc8655fa99f06e787871a9f8b5ceec283c856fa341a5b38824a0ca89420b0fe
+PKG_HASH:=8430f80dc17b98fd78aca6f7d635bf12a486687677e15989a891ff4f6d8490a9
 
 PKG_LICENSE:=BSD-2-Clause
 PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Markus Weippert <markus@gekmihesg.de>
+PKG_MAINTAINER:=Tom Stöveken <tom@naaa.de>
 
 PKG_BUILD_DEPENDS:=golang/host
 PKG_BUILD_PARALLEL:=1
index 648e7273c64af5a0b52e6b5d9dd38f0fc267780b..ab37366b36181783f03394f238400b1bfcfce829 100644 (file)
@@ -1,14 +1,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=runc
-PKG_VERSION:=1.1.1
+PKG_VERSION:=1.1.2
 PKG_RELEASE:=1
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=LICENSE
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/opencontainers/runc/tar.gz/v${PKG_VERSION}?
-PKG_HASH:=11a34535c108b36fd59de58e7bef3a130444c9ea41e4b8bb8f8d4654c8ad654c
+PKG_HASH:=0ccce82b1d9c058d8fd7443d261c96fd7a803f2775bcb1fec2bdb725bc7640f6
 
 PKG_MAINTAINER:=Gerard Ryan <G.M0N3Y.2503@gmail.com>
 
index 3988bc3361cf1a08c48fc14a7386ee863b68d2ef..e0e503beb1a2c1e471220b178667241e17832c2d 100644 (file)
@@ -2,12 +2,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sexpect
-PKG_VERSION:=2.3.8
+PKG_VERSION:=2.3.11
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/clarkwang/sexpect/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=a586283210a76f03b9cce9f09aac28977d6fc3e314355e22c30d6f42524d9a42
+PKG_HASH:=0ffdba912760383a60783bf010edc184b96d6dd454dc24922fcf7190de969e55
 
 PKG_MAINTAINER:=Clark Wang <dearvoid@gmail.com>
 PKG_LICENSE:=GPL-3.0-only
index bf59f4c1d5509ff1a0bf960d09435479ac0551ba..832c452350524cad94e9c40cb46faf53fbf5e0ae 100644 (file)
@@ -20,8 +20,15 @@ PKG_LICENSE:=GPL-3.0-or-later
 PKG_LICENSE_FILES:=COPYING
 PKG_CPE_ID:=cpe:/a:gnu:tar
 
-PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_PACKAGE_TAR_POSIX_ACL \
+       CONFIG_PACKAGE_TAR_XATTR \
+       CONFIG_PACKAGE_TAR_BZIP2 \
+       CONFIG_PACKAGE_TAR_GZIP \
+       CONFIG_PACKAGE_TAR_XZ \
+       CONFIG_PACKAGE_TAR_ZSTD
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -53,7 +60,7 @@ define Package/tar/config
                        default y
 
                config PACKAGE_TAR_GZIP
-                       bool "tar: Enable seamless gzip support"
+                       bool "tar: Enable seamless gzip support. Needed for sysupgrade."
                        default y
 
                config PACKAGE_TAR_XZ
index 00d193c3ecc6cf3990e5decf89160e509854175f..2a014089c6ccc2d293e017b9ddc8b09ffb5f19a1 100644 (file)
@@ -3,12 +3,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=telegraf
-PKG_VERSION:=1.23.0
+PKG_VERSION:=1.23.3
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/influxdata/telegraf/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=097f0ae89332dd55c121dbb6b5f81b151a0f0418c11d26b430b33be31ca90d0b
+PKG_HASH:=984612d5d74b014e82e03069c2430b7868cc9c4c40b2215f43dc5533b105fe3d
 
 PKG_MAINTAINER:=Jonathan Pagel <jonny_tischbein@systemli.org>
 PKG_LICENSE:=MIT
index 0be245c47c2b2abceba4f371389582f018f7acdd..17b585b33e6123c154da0b5ee375c6ae6d4d321e 100644 (file)
@@ -2,12 +2,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tmux
-PKG_VERSION:=3.2a
+PKG_VERSION:=3.3a
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/tmux/tmux/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=497bc4ee16f10b53b161bf0253b6f9e20cd0f86c5d0104f149212cb0778ae13a
+PKG_HASH:=f9687493203f86d346791a9327cde9148b9b4be959381b1effc575a9364a043f
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
 
 PKG_LICENSE:=ISC
diff --git a/utils/tmux/patches/100-add-crosscompiling-fallbacks.patch b/utils/tmux/patches/100-add-crosscompiling-fallbacks.patch
deleted file mode 100644 (file)
index 805392f..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -160,6 +160,7 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM(
-          [return (strtonum("0", 0, 1, NULL) == 0 ? 0 : 1);]
-        )],
-        [AC_DEFINE(HAVE_STRTONUM) AC_MSG_RESULT(yes)],
-+       [AC_LIBOBJ(strtonum) AC_MSG_RESULT(no)],
-        [AC_LIBOBJ(strtonum) AC_MSG_RESULT(no)]
- )
index 6f2e4cade1e213f7d834aed81d8238ae0fecc44c..8bdf864a43385c0de914945d89ec0b9392fd18ed 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=watchcat
 PKG_VERSION:=1
-PKG_RELEASE:=14
+PKG_RELEASE:=16
 
 PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
 PKG_LICENSE:=GPL-2.0
index 3cc05f0c18c4d6ebb0d32c9f9c44c3d08cc04fa6..688b44bb8cf444f70eda6900282119601711be88 100644 (file)
@@ -9,7 +9,7 @@ append_string() {
        varname="$1"
        add="$2"
        separator="${3:- }"
-       actual
+       local actual
        eval "actual=\$$varname"
 
        new="${actual:+$actual$separator}$add"
@@ -41,6 +41,8 @@ config_watchcat() {
        config_get interface "$1" interface
        config_get mmifacename "$1" mmifacename
        config_get_bool unlockbands "$1" unlockbands "0"
+       config_get addressfamily "$1" addressfamily "any"
+       config_get script "$1" script
 
        # Fix potential typo in mode and provide backward compatibility.
        [ "$mode" = "allways" ] && mode="periodic_reboot"
@@ -48,8 +50,8 @@ config_watchcat() {
        [ "$mode" = "ping" ] && mode="ping_reboot"
 
        # Checks for settings common to all operation modes
-       if [ "$mode" != "periodic_reboot" ] && [ "$mode" != "ping_reboot" ] && [ "$mode" != "restart_iface" ]; then
-               append_string "error" "mode must be 'periodic_reboot' or 'ping_reboot' or 'restart_iface'" "; "
+       if [ "$mode" != "periodic_reboot" ] && [ "$mode" != "ping_reboot" ] && [ "$mode" != "restart_iface" ] && [ "$mode" != "run_script" ]; then
+               append_string "error" "mode must be 'periodic_reboot' or 'ping_reboot' or 'restart_iface' or 'run_script'" "; "
        fi
 
        period="$(time_to_seconds "$period")"
@@ -57,7 +59,7 @@ config_watchcat() {
                append_string "error" "period has invalid format. Use time value(ex: '30'; '4m'; '6h'; '2d')" "; "
 
        # ping_reboot mode and restart_iface mode specific checks
-       if [ "$mode" = "ping_reboot" ] || [ "$mode" = "restart_iface" ]; then
+       if [ "$mode" = "ping_reboot" ] || [ "$mode" = "restart_iface" ] || [ "$mode" = "run_script" ]; then
                if [ -z "$error" ]; then
                        pingperiod_default="$((period / 5))"
                        pingperiod="$(time_to_seconds "$pingperiod")"
@@ -77,6 +79,10 @@ config_watchcat() {
                fi
        fi
 
+       if [ "$mode" = "run_script" ] && [ -z "$script" ]; then
+               append_string "error" "run_script mode requires a script"
+       fi
+
        # ping_reboot mode and periodic_reboot mode specific checks
        if [ "$mode" = "ping_reboot" ] || [ "$mode" = "periodic_reboot" ]; then
                forcedelay="$(time_to_seconds "$forcedelay")"
@@ -93,19 +99,25 @@ config_watchcat() {
        periodic_reboot)
                procd_open_instance "watchcat_${1}"
                procd_set_param command /usr/bin/watchcat.sh "periodic_reboot" "$period" "$forcedelay"
-               procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
+               procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}"
                procd_close_instance
                ;;
        ping_reboot)
                procd_open_instance "watchcat_${1}"
-               procd_set_param command /usr/bin/watchcat.sh "ping_reboot" "$period" "$forcedelay" "$pinghosts" "$pingperiod" "$pingsize"
-               procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
+               procd_set_param command /usr/bin/watchcat.sh "ping_reboot" "$period" "$forcedelay" "$pinghosts" "$pingperiod" "$pingsize" "$addressfamily"
+               procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}"
                procd_close_instance
                ;;
        restart_iface)
                procd_open_instance "watchcat_${1}"
-               procd_set_param command /usr/bin/watchcat.sh "restart_iface" "$period" "$pinghosts" "$pingperiod" "$pingsize" "$interface" "$mmifacename"
-               procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
+               procd_set_param command /usr/bin/watchcat.sh "restart_iface" "$period" "$pinghosts" "$pingperiod" "$pingsize" "$interface" "$mmifacename" "$unlockbands" "$addressfamily"
+               procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}"
+               procd_close_instance
+               ;;
+       run_script)
+               procd_open_instance "watchcat_${1}"
+               procd_set_param command /usr/bin/watchcat.sh "run_script" "$period" "$pinghosts" "$pingperiod" "$pingsize" "$interface" "$addressfamily" "$script"
+               procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}"
                procd_close_instance
                ;;
        *)
index 9ee0f6d5683a7d71001ee8d212e1ef14bf4777ea..dd0e9b27fc8e209ea677ff5170838098d8dd01f2 100644 (file)
@@ -28,13 +28,32 @@ get_ping_size() {
                ps="9000"
                ;;
        *)
-               echo "Error: invalid ping_size. ping_size should be either: small, windows, standard, big, huge or jumbo"
-               echo "Cooresponding ping packet sizes (bytes): small=1, windows=32, standard=56, big=248, huge=1492, jumbo=9000"
+               echo "Error: invalid ping_size. ping_size should be either: small, windows, standard, big, huge or jumbo" 1>&2
+               echo "Corresponding ping packet sizes (bytes): small=1, windows=32, standard=56, big=248, huge=1492, jumbo=9000" 1>&2
                ;;
        esac
        echo $ps
 }
 
+get_ping_family_flag() {
+       family=$1
+       case "$family" in
+       any)
+               family=""
+               ;;
+       ipv4)
+               family="-4"
+               ;;
+       ipv6)
+               family="-6"
+               ;;
+       *)
+               echo "Error: invalid address_family \"$family\". address_family should be one of: any, ipv4, ipv6" 1>&2
+               ;;
+       esac
+       echo $family
+}
+
 reboot_now() {
        reboot &
 
@@ -54,22 +73,27 @@ watchcat_periodic() {
 
 watchcat_restart_modemmanager_iface() {
        [ "$2" -gt 0 ] && {
-               logger -t INFO "Resetting current-bands to 'any' on modem: \"$1\" now."
+               logger -p daemon.info -t "watchcat[$$]" "Resetting current-bands to 'any' on modem: \"$1\" now."
                /usr/bin/mmcli -m any --set-current-bands=any
        }
-       logger -t INFO "Reconnecting modem: \"$1\" now."
+       logger -p daemon.info -t "watchcat[$$]" "Reconnecting modem: \"$1\" now."
        /etc/init.d/modemmanager restart
        ifup "$1"
 }
 
 watchcat_restart_network_iface() {
-       logger -t INFO "Restarting network interface: \"$1\"."
+       logger -p daemon.info -t "watchcat[$$]" "Restarting network interface: \"$1\"."
        ip link set "$1" down
        ip link set "$1" up
 }
 
+watchcat_run_script() {
+       logger -p daemon.info -t "watchcat[$$]" "Running script \"$1\" for network interface: \"$2\"."
+       "$1" "$2"
+}
+
 watchcat_restart_all_network() {
-       logger -t INFO "Restarting networking now by running: /etc/init.d/network restart"
+       logger -p daemon.info -t "watchcat[$$]" "Restarting networking now by running: /etc/init.d/network restart"
        /etc/init.d/network restart
 }
 
@@ -81,6 +105,8 @@ watchcat_monitor_network() {
        iface="$5"
        mm_iface_name="$6"
        mm_iface_unlock_bands="$7"
+       address_family="$8"
+       script="$9"
 
        time_now="$(cat /proc/uptime)"
        time_now="${time_now%%.*}"
@@ -94,6 +120,8 @@ watchcat_monitor_network() {
 
        ping_size="$(get_ping_size "$ping_size")"
 
+       ping_family="$(get_ping_family_flag "$address_family")"
+
        while true; do
                # account for the time ping took to return. With a ping time of 5s, ping might take more than that, so it is important to avoid even more delay.
                time_now="$(cat /proc/uptime)"
@@ -109,12 +137,12 @@ watchcat_monitor_network() {
                for host in $ping_hosts; do
                        if [ "$iface" != "" ]; then
                                ping_result="$(
-                                       ping -I "$iface" -s "$ping_size" -c 1 "$host" &> /dev/null
+                                       ping "$ping_family" -I "$iface" -s "$ping_size" -c 1 "$host" &> /dev/null
                                        echo $?
                                )"
                        else
                                ping_result="$(
-                                       ping -s "$ping_size" -c 1 "$host" &> /dev/null
+                                       ping "$ping_family" -s "$ping_size" -c 1 "$host" &> /dev/null
                                        echo $?
                                )"
                        fi
@@ -122,7 +150,9 @@ watchcat_monitor_network() {
                        if [ "$ping_result" -eq 0 ]; then
                                time_lastcheck_withinternet="$time_now"
                        else
-                               if [ "$iface" != "" ]; then
+                               if [ "$script" != "" ]; then
+                                       logger -p daemon.info -t "watchcat[$$]" "Could not reach $host via \"$iface\" for \"$((time_now - time_lastcheck_withinternet))\" seconds. Running script after reaching \"$failure_period\" seconds"
+                               elif [ "$iface" != "" ]; then
                                        logger -p daemon.info -t "watchcat[$$]" "Could not reach $host via \"$iface\" for \"$((time_now - time_lastcheck_withinternet))\" seconds. Restarting \"$iface\" after reaching \"$failure_period\" seconds"
                                else
                                        logger -p daemon.info -t "watchcat[$$]" "Could not reach $host for \"$((time_now - time_lastcheck_withinternet))\" seconds. Restarting networking after reaching \"$failure_period\" seconds"
@@ -131,13 +161,17 @@ watchcat_monitor_network() {
                done
 
                [ "$((time_now - time_lastcheck_withinternet))" -ge "$failure_period" ] && {
-                       if [ "$mm_iface_name" != "" ]; then
-                               watchcat_restart_modemmanager_iface "$mm_iface_name" "$mm_iface_unlock_bands"
-                       fi
-                       if [ "$iface" != "" ]; then
-                               watchcat_restart_network_iface "$iface"
+                       if [ "$script" != "" ]; then
+                               watchcat_run_script "$script" "$iface"
                        else
-                               watchcat_restart_all_network
+                               if [ "$mm_iface_name" != "" ]; then
+                                       watchcat_restart_modemmanager_iface "$mm_iface_name" "$mm_iface_unlock_bands"
+                               fi
+                               if [ "$iface" != "" ]; then
+                                       watchcat_restart_network_iface "$iface"
+                               else
+                                       watchcat_restart_all_network
+                               fi
                        fi
                        /etc/init.d/watchcat start
                        # Restart timer cycle.
@@ -153,6 +187,7 @@ watchcat_ping() {
        ping_hosts="$3"
        ping_frequency_interval="$4"
        ping_size="$5"
+       address_family="$6"
 
        time_now="$(cat /proc/uptime)"
        time_now="${time_now%%.*}"
@@ -166,6 +201,8 @@ watchcat_ping() {
 
        ping_size="$(get_ping_size "$ping_size")"
 
+       ping_family="$(get_ping_family_flag "$address_family")"
+
        while true; do
                # account for the time ping took to return. With a ping time of 5s, ping might take more than that, so it is important to avoid even more delay.
                time_now="$(cat /proc/uptime)"
@@ -181,12 +218,12 @@ watchcat_ping() {
                for host in $ping_hosts; do
                        if [ "$iface" != "" ]; then
                                ping_result="$(
-                                       ping -I "$iface" -s "$ping_size" -c 1 "$host" &> /dev/null
+                                       ping "$ping_family" -I "$iface" -s "$ping_size" -c 1 "$host" &> /dev/null
                                        echo $?
                                )"
                        else
                                ping_result="$(
-                                       ping -s "$ping_size" -c 1 "$host" &> /dev/null
+                                       ping "$ping_family" -s "$ping_size" -c 1 "$host" &> /dev/null
                                        echo $?
                                )"
                        fi
@@ -211,13 +248,20 @@ mode="$1"
 
 case "$mode" in
 periodic_reboot)
+       # args from init script: period forcedelay
        watchcat_periodic "$2" "$3"
        ;;
 ping_reboot)
-       watchcat_ping "$2" "$3" "$4" "$5" "$6"
+       # args from init script: period forcedelay pinghosts pingperiod pingsize addressfamily
+       watchcat_ping "$2" "$3" "$4" "$5" "$6" "$7"
        ;;
 restart_iface)
-       watchcat_monitor_network "$2" "$3" "$4" "$5" "$6" "$7"
+       # args from init script: period pinghosts pingperiod pingsize interface mmifacename unlockbands addressfamily
+       watchcat_monitor_network "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" ""
+       ;;
+run_script)
+       # args from init script: period pinghosts pingperiod pingsize interface addressfamily script
+       watchcat_monitor_network "$2" "$3" "$4" "$5" "$6" "" "" "$7" "$8"
        ;;
 *)
        echo "Error: invalid mode selected: $mode"
index 810534c5cb47d43eab725d290218e5d1320ea7c5..14ef6286628dd741c5f3b12aadbfcb3cc45f2475 100644 (file)
@@ -1,12 +1,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=yq
-PKG_VERSION:=4.25.2
+PKG_VERSION:=4.26.1
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/mikefarah/yq/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=2aa2d3e4e44a74bc8a2213f60620f69366a86bbc9f5deffcc15047eaa4cf9e19
+PKG_HASH:=aa280a6facafc8fc5d0f3b5926a0f990ed16520dec8cb18f33752dbf6b8dc998
 
 PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
 PKG_LICENSE:=MIT