Initial commit

This commit is contained in:
domenico
2025-06-24 13:14:22 +02:00
commit 4002f145fc
9002 changed files with 1731834 additions and 0 deletions

View File

@@ -0,0 +1,143 @@
#
# 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.35.2
PKG_RELEASE:=1
PKG_SOURCE_URL:=@GNU/binutils
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_VERSION:=$(PKG_VERSION)
PKG_HASH:=dcd5b0416e7b0a9b24bed76cd8c6c132526805761863150a26d016415b8bdc7b
PKG_FIXUP:=autoreconf
PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof binutils ld libiberty gold intl
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_USE_MIPS16:=0
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
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/
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))

View File

@@ -0,0 +1,93 @@
#
# 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:=10.2
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/gdb
PKG_HASH:=aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29
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
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 \
--disable-unit-tests \
--disable-ubsan \
--disable-sim \
--disable-werror \
--disable-source-highlight
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))

View File

@@ -0,0 +1,16 @@
See http://sourceware.org/bugzilla/show_bug.cgi?id=14523
--- a/gdbsupport/signals.cc
+++ b/gdbsupport/signals.cc
@@ -348,6 +348,11 @@ gdb_signal_from_host (int hostsig)
else if (64 <= hostsig && hostsig <= 127)
return (enum gdb_signal)
(hostsig - 64 + (int) GDB_SIGNAL_REALTIME_64);
+ else if (hostsig == 128)
+ /* Some platforms, such as Linux MIPS, have NSIG == 128, in which case
+ signal 128 is the highest realtime signal. There is no constant for
+ that though. */
+ return GDB_SIGNAL_UNKNOWN;
else
error (_("GDB bug: target.c (gdb_signal_from_host): "
"unrecognized real-time signal"));

View File

@@ -0,0 +1,76 @@
--- a/configure.ac
+++ b/configure.ac
@@ -1302,13 +1302,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)
@@ -1648,7 +1648,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)
@@ -1677,7 +1677,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])
AC_SUBST(poststage1_ldflags)
--- a/configure
+++ b/configure
@@ -5075,14 +5075,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'
@@ -5883,7 +5883,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
@@ -5919,7 +5919,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

View File

@@ -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
@@ -38,7 +38,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"));

View File

@@ -0,0 +1,35 @@
From 63df98fa78c8a6e12b40ebdc5c155838d2bf8b5f Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 29 Nov 2018 18:00:23 -0800
Subject: [PATCH 11/11] gdbserver ctrl-c handling
This problem was created by the upstream commit 78708b7c8c
After applying the commit, it will send SIGINT to the process
group(-signal_pid).
But if we use gdbserver send SIGINT, and the attached process is not a
process
group leader, then the "kill (-signal_pid, SIGINT)" returns error and
fails to
interrupt the attached process.
Upstream-Status: Submitted
[https://sourceware.org/bugzilla/show_bug.cgi?id=18945]
Author: Josh Gao
Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
gdbserver/linux-low.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/gdbserver/linux-low.cc
+++ b/gdbserver/linux-low.cc
@@ -5714,7 +5714,7 @@ linux_process_target::request_interrupt
{
/* Send a SIGINT to the process group. This acts just like the user
typed a ^C on the controlling terminal. */
- ::kill (-signal_pid, SIGINT);
+ ::kill (signal_pid, SIGINT);
}
bool

View File

@@ -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
@@ -31,7 +31,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"

View File

@@ -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
@@ -42,6 +42,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:

View File

@@ -0,0 +1,80 @@
#
# 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:=4
PKG_USE_MIPS16:=0
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 @!TARGET_arc770 @KERNEL_PERF_EVENTS
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='') \
WERROR=0 \
O=$(PKG_BUILD_DIR) \
prefix=/usr
define Build/Compile
+$(MAKE_FLAGS) $(MAKE) $(PKG_JOBS) \
--no-print-directory \
-C $(LINUX_DIR)/tools/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))

View File

@@ -0,0 +1,83 @@
#
# 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:=5.10
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://strace.io/files/$(PKG_VERSION)
PKG_HASH:=fe3982ea4cd9aeb3b4ba35f6279f0b577a37175d3282be24b9a5537b56b8f01c
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=LGPL-2.1-or-later
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:paul_kranenburg:strace
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_CONFIG_DEPENDS := \
CONFIG_STRACE_LIBDW \
CONFIG_STRACE_LIBUNWIND
include $(INCLUDE_DIR)/package.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
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))

View File

