Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
This commit is contained in:
97
package/devel/gdb/Makefile
Normal file
97
package/devel/gdb/Makefile
Normal file
@@ -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:=14.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=@GNU/gdb
|
||||
PKG_HASH:=d66df51276143451fcbff464cc8723d68f1e9df45a6a2d5635a54e71643edb80
|
||||
|
||||
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))
|
||||
@@ -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"));
|
||||
76
package/devel/gdb/patches/110-shared_libgcc.patch
Normal file
76
package/devel/gdb/patches/110-shared_libgcc.patch
Normal file
@@ -0,0 +1,76 @@
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -1400,13 +1400,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)
|
||||
@@ -1836,7 +1836,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)
|
||||
|
||||
@@ -1865,7 +1865,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
|
||||
@@ -5413,14 +5413,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'
|
||||
@@ -8464,7 +8464,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
|
||||
|
||||
@@ -8500,7 +8500,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
|
||||
|
||||
38
package/devel/gdb/patches/120-sigprocmask-invalid-call.patch
Normal file
38
package/devel/gdb/patches/120-sigprocmask-invalid-call.patch
Normal 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"));
|
||||
|
||||
35
package/devel/gdb/patches/130-gdb-ctrl-c.patch
Normal file
35
package/devel/gdb/patches/130-gdb-ctrl-c.patch
Normal 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
|
||||
@@ -5481,7 +5481,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. */
|
||||
- int res = ::kill (-signal_pid, SIGINT);
|
||||
+ int res = ::kill (signal_pid, SIGINT);
|
||||
if (res == -1)
|
||||
warning (_("Sending SIGINT to process group of pid %ld failed: %s"),
|
||||
signal_pid, safe_strerror (errno));
|
||||
30
package/devel/gdb/patches/140-sgidefs.patch
Normal file
30
package/devel/gdb/patches/140-sgidefs.patch
Normal 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"
|
||||
32
package/devel/gdb/patches/150-mips64.patch
Normal file
32
package/devel/gdb/patches/150-mips64.patch
Normal 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:
|
||||
Reference in New Issue
Block a user