From 5b80bfd7bffd4c20d80b7c70a7130529e9a755dd Mon Sep 17 00:00:00 2001 From: ToshikazuOhiwa Date: Mon, 30 Mar 2020 09:24:26 +0900 Subject: agl-basesystem --- bsp/meta-synopsys/recipes-devtools/gdb/gdb-arc.inc | 19 ++++++++ .../recipes-devtools/gdb/gdb-cross-canadian_arc.bb | 3 ++ .../recipes-devtools/gdb/gdb-cross_arc.bb | 2 + ...0002-make-man-install-relative-to-DESTDIR.patch | 28 +++++++++++ ...e-libreadline.a-when-using-disable-static.patch | 50 +++++++++++++++++++ .../0008-Use-exorted-definitions-of-SIGRTMIN.patch | 50 +++++++++++++++++++ .../gdb/gdb/0009-Change-order-of-CFLAGS.patch | 30 ++++++++++++ .../0010-resolve-restrict-keyword-conflict.patch | 48 +++++++++++++++++++ ...4-defining-TRAP_HWBKPT-before-including-g.patch | 56 ++++++++++++++++++++++ ..._gdb_patches_120-sigprocmask-invalid-call.patch | 45 +++++++++++++++++ bsp/meta-synopsys/recipes-devtools/gdb/gdb_arc.bb | 29 +++++++++++ 11 files changed, 360 insertions(+) create mode 100644 bsp/meta-synopsys/recipes-devtools/gdb/gdb-arc.inc create mode 100644 bsp/meta-synopsys/recipes-devtools/gdb/gdb-cross-canadian_arc.bb create mode 100644 bsp/meta-synopsys/recipes-devtools/gdb/gdb-cross_arc.bb create mode 100644 bsp/meta-synopsys/recipes-devtools/gdb/gdb/0002-make-man-install-relative-to-DESTDIR.patch create mode 100644 bsp/meta-synopsys/recipes-devtools/gdb/gdb/0006-Dont-disable-libreadline.a-when-using-disable-static.patch create mode 100644 bsp/meta-synopsys/recipes-devtools/gdb/gdb/0008-Use-exorted-definitions-of-SIGRTMIN.patch create mode 100644 bsp/meta-synopsys/recipes-devtools/gdb/gdb/0009-Change-order-of-CFLAGS.patch create mode 100644 bsp/meta-synopsys/recipes-devtools/gdb/gdb/0010-resolve-restrict-keyword-conflict.patch create mode 100644 bsp/meta-synopsys/recipes-devtools/gdb/gdb/gdb-Fix-ia64-defining-TRAP_HWBKPT-before-including-g.patch create mode 100644 bsp/meta-synopsys/recipes-devtools/gdb/gdb/package_devel_gdb_patches_120-sigprocmask-invalid-call.patch create mode 100644 bsp/meta-synopsys/recipes-devtools/gdb/gdb_arc.bb (limited to 'bsp/meta-synopsys/recipes-devtools/gdb') diff --git a/bsp/meta-synopsys/recipes-devtools/gdb/gdb-arc.inc b/bsp/meta-synopsys/recipes-devtools/gdb/gdb-arc.inc new file mode 100644 index 00000000..83b56e33 --- /dev/null +++ b/bsp/meta-synopsys/recipes-devtools/gdb/gdb-arc.inc @@ -0,0 +1,19 @@ +LICENSE = "GPLv2 & GPLv3 & LGPLv2 & LGPLv3" +LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \ + file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \ + file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \ + file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674" + +SRCREV ?= "arc-2018.09-release-gdb" + +SRC_URI = "git://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb;protocol=https;branch=arc-2018.09-gdb \ + file://0002-make-man-install-relative-to-DESTDIR.patch \ + file://0006-Dont-disable-libreadline.a-when-using-disable-static.patch \ + file://0008-Use-exorted-definitions-of-SIGRTMIN.patch \ + file://0009-Change-order-of-CFLAGS.patch \ + file://0010-resolve-restrict-keyword-conflict.patch \ + file://package_devel_gdb_patches_120-sigprocmask-invalid-call.patch \ + file://gdb-Fix-ia64-defining-TRAP_HWBKPT-before-including-g.patch \ +" + +S = "${WORKDIR}/git" diff --git a/bsp/meta-synopsys/recipes-devtools/gdb/gdb-cross-canadian_arc.bb b/bsp/meta-synopsys/recipes-devtools/gdb/gdb-cross-canadian_arc.bb new file mode 100644 index 00000000..8a3c625a --- /dev/null +++ b/bsp/meta-synopsys/recipes-devtools/gdb/gdb-cross-canadian_arc.bb @@ -0,0 +1,3 @@ +require recipes-devtools/gdb/gdb-common.inc +require recipes-devtools/gdb/gdb-cross-canadian.inc +require recipes-devtools/gdb/gdb-${PV}.inc diff --git a/bsp/meta-synopsys/recipes-devtools/gdb/gdb-cross_arc.bb b/bsp/meta-synopsys/recipes-devtools/gdb/gdb-cross_arc.bb new file mode 100644 index 00000000..3051db45 --- /dev/null +++ b/bsp/meta-synopsys/recipes-devtools/gdb/gdb-cross_arc.bb @@ -0,0 +1,2 @@ +require recipes-devtools/gdb/gdb-cross.inc +require recipes-devtools/gdb/gdb-${PV}.inc diff --git a/bsp/meta-synopsys/recipes-devtools/gdb/gdb/0002-make-man-install-relative-to-DESTDIR.patch b/bsp/meta-synopsys/recipes-devtools/gdb/gdb/0002-make-man-install-relative-to-DESTDIR.patch new file mode 100644 index 00000000..83c4dded --- /dev/null +++ b/bsp/meta-synopsys/recipes-devtools/gdb/gdb/0002-make-man-install-relative-to-DESTDIR.patch @@ -0,0 +1,28 @@ +From 9ce61f97b7758794f06894e934fbb256ff62163e Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 2 Mar 2015 02:27:55 +0000 +Subject: [PATCH 02/10] make man install relative to DESTDIR + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + sim/common/Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sim/common/Makefile.in b/sim/common/Makefile.in +index 3944956b5d..aa355e8347 100644 +--- a/sim/common/Makefile.in ++++ b/sim/common/Makefile.in +@@ -35,7 +35,7 @@ tooldir = $(libdir)/$(target_alias) + datarootdir = @datarootdir@ + datadir = @datadir@ + mandir = @mandir@ +-man1dir = $(mandir)/man1 ++man1dir = $(DESTDIR)$(mandir)/man1 + infodir = @infodir@ + includedir = @includedir@ + +-- +2.13.1 + diff --git a/bsp/meta-synopsys/recipes-devtools/gdb/gdb/0006-Dont-disable-libreadline.a-when-using-disable-static.patch b/bsp/meta-synopsys/recipes-devtools/gdb/gdb/0006-Dont-disable-libreadline.a-when-using-disable-static.patch new file mode 100644 index 00000000..8b139581 --- /dev/null +++ b/bsp/meta-synopsys/recipes-devtools/gdb/gdb/0006-Dont-disable-libreadline.a-when-using-disable-static.patch @@ -0,0 +1,50 @@ +From 5c92ebd5e117e4cf118c984171e0703dfcfb8cd8 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 30 Apr 2016 15:25:03 -0700 +Subject: [PATCH 06/10] Dont disable libreadline.a when using --disable-static + +If gdb is configured with --disable-static then this is dutifully passed to +readline which then disables libreadline.a, which causes a problem when gdb +tries to link against that. + +To ensure that readline always builds static libraries, pass --enable-static to +the sub-configure. + +Upstream-Status: Pending +Signed-off-by: Ross Burton +Signed-off-by: Khem Raj +--- + Makefile.def | 3 ++- + Makefile.in | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Makefile.def b/Makefile.def +index 0d13f037d0..8bcd86e13f 100644 +--- a/Makefile.def ++++ b/Makefile.def +@@ -105,7 +105,8 @@ host_modules= { module= libiconv; + missing= install-html; + missing= install-info; }; + host_modules= { module= m4; }; +-host_modules= { module= readline; }; ++host_modules= { module= readline; ++ extra_configure_flags='--enable-static';}; + host_modules= { module= sid; }; + host_modules= { module= sim; }; + host_modules= { module= texinfo; no_install= true; }; +diff --git a/Makefile.in b/Makefile.in +index 3acb83b8de..e348907128 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -25470,7 +25470,7 @@ configure-readline: + $$s/$$module_srcdir/configure \ + --srcdir=$${topdir}/$$module_srcdir \ + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ +- --target=${target_alias} \ ++ --target=${target_alias} --enable-static \ + || exit 1 + @endif readline + +-- +2.13.1 + diff --git a/bsp/meta-synopsys/recipes-devtools/gdb/gdb/0008-Use-exorted-definitions-of-SIGRTMIN.patch b/bsp/meta-synopsys/recipes-devtools/gdb/gdb/0008-Use-exorted-definitions-of-SIGRTMIN.patch new file mode 100644 index 00000000..4f64dea2 --- /dev/null +++ b/bsp/meta-synopsys/recipes-devtools/gdb/gdb/0008-Use-exorted-definitions-of-SIGRTMIN.patch @@ -0,0 +1,50 @@ +From d3f240b38eed7cd08f6c50ea896572f1327b437a Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 30 Apr 2016 15:31:40 -0700 +Subject: [PATCH 08/10] Use exorted definitions of SIGRTMIN + +Define W_STOPCODE if not defined already + +__SIGRTMIN is internal to glibc and other libcs e.g. musl +may not provide them + +Fixes +https://sourceware.org/bugzilla/show_bug.cgi?id=13012 + +Upstream-Status: Submitted + +Signed-off-by: Khem Raj +--- + gdb/linux-nat.c | 4 ++-- + gdb/nat/linux-nat.h | 4 ++++ + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c +index 8b29245c3d..f424ae9711 100644 +--- a/gdb/linux-nat.c ++++ b/gdb/linux-nat.c +@@ -5021,6 +5021,6 @@ lin_thread_get_thread_signals (sigset_t *set) + /* NPTL reserves the first two RT signals, but does not provide any + way for the debugger to query the signal numbers - fortunately + they don't change. */ +- sigaddset (set, __SIGRTMIN); +- sigaddset (set, __SIGRTMIN + 1); ++ sigaddset (set, SIGRTMIN); ++ sigaddset (set, SIGRTMIN + 1); + } +diff --git a/gdb/nat/linux-nat.h b/gdb/nat/linux-nat.h +index 7dd18fefff..35137ab34f 100644 +--- a/gdb/nat/linux-nat.h ++++ b/gdb/nat/linux-nat.h +@@ -90,4 +90,8 @@ extern void linux_stop_lwp (struct lwp_info *lwp); + + extern int lwp_is_stepping (struct lwp_info *lwp); + ++#ifndef W_STOPCODE ++#define W_STOPCODE(sig) ((sig) << 8 | 0x7f) ++#endif ++ + #endif /* LINUX_NAT_H */ +-- +2.13.1 + diff --git a/bsp/meta-synopsys/recipes-devtools/gdb/gdb/0009-Change-order-of-CFLAGS.patch b/bsp/meta-synopsys/recipes-devtools/gdb/gdb/0009-Change-order-of-CFLAGS.patch new file mode 100644 index 00000000..0c103ef3 --- /dev/null +++ b/bsp/meta-synopsys/recipes-devtools/gdb/gdb/0009-Change-order-of-CFLAGS.patch @@ -0,0 +1,30 @@ +From 3f54036b891054072b3e43ea8daaa57aa367b2e0 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 30 Apr 2016 15:35:39 -0700 +Subject: [PATCH 09/10] Change order of CFLAGS + +Lets us override Werror if need be + +Upstream-Status: Inappropriate + +Signed-off-by: Khem Raj +--- + gdb/gdbserver/Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in +index 01dfdc0b89..f6aebef464 100644 +--- a/gdb/gdbserver/Makefile.in ++++ b/gdb/gdbserver/Makefile.in +@@ -140,7 +140,7 @@ CPPFLAGS = @CPPFLAGS@ + INTERNAL_CFLAGS_BASE = ${CXXFLAGS} ${GLOBAL_CFLAGS} \ + ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS} + INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS) +-INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER ++INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) ${COMPILER_CFLAGS} -DGDBSERVER + + # LDFLAGS is specifically reserved for setting from the command line + # when running make. +-- +2.13.1 + diff --git a/bsp/meta-synopsys/recipes-devtools/gdb/gdb/0010-resolve-restrict-keyword-conflict.patch b/bsp/meta-synopsys/recipes-devtools/gdb/gdb/0010-resolve-restrict-keyword-conflict.patch new file mode 100644 index 00000000..c9507109 --- /dev/null +++ b/bsp/meta-synopsys/recipes-devtools/gdb/gdb/0010-resolve-restrict-keyword-conflict.patch @@ -0,0 +1,48 @@ +From 3ead0dd143521b0ba69c9e753bc4a236f9445ad9 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 10 May 2016 08:47:05 -0700 +Subject: [PATCH 10/10] resolve restrict keyword conflict + +GCC detects that we call 'restrict' as param name in function +signatures and complains since both params are called 'restrict' +therefore we use __restrict to denote the C99 keywork + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + gdb/gnulib/import/sys_time.in.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/gdb/gnulib/import/sys_time.in.h b/gdb/gnulib/import/sys_time.in.h +index d535a6a48b..7c34d5a1aa 100644 +--- a/gdb/gnulib/import/sys_time.in.h ++++ b/gdb/gnulib/import/sys_time.in.h +@@ -93,20 +93,20 @@ struct timeval + # define gettimeofday rpl_gettimeofday + # endif + _GL_FUNCDECL_RPL (gettimeofday, int, +- (struct timeval *restrict, void *restrict) ++ (struct timeval *__restrict, void *__restrict) + _GL_ARG_NONNULL ((1))); + _GL_CXXALIAS_RPL (gettimeofday, int, +- (struct timeval *restrict, void *restrict)); ++ (struct timeval *__restrict, void *__restrict)); + # else + # if !@HAVE_GETTIMEOFDAY@ + _GL_FUNCDECL_SYS (gettimeofday, int, +- (struct timeval *restrict, void *restrict) ++ (struct timeval *__restrict, void *__restrict) + _GL_ARG_NONNULL ((1))); + # endif + /* Need to cast, because on glibc systems, by default, the second argument is + struct timezone *. */ + _GL_CXXALIAS_SYS_CAST (gettimeofday, int, +- (struct timeval *restrict, void *restrict)); ++ (struct timeval *__restrict, void *__restrict)); + # endif + _GL_CXXALIASWARN (gettimeofday); + # if defined __cplusplus && defined GNULIB_NAMESPACE +-- +2.13.1 + diff --git a/bsp/meta-synopsys/recipes-devtools/gdb/gdb/gdb-Fix-ia64-defining-TRAP_HWBKPT-before-including-g.patch b/bsp/meta-synopsys/recipes-devtools/gdb/gdb/gdb-Fix-ia64-defining-TRAP_HWBKPT-before-including-g.patch new file mode 100644 index 00000000..ef97de77 --- /dev/null +++ b/bsp/meta-synopsys/recipes-devtools/gdb/gdb/gdb-Fix-ia64-defining-TRAP_HWBKPT-before-including-g.patch @@ -0,0 +1,56 @@ +From b033a9663053eed87cb572397176747b88e9a699 Mon Sep 17 00:00:00 2001 +From: James Clarke +Date: Fri, 19 Jan 2018 17:22:49 +0000 +Subject: [PATCH] gdb: Fix ia64 defining TRAP_HWBKPT before including + gdb_wait.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +On ia64, gdb_wait.h eventually includes siginfo-consts-arch.h, which +contains an enum with TRAP_HWBKPT, along with a #define. Thus we cannot +define TRAP_HWBKPT to 4 beforehand, and so gdb_wait.h must be included +earlier; include it from linux-ptrace.h so it can never come afterwards. + +gdb/ChangeLog: + + * nat/linux-ptrace.c: Remove unnecessary reinclusion of + gdb_ptrace.h, and move including gdb_wait.h ... + * nat/linux-ptrace.h: ... to here. + +Upstream-Status: Accepted [https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=5a6c3296a7a90694ad4042f6256f3da6d4fa4ee8] + +Signed-off-by: Daniel Díaz +--- + gdb/nat/linux-ptrace.c | 2 -- + gdb/nat/linux-ptrace.h | 1 + + 2 files changed, 1 insertion(+), 2 deletions(-) + +diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c +index 3265b16..559c2de 100644 +--- a/gdb/nat/linux-ptrace.c ++++ b/gdb/nat/linux-ptrace.c +@@ -21,8 +21,6 @@ + #include "linux-procfs.h" + #include "linux-waitpid.h" + #include "buffer.h" +-#include "gdb_wait.h" +-#include "gdb_ptrace.h" + #ifdef HAVE_SYS_PROCFS_H + #include + #endif +diff --git a/gdb/nat/linux-ptrace.h b/gdb/nat/linux-ptrace.h +index 5954945..6faa89b 100644 +--- a/gdb/nat/linux-ptrace.h ++++ b/gdb/nat/linux-ptrace.h +@@ -21,6 +21,7 @@ + struct buffer; + + #include "nat/gdb_ptrace.h" ++#include "gdb_wait.h" + + #ifdef __UCLIBC__ + #if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__)) +-- +2.7.4 + diff --git a/bsp/meta-synopsys/recipes-devtools/gdb/gdb/package_devel_gdb_patches_120-sigprocmask-invalid-call.patch b/bsp/meta-synopsys/recipes-devtools/gdb/gdb/package_devel_gdb_patches_120-sigprocmask-invalid-call.patch new file mode 100644 index 00000000..c5484f78 --- /dev/null +++ b/bsp/meta-synopsys/recipes-devtools/gdb/gdb/package_devel_gdb_patches_120-sigprocmask-invalid-call.patch @@ -0,0 +1,45 @@ +From 56893a61aa4f0270fa8d1197b9848247f90fce0d Mon Sep 17 00:00:00 2001 +From: Yousong Zhou +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 + + * common/signals-state-save-restore.c (save_original_signals_state): + Fix invalid sigprocmask call. +--- +Upstream-Status: Pending [not author, cherry-picked from LEDE https://bugs.lede-project.org/index.php?do=details&task_id=637&openedfrom=-1%2Bweek] +Signed-off-by: André Draszik + gdb/ChangeLog | 5 +++++ + gdb/common/signals-state-save-restore.c | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/gdb/common/signals-state-save-restore.c b/gdb/common/signals-state-save-restore.c +index d11a9ae..734335c 100644 +--- a/gdb/common/signals-state-save-restore.c ++++ b/gdb/common/signals-state-save-restore.c +@@ -41,7 +41,7 @@ save_original_signals_state (void) + int i; + int res; + +- res = sigprocmask (0, NULL, &original_signal_mask); ++ res = sigprocmask (SIG_BLOCK, NULL, &original_signal_mask); + if (res == -1) + perror_with_name (("sigprocmask")); + +-- +2.6.4 + diff --git a/bsp/meta-synopsys/recipes-devtools/gdb/gdb_arc.bb b/bsp/meta-synopsys/recipes-devtools/gdb/gdb_arc.bb new file mode 100644 index 00000000..bdc7bcbd --- /dev/null +++ b/bsp/meta-synopsys/recipes-devtools/gdb/gdb_arc.bb @@ -0,0 +1,29 @@ +require recipes-devtools/gdb/gdb.inc +require recipes-devtools/gdb/gdb-${PV}.inc + +inherit python3-dir + +EXTRA_OEMAKE_append_libc-musl = "\ + gt_cv_func_gnugettext1_libc=yes \ + gt_cv_func_gnugettext2_libc=yes \ + gl_cv_func_working_strerror=yes \ + gl_cv_func_strerror_0_works=yes \ + gl_cv_func_gettimeofday_clobber=no \ + " + +do_configure_prepend() { + if [ "${@bb.utils.filter('PACKAGECONFIG', 'python', d)}" ]; then + cat > ${WORKDIR}/python << EOF +#!/bin/sh +case "\$2" in + --includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}/" ;; + --ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}${PYTHON_ABI}" ;; + --exec-prefix) echo "${exec_prefix}" ;; + *) exit 1 ;; +esac +exit 0 +EOF + chmod +x ${WORKDIR}/python + fi +} +CPPFLAGS_append_libc-musl = " -Drpl_gettimeofday=gettimeofday -Drpl_stat=stat" -- cgit 1.2.3-korg