ASR_BASE
Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/package/devel/binutils/Makefile b/package/devel/binutils/Makefile
new file mode 100644
index 0000000..3fb281c
--- /dev/null
+++ b/package/devel/binutils/Makefile
@@ -0,0 +1,148 @@
+#
+# Copyright (C) 2006-2013 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:=binutils
+PKG_VERSION:=2.42
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=@GNU/binutils
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_VERSION:=$(PKG_VERSION)
+PKG_HASH:=f6e4d41fd5fc778b06b7891457b3620da5ecea1006c6a4a41ae998109f85a800
+
+PKG_FIXUP:=patch-libtool
+PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof gprofng binutils ld libiberty gold intl libctf libsframe
+PKG_REMOVE_FILES:=libtool.m4
+PKG_INSTALL:=1
+
+PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
+PKG_LICENSE:=GPL-3.0+
+PKG_CPE_ID:=cpe:/a:gnu:binutils
+PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=no-mips16
+
+include $(INCLUDE_DIR)/nls.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libbfd
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=libbfd
+ DEPENDS:=+zlib $(INTL_DEPENDS)
+endef
+
+define Package/libctf
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=libctf
+ DEPENDS:=+libbfd
+endef
+
+define Package/libopcodes
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=libopcodes
+ DEPENDS:=+libbfd
+endef
+
+define Package/binutils
+ SECTION:=devel
+ CATEGORY:=Development
+ TITLE:=binutils
+ DEPENDS:=+objdump +ar
+ ALTERNATIVES:=200:/usr/bin/strings:/usr/bin/binutils-strings
+endef
+
+define Package/objdump
+ SECTION:=devel
+ CATEGORY:=Development
+ TITLE:=objdump
+ DEPENDS:=+libopcodes +libctf
+endef
+
+define Package/ar
+ SECTION:=devel
+ CATEGORY:=Development
+ TITLE:=ar
+ DEPENDS:=+zlib +libbfd
+endef
+
+define Package/binutils/description
+ The Binutils package contains a linker, an assembler, and other tools for handling object files
+endef
+
+TARGET_CFLAGS += $(FPIC) -Wno-unused-value
+
+TARGET_LDFLAGS += $(if $(INTL_FULL),-lintl)
+
+CONFIGURE_ARGS += \
+ --host=$(REAL_GNU_TARGET_NAME) \
+ --target=$(REAL_GNU_TARGET_NAME) \
+ --enable-shared \
+ --enable-install-libiberty \
+ --enable-install-libbfd \
+ --enable-install-libctf \
+ --with-system-zlib \
+ --without-zstd \
+ --without-msgpack \
+ --disable-gprofng
+
+define Build/Install
+ $(call Build/Install/Default)
+ $(MAKE) -C $(PKG_BUILD_DIR)/libiberty \
+ target_header_dir=libiberty \
+ DESTDIR="$(PKG_INSTALL_DIR)" \
+ MULTIOSDIR="" \
+ install
+endef
+
+define Build/InstallDev
+ $(CP) $(PKG_INSTALL_DIR)/* $(1)/
+endef
+
+define Package/libbfd/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbfd*.so* $(1)/usr/lib/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsframe*.so* $(1)/usr/lib/
+endef
+
+define Package/libctf/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libctf*.so* $(1)/usr/lib/
+endef
+
+define Package/libopcodes/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopcodes*.so $(1)/usr/lib/
+endef
+
+define Package/objdump/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/objdump $(1)/usr/bin/
+endef
+
+define Package/ar/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/ar $(1)/usr/bin/
+endef
+
+define Package/binutils/install
+ $(INSTALL_DIR) $(1)/usr $(1)/bin
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
+ mv $(1)/usr/bin/strings $(1)/usr/bin/binutils-strings
+ rm -f $(1)/usr/bin/objdump
+ rm -f $(1)/usr/bin/ar
+endef
+
+$(eval $(call BuildPackage,libbfd))
+$(eval $(call BuildPackage,libctf))
+$(eval $(call BuildPackage,libopcodes))
+$(eval $(call BuildPackage,binutils))
+$(eval $(call BuildPackage,objdump))
+$(eval $(call BuildPackage,ar))
diff --git a/package/devel/binutils/patches/001-replace-attribute_const.patch b/package/devel/binutils/patches/001-replace-attribute_const.patch
new file mode 100644
index 0000000..dac641d
--- /dev/null
+++ b/package/devel/binutils/patches/001-replace-attribute_const.patch
@@ -0,0 +1,88 @@
+Fix this compile error:
+----------------------
+./../common/cpuid.c:27:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__get_cpuid'
+ 27 | __get_cpuid (unsigned int op ATTRIBUTE_UNUSED, unsigned int *eax,
+ | ^~~~~~~~~~~
+----------------------
+
+and this error:
+----------------------
+unwind.c: In function '__collector_ext_return_address':
+unwind.c:236:34: error: '__u64' undeclared (first use in this function)
+ 236 | context->uc_mcontext.sp = (__u64) __builtin_frame_address(0); \
+ | ^~~~~
+unwind.c:490:3: note: in expansion of macro 'FILL_CONTEXT'
+ 490 | FILL_CONTEXT ((&context));
+
+----------------------
+--- a/gprofng/common/cpuid.c
++++ b/gprofng/common/cpuid.c
+@@ -23,7 +23,7 @@
+ #elif defined(__aarch64__)
+ #define ATTRIBUTE_UNUSED __attribute__((unused))
+
+-static inline uint_t __attribute_const__
++static inline uint_t __attribute__((__const__))
+ __get_cpuid (unsigned int op ATTRIBUTE_UNUSED, unsigned int *eax,
+ unsigned int *ebx ATTRIBUTE_UNUSED,
+ unsigned int *ecx ATTRIBUTE_UNUSED, unsigned int *edx ATTRIBUTE_UNUSED)
+--- a/gprofng/libcollector/unwind.c
++++ b/gprofng/libcollector/unwind.c
+@@ -237,7 +237,7 @@ typedef uint64_t __u64;
+
+ #define FILL_CONTEXT(context) \
+ { CALL_UTIL (getcontext) (context); \
+- context->uc_mcontext.sp = (__u64) __builtin_frame_address(0); \
++ context->uc_mcontext.sp = (uint64_t) __builtin_frame_address(0); \
+ }
+
+ #endif /* ARCH() */
+@@ -4583,11 +4583,11 @@ stack_unwind (char *buf, int size, void
+ if (buf && bptr && eptr && context && size + mode > 0)
+ getByteInstruction ((unsigned char *) eptr);
+ int ind = 0;
+- __u64 *lbuf = (void *) buf;
+- int lsize = size / sizeof (__u64);
+- __u64 pc = context->uc_mcontext.pc;
+- __u64 sp = context->uc_mcontext.sp;
+- __u64 stack_base;
++ uint64_t *lbuf = (void *) buf;
++ int lsize = size / sizeof (uint64_t);
++ uint64_t pc = context->uc_mcontext.pc;
++ uint64_t sp = context->uc_mcontext.sp;
++ uint64_t stack_base;
+ unsigned long tbgn = 0;
+ unsigned long tend = 0;
+
+@@ -4598,7 +4598,7 @@ stack_unwind (char *buf, int size, void
+ {
+ stack_base = sp + 0x100000;
+ if (stack_base < sp) // overflow
+- stack_base = (__u64) -1;
++ stack_base = (uint64_t) -1;
+ }
+ DprintfT (SP_DUMP_UNWIND,
+ "unwind.c:%d stack_unwind %2d pc=0x%llx sp=0x%llx stack_base=0x%llx\n",
+@@ -4629,17 +4629,17 @@ stack_unwind (char *buf, int size, void
+ __LINE__, (unsigned long) sp);
+ break;
+ }
+- pc = ((__u64 *) sp)[1];
+- __u64 old_sp = sp;
+- sp = ((__u64 *) sp)[0];
++ pc = ((uint64_t *) sp)[1];
++ uint64_t old_sp = sp;
++ sp = ((uint64_t *) sp)[0];
+ if (sp < old_sp)
+ break;
+ }
+ if (ind >= lsize)
+ {
+ ind = lsize - 1;
+- lbuf[ind++] = (__u64) SP_TRUNC_STACK_MARKER;
++ lbuf[ind++] = (uint64_t) SP_TRUNC_STACK_MARKER;
+ }
+- return ind * sizeof (__u64);
++ return ind * sizeof (uint64_t);
+ }
+ #endif /* ARCH() */
diff --git a/package/devel/gdb/Makefile b/package/devel/gdb/Makefile
new file mode 100644
index 0000000..7bdc6c8
--- /dev/null
+++ b/package/devel/gdb/Makefile
@@ -0,0 +1,97 @@
+#
+# Copyright (C) 2006-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:=gdb
+PKG_VERSION:=15.2
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@GNU/gdb
+PKG_HASH:=83350ccd35b5b5a0cba6b334c41294ea968158c573940904f00b92f76345314d
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+PKG_LICENSE:=GPL-3.0+
+PKG_CPE_ID:=cpe:/a:gnu:gdb
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/gdb/Default
+ SECTION:=devel
+ CATEGORY:=Development
+ DEPENDS:=+!USE_MUSL:libthread-db $(ICONV_DEPENDS) $(INTL_DEPENDS)
+ URL:=https://www.gnu.org/software/gdb/
+endef
+
+define Package/gdb
+$(call Package/gdb/Default)
+ TITLE:=GNU Debugger
+ DEPENDS+=+libreadline +libncurses +zlib +libgmp +libmpfr
+endef
+
+define Package/gdb/description
+GDB, the GNU Project debugger, allows you to see what is going on 'inside'
+another program while it executes -- or what another program was doing at the
+moment it crashed.
+endef
+
+define Package/gdbserver
+$(call Package/gdb/Default)
+ TITLE:=Remote server for GNU Debugger
+endef
+
+define Package/gdbserver/description
+GDBSERVER is a program that allows you to run GDB on a different machine than the
+one which is running the program being debugged.
+endef
+
+# XXX: add --disable-werror to prevent build failure with arm
+CONFIGURE_ARGS+= \
+ --with-system-readline \
+ --with-system-zlib \
+ --without-expat \
+ --without-lzma \
+ --without-zstd \
+ --disable-unit-tests \
+ --disable-ubsan \
+ --disable-sim \
+ --disable-werror \
+ --disable-source-highlight \
+ --without-isl \
+ --without-xxhash \
+ --with-libgmp-prefix=$(STAGING_DIR)/usr
+
+CONFIGURE_VARS+= \
+ ac_cv_search_tgetent="$(TARGET_LDFLAGS) -lncurses -lreadline"
+
+TARGET_LDFLAGS+= \
+ $(INTL_LDFLAGS) $(if $(INTL_FULL),-lintl) \
+ -static-libstdc++ \
+ -Wl,--gc-sections
+
+define Build/Install
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ DESTDIR="$(PKG_INSTALL_DIR)" \
+ CPPFLAGS="$(TARGET_CPPFLAGS)" \
+ install-gdb install-gdbserver
+endef
+
+define Package/gdb/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gdb $(1)/usr/bin/
+endef
+
+define Package/gdbserver/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gdbserver $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,gdb))
+$(eval $(call BuildPackage,gdbserver))
diff --git a/package/devel/gdb/patches/110-shared_libgcc.patch b/package/devel/gdb/patches/110-shared_libgcc.patch
new file mode 100644
index 0000000..d9dcafe
--- /dev/null
+++ b/package/devel/gdb/patches/110-shared_libgcc.patch
@@ -0,0 +1,76 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -1401,13 +1401,13 @@ if test -z "$LD"; then
+ fi
+ fi
+
+-# Check whether -static-libstdc++ -static-libgcc is supported.
++# Check whether -static-libstdc++ is supported.
+ have_static_libs=no
+ if test "$GCC" = yes; then
+ saved_LDFLAGS="$LDFLAGS"
+
+- LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc"
+- AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc])
++ LDFLAGS="$LDFLAGS -static-libstdc++"
++ AC_MSG_CHECKING([whether g++ accepts -static-libstdc++])
+ AC_LANG_PUSH(C++)
+ AC_LINK_IFELSE([AC_LANG_SOURCE([
+ #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
+@@ -1837,7 +1837,7 @@ AC_ARG_WITH(stage1-ldflags,
+ # trust that they are doing what they want.
+ if test "$with_static_standard_libraries" = yes -a "$stage1_libs" = "" \
+ -a "$have_static_libs" = yes; then
+- stage1_ldflags="-static-libstdc++ -static-libgcc"
++ stage1_ldflags="-static-libstdc++"
+ fi])
+ AC_SUBST(stage1_ldflags)
+
+@@ -1866,7 +1866,7 @@ AC_ARG_WITH(boot-ldflags,
+ # statically. But if the user explicitly specified the libraries to
+ # use, trust that they are doing what they want.
+ if test "$poststage1_libs" = ""; then
+- poststage1_ldflags="-static-libstdc++ -static-libgcc"
++ poststage1_ldflags="-static-libstdc++"
+ fi])
+ case $target in
+ *-darwin2* | *-darwin1[[56789]]*)
+--- a/configure
++++ b/configure
+@@ -5414,14 +5414,14 @@ if test -z "$LD"; then
+ fi
+ fi
+
+-# Check whether -static-libstdc++ -static-libgcc is supported.
++# Check whether -static-libstdc++ is supported.
+ have_static_libs=no
+ if test "$GCC" = yes; then
+ saved_LDFLAGS="$LDFLAGS"
+
+- LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc"
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether g++ accepts -static-libstdc++ -static-libgcc" >&5
+-$as_echo_n "checking whether g++ accepts -static-libstdc++ -static-libgcc... " >&6; }
++ LDFLAGS="$LDFLAGS -static-libstdc++"
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether g++ accepts -static-libstdc++" >&5
++$as_echo_n "checking whether g++ accepts -static-libstdc++... " >&6; }
+ ac_ext=cpp
+ ac_cpp='$CXXCPP $CPPFLAGS'
+ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+@@ -8465,7 +8465,7 @@ else
+ # trust that they are doing what they want.
+ if test "$with_static_standard_libraries" = yes -a "$stage1_libs" = "" \
+ -a "$have_static_libs" = yes; then
+- stage1_ldflags="-static-libstdc++ -static-libgcc"
++ stage1_ldflags="-static-libstdc++"
+ fi
+ fi
+
+@@ -8501,7 +8501,7 @@ else
+ # statically. But if the user explicitly specified the libraries to
+ # use, trust that they are doing what they want.
+ if test "$poststage1_libs" = ""; then
+- poststage1_ldflags="-static-libstdc++ -static-libgcc"
++ poststage1_ldflags="-static-libstdc++"
+ fi
+ fi
+
diff --git a/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch b/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch
new file mode 100644
index 0000000..0796c34
--- /dev/null
+++ b/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch
@@ -0,0 +1,38 @@
+From 56893a61aa4f0270fa8d1197b9848247f90fce0d Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Fri, 24 Mar 2017 10:36:03 +0800
+Subject: [PATCH] Fix invalid sigprocmask call
+
+The POSIX document says
+
+ The pthread_sigmask() and sigprocmask() functions shall fail if:
+
+ [EINVAL]
+ The value of the how argument is not equal to one of the defined values.
+
+and this is how musl-libc is currently doing. Fix the call to be safe
+and correct
+
+ [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html
+
+gdb/ChangeLog:
+2017-03-24 Yousong Zhou <yszhou4tech@gmail.com>
+
+ * common/signals-state-save-restore.c (save_original_signals_state):
+ Fix invalid sigprocmask call.
+---
+ gdb/ChangeLog | 5 +++++
+ gdb/common/signals-state-save-restore.c | 2 +-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+--- a/gdbsupport/signals-state-save-restore.cc
++++ b/gdbsupport/signals-state-save-restore.cc
+@@ -37,7 +37,7 @@ save_original_signals_state (bool quiet)
+ int i;
+ int res;
+
+- res = gdb_sigmask (0, NULL, &original_signal_mask);
++ res = gdb_sigmask (SIG_BLOCK, NULL, &original_signal_mask);
+ if (res == -1)
+ perror_with_name (("sigprocmask"));
+
diff --git a/package/devel/gdb/patches/140-sgidefs.patch b/package/devel/gdb/patches/140-sgidefs.patch
new file mode 100644
index 0000000..1753e9b
--- /dev/null
+++ b/package/devel/gdb/patches/140-sgidefs.patch
@@ -0,0 +1,30 @@
+From 677b5b56135141c0d259e370aacd0e11c810aa15 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Fri, 5 Feb 2016 14:00:00 -0800
+Subject: [PATCH] use <asm/sgidefs.h>
+
+Build fix for MIPS with musl libc
+
+The MIPS specific header <sgidefs.h> is provided by glibc and uclibc
+but not by musl. Regardless of the libc, the kernel headers provide
+<asm/sgidefs.h> which provides the same definitions, so use that
+instead.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ gdb/mips-linux-nat.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -30,7 +30,7 @@
+ #include "gdb_proc_service.h"
+ #include "gregset.h"
+
+-#include <sgidefs.h>
++#include <asm/sgidefs.h>
+ #include "nat/gdb_ptrace.h"
+ #include <asm/ptrace.h>
+ #include "inf-ptrace.h"
diff --git a/package/devel/gdb/patches/150-mips64.patch b/package/devel/gdb/patches/150-mips64.patch
new file mode 100644
index 0000000..41c267b
--- /dev/null
+++ b/package/devel/gdb/patches/150-mips64.patch
@@ -0,0 +1,32 @@
+From e92f8932ef488de2a56db4299131ce6a4eb170bd Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 23 Mar 2016 06:30:09 +0000
+Subject: [PATCH] mips-linux-nat: Define _ABIO32 if not defined
+
+This helps building gdb on mips64 on musl, since
+musl does not provide sgidefs.h this define is
+only defined when GCC is using o32 ABI, in that
+case gcc emits it as built-in define and hence
+it works ok for mips32
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ gdb/mips-linux-nat.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/gdb/mips-linux-nat.c
++++ b/gdb/mips-linux-nat.c
+@@ -41,6 +41,11 @@
+ #define PTRACE_GET_THREAD_AREA 25
+ #endif
+
++/* musl does not define and relies on compiler built-in macros for it */
++#ifndef _ABIO32
++#define _ABIO32 1
++#endif
++
+ class mips_linux_nat_target final : public linux_nat_trad_target
+ {
+ public:
diff --git a/package/devel/gperf/Makefile b/package/devel/gperf/Makefile
new file mode 100644
index 0000000..9cf4dbc
--- /dev/null
+++ b/package/devel/gperf/Makefile
@@ -0,0 +1,38 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gperf
+PKG_VERSION:=3.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@GNU/gperf
+PKG_HASH:=588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2
+
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+
+HOST_CPPFLAGS:=-I$(HOST_BUILD_DIR)/lib -I$(HOST_BUILD_DIR)/src $(HOST_CPPFLAGS)
+TARGET_CPPFLAGS:=-I$(PKG_BUILD_DIR)/lib -I$(PKG_BUILD_DIR)/src $(TARGET_CPPFLAGS)
+
+HOST_CXXFLAGS += -std=c++11
+
+define Package/gperf
+ SECTION:=devel
+ CATEGORY:=Development
+ TITLE:=GNU gperf
+ URL:=http://www.gnu.org/software/gperf
+endef
+
+define Package/gperf/description
+ GNU gperf is a perfect hash function generator. For a given list of strings,
+ it produces a hash function and hash table, in form of C or C++ code,
+ for looking up a value depending on the input string.
+ The hash function is perfect, which means that the hash table has no collisions,
+ and the hash table lookup needs a single string comparison only.
+endef
+
+$(eval $(call HostBuild))
+$(eval $(call BuildPackage,gperf))
diff --git a/package/devel/kselftests-bpf/Makefile b/package/devel/kselftests-bpf/Makefile
new file mode 100644
index 0000000..d69e1e6
--- /dev/null
+++ b/package/devel/kselftests-bpf/Makefile
@@ -0,0 +1,73 @@
+#
+# Copyright (C) 2021 Tony Ambardar <itugrok@yahoo.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=kselftests-bpf
+PKG_VERSION:=$(LINUX_VERSION)
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com>
+
+PKG_BUILD_FLAGS:=no-lto
+PKG_BUILD_PARALLEL:=1
+PKG_FLAGS:=nonshared
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/kselftests-bpf
+ SECTION:=devel
+ CATEGORY:=Development
+ DEPENDS:= \
+ +libelf +zlib +libpthread +librt @!IN_SDK \
+ @KERNEL_DEBUG_FS @KERNEL_DEBUG_INFO_BTF @KERNEL_BPF_EVENTS
+ TITLE:=Linux Kernel Selftests (BPF)
+ URL:=http://www.kernel.org
+endef
+
+define Package/kselftests-bpf/description
+ kselftests-bpf is the Linux kernel BPF test suite
+endef
+
+EXE_TARGETS = test_verifier
+
+MOD_TARGETS = $(if $(call kernel_patchver_ge,6.4),bpf_testmod.ko)
+
+MAKE_PATH:=tools/testing/selftests/bpf
+
+MAKE_VARS = \
+ ARCH="$(LINUX_KARCH)" \
+ CROSS_COMPILE="$(TARGET_CROSS)" \
+ EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
+ LDLIBS="$(TARGET_LDFLAGS)" \
+ TOOLCHAIN_INCLUDE="$(TOOLCHAIN_INC_DIRS)" \
+ KBUILD_OUTPUT="$(LINUX_DIR)"
+
+MAKE_FLAGS = \
+ $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
+ OUTPUT=$(PKG_BUILD_DIR)
+
+define Build/Compile
+ +$(MAKE_VARS) \
+ $(MAKE) $(PKG_JOBS) -C $(LINUX_DIR)/$(MAKE_PATH) \
+ $(MAKE_FLAGS) $(EXE_TARGETS) $(MOD_TARGETS) ;
+endef
+
+define Package/kselftests-bpf/install
+ $(INSTALL_DIR) $(1)/usr/libexec/$(PKG_NAME)
+ $(foreach tgt,$(MOD_TARGETS), \
+ $(INSTALL_DATA) \
+ $(PKG_BUILD_DIR)/$(tgt) $(1)/usr/libexec/$(PKG_NAME); \
+ )
+ $(foreach tgt,$(EXE_TARGETS), \
+ $(INSTALL_BIN) \
+ $(PKG_BUILD_DIR)/$(tgt) $(1)/usr/libexec/$(PKG_NAME); \
+)
+endef
+
+$(eval $(call BuildPackage,kselftests-bpf))
diff --git a/package/devel/leds/Makefile b/package/devel/leds/Makefile
new file mode 100644
index 0000000..ea3b19c
--- /dev/null
+++ b/package/devel/leds/Makefile
@@ -0,0 +1,73 @@
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=leds
+PKG_VERSION:=$(LINUX_VERSION)
+PKG_RELEASE:=1
+
+PKG_BUILD_PARALLEL:=1
+PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
+PKG_LICENSE:=GPL-2.0-only
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/leds/default
+ SECTION:=devel
+ CATEGORY:=Development
+ URL:=http://www.kernel.org
+endef
+
+define Package/ledumon
+ $(Package/leds/default)
+ TITLE:=Monitoring userspace LEDs
+ DEPENDS:=+kmod-leds-uleds
+endef
+
+define Package/ledumon/description
+ This program creates a new userspace LED class device and monitors it.
+ A timestamp and brightness value is printed each time the brightness
+ changes.
+endef
+
+define Package/ledhwbmon
+ $(Package/leds/default)
+ TITLE:=Monitoring hardware controlled LED brightness
+endef
+
+define Package/ledhwbmon/description
+ This program monitors LED brightness level changes having its origin
+ in hardware/firmware, i.e. outside of kernel control. A timestamp and
+ brightness value is printed each time the brightness changes.
+endef
+
+MAKE_FLAGS = \
+ ARCH="$(LINUX_KARCH)" \
+ CROSS_COMPILE="$(TARGET_CROSS)" \
+ CC="$(TARGET_CC)" \
+ LD="$(TARGET_CROSS)ld" \
+ EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS) -static" \
+ $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
+ prefix=/usr
+
+define Build/Compile
+ -$(MAKE) clean \
+ -C $(LINUX_DIR)/tools/leds
+ +$(MAKE_FLAGS) $(MAKE) \
+ -C $(LINUX_DIR)/tools/leds
+endef
+
+define Package/ledumon/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(LINUX_DIR)/tools/leds/uledmon \
+ $(1)/usr/bin/ledumon
+endef
+
+define Package/ledhwbmon/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(LINUX_DIR)/tools/leds/led_hw_brightness_mon \
+ $(1)/usr/bin/ledhwbmon
+endef
+
+$(eval $(call BuildPackage,ledumon))
+$(eval $(call BuildPackage,ledhwbmon))
diff --git a/package/devel/perf/Makefile b/package/devel/perf/Makefile
new file mode 100644
index 0000000..20be595
--- /dev/null
+++ b/package/devel/perf/Makefile
@@ -0,0 +1,90 @@
+#
+# Copyright (C) 2011-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=perf
+PKG_VERSION:=$(LINUX_VERSION)
+PKG_RELEASE:=5
+
+PKG_BUILD_FLAGS:=no-mips16 no-lto
+PKG_BUILD_PARALLEL:=1
+PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
+PKG_FLAGS:=nonshared
+
+# Perf's makefile and headers are not relocatable and must be built from the
+# Linux sources directory
+PKG_BUILD_DIR:=$(LINUX_DIR)/tools/perf-$(TARGET_DIR_NAME)
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/perf
+ SECTION:=devel
+ CATEGORY:=Development
+ DEPENDS:= +libelf +libdw +PACKAGE_libunwind:libunwind +libpthread +librt +objdump @!IN_SDK @KERNEL_PERF_EVENTS \
+ +PACKAGE_libbfd:libbfd +PACKAGE_libopcodes:libopcodes +libtraceevent
+ TITLE:=Linux performance monitoring tool
+ VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
+ URL:=http://www.kernel.org
+endef
+
+define Package/perf/description
+ perf is the Linux performance monitoring tool
+endef
+
+HOST_CFLAGS += -I$(LINUX_DIR)/tools/include
+
+TARGET_LDFLAGS += $(INTL_LDFLAGS)
+
+MAKE_FLAGS = \
+ ARCH="$(LINUX_KARCH)" \
+ NO_LIBPERL=1 \
+ NO_LIBPYTHON=1 \
+ NO_NEWT=1 \
+ NO_LZMA=1 \
+ NO_BACKTRACE=1 \
+ NO_LIBNUMA=1 \
+ NO_GTK2=1 \
+ NO_LIBAUDIT=1 \
+ NO_LIBCRYPTO=1 \
+ NO_LIBUNWIND=1 \
+ NO_LIBZSTD=1 \
+ NO_LIBCAP=1 \
+ CROSS_COMPILE="$(TARGET_CROSS)" \
+ CC="$(TARGET_CC)" \
+ LD="$(TARGET_CROSS)ld" \
+ EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ KBUILD_HOSTCFLAGS="$(HOST_CFLAGS)" \
+ $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \
+ PKG_CONFIG="$(PKG_CONFIG)" \
+ PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" \
+ EXCLUDE_EXTLIBS="-lstdc++" \
+ EXTRA_PERFLIBS="$(shell $(TARGET_CC) -print-file-name=libstdc++.a)" \
+ WERROR=0 \
+ O=$(PKG_BUILD_DIR) \
+ prefix=/usr
+
+ifeq ($(LINUX_KARCH),powerpc)
+ MAKE_FLAGS += NO_AUXTRACE=1
+endif
+
+define Build/Compile
+ +$(MAKE) $(PKG_JOBS) $(MAKE_FLAGS) \
+ --no-print-directory \
+ -C $(LINUX_DIR)/tools/perf \
+ -f Makefile.perf
+endef
+
+define Package/perf/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/perf $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,perf))
diff --git a/package/devel/ply/Makefile b/package/devel/ply/Makefile
new file mode 100644
index 0000000..4a2443a
--- /dev/null
+++ b/package/devel/ply/Makefile
@@ -0,0 +1,54 @@
+#
+# Copyright (C) 2022 Ye Jiaqiang, Tony Ambardar
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ply
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/iovisor/ply.git
+PKG_MIRROR_HASH:=d4f434c4d11b662b61da2de8b5a29ecdeac655aa5158f4c4127e2a91047c0c54
+PKG_SOURCE_DATE:=2023-05-16
+PKG_SOURCE_VERSION:=1b57943db56692924bccb61c271de24a8264d8df
+
+PKG_LICENSE:=GPLv2
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Tony Ambardar <itugrok@yahoo.com>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/ply
+ SECTION:=devel
+ CATEGORY:=Development
+ TITLE:=Light-weight dynamic tracer for Linux
+ URL:=https://github.com/iovisor/ply.git
+ DEPENDS:= \
+ @KERNEL_BPF_EVENTS @KERNEL_DYNAMIC_FTRACE @KERNEL_DEBUG_FS \
+ @mips||mipsel||mips64||mips64el||x86_64||powerpc||arm_v7||aarch64||riscv||riscv64
+endef
+
+define Package/ply/description
+ A light-weight dynamic tracer for Linux that leverages the kernel's
+ BPF VM in concert with kprobes and tracepoints to attach probes to
+ arbitrary points in the kernel.
+endef
+
+CONFIGURE_ARGS += --enable-shared=yes --enable-static=no
+
+define Build/Prepare
+ $(call Build/Prepare/Default)
+ cd $(PKG_BUILD_DIR) && exec ./autogen.sh
+endef
+
+define Package/ply/install
+ $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ply/.libs/ply $(1)/usr/bin/
+ $(CP) $(PKG_BUILD_DIR)/src/libply/.libs/libply.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,ply))
diff --git a/package/devel/ply/patches/100-revert-read-kernel-variants.patch b/package/devel/ply/patches/100-revert-read-kernel-variants.patch
new file mode 100644
index 0000000..61615e9
--- /dev/null
+++ b/package/devel/ply/patches/100-revert-read-kernel-variants.patch
@@ -0,0 +1,94 @@
+From 755220eb974708615b14bcdc6412319698e0485d Mon Sep 17 00:00:00 2001
+From: Tony Ambardar <Tony.Ambardar@gmail.com>
+Date: Thu, 22 Dec 2022 22:53:10 -0800
+Subject: [PATCH] Revert "ply: Use new read_kernel variants"
+
+This reverts commit 17864b9818cceca09f31a346908afe1c718c10c5.
+
+Fixes: 17864b98 ("ply: Use new read_kernel variants")
+Signed-off-by: Tony Ambardar <Tony.Ambardar@gmail.com>
+---
+ src/libply/built-in/memory.c | 10 +++++-----
+ src/libply/ir.c | 10 +++++-----
+ src/libply/provider/tracepoint.c | 2 +-
+ 3 files changed, 11 insertions(+), 11 deletions(-)
+
+--- a/src/libply/built-in/memory.c
++++ b/src/libply/built-in/memory.c
+@@ -140,7 +140,7 @@ static int str_ir_post(const struct func
+ ir_emit_ldbp(pb->ir, BPF_REG_1, n->sym->irs.stack);
+ ir_emit_insn(ir, MOV_IMM((int32_t)type_sizeof(n->sym->type)), BPF_REG_2, 0);
+ ir_emit_sym_to_reg(ir, BPF_REG_3, ptr->sym);
+- ir_emit_insn(ir, CALL(BPF_FUNC_probe_read_kernel_str), 0, 0);
++ ir_emit_insn(ir, CALL(BPF_FUNC_probe_read_str), 0, 0);
+ return 0;
+ }
+
+@@ -305,7 +305,7 @@ static int struct_dot_ir_pre(const struc
+ sou->sym->irs.hint.dot = 1;
+
+ /* this also means we need to put ourselves on the
+- * stack since data will be loaded via probe_read_kernel */
++ * stack since data will be loaded via probe_read */
+ n->sym->irs.hint.stack = 1;
+ }
+ return 0;
+@@ -334,7 +334,7 @@ static int struct_dot_ir_post(const stru
+
+ ir_emit_sym_to_reg(pb->ir, BPF_REG_3, ptr->sym);
+ ir_emit_insn(pb->ir, ALU64_IMM(BPF_ADD, offset), BPF_REG_3, 0);
+- goto probe_read_kernel;
++ goto probe_read;
+ }
+
+ offset += sou->sym->irs.stack;
+@@ -346,10 +346,10 @@ static int struct_dot_ir_post(const stru
+ }
+
+ ir_emit_insn(pb->ir, ALU_IMM(BPF_ADD, offset), BPF_REG_3, 0);
+-probe_read_kernel:
++probe_read:
+ ir_emit_insn(pb->ir, MOV_IMM((int32_t)dst->size), BPF_REG_2, 0);
+ ir_emit_ldbp(pb->ir, BPF_REG_1, dst->stack);
+- ir_emit_insn(pb->ir, CALL(BPF_FUNC_probe_read_kernel), 0, 0);
++ ir_emit_insn(pb->ir, CALL(BPF_FUNC_probe_read), 0, 0);
+ /* TODO if (r0) exit(r0); */
+ return 0;
+ }
+--- a/src/libply/ir.c
++++ b/src/libply/ir.c
+@@ -38,10 +38,10 @@ static const char *bpf_func_name(enum bp
+ return "map_update_elem";
+ case BPF_FUNC_perf_event_output:
+ return "perf_event_output";
+- case BPF_FUNC_probe_read_kernel:
+- return "probe_read_kernel";
+- case BPF_FUNC_probe_read_kernel_str:
+- return "probe_read_kernel_str";
++ case BPF_FUNC_probe_read:
++ return "probe_read";
++ case BPF_FUNC_probe_read_str:
++ return "probe_read_str";
+ case BPF_FUNC_trace_printk:
+ return "trace_printk";
+ default:
+@@ -416,7 +416,7 @@ void ir_emit_read_to_sym(struct ir *ir,
+ if (src != BPF_REG_3)
+ ir_emit_insn(ir, MOV, BPF_REG_3, src);
+
+- ir_emit_insn(ir, CALL(BPF_FUNC_probe_read_kernel), 0, 0);
++ ir_emit_insn(ir, CALL(BPF_FUNC_probe_read), 0, 0);
+ /* TODO if (r0) exit(r0); */
+ }
+
+--- a/src/libply/provider/tracepoint.c
++++ b/src/libply/provider/tracepoint.c
+@@ -68,7 +68,7 @@ static int tracepoint_dyn_ir_post(const
+ ir_emit_insn(ir, ALU_IMM(BPF_AND, 0xffff), BPF_REG_4, 0);
+ ir_emit_insn(ir, ALU64(BPF_ADD), BPF_REG_3, BPF_REG_4);
+
+- ir_emit_insn(ir, CALL(BPF_FUNC_probe_read_kernel), 0, 0);
++ ir_emit_insn(ir, CALL(BPF_FUNC_probe_read), 0, 0);
+ return 0;
+ }
+
diff --git a/package/devel/strace/Makefile b/package/devel/strace/Makefile
new file mode 100644
index 0000000..f418bea
--- /dev/null
+++ b/package/devel/strace/Makefile
@@ -0,0 +1,85 @@
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=strace
+PKG_VERSION:=6.11
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://strace.io/files/$(PKG_VERSION)
+PKG_HASH:=83262583a3529f02c3501aa8b8ac772b4cbc03dc934e98bab6e4883626e283a5
+
+PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
+PKG_LICENSE:=LGPL-2.1-or-later
+PKG_LICENSE_FILES:=COPYING
+PKG_CPE_ID:=cpe:/a:strace_project:strace
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+PKG_CONFIG_DEPENDS := \
+ CONFIG_STRACE_LIBDW \
+ CONFIG_STRACE_LIBUNWIND
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+HOST_CFLAGS += -I$(LINUX_DIR)/user_headers/include
+
+CONFIGURE_VARS+= \
+ LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
+ CPPFLAGS_FOR_BUILD="$(HOST_CPPFLAGS)" \
+ CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
+ CC_FOR_BUILD="$(HOST_CC)"
+
+define Package/strace
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=System call tracer
+ URL:=https://strace.io/
+ DEPENDS:=+STRACE_LIBDW:libdw +STRACE_LIBUNWIND:libunwind
+endef
+
+define Package/strace/description
+ A useful diagnostic, instructional, and debugging tool. Allows you to track what
+ system calls a program makes while it is running.
+endef
+
+define Package/strace/config
+choice
+ prompt "stack tracing support"
+ default STRACE_NONE
+
+ config STRACE_NONE
+ bool "None"
+
+ config STRACE_LIBDW
+ bool "libdw"
+
+ config STRACE_LIBUNWIND
+ bool "libunwind (experimental)"
+endchoice
+endef
+
+CONFIGURE_ARGS += \
+ --with-libdw=$(if $(CONFIG_STRACE_LIBDW),yes,no) \
+ --with-libunwind=$(if $(CONFIG_STRACE_LIBUNWIND),yes,no) \
+ --enable-mpers=no \
+ --without-libselinux
+
+MAKE_FLAGS := \
+ CCOPT="$(TARGET_CFLAGS)"
+
+define Package/strace/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/strace $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,strace))
diff --git a/package/devel/strace/patches/010-m4.patch b/package/devel/strace/patches/010-m4.patch
new file mode 100644
index 0000000..32584e1
--- /dev/null
+++ b/package/devel/strace/patches/010-m4.patch
@@ -0,0 +1,10 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -21,7 +21,6 @@ man_MANS = doc/strace.1 doc/strace-log-m
+
+ ACLOCAL_AMFLAGS = -I m4 -I src/xlat
+
+-@CODE_COVERAGE_RULES@
+ CODE_COVERAGE_BRANCH_COVERAGE = 1
+ CODE_COVERAGE_GENHTML_OPTIONS = $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) \
+ --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
diff --git a/package/devel/tmon/Makefile b/package/devel/tmon/Makefile
new file mode 100644
index 0000000..25aeb02
--- /dev/null
+++ b/package/devel/tmon/Makefile
@@ -0,0 +1,52 @@
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=tmon
+PKG_VERSION:=$(LINUX_VERSION)
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
+PKG_LICENSE:=GPL-2.0-only
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/tmon
+ SECTION:=devel
+ CATEGORY:=Development
+ TITLE:=Thermal monitoring and testing tool
+ URL:=http://www.kernel.org
+ DEPENDS:=+libncursesw
+endef
+
+define Package/tmon/description
+ As hardware vendors cope with the thermal constraints on their products,
+ more and more sensors are added, new cooling capabilities are introduced.
+ To expose such relationship to the userspace, Linux generic thermal layer
+ introduced sysfs entry at /sys/class/thermal with a matrix of symbolic
+ links, trip point bindings, and device instances. To traverse such
+ matrix by hand is not a trivial task.
+ 'TMON' is conceived as a tool to help visualize, tune, and test the
+ complex thermal subsystem.
+endef
+
+MAKE_FLAGS = \
+ ARCH="$(LINUX_KARCH)" \
+ CROSS_COMPILE="$(TARGET_CROSS)" \
+ CC="$(TARGET_CC)" \
+ CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS)"
+
+define Build/Compile
+ -$(MAKE) clean \
+ -C $(LINUX_DIR)/tools/thermal/tmon
+ +$(MAKE_FLAGS) $(MAKE) \
+ -C $(LINUX_DIR)/tools/thermal/tmon
+endef
+
+define Package/tmon/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(LINUX_DIR)/tools/thermal/tmon/tmon \
+ $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,tmon))
diff --git a/package/devel/trace-cmd/Makefile b/package/devel/trace-cmd/Makefile
new file mode 100644
index 0000000..22d3775
--- /dev/null
+++ b/package/devel/trace-cmd/Makefile
@@ -0,0 +1,47 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=trace-cmd
+PKG_VERSION:=3.3
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=$(PKG_NAME)-v$(PKG_VERSION)
+PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd
+PKG_MIRROR_HASH:=7a4f9c3a18a01012cd76ab9a0a2c4447aed8293d005679d5228ef2aef243445c
+
+PKG_LICENSE:=GPL-2.0-only
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+PKG_BUILD_FLAGS:=no-mips16
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/trace-cmd
+ SECTION:=devel
+ CATEGORY:=Development
+ TITLE:=Linux trace command line utility
+ DEPENDS:=+libtracefs +zlib
+endef
+
+define Package/trace-cmd-extra
+ SECTION:=devel
+ CATEGORY:=Development
+ TITLE:=Extra plugins for trace-cmd
+ DEPENDS:=+libtraceevent-extra
+endef
+
+MAKE_FLAGS += \
+ NO_PYTHON=1 \
+ NO_AUDIT=1 \
+ NO_LIBZSTD=1 \
+ prefix=/usr
+
+define Package/trace-cmd/install
+ $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/traceevent/plugins
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/trace-cmd $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,trace-cmd))
+$(eval $(call BuildPackage,trace-cmd-extra))
diff --git a/package/devel/valgrind/Makefile b/package/devel/valgrind/Makefile
new file mode 100644
index 0000000..4b94149
--- /dev/null
+++ b/package/devel/valgrind/Makefile
@@ -0,0 +1,200 @@
+#
+# Copyright (C) 2006-2013 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:=valgrind
+PKG_VERSION:=3.23.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=https://sourceware.org/pub/valgrind/
+PKG_HASH:=c5c34a3380457b9b75606df890102e7df2c702b9420c2ebef9540f8b5d56264d
+
+PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
+PKG_LICENSE:=GPL-2.0+
+PKG_CPE_ID:=cpe:/a:valgrind:valgrind
+
+PKG_FIXUP = autoreconf
+PKG_INSTALL := 1
+PKG_BUILD_PARALLEL := 1
+PKG_BUILD_FLAGS:=no-mips16
+PKG_SSP:=0
+
+STRIP:=:
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+define Package/valgrind
+ SECTION:=devel
+ CATEGORY:=Development
+ DEPENDS:=@mips||mipsel||mips64||mips64el||i386||x86_64||powerpc||arm_v7||arm +libpthread +librt
+ TITLE:=debugging and profiling tools for Linux
+ URL:=http://www.valgrind.org
+endef
+
+define Package/valgrind/default
+ $(Package/valgrind)
+ DEPENDS := valgrind
+endef
+
+define Package/valgrind-cachegrind
+ $(Package/valgrind/default)
+ TITLE += (cache profiling)
+endef
+
+define Package/valgrind-callgrind
+ $(Package/valgrind/default)
+ TITLE += (callgraph profiling)
+endef
+
+define Package/valgrind-drd
+ $(Package/valgrind/default)
+ TITLE += (thread error detection)
+endef
+
+define Package/valgrind-massif
+ $(Package/valgrind/default)
+ TITLE += (heap profiling)
+endef
+
+define Package/valgrind-helgrind
+ $(Package/valgrind/default)
+ TITLE += (thread debugging)
+endef
+
+define Package/valgrind-vgdb
+ $(Package/valgrind/default)
+ TITLE += (GDB interface)
+endef
+
+define Package/valgrind/description
+ Valgrind is an award-winning suite of tools for debugging and
+ profiling Linux programs. With the tools that come with Valgrind,
+ you can automatically detect many memory management and threading
+ bugs, avoiding hours of frustrating bug-hunting, making your
+ programs more stable. You can also perform detailed profiling,
+ to speed up and reduce memory use of your programs.
+endef
+
+CPU := $(patsubst x86_64,amd64,$(patsubst x86,i386,$(patsubst um,$(ARCH),$(LINUX_KARCH))))
+
+CONFIGURE_VARS += \
+ UNAME_R=$(LINUX_VERSION)
+
+ifeq ($(CONFIG_ARCH_64BIT),y)
+ CONFIGURE_ARGS += \
+ --enable-only64bit
+ BITS := 64bit
+else
+ CONFIGURE_ARGS += \
+ --enable-only32bit
+ BITS := 32bit
+endif
+
+ifeq ($(CONFIG_arm_v7),y)
+ CONFIGURE_ARGS += --host=armv7-openwrt-linux$(if $(TARGET_SUFFIX),-$(TARGET_SUFFIX))
+endif
+
+CONFIGURE_ARGS += \
+ --enable-lto \
+ --enable-tls \
+ --without-mpicc \
+
+define Package/valgrind/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/valgrind* $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/usr/lib/valgrind
+ $(CP) \
+ ./files/default.supp \
+ $(PKG_INSTALL_DIR)/usr/lib/valgrind/none-* \
+ $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_core*.so \
+ $(PKG_INSTALL_DIR)/usr/lib/valgrind/$(BITS)-core*.xml \
+ $(PKG_INSTALL_DIR)/usr/lib/valgrind/$(BITS)-linux*.xml \
+ $(PKG_INSTALL_DIR)/usr/lib/valgrind/memcheck-* \
+ $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_memcheck*.so \
+ $(1)/usr/lib/valgrind/
+
+ifneq ($(ARCH),aarch64)
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/valgrind/$(CPU)-*.xml \
+ $(1)/usr/lib/valgrind/
+endif
+ $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/bin
+ $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip -g",$(RSTRIP)) \
+ $(PKG_INSTALL_DIR)/usr/lib/valgrind/none-* \
+ $(PKG_INSTALL_DIR)/usr/lib/valgrind/memcheck-*
+endef
+
+define Package/valgrind-cachegrind/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cg_* $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/usr/lib/valgrind
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/valgrind/cachegrind-* \
+ $(1)/usr/lib/valgrind/
+ $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/bin
+ $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip -g",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/lib/valgrind/cachegrind-*
+endef
+
+define Package/valgrind-callgrind/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/callgrind* $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/usr/lib/valgrind
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/valgrind/callgrind-* \
+ $(1)/usr/lib/valgrind/
+ $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/bin
+ $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip -g",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/lib/valgrind/callgrind-*
+endef
+
+define Package/valgrind-drd/install
+ $(INSTALL_DIR) $(1)/usr/lib/valgrind
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/valgrind/drd-* \
+ $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_drd*.so \
+ $(1)/usr/lib/valgrind/
+ $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/bin
+ $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip -g",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/lib/valgrind/drd-*
+endef
+
+define Package/valgrind-massif/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ms_print $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/usr/lib/valgrind
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/valgrind/massif-* \
+ $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_massif*.so \
+ $(1)/usr/lib/valgrind/
+ $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/bin
+ $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip -g",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/lib/valgrind/massif-*
+endef
+
+define Package/valgrind-helgrind/install
+ $(INSTALL_DIR) $(1)/usr/lib/valgrind
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/valgrind/helgrind-* \
+ $(PKG_INSTALL_DIR)/usr/lib/valgrind/vgpreload_helgrind*.so \
+ $(1)/usr/lib/valgrind/
+ $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/bin
+ $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip -g",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/lib/valgrind/helgrind-*
+endef
+
+define Package/valgrind-vgdb/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vgdb $(1)/usr/bin/
+ $(patsubst STRIP=%,STRIP="$(TARGET_CROSS)strip",$(RSTRIP)) $(PKG_INSTALL_DIR)/usr/bin
+endef
+
+$(eval $(call BuildPackage,valgrind))
+$(eval $(call BuildPackage,valgrind-cachegrind))
+$(eval $(call BuildPackage,valgrind-callgrind))
+$(eval $(call BuildPackage,valgrind-drd))
+$(eval $(call BuildPackage,valgrind-massif))
+$(eval $(call BuildPackage,valgrind-helgrind))
+$(eval $(call BuildPackage,valgrind-vgdb))
diff --git a/package/devel/valgrind/files/default.supp b/package/devel/valgrind/files/default.supp
new file mode 100644
index 0000000..beff559
--- /dev/null
+++ b/package/devel/valgrind/files/default.supp
@@ -0,0 +1,42 @@
+{
+ ld(Addr1)
+ Memcheck:Addr1
+ fun:*
+ obj:/lib/ld-*
+}
+{
+ ld(Addr2)
+ Memcheck:Addr2
+ fun:*
+ obj:/lib/ld-*
+}
+{
+ ld(Addr4)
+ Memcheck:Addr4
+ fun:*
+ obj:/lib/ld-*
+}
+{
+ ld(Cond)
+ Memcheck:Cond
+ fun:*
+ obj:/lib/ld-*
+}
+{
+ strlen(Cond)
+ Memcheck:Cond
+ fun:strlen
+ fun:*
+}
+{
+ strnlen(Cond)
+ Memcheck:Cond
+ fun:strnlen
+ fun:*
+}
+{
+ index(Cond)
+ Memcheck:Cond
+ fun:index
+ fun:*
+}
diff --git a/package/devel/valgrind/patches/010-486180-Valgrind-MIPS-VexGuestArchState-has-no-member.patch b/package/devel/valgrind/patches/010-486180-Valgrind-MIPS-VexGuestArchState-has-no-member.patch
new file mode 100644
index 0000000..912ac38
--- /dev/null
+++ b/package/devel/valgrind/patches/010-486180-Valgrind-MIPS-VexGuestArchState-has-no-member.patch
@@ -0,0 +1,61 @@
+From 7214886886bce9029f325214156c02dcfff760d5 Mon Sep 17 00:00:00 2001
+From: Paul Floyd <pjfloyd@wanadoo.fr>
+Date: Sat, 27 Apr 2024 13:07:07 +0200
+Subject: 486180 - [Valgrind][MIPS] 'VexGuestArchState' has no member named
+ 'guest_IP_AT_SYSCALL'
+
+---
+ NEWS | 34 ++++++++++++++++++++++++++++++++++
+ VEX/priv/guest_mips_helpers.c | 4 ++++
+ VEX/pub/libvex_guest_mips32.h | 6 +++---
+ VEX/pub/libvex_guest_mips64.h | 2 ++
+ configure.ac | 6 +++---
+ 5 files changed, 46 insertions(+), 6 deletions(-)
+
+--- a/VEX/priv/guest_mips_helpers.c
++++ b/VEX/priv/guest_mips_helpers.c
+@@ -187,6 +187,8 @@ void LibVEX_GuestMIPS32_initialise( /*OU
+ vex_state->guest_w1.w64[1] = 0;
+ vex_state->guest_w2.w64[0] = 0;
+ vex_state->guest_w2.w64[1] = 0;
++
++ vex_state->guest_IP_AT_SYSCALL = 0;
+ }
+
+ void LibVEX_GuestMIPS64_initialise ( /*OUT*/ VexGuestMIPS64State * vex_state )
+@@ -294,6 +296,8 @@ void LibVEX_GuestMIPS64_initialise ( /*O
+ vex_state->guest_LLaddr = 0xFFFFFFFFFFFFFFFFULL;
+ vex_state->guest_LLdata = 0;
+
++ vex_state->guest_IP_AT_SYSCALL = 0;
++
+ vex_state->guest_MSACSR = 0;
+ }
+
+--- a/VEX/pub/libvex_guest_mips32.h
++++ b/VEX/pub/libvex_guest_mips32.h
+@@ -188,10 +188,10 @@ typedef
+
+ /* 1016 */ UInt guest_MSACSR;
+
+- /* 1020 */ UInt _padding3;
++ /* 1020 */ UInt guest_IP_AT_SYSCALL;
+
+- /* 1020 */ ULong guest_LLdata64;
+- /* 1028 */ ULong _padding4;
++ /* 1024 */ ULong guest_LLdata64;
++ /* 1032 */ ULong _padding3;
+ } VexGuestMIPS32State;
+ /*---------------------------------------------------------------*/
+ /*--- Utility functions for MIPS32 guest stuff. ---*/
+--- a/VEX/pub/libvex_guest_mips64.h
++++ b/VEX/pub/libvex_guest_mips64.h
+@@ -184,6 +184,8 @@ typedef
+ /* 1144 */ UInt guest_MSACSR;
+
+ /* 1148 */ UInt _padding2;
++ /* 1152 */ ULong guest_IP_AT_SYSCALL;
++ /* 1160 */ ULong _padding3;
+
+ } VexGuestMIPS64State;
+
diff --git a/package/devel/valgrind/patches/020-mips-skip-using-shared-syscall-numbers-for-mips32.patch b/package/devel/valgrind/patches/020-mips-skip-using-shared-syscall-numbers-for-mips32.patch
new file mode 100644
index 0000000..a519341
--- /dev/null
+++ b/package/devel/valgrind/patches/020-mips-skip-using-shared-syscall-numbers-for-mips32.patch
@@ -0,0 +1,159 @@
+From 54d6ad3348fb50f5b972fe9c05d0d8757bfe73ba Mon Sep 17 00:00:00 2001
+From: Aleksandar Rikalo <arikalo@gmail.com>
+Date: Fri, 10 May 2024 17:59:28 +0200
+Subject: mips: skip using shared syscall numbers for mips32
+
+mips does not use shared syscall numbers, so we can not use
+vki-scnums-shared-linux.h.
+
+This partially fixes KDE #444781.
+
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+Signed-off-by: Aleksandar Rikalo <arikalo@gmail.com>
+---
+ coregrind/m_syswrap/syswrap-mips32-linux.c | 1 +
+ include/pub_tool_vkiscnums_asm.h | 2 -
+ include/vki/vki-scnums-mips32-linux.h | 105 ++++++++++++++++-----
+ 3 files changed, 83 insertions(+), 25 deletions(-)
+
+--- a/coregrind/m_syswrap/syswrap-mips32-linux.c
++++ b/coregrind/m_syswrap/syswrap-mips32-linux.c
+@@ -1110,6 +1110,7 @@ static SyscallTableEntry syscall_main_ta
+ LINX_ (__NR_pwritev2, sys_pwritev2), // 362
+ //..
+ LINXY(__NR_statx, sys_statx), // 366
++ GENX_(__NR_rseq, sys_ni_syscall), // 367
+
+ LINXY(__NR_clock_gettime64, sys_clock_gettime64), // 403
+ LINX_(__NR_clock_settime64, sys_clock_settime64), // 404
+--- a/include/pub_tool_vkiscnums_asm.h
++++ b/include/pub_tool_vkiscnums_asm.h
+@@ -63,8 +63,6 @@
+ # include "vki/vki-scnums-arm64-linux.h"
+
+ #elif defined(VGP_mips32_linux)
+-# include "vki/vki-scnums-shared-linux.h"
+-# include "vki/vki-scnums-32bit-linux.h"
+ # include "vki/vki-scnums-mips32-linux.h"
+
+ #elif defined(VGP_nanomips_linux)
+--- a/include/vki/vki-scnums-mips32-linux.h
++++ b/include/vki/vki-scnums-mips32-linux.h
+@@ -380,35 +380,94 @@
+ #define __NR_setns (__NR_Linux + 343)
+ #define __NR_process_vm_readv (__NR_Linux + 345)
+ #define __NR_process_vm_writev (__NR_Linux + 346)
+-#define __NR_kcmp (__NR_Linux + 347)
+-#define __NR_finit_module (__NR_Linux + 348)
+-#define __NR_sched_setattr (__NR_Linux + 349)
+-#define __NR_sched_getattr (__NR_Linux + 350)
+-#define __NR_renameat2 (__NR_Linux + 351)
+-#define __NR_seccomp (__NR_Linux + 352)
+-#define __NR_getrandom (__NR_Linux + 353)
+-#define __NR_memfd_create (__NR_Linux + 354)
+-#define __NR_bpf (__NR_Linux + 355)
+-#define __NR_execveat (__NR_Linux + 356)
+-#define __NR_userfaultfd (__NR_Linux + 357)
+-#define __NR_membarrier (__NR_Linux + 358)
+-#define __NR_mlock2 (__NR_Linux + 359)
+-#define __NR_copy_file_range (__NR_Linux + 360)
+-#define __NR_preadv2 (__NR_Linux + 361)
+-#define __NR_pwritev2 (__NR_Linux + 362)
+-#define __NR_pkey_mprotect (__NR_Linux + 363)
+-#define __NR_pkey_alloc (__NR_Linux + 364)
+-#define __NR_pkey_free (__NR_Linux + 365)
+-#define __NR_statx (__NR_Linux + 366)
+-
++#define __NR_kcmp (__NR_Linux + 347)
++#define __NR_finit_module (__NR_Linux + 348)
++#define __NR_sched_setattr (__NR_Linux + 349)
++#define __NR_sched_getattr (__NR_Linux + 350)
++#define __NR_renameat2 (__NR_Linux + 351)
++#define __NR_seccomp (__NR_Linux + 352)
++#define __NR_getrandom (__NR_Linux + 353)
++#define __NR_memfd_create (__NR_Linux + 354)
++#define __NR_bpf (__NR_Linux + 355)
++#define __NR_execveat (__NR_Linux + 356)
++#define __NR_userfaultfd (__NR_Linux + 357)
++#define __NR_membarrier (__NR_Linux + 358)
++#define __NR_mlock2 (__NR_Linux + 359)
++#define __NR_copy_file_range (__NR_Linux + 360)
++#define __NR_preadv2 (__NR_Linux + 361)
++#define __NR_pwritev2 (__NR_Linux + 362)
++#define __NR_pkey_mprotect (__NR_Linux + 363)
++#define __NR_pkey_alloc (__NR_Linux + 364)
++#define __NR_pkey_free (__NR_Linux + 365)
++#define __NR_statx (__NR_Linux + 366)
++#define __NR_rseq (__NR_Linux + 367)
++#define __NR_io_pgetevents (__NR_Linux + 368)
++#define __NR_semget (__NR_Linux + 393)
++#define __NR_semctl (__NR_Linux + 394)
++#define __NR_shmget (__NR_Linux + 395)
++#define __NR_shmctl (__NR_Linux + 396)
++#define __NR_shmat (__NR_Linux + 397)
++#define __NR_shmdt (__NR_Linux + 398)
++#define __NR_msgget (__NR_Linux + 399)
++#define __NR_msgsnd (__NR_Linux + 400)
++#define __NR_msgrcv (__NR_Linux + 401)
++#define __NR_msgctl (__NR_Linux + 402)
++#define __NR_clock_gettime64 (__NR_Linux + 403)
++#define __NR_clock_settime64 (__NR_Linux + 404)
++#define __NR_clock_adjtime64 (__NR_Linux + 405)
++#define __NR_clock_getres_time64 (__NR_Linux + 406)
++#define __NR_clock_nanosleep_time64 (__NR_Linux + 407)
++#define __NR_timer_gettime64 (__NR_Linux + 408)
++#define __NR_timer_settime64 (__NR_Linux + 409)
++#define __NR_timerfd_gettime64 (__NR_Linux + 410)
++#define __NR_timerfd_settime64 (__NR_Linux + 411)
++#define __NR_utimensat_time64 (__NR_Linux + 412)
++#define __NR_pselect6_time64 (__NR_Linux + 413)
++#define __NR_ppoll_time64 (__NR_Linux + 414)
++#define __NR_io_pgetevents_time64 (__NR_Linux + 416)
++#define __NR_recvmmsg_time64 (__NR_Linux + 417)
++#define __NR_mq_timedsend_time64 (__NR_Linux + 418)
++#define __NR_mq_timedreceive_time64 (__NR_Linux + 419)
++#define __NR_semtimedop_time64 (__NR_Linux + 420)
++#define __NR_rt_sigtimedwait_time64 (__NR_Linux + 421)
++#define __NR_futex_time64 (__NR_Linux + 422)
++#define __NR_sched_rr_get_interval_time64 (__NR_Linux + 423)
++#define __NR_pidfd_send_signal (__NR_Linux + 424)
++#define __NR_io_uring_setup (__NR_Linux + 425)
++#define __NR_io_uring_enter (__NR_Linux + 426)
++#define __NR_io_uring_register (__NR_Linux + 427)
++#define __NR_open_tree (__NR_Linux + 428)
++#define __NR_move_mount (__NR_Linux + 429)
++#define __NR_fsopen (__NR_Linux + 430)
++#define __NR_fsconfig (__NR_Linux + 431)
++#define __NR_fsmount (__NR_Linux + 432)
++#define __NR_fspick (__NR_Linux + 433)
++#define __NR_pidfd_open (__NR_Linux + 434)
++#define __NR_clone3 (__NR_Linux + 435)
++#define __NR_close_range (__NR_Linux + 436)
++#define __NR_openat2 (__NR_Linux + 437)
++#define __NR_pidfd_getfd (__NR_Linux + 438)
++#define __NR_faccessat2 (__NR_Linux + 439)
++#define __NR_process_madvise (__NR_Linux + 440)
++#define __NR_epoll_pwait2 (__NR_Linux + 441)
++#define __NR_mount_setattr (__NR_Linux + 442)
++#define __NR_quotactl_fd (__NR_Linux + 443)
++#define __NR_landlock_create_ruleset (__NR_Linux + 444)
++#define __NR_landlock_add_rule (__NR_Linux + 445)
++#define __NR_landlock_restrict_self (__NR_Linux + 446)
++#define __NR_process_mrelease (__NR_Linux + 448)
++#define __NR_futex_waitv (__NR_Linux + 449)
++#define __NR_set_mempolicy_home_node (__NR_Linux + 450)
++#define __NR_cachestat (__NR_Linux + 451)
++#define __NR_fchmodat2 (__NR_Linux + 452)
+ /*
+ * Offset of the last Linux o32 flavoured syscall
+ */
+-#define __NR_Linux_syscalls 366
++#define __NR_Linux_syscalls 366
+
+
+ #define __NR_O32_Linux 4000
+-#define __NR_O32_Linux_syscalls 366
++#define __NR_O32_Linux_syscalls 366
+
+
+ #endif /* __VKI_SCNUMS_MIPS32_LINUX_H */
diff --git a/package/devel/valgrind/patches/021-mips-skip-using-shared-syscall-numbers-for-mips64.patch b/package/devel/valgrind/patches/021-mips-skip-using-shared-syscall-numbers-for-mips64.patch
new file mode 100644
index 0000000..759c5fd
--- /dev/null
+++ b/package/devel/valgrind/patches/021-mips-skip-using-shared-syscall-numbers-for-mips64.patch
@@ -0,0 +1,152 @@
+From efaa17e53a750d5f0f4c138b507b1b104729ed67 Mon Sep 17 00:00:00 2001
+From: Petar Jovanovic <mips32r2@gmail.com>
+Date: Mon, 24 Jun 2024 10:33:46 +0000
+Subject: mips: skip using shared syscall numbers for mips64
+
+mips does not use shared syscall numbers, so we can not use
+vki-scnums-shared-linux.h.
+
+This fixes KDE #444781.
+
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+Signed-off-by: Aleksandar Rikalo <arikalo@gmail.com>
+---
+ coregrind/m_syswrap/syswrap-mips64-linux.c | 1 +
+ include/pub_tool_vkiscnums_asm.h | 1 -
+ include/vki/vki-scnums-mips64-linux.h | 98 ++++++++++++++++++++++
+ 3 files changed, 99 insertions(+), 1 deletion(-)
+
+--- a/coregrind/m_syswrap/syswrap-mips64-linux.c
++++ b/coregrind/m_syswrap/syswrap-mips64-linux.c
+@@ -813,6 +813,7 @@ static SyscallTableEntry syscall_main_ta
+ LINX_ (__NR_pwritev2, sys_pwritev2),
+ LINX_ (__NR_syncfs, sys_syncfs),
+ LINXY (__NR_statx, sys_statx),
++ GENX_ (__NR_rseq, sys_ni_syscall),
+ LINX_ (__NR_setns, sys_setns),
+ LINXY (__NR_io_uring_setup, sys_io_uring_setup),
+ LINXY (__NR_io_uring_enter, sys_io_uring_enter),
+--- a/include/pub_tool_vkiscnums_asm.h
++++ b/include/pub_tool_vkiscnums_asm.h
+@@ -70,7 +70,6 @@
+ # include "vki/vki-scnums-shared-linux.h"
+
+ #elif defined(VGP_mips64_linux)
+-# include "vki/vki-scnums-shared-linux.h"
+ # include "vki/vki-scnums-mips64-linux.h"
+
+ #elif defined(VGP_x86_freebsd) || defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd)
+--- a/include/vki/vki-scnums-mips64-linux.h
++++ b/include/vki/vki-scnums-mips64-linux.h
+@@ -362,6 +362,45 @@
+ #define __NR_pkey_alloc (__NR_Linux + 324)
+ #define __NR_pkey_free (__NR_Linux + 325)
+ #define __NR_statx (__NR_Linux + 326)
++#define __NR_rseq (__NR_Linux + 327)
++#define __NR_io_pgetevents (__NR_Linux + 328)
++#define __NR_pidfd_send_signal (__NR_Linux + 424)
++#define __NR_io_uring_setup (__NR_Linux + 425)
++#define __NR_io_uring_enter (__NR_Linux + 426)
++#define __NR_io_uring_register (__NR_Linux + 427)
++#define __NR_open_tree (__NR_Linux + 428)
++#define __NR_move_mount (__NR_Linux + 429)
++#define __NR_fsopen (__NR_Linux + 430)
++#define __NR_fsconfig (__NR_Linux + 431)
++#define __NR_fsmount (__NR_Linux + 432)
++#define __NR_fspick (__NR_Linux + 433)
++#define __NR_pidfd_open (__NR_Linux + 434)
++#define __NR_clone3 (__NR_Linux + 435)
++#define __NR_close_range (__NR_Linux + 436)
++#define __NR_openat2 (__NR_Linux + 437)
++#define __NR_pidfd_getfd (__NR_Linux + 438)
++#define __NR_faccessat2 (__NR_Linux + 439)
++#define __NR_process_madvise (__NR_Linux + 440)
++#define __NR_epoll_pwait2 (__NR_Linux + 441)
++#define __NR_mount_setattr (__NR_Linux + 442)
++#define __NR_quotactl_fd (__NR_Linux + 443)
++#define __NR_landlock_create_ruleset (__NR_Linux + 444)
++#define __NR_landlock_add_rule (__NR_Linux + 445)
++#define __NR_landlock_restrict_self (__NR_Linux + 446)
++#define __NR_process_mrelease (__NR_Linux + 448)
++#define __NR_futex_waitv (__NR_Linux + 449)
++#define __NR_set_mempolicy_home_node (__NR_Linux + 450)
++#define __NR_cachestat (__NR_Linux + 451)
++#define __NR_fchmodat2 (__NR_Linux + 452)
++#define __NR_map_shadow_stack (__NR_Linux + 453)
++#define __NR_futex_wake (__NR_Linux + 454)
++#define __NR_futex_wait (__NR_Linux + 455)
++#define __NR_futex_requeue (__NR_Linux + 456)
++#define __NR_statmount (__NR_Linux + 457)
++#define __NR_listmount (__NR_Linux + 458)
++#define __NR_lsm_get_self_attr (__NR_Linux + 459)
++#define __NR_lsm_set_self_attr (__NR_Linux + 460)
++#define __NR_lsm_list_modules (__NR_Linux + 461)
+
+ #elif defined(VGABI_N32)
+
+@@ -701,6 +740,65 @@
+ #define __NR_pkey_alloc (__NR_Linux + 328)
+ #define __NR_pkey_free (__NR_Linux + 329)
+ #define __NR_statx (__NR_Linux + 330)
++#define __NR_rseq (__NR_Linux + 331)
++#define __NR_io_pgetevents (__NR_Linux + 332)
++#define __NR_clock_gettime64 (__NR_Linux + 403)
++#define __NR_clock_settime64 (__NR_Linux + 404)
++#define __NR_clock_adjtime64 (__NR_Linux + 405)
++#define __NR_clock_getres_time64 (__NR_Linux + 406)
++#define __NR_clock_nanosleep_time64 (__NR_Linux + 407)
++#define __NR_timer_gettime64 (__NR_Linux + 408)
++#define __NR_timer_settime64 (__NR_Linux + 409)
++#define __NR_timerfd_gettime64 (__NR_Linux + 410)
++#define __NR_timerfd_settime64 (__NR_Linux + 411)
++#define __NR_utimensat_time64 (__NR_Linux + 412)
++#define __NR_pselect6_time64 (__NR_Linux + 413)
++#define __NR_ppoll_time64 (__NR_Linux + 414)
++#define __NR_io_pgetevents_time64 (__NR_Linux + 416)
++#define __NR_recvmmsg_time64 (__NR_Linux + 417)
++#define __NR_mq_timedsend_time64 (__NR_Linux + 418)
++#define __NR_mq_timedreceive_time64 (__NR_Linux + 419)
++#define __NR_semtimedop_time64 (__NR_Linux + 420)
++#define __NR_rt_sigtimedwait_time64 (__NR_Linux + 421)
++#define __NR_futex_time64 (__NR_Linux + 422)
++#define __NR_sched_rr_get_interval_time64 (__NR_Linux + 423)
++#define __NR_pidfd_send_signal (__NR_Linux + 424)
++#define __NR_io_uring_setup (__NR_Linux + 425)
++#define __NR_io_uring_enter (__NR_Linux + 426)
++#define __NR_io_uring_register (__NR_Linux + 427)
++#define __NR_open_tree (__NR_Linux + 428)
++#define __NR_move_mount (__NR_Linux + 429)
++#define __NR_fsopen (__NR_Linux + 430)
++#define __NR_fsconfig (__NR_Linux + 431)
++#define __NR_fsmount (__NR_Linux + 432)
++#define __NR_fspick (__NR_Linux + 433)
++#define __NR_pidfd_open (__NR_Linux + 434)
++#define __NR_clone3 (__NR_Linux + 435)
++#define __NR_close_range (__NR_Linux + 436)
++#define __NR_openat2 (__NR_Linux + 437)
++#define __NR_pidfd_getfd (__NR_Linux + 438)
++#define __NR_faccessat2 (__NR_Linux + 439)
++#define __NR_process_madvise (__NR_Linux + 440)
++#define __NR_epoll_pwait2 (__NR_Linux + 441)
++#define __NR_mount_setattr (__NR_Linux + 442)
++#define __NR_quotactl_fd (__NR_Linux + 443)
++#define __NR_landlock_create_ruleset (__NR_Linux + 444)
++#define __NR_landlock_add_rule (__NR_Linux + 445)
++#define __NR_landlock_restrict_self (__NR_Linux + 446)
++#define __NR_process_mrelease (__NR_Linux + 448)
++#define __NR_futex_waitv (__NR_Linux + 449)
++#define __NR_set_mempolicy_home_node (__NR_Linux + 450)
++#define __NR_cachestat (__NR_Linux + 451)
++#define __NR_fchmodat2 (__NR_Linux + 452)
++#define __NR_map_shadow_stack (__NR_Linux + 453)
++#define __NR_futex_wake (__NR_Linux + 454)
++#define __NR_futex_wait (__NR_Linux + 455)
++#define __NR_futex_requeue (__NR_Linux + 456)
++#define __NR_statmount (__NR_Linux + 457)
++#define __NR_listmount (__NR_Linux + 458)
++#define __NR_lsm_get_self_attr (__NR_Linux + 459)
++#define __NR_lsm_set_self_attr (__NR_Linux + 460)
++#define __NR_lsm_list_modules (__NR_Linux + 461)
+
+ #else
+ #error unknown mips64 abi
diff --git a/package/devel/valgrind/patches/100-fix_configure_check.patch b/package/devel/valgrind/patches/100-fix_configure_check.patch
new file mode 100644
index 0000000..d771943
--- /dev/null
+++ b/package/devel/valgrind/patches/100-fix_configure_check.patch
@@ -0,0 +1,11 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -381,7 +381,7 @@ case "${host_os}" in
+ # Ok, this is linux. Check the kernel version
+ AC_MSG_CHECKING([for the kernel version])
+
+- kernel=`uname -r`
++ kernel=${UNAME_R:-`uname -r`}
+
+ case "${kernel}" in
+ 0.*|1.*|2.0.*|2.1.*|2.2.*|2.3.*|2.4.*|2.5.*)
diff --git a/package/devel/valgrind/patches/130-mips_fix_soft_float.patch b/package/devel/valgrind/patches/130-mips_fix_soft_float.patch
new file mode 100644
index 0000000..f861646
--- /dev/null
+++ b/package/devel/valgrind/patches/130-mips_fix_soft_float.patch
@@ -0,0 +1,68 @@
+Disable the valgrind helpers which use MIPS floating point operations
+when floating point support is deactivated in the toolchain.
+
+The fix from this commit is not sufficient any more:
+https://sourceware.org/git/?p=valgrind.git;a=commitdiff;h=869fcf2f6739f17b4eff36ec68f8dca826c8afeb
+
+This fixes the following error message when compiling with a GCC 10 MIPS BE 32:
+---------------------------------------------------------
+../VEX/priv/guest_mips_helpers.c: In function 'mips_dirtyhelper_calculate_FCSR_fp32':
+../VEX/priv/guest_mips_helpers.c:640:10: error: the register '$f21' cannot be clobbered in 'asm' for the current target
+ 640 | ASM_VOLATILE_UNARY32_DOUBLE(round.w.d)
+ | ^
+---------------------------------------------------------
+
+--- a/VEX/priv/guest_mips_helpers.c
++++ b/VEX/priv/guest_mips_helpers.c
+@@ -620,6 +620,7 @@ extern UInt mips_dirtyhelper_calculate_F
+ flt_op inst )
+ {
+ UInt ret = 0;
++#ifndef __mips_soft_float
+ #if defined(__mips__)
+ VexGuestMIPS32State* guest_state = (VexGuestMIPS32State*)gs;
+ UInt loFsVal, hiFsVal, loFtVal, hiFtVal;
+@@ -702,6 +703,7 @@ extern UInt mips_dirtyhelper_calculate_F
+ break;
+ }
+ #endif
++#endif
+ return ret;
+ }
+
+@@ -711,6 +713,7 @@ extern UInt mips_dirtyhelper_calculate_F
+ flt_op inst )
+ {
+ UInt ret = 0;
++#ifndef __mips_soft_float
+ #if defined(__mips__) && ((__mips == 64) || \
+ (defined(__mips_isa_rev) && (__mips_isa_rev >= 2)))
+ #if defined(VGA_mips32)
+@@ -863,6 +866,7 @@ extern UInt mips_dirtyhelper_calculate_F
+ break;
+ }
+ #endif
++#endif
+ return ret;
+ }
+
+--- a/coregrind/m_machine.c
++++ b/coregrind/m_machine.c
+@@ -2119,6 +2119,7 @@ Bool VG_(machine_get_hwcaps)( void )
+ we are using alternative way to determine FP mode */
+ ULong result = 0;
+
++#ifndef __mips_soft_float
+ if (!VG_MINIMAL_SETJMP(env_unsup_insn)) {
+ __asm__ volatile (
+ ".set push\n\t"
+@@ -2136,6 +2137,9 @@ Bool VG_(machine_get_hwcaps)( void )
+
+ fpmode = (result != 0x3FF0000000000000ull);
+ }
++#else
++ fpmode = 0;
++#endif
+ }
+
+ if (fpmode != 0)