From 2b9b1c31541ba32cf517dbaa5fa58d661e23a60b Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sat, 19 Oct 2019 08:19:16 +0800 Subject: [PATCH] gdb: bump to 8.3.1 --- package/devel/gdb/Makefile | 11 +++--- .../001-gdb-pr14523-mips-signal-number.patch | 2 +- .../gdb/patches/010-aarch64-headers.patch | 38 +++++++++++++++++++ package/devel/gdb/patches/100-musl_fix.patch | 12 +++--- .../devel/gdb/patches/110-shared_libgcc.patch | 20 +++++----- .../devel/gdb/patches/130-uclibc-fix.patch | 11 ++++++ toolchain/gdb/Makefile | 4 +- .../gdb/patches/100-no_extern_inline.patch | 12 +----- toolchain/gdb/patches/110-no_testsuite.patch | 6 +-- .../120-fix-compile-flag-mismatch.patch | 2 +- 10 files changed, 80 insertions(+), 38 deletions(-) create mode 100644 package/devel/gdb/patches/010-aarch64-headers.patch create mode 100644 package/devel/gdb/patches/130-uclibc-fix.patch diff --git a/package/devel/gdb/Makefile b/package/devel/gdb/Makefile index 9e816697c1..fd5ac7eb67 100644 --- a/package/devel/gdb/Makefile +++ b/package/devel/gdb/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gdb -PKG_VERSION:=8.2 +PKG_VERSION:=8.3.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb -PKG_HASH:=c3a441a29c7c89720b734e5a9c6289c0a06be7e0c76ef538f7bbcef389347c39 +PKG_HASH:=1e55b4d7cdca7b34be12f4ceae651623aa73b2fd640152313f9f66a7149757c4 PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 @@ -25,8 +25,8 @@ include $(INCLUDE_DIR)/package.mk define Package/gdb/Default SECTION:=devel CATEGORY:=Development - DEPENDS:=+!USE_MUSL:libthread-db +PACKAGE_zlib:zlib @!arc - URL:=http://www.gnu.org/software/gdb/ + DEPENDS:=+!USE_MUSL:libthread-db +PACKAGE_zlib:zlib + URL:=https://www.gnu.org/software/gdb/ endef define Package/gdb @@ -57,7 +57,8 @@ CONFIGURE_ARGS+= \ --without-expat \ --without-lzma \ --disable-sim \ - --disable-werror + --disable-werror \ + --disable-source-highlight CONFIGURE_VARS+= \ ac_cv_search_tgetent="$(TARGET_LDFLAGS) -lncurses -lreadline" diff --git a/package/devel/gdb/patches/001-gdb-pr14523-mips-signal-number.patch b/package/devel/gdb/patches/001-gdb-pr14523-mips-signal-number.patch index 25ac86fd91..f78c7ed315 100644 --- a/package/devel/gdb/patches/001-gdb-pr14523-mips-signal-number.patch +++ b/package/devel/gdb/patches/001-gdb-pr14523-mips-signal-number.patch @@ -1,5 +1,5 @@ See http://sourceware.org/bugzilla/show_bug.cgi?id=14523 ---- + --- a/gdb/common/signals.c +++ b/gdb/common/signals.c @@ -348,6 +348,11 @@ gdb_signal_from_host (int hostsig) diff --git a/package/devel/gdb/patches/010-aarch64-headers.patch b/package/devel/gdb/patches/010-aarch64-headers.patch new file mode 100644 index 0000000000..8f05738298 --- /dev/null +++ b/package/devel/gdb/patches/010-aarch64-headers.patch @@ -0,0 +1,38 @@ +The signal definitions of musl and gdb collide + +The kernel defines "struct sigcontext" in asm/sigcontext.h and musl libc +defines it in signal.h which collides. +Kernel 4.14 misses the definitions of struct user_sve_header so we still +have to use the aarch64-sve-linux-sigcontext.h header file which also +provides that and make sure aarch64-sve-linux-sigcontext.h does not +provide the same headers as the kernel or musl. + +--- a/gdb/nat/aarch64-sve-linux-ptrace.h ++++ b/gdb/nat/aarch64-sve-linux-ptrace.h +@@ -25,7 +25,7 @@ + #include + #include + +-#ifndef SVE_SIG_ZREGS_SIZE ++#ifndef SVE_PT_REGS_SVE + #include "aarch64-sve-linux-sigcontext.h" + #endif + +--- a/gdb/nat/aarch64-sve-linux-sigcontext.h ++++ b/gdb/nat/aarch64-sve-linux-sigcontext.h +@@ -19,6 +19,7 @@ + #ifndef NAT_AARCH64_SVE_LINUX_SIGCONTEXT_H + #define NAT_AARCH64_SVE_LINUX_SIGCONTEXT_H + ++#ifndef SVE_MAGIC + #define SVE_MAGIC 0x53564501 + + struct sve_context { +@@ -128,6 +129,7 @@ struct sve_context { + (SVE_SIG_FFR_OFFSET(vq) + SVE_SIG_FFR_SIZE(vq) - SVE_SIG_REGS_OFFSET) + + #define SVE_SIG_CONTEXT_SIZE(vq) (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq)) ++#endif + + /* SVE/FP/SIMD state (NT_ARM_SVE) */ + diff --git a/package/devel/gdb/patches/100-musl_fix.patch b/package/devel/gdb/patches/100-musl_fix.patch index 356d8c4111..8ba6d46900 100644 --- a/package/devel/gdb/patches/100-musl_fix.patch +++ b/package/devel/gdb/patches/100-musl_fix.patch @@ -8,7 +8,7 @@ #include "defs.h" #include "inferior.h" #include "infrun.h" -@@ -71,6 +72,10 @@ +@@ -72,6 +73,10 @@ #define SPUFS_MAGIC 0x23c9b64e #endif @@ -29,8 +29,8 @@ --- a/gdb/nat/ppc-linux.h +++ b/gdb/nat/ppc-linux.h @@ -18,7 +18,10 @@ - #ifndef PPC_LINUX_H - #define PPC_LINUX_H 1 + #ifndef NAT_PPC_LINUX_H + #define NAT_PPC_LINUX_H +#define pt_regs __pt_regs #include @@ -41,9 +41,9 @@ /* This sometimes isn't defined. */ --- a/gdb/gdbserver/linux-ppc-low.c +++ b/gdb/gdbserver/linux-ppc-low.c -@@ -21,7 +21,9 @@ - #include "linux-low.h" - +@@ -23,7 +23,9 @@ + #include "elf/common.h" + #include #include +#define pt_regs __pt_regs #include diff --git a/package/devel/gdb/patches/110-shared_libgcc.patch b/package/devel/gdb/patches/110-shared_libgcc.patch index c8ddfde5cc..f07ac8ca24 100644 --- a/package/devel/gdb/patches/110-shared_libgcc.patch +++ b/package/devel/gdb/patches/110-shared_libgcc.patch @@ -1,6 +1,6 @@ --- a/configure.ac +++ b/configure.ac -@@ -1277,13 +1277,13 @@ if test -z "$LD"; then +@@ -1283,13 +1283,13 @@ if test -z "$LD"; then fi fi @@ -17,16 +17,16 @@ AC_LANG_PUSH(C++) AC_LINK_IFELSE([AC_LANG_SOURCE([ #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) -@@ -1609,7 +1609,7 @@ AC_ARG_WITH(stage1-ldflags, - # if supported. But if the user explicitly specified the libraries to use, +@@ -1629,7 +1629,7 @@ AC_ARG_WITH(stage1-ldflags, # trust that they are doing what they want. - if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then + 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) -@@ -1638,7 +1638,7 @@ AC_ARG_WITH(boot-ldflags, +@@ -1658,7 +1658,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 @@ -37,7 +37,7 @@ --- a/configure +++ b/configure -@@ -5043,14 +5043,14 @@ if test -z "$LD"; then +@@ -5053,14 +5053,14 @@ if test -z "$LD"; then fi fi @@ -56,16 +56,16 @@ ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -@@ -5833,7 +5833,7 @@ else - # if supported. But if the user explicitly specified the libraries to use, +@@ -5861,7 +5861,7 @@ else # trust that they are doing what they want. - if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then + 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 -@@ -5869,7 +5869,7 @@ else +@@ -5897,7 +5897,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 diff --git a/package/devel/gdb/patches/130-uclibc-fix.patch b/package/devel/gdb/patches/130-uclibc-fix.patch new file mode 100644 index 0000000000..4925e665c5 --- /dev/null +++ b/package/devel/gdb/patches/130-uclibc-fix.patch @@ -0,0 +1,11 @@ +--- a/gdb/dwarf-index-write.c ++++ b/gdb/dwarf-index-write.c +@@ -701,7 +701,7 @@ public: + gdb_assert (m_abbrev_table.empty ()); + const size_t name_count = m_name_to_value_set.size (); + m_bucket_table.resize +- (std::pow (2, std::ceil (std::log2 (name_count * 4 / 3)))); ++ (std::pow (2, std::ceil (log2 (name_count * 4 / 3)))); + m_hash_table.reserve (name_count); + m_name_table_string_offs.reserve (name_count); + m_name_table_entry_offs.reserve (name_count); diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile index 49816618ff..41ba9853fd 100644 --- a/toolchain/gdb/Makefile +++ b/toolchain/gdb/Makefile @@ -17,11 +17,11 @@ PKG_HASH:=7e3c2a763bf500a40c5c4591a7e22c591dafc1f214b1d514895c1096e85c883a GDB_DIR:=binutils-$(PKG_NAME)-$(PKG_VERSION) PATCH_DIR:=./patches-arc else -PKG_VERSION:=8.2 +PKG_VERSION:=8.3.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb -PKG_HASH:=c3a441a29c7c89720b734e5a9c6289c0a06be7e0c76ef538f7bbcef389347c39 +PKG_HASH:=1e55b4d7cdca7b34be12f4ceae651623aa73b2fd640152313f9f66a7149757c4 GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION) endif diff --git a/toolchain/gdb/patches/100-no_extern_inline.patch b/toolchain/gdb/patches/100-no_extern_inline.patch index 8c18c6e2e7..4036f70301 100644 --- a/toolchain/gdb/patches/100-no_extern_inline.patch +++ b/toolchain/gdb/patches/100-no_extern_inline.patch @@ -1,24 +1,16 @@ --- a/sim/common/sim-arange.c +++ b/sim/common/sim-arange.c -@@ -280,11 +280,7 @@ sim_addr_range_delete (ADDR_RANGE *ar, a +@@ -277,9 +277,7 @@ sim_addr_range_delete (ADDR_RANGE *ar, a build_search_tree (ar); } --#endif /* DEFINE_NON_INLINE_P */ -- --#if DEFINE_INLINE_P +-#else /* SIM_ARANGE_C_INCLUDED */ - -SIM_ARANGE_INLINE int +int sim_addr_range_hit_p (ADDR_RANGE *ar, address_word addr) { ADDR_RANGE_TREE *t = ar->range_tree; -@@ -301,4 +297,4 @@ sim_addr_range_hit_p (ADDR_RANGE *ar, ad - return 0; - } - --#endif /* DEFINE_INLINE_P */ -+#endif /* DEFINE_NON_INLINE_P */ --- a/sim/common/sim-arange.h +++ b/sim/common/sim-arange.h @@ -73,7 +73,7 @@ extern void sim_addr_range_delete (ADDR_ diff --git a/toolchain/gdb/patches/110-no_testsuite.patch b/toolchain/gdb/patches/110-no_testsuite.patch index bcb10e69b4..f4a2cde5c8 100644 --- a/toolchain/gdb/patches/110-no_testsuite.patch +++ b/toolchain/gdb/patches/110-no_testsuite.patch @@ -1,16 +1,16 @@ --- a/gdb/configure +++ b/gdb/configure -@@ -915,8 +915,7 @@ MAKEINFOFLAGS +@@ -918,8 +918,7 @@ MAKEINFOFLAGS YACC YFLAGS XMKMF' -ac_subdirs_all='testsuite -gdbtk +ac_subdirs_all='gdbtk - multi-ice gdbserver' -@@ -6577,7 +6576,7 @@ $as_echo "$with_auto_load_safe_path" >&6 + # Initialize some variables set by options. +@@ -6628,7 +6627,7 @@ $as_echo "$with_auto_load_safe_path" >&6 diff --git a/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch b/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch index d971e28d88..2b6610673c 100644 --- a/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch +++ b/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch @@ -1,6 +1,6 @@ --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure -@@ -2508,7 +2508,7 @@ $as_echo "$as_me: error: \`$ac_var' was +@@ -2511,7 +2511,7 @@ $as_echo "$as_me: error: \`$ac_var' was ac_cache_corrupted=: ;; ,);; *)