@@ -0,0 +1,63 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=trace-cmd
PKG_VERSION:=v2.9.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git/snapshot/
PKG_HASH:=9404fc3cf540ea795304608068c9db6cdb38b90584c7f3c43249785913d54b38
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
PKG_USE_MIPS16:=0
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/trace-cmd
SECTION:=devel
CATEGORY:=Development
TITLE:=Linux trace command line utility
DEPENDS:=
endef
define Package/trace-cmd-extra
SECTION:=devel
CATEGORY:=Development
TITLE:=Extra plugins for trace-cmd
DEPENDS:=
endef
MAKE_FLAGS += \
NO_PYTHON=1 \
NO_AUDIT=1 \
prefix=/usr
PLUGINS_DIR := $(PKG_INSTALL_DIR)/usr/lib/traceevent/plugins
PLUGINS_MAIN := function hrtimer mac80211 sched_switch
TARGET_CFLAGS += --std=gnu99 -D_GNU_SOURCE
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/
$(CP) \
$(patsubst %,$(PLUGINS_DIR)/plugin_%.so,$(PLUGINS_MAIN)) \
$(1)/usr/lib/traceevent/plugins
endef
define Package/trace-cmd-extra/install
$(INSTALL_DIR) $(1)/usr/lib/traceevent/plugins
$(CP) \
$$(patsubst %,$(PLUGINS_DIR)/plugin_%.so, \
$$(filter-out $(PLUGINS_MAIN), \
$$(patsubst $(PLUGINS_DIR)/plugin_%.so,%, \
$$(wildcard $(PLUGINS_DIR)/plugin_*.so)))) \
$(1)/usr/lib/traceevent/plugins
endef
$(eval $(call BuildPackage,trace-cmd))
$(eval $(call BuildPackage,trace-cmd-extra))

View File

@@ -0,0 +1,104 @@
From 1a000636c1828eecdcec5360a51623ef4ffbff04 Mon Sep 17 00:00:00 2001
From: Beniamin Sandu <beniaminsandu@gmail.com>
Date: Mon, 30 Nov 2020 14:27:55 +0200
Subject: trace-cmd: make it build against musl C library
* add some missing headers and macros
* set pthread affinity using pthread_setaffinity_np after creating the thread
instead of pthread_attr_setaffinity_np (which seems to not be implemented
in musl)
Tested using https://musl.cc/x86_64-linux-musl-native.tgz
Link: https://lore.kernel.org/linux-trace-devel/20201130122755.31000-1-beniaminsandu@gmail.com
Reviewed-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Signed-off-by: Beniamin Sandu <beniaminsandu@gmail.com>
[ Fixed a whitespace issue ]
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
include/trace-cmd/trace-cmd.h | 1 +
lib/trace-cmd/include/trace-cmd-local.h | 1 +
lib/tracefs/tracefs-events.c | 1 +
tracecmd/include/trace-local.h | 1 +
tracecmd/trace-tsync.c | 16 +++++++++++-----
5 files changed, 20 insertions(+), 5 deletions(-)
--- a/include/trace-cmd/trace-cmd.h
+++ b/include/trace-cmd/trace-cmd.h
@@ -6,6 +6,7 @@
#ifndef _TRACE_CMD_H
#define _TRACE_CMD_H
+#include <pthread.h>
#include "traceevent/event-parse.h"
#define TRACECMD_MAGIC { 23, 8, 68 }
--- a/lib/trace-cmd/include/trace-cmd-local.h
+++ b/lib/trace-cmd/include/trace-cmd-local.h
@@ -26,5 +26,6 @@ void warning(const char *fmt, ...);
#endif
#endif
+#include <byteswap.h>
#endif /* _TRACE_CMD_LOCAL_H */
--- a/lib/tracefs/tracefs-events.c
+++ b/lib/tracefs/tracefs-events.c
@@ -13,6 +13,7 @@
#include <errno.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <limits.h>
#include "kbuffer.h"
#include "tracefs.h"
--- a/tracecmd/include/trace-local.h
+++ b/tracecmd/include/trace-local.h
@@ -8,6 +8,7 @@
#include <sys/types.h>
#include <dirent.h> /* for DIR */
+#include <limits.h>
#include "trace-cmd.h"
#include "event-utils.h"
--- a/tracecmd/trace-tsync.c
+++ b/tracecmd/trace-tsync.c
@@ -104,13 +104,16 @@ int tracecmd_host_tsync(struct buffer_in
pthread_attr_init(&attrib);
pthread_attr_setdetachstate(&attrib, PTHREAD_CREATE_JOINABLE);
- if (!get_first_cpu(&pin_mask, &mask_size))
- pthread_attr_setaffinity_np(&attrib, mask_size, pin_mask);
ret = pthread_create(&instance->tsync_thread, &attrib,
tsync_host_thread, &instance->tsync);
- if (!ret)
+
+ if (!ret) {
+ if (!get_first_cpu(&pin_mask, &mask_size))
+ pthread_setaffinity_np(instance->tsync_thread, mask_size, pin_mask);
instance->tsync_thread_running = true;
+ }
+
if (pin_mask)
CPU_FREE(pin_mask);
pthread_attr_destroy(&attrib);
@@ -243,11 +246,14 @@ unsigned int tracecmd_guest_tsync(char *
pthread_attr_init(&attrib);
tsync->sync_proto = proto;
pthread_attr_setdetachstate(&attrib, PTHREAD_CREATE_JOINABLE);
- if (!get_first_cpu(&pin_mask, &mask_size))
- pthread_attr_setaffinity_np(&attrib, mask_size, pin_mask);
ret = pthread_create(thr_id, &attrib, tsync_agent_thread, tsync);
+ if (!ret) {
+ if (!get_first_cpu(&pin_mask, &mask_size))
+ pthread_setaffinity_np(*thr_id, mask_size, pin_mask);
+ }
+
if (pin_mask)
CPU_FREE(pin_mask);
pthread_attr_destroy(&attrib);

View File

@@ -0,0 +1,24 @@
--- a/lib/traceevent/plugins/plugin_mac80211.c
+++ b/lib/traceevent/plugins/plugin_mac80211.c
@@ -165,12 +165,15 @@ static int drv_config(struct trace_seq *
{ 2, "IDLE" },
{ 3, "QOS"},
);
- tep_print_num_field(s, " chan:%d/", event, "center_freq", record, 1);
- print_enum(s, event, "channel_type", data,
- { 0, "noht" },
- { 1, "ht20" },
- { 2, "ht40-" },
- { 3, "ht40+" });
+ tep_print_num_field(s, " chan:%d@", event, "control_freq", record, 1);
+ print_enum(s, event, "chan_width", data,
+ { 0, "20_noht" },
+ { 1, "20" },
+ { 2, "40" },
+ { 3, "80" },
+ { 4, "80p80" },
+ { 5, "160" });
+
trace_seq_putc(s, ' ');
SF("power_level");

View File

@@ -0,0 +1,203 @@
#
# 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.16.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://sourceware.org/pub/valgrind/
PKG_HASH:=c91f3a2f7b02db0f3bc99479861656154d241d2fdb265614ba918cc6720a33ca
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_USE_MIPS16:=0
PKG_SSP:=0
STRIP:=:
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/kernel.mk
define Package/valgrind
SECTION:=devel
CATEGORY:=Development
DEPENDS:=@mips||mipsel||i386||x86_64||powerpc||arm_v7||aarch64 +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
CONFIGURE_ARGS += \
--enable-lto \
--enable-tls \
--without-x \
--without-mpicc \
--without-uiout \
--disable-valgrindmi \
--disable-tui \
--disable-valgrindtk \
--without-included-gettext \
--with-pagesize=4 \
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))

View File

@@ -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:*
}

View File

@@ -0,0 +1,11 @@
--- a/configure.ac
+++ b/configure.ac
@@ -345,7 +345,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.*)

View File

@@ -0,0 +1,17 @@
Description: Fix FTBFS on armhf by correctly detecting the architecture
Origin: vendor
Bug-Debian: http://bugs.debian.org/730844
Author: Alessandro Ghedini <ghedo@debian.org>
Last-Update: 2013-11-30
--- a/configure.ac
+++ b/configure.ac
@@ -252,7 +252,7 @@ case "${host_cpu}" in
ARCH_MAX="s390x"
;;
- armv7*)
+ arm*)
AC_MSG_RESULT([ok (${host_cpu})])
ARCH_MAX="arm"
;;

View File

@@ -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
@@ -617,6 +617,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;
@@ -699,6 +700,7 @@ extern UInt mips_dirtyhelper_calculate_F
break;
}
#endif
+#endif
return ret;
}
@@ -708,6 +710,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)
@@ -860,6 +863,7 @@ extern UInt mips_dirtyhelper_calculate_F
break;
}
#endif
+#endif
return ret;
}
--- a/coregrind/m_machine.c
+++ b/coregrind/m_machine.c
@@ -1828,6 +1828,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"
@@ -1845,6 +1846,9 @@ Bool VG_(machine_get_hwcaps)( void )
fpmode = (result != 0x3FF0000000000000ull);
}
+#else
+ fpmode = 0;
+#endif
}
if (fpmode != 0)