aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-kernel/crash
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-kernel/crash')
-rw-r--r--meta-oe/recipes-kernel/crash/crash-cross-canadian_8.0.4.bb52
-rw-r--r--meta-oe/recipes-kernel/crash/crash.inc (renamed from meta-oe/recipes-kernel/crash/crash_7.2.9.bb)63
-rw-r--r--meta-oe/recipes-kernel/crash/crash/0001-cross_add_configure_option.patch21
-rw-r--r--meta-oe/recipes-kernel/crash/crash/0001-printk-add-support-for-lockless-ringbuffer.patch445
-rw-r--r--meta-oe/recipes-kernel/crash/crash/0002-crash-fix-build-error-unknown-type-name-gdb_fpregset.patch36
-rw-r--r--meta-oe/recipes-kernel/crash/crash/0002-printk-use-committed-finalized-state-values.patch103
-rw-r--r--meta-oe/recipes-kernel/crash/crash/0003-crash-detect-the-sysroot-s-glibc-header-file.patch33
-rw-r--r--meta-oe/recipes-kernel/crash/crash/7001force_define_architecture.patch2
-rw-r--r--meta-oe/recipes-kernel/crash/crash/7003cross_ranlib.patch21
-rw-r--r--meta-oe/recipes-kernel/crash/crash/config-site.crash-7.0.91
-rw-r--r--meta-oe/recipes-kernel/crash/crash/donnot-extract-gdb-during-do-compile.patch29
-rw-r--r--meta-oe/recipes-kernel/crash/crash/gdb_build_jobs_and_not_write_crash_target.patch26
-rw-r--r--meta-oe/recipes-kernel/crash/crash/remove-unrecognized-gcc-option-m32-for-mips.patch33
-rw-r--r--meta-oe/recipes-kernel/crash/crash/sim-common-sim-arange-fix-extern-inline-handling.patch79
-rw-r--r--meta-oe/recipes-kernel/crash/crash/sim-ppc-drop-LIBS-from-psim-dependency.patch37
-rw-r--r--meta-oe/recipes-kernel/crash/crash_8.0.4.bb28
16 files changed, 166 insertions, 843 deletions
diff --git a/meta-oe/recipes-kernel/crash/crash-cross-canadian_8.0.4.bb b/meta-oe/recipes-kernel/crash/crash-cross-canadian_8.0.4.bb
new file mode 100644
index 0000000000..54883cef38
--- /dev/null
+++ b/meta-oe/recipes-kernel/crash/crash-cross-canadian_8.0.4.bb
@@ -0,0 +1,52 @@
+inherit cross-canadian
+
+SUMMARY = "crash utility (cross-canadian crash for ${TARGET_ARCH} target)"
+PN = "crash-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+BPN = "crash"
+
+require crash.inc
+
+
+DEPENDS = "\
+ nativesdk-ncurses \
+ nativesdk-expat \
+ nativesdk-gettext \
+ nativesdk-gmp \
+ nativesdk-mpfr \
+ nativesdk-readline \
+ nativesdk-zlib \
+ virtual/${HOST_PREFIX}gcc \
+ virtual/${HOST_PREFIX}binutils \
+ virtual/nativesdk-${HOST_PREFIX}compilerlibs \
+ virtual/nativesdk-libc"
+
+RDEPENDS:${PN} = "nativesdk-liblzma"
+
+EXTRA_OEMAKE:class-cross-canadian = 'RPMPKG="${PV}" \
+ GDB_TARGET="${BUILD_SYS} --target=${TARGET_SYS}" \
+ GDB_HOST="${HOST_SYS}" \
+ GDB_MAKE_JOBS="${PARALLEL_MAKE}" \
+ LDFLAGS="${LDFLAGS}" \
+ '
+
+# To ship crash into your sdk, you should create/update a packagegroup-cross-canadian.bbappend and
+# add the following
+# CRASH = "crash-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+# RDEPENDS:${PN} += "${@all_multilib_tune_values(d, 'CRASH')}"
+#
+# You should also add some kernel packages in your sdk, add the followng in your conf/local.conf:
+#
+# TOOLCHAIN_TARGET_TASK += "\
+# kernel-vmlinux \
+# kernel-dbg \
+# kernel-dev \
+# "
+#
+# After sourcing the sdk environment script, you can analyze a kernel panic dump with
+#
+# crash $OECORE_TARGET_SYSROOT/boot/<vmlinux file> $OECORE_TARGET_SYSROOT/boot/<System.map file> <your vmcore>
+
+do_install:class-cross-canadian () {
+ install -m 0755 ${S}/crash ${D}/${bindir}
+ cross_canadian_bindirlinks
+}
diff --git a/meta-oe/recipes-kernel/crash/crash_7.2.9.bb b/meta-oe/recipes-kernel/crash/crash.inc
index 0b6883a49a..04318b1505 100644
--- a/meta-oe/recipes-kernel/crash/crash_7.2.9.bb
+++ b/meta-oe/recipes-kernel/crash/crash.inc
@@ -7,44 +7,37 @@ offered by Mission Critical Linux, or the LKCD kernel patch."
HOMEPAGE = "http://people.redhat.com/anderson"
SECTION = "devel"
-LICENSE = "GPLv3"
+LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING3;md5=d32239bcb673463ab874e80d47fae504"
DEPENDS = "zlib readline coreutils-native ncurses-native"
+INC_PR = "r1"
+
S = "${WORKDIR}/git"
-SRC_URI = "git://github.com/crash-utility/${BPN}.git \
- ${GNU_MIRROR}/gdb/gdb-7.6.tar.gz;name=gdb;subdir=git \
+SRC_URI = "git://github.com/crash-utility/${BPN}.git;branch=master;protocol=https \
+ ${GNU_MIRROR}/gdb/gdb-10.2.tar.gz;name=gdb;subdir=git \
file://7001force_define_architecture.patch \
file://7003cross_ranlib.patch \
file://0001-cross_add_configure_option.patch \
- file://sim-ppc-drop-LIBS-from-psim-dependency.patch \
- file://sim-common-sim-arange-fix-extern-inline-handling.patch \
file://donnot-extract-gdb-during-do-compile.patch \
file://gdb_build_jobs_and_not_write_crash_target.patch \
- file://remove-unrecognized-gcc-option-m32-for-mips.patch \
- file://0002-crash-fix-build-error-unknown-type-name-gdb_fpregset.patch \
- file://0003-crash-detect-the-sysroot-s-glibc-header-file.patch \
- file://0001-printk-add-support-for-lockless-ringbuffer.patch \
- file://0002-printk-use-committed-finalized-state-values.patch \
"
-SRCREV = "a25aa4b649d339dd25c20d5413d81b851a77e0b2"
+SRCREV = "a6832f608cb5d473739cf33bbf84ab1df8d98fd5"
-SRC_URI[gdb.md5sum] = "a9836707337e5f7bf76a009a8904f470"
-SRC_URI[gdb.sha256sum] = "8070389a5dcc104eb0be483d582729f98ed4d761ad19cedd3f17b5d2502faa36"
+SRC_URI[gdb.sha256sum] = "b33ad58d687487a821ec8d878daab0f716be60d0936f2e3ac5cf08419ce70350"
UPSTREAM_CHECK_URI = "https://github.com/crash-utility/crash/releases"
inherit gettext
-BBCLASSEXTEND = "native cross"
-TARGET_CC_ARCH_append = " ${SELECTED_OPTIMIZATION}"
+TARGET_CC_ARCH:append = " ${SELECTED_OPTIMIZATION}"
# crash 7.1.3 and before don't support mips64/riscv64
-COMPATIBLE_HOST_riscv64 = "null"
-COMPATIBLE_HOST_riscv32 = "null"
-COMPATIBLE_HOST_mipsarchn64 = "null"
-COMPATIBLE_HOST_mipsarchn32 = "null"
+COMPATIBLE_HOST:riscv64 = "null"
+COMPATIBLE_HOST:riscv32 = "null"
+COMPATIBLE_HOST:mipsarchn64 = "null"
+COMPATIBLE_HOST:mipsarchn32 = "null"
EXTRA_OEMAKE = 'RPMPKG="${PV}" \
@@ -54,20 +47,11 @@ EXTRA_OEMAKE = 'RPMPKG="${PV}" \
LDFLAGS="${LDFLAGS}" \
'
-EXTRA_OEMAKE_class-cross = 'RPMPKG="${PV}" \
- GDB_TARGET="${BUILD_SYS} --target=${TARGET_SYS}" \
- GDB_HOST="${BUILD_SYS}" \
- GDB_MAKE_JOBS="${PARALLEL_MAKE}" \
- '
-
-EXTRA_OEMAKE_append_class-native = " LDFLAGS='${BUILD_LDFLAGS}'"
-EXTRA_OEMAKE_append_class-cross = " LDFLAGS='${BUILD_LDFLAGS}'"
-
do_configure() {
:
}
-do_compile_prepend() {
+do_compile:prepend() {
case ${TARGET_ARCH} in
aarch64*) ARCH=ARM64 ;;
arm*) ARCH=ARM ;;
@@ -80,6 +64,7 @@ do_compile_prepend() {
sed -i s/FORCE_DEFINE_ARCH/"${ARCH}"/g ${S}/configure.c
sed -i -e 's/#define TARGET_CFLAGS_ARM_ON_X86_64.*/#define TARGET_CFLAGS_ARM_ON_X86_64\t\"TARGET_CFLAGS=-D_FILE_OFFSET_BITS=64\"/g' ${S}/configure.c
+ sed -i -e 's/#define TARGET_CFLAGS_MIPS_ON_X86_64.*/#define TARGET_CFLAGS_MIPS_ON_X86_64\t\"TARGET_CFLAGS=-D_FILE_OFFSET_BITS=64\"/g' ${S}/configure.c
sed -i 's/&gt;/>/g' ${S}/Makefile
}
@@ -87,7 +72,7 @@ do_compile() {
oe_runmake ${EXTRA_OEMAKE} RECIPE_SYSROOT=${RECIPE_SYSROOT}
}
-do_install_prepend () {
+do_install:prepend () {
install -d ${D}${bindir}
install -d ${D}/${mandir}/man8
install -d ${D}${includedir}/crash
@@ -96,25 +81,11 @@ do_install_prepend () {
install -m 0644 ${S}/defs.h ${D}${includedir}/crash
}
-do_install_class-target () {
- oe_runmake DESTDIR=${D} install
-}
-
-do_install_class-native () {
- oe_runmake DESTDIR=${D}${STAGING_DIR_NATIVE} install
-}
-
-do_install_class-cross () {
- install -m 0755 ${S}/crash ${D}/${bindir}
-}
-
-RDEPENDS_${PN} += "liblzma"
-RDEPENDS_${PN}_class-native = ""
-RDEPENDS_${PN}_class-cross = ""
+RDEPENDS:${PN} += "liblzma"
# Causes gcc to get stuck and eat all available memory in qemuarm builds
# jenkins 15161 100 12.5 10389596 10321284 ? R 11:40 28:17 /home/jenkins/oe/world/shr-core/tmp-glibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.2/cc1 -quiet -I . -I . -I ./common -I ./config -I ./../include/opcode -I ./../opcodes/.. -I ./../readline/.. -I ../bfd -I ./../bfd -I ./../include -I ../libdecnumber -I ./../libdecnumber -I ./gnulib/import -I build-gnulib/import -isysroot /home/jenkins/oe/world/shr-core/tmp-glibc/sysroots/qemuarm -MMD eval.d -MF .deps/eval.Tpo -MP -MT eval.o -D LOCALEDIR="/usr/local/share/locale" -D CRASH_MERGE -D HAVE_CONFIG_H -D TUI=1 eval.c -quiet -dumpbase eval.c -march=armv5te -mthumb -mthumb-interwork -mtls-dialect=gnu -auxbase-strip eval.o -g -O2 -Wall -Wpointer-arith -Wformat-nonliteral -Wno-pointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -feliminate-unused-debug-types -o -
ARM_INSTRUCTION_SET = "arm"
# http://errors.yoctoproject.org/Errors/Details/186964/
-COMPATIBLE_HOST_libc-musl = 'null'
+COMPATIBLE_HOST:libc-musl = 'null'
diff --git a/meta-oe/recipes-kernel/crash/crash/0001-cross_add_configure_option.patch b/meta-oe/recipes-kernel/crash/crash/0001-cross_add_configure_option.patch
index 26a34e5c16..fc99ff5187 100644
--- a/meta-oe/recipes-kernel/crash/crash/0001-cross_add_configure_option.patch
+++ b/meta-oe/recipes-kernel/crash/crash/0001-cross_add_configure_option.patch
@@ -1,27 +1,29 @@
-From 73269df4d8196abe81112acaa2613155b308a8b8 Mon Sep 17 00:00:00 2001
+From e3ba432243d9be4e845daabc78a0ae7c03c680f5 Mon Sep 17 00:00:00 2001
From: Lei Maohui <leimaohui@cn.fujitsu.com>
Date: Fri, 9 Jan 2015 11:51:18 +0900
-Subject: [PATCH 1/9] cross_add_configure_option
+Subject: [PATCH] cross_add_configure_option
+
-%% original patch: 0001-cross_add_configure_option.patch
---
+Upstream-Status: Pending
+
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
-index a2baec1..f1972c8 100644
+index 7266e305..390fc0ef 100644
--- a/Makefile
+++ b/Makefile
-@@ -232,7 +232,7 @@ gdb_merge: force
+@@ -260,7 +260,7 @@ gdb_merge: force
@echo "../../${PROGRAM} ../../${PROGRAM}lib.a" > ${GDB}/gdb/mergeobj
@rm -f ${PROGRAM}
@if [ ! -f ${GDB}/config.status ]; then \
- (cd ${GDB}; ./configure ${GDB_CONF_FLAGS} --with-separate-debug-dir=/usr/lib/debug \
+ (cd ${GDB}; ./configure --host=${GDB_TARGET} --build=${GDB_HOST} --with-separate-debug-dir=/usr/lib/debug \
--with-bugurl="" --with-expat=no --with-python=no --disable-sim; \
- make --no-print-directory CRASH_TARGET=${TARGET}; echo ${TARGET} > crash.target) \
- else make --no-print-directory rebuild; fi
-@@ -283,7 +283,7 @@ force:
+ $(MAKE) CRASH_TARGET=${TARGET}; echo ${TARGET} > crash.target) \
+ else $(MAKE) rebuild; fi
+@@ -306,7 +306,7 @@ force:
make_configure: force
@rm -f configure
@@ -30,6 +32,3 @@ index a2baec1..f1972c8 100644
clean: make_configure
@./configure ${CONF_TARGET_FLAG} -q -b
---
-2.8.1
-
diff --git a/meta-oe/recipes-kernel/crash/crash/0001-printk-add-support-for-lockless-ringbuffer.patch b/meta-oe/recipes-kernel/crash/crash/0001-printk-add-support-for-lockless-ringbuffer.patch
deleted file mode 100644
index 1aaf1e6b07..0000000000
--- a/meta-oe/recipes-kernel/crash/crash/0001-printk-add-support-for-lockless-ringbuffer.patch
+++ /dev/null
@@ -1,445 +0,0 @@
-From a5531b24750e7949c35640d996ea14c0587938bc Mon Sep 17 00:00:00 2001
-From: John Ogness <john.ogness@linutronix.de>
-Date: Fri, 20 Nov 2020 05:56:59 +0000
-Subject: [PATCH 1/2] printk: add support for lockless ringbuffer
-
-Linux 5.10 introduces a new lockless ringbuffer. The new ringbuffer
-is structured completely different to the previous iterations.
-Add support for dumping the ringbuffer with the "log" command.
-The new ringbuffer is detected based on the availability of
-the "prb" symbol.
-
-Upstream-Status: Backport [https://github.com/crash-utility/crash/commit/a5531b24750e7949c35640d996ea14c0587938bc]
-
-Signed-off-by: John Ogness <john.ogness@linutronix.de>
-Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
-Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
----
- Makefile | 5 ++
- defs.h | 30 +++++++
- kernel.c | 7 +-
- printk.c | 256 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
- symbols.c | 27 ++++++
- 5 files changed, 324 insertions(+), 1 deletion(-)
- create mode 100644 printk.c
-
-diff --git a/Makefile b/Makefile
-index d185719..f66eba7 100644
---- a/Makefile
-+++ b/Makefile
-@@ -61,6 +61,7 @@ VMWARE_HFILES=vmware_vmss.h
-
- CFILES=main.c tools.c global_data.c memory.c filesys.c help.c task.c \
- kernel.c test.c gdb_interface.c configure.c net.c dev.c bpf.c \
-+ printk.c \
- alpha.c x86.c ppc.c ia64.c s390.c s390x.c s390dbf.c ppc64.c x86_64.c \
- arm.c arm64.c mips.c sparc64.c \
- extensions.c remote.c va_server.c va_server_v1.c symbols.c cmdline.c \
-@@ -80,6 +81,7 @@ SOURCE_FILES=${CFILES} ${GENERIC_HFILES} ${MCORE_HFILES} \
-
- OBJECT_FILES=main.o tools.o global_data.o memory.o filesys.o help.o task.o \
- build_data.o kernel.o test.o gdb_interface.o net.o dev.o bpf.o \
-+ printk.o \
- alpha.o x86.o ppc.o ia64.o s390.o s390x.o s390dbf.o ppc64.o x86_64.o \
- arm.o arm64.o mips.o sparc64.o \
- extensions.o remote.o va_server.o va_server_v1.o symbols.o cmdline.o \
-@@ -363,6 +365,9 @@ task.o: ${GENERIC_HFILES} task.c
- kernel.o: ${GENERIC_HFILES} kernel.c
- ${CC} -c ${CRASH_CFLAGS} kernel.c ${WARNING_OPTIONS} ${WARNING_ERROR}
-
-+printk.o: ${GENERIC_HFILES} printk.c
-+ ${CC} -c ${CRASH_CFLAGS} printk.c ${WARNING_OPTIONS} ${WARNING_ERROR}
-+
- gdb_interface.o: ${GENERIC_HFILES} gdb_interface.c
- ${CC} -c ${CRASH_CFLAGS} gdb_interface.c ${WARNING_OPTIONS} ${WARNING_ERROR}
-
-diff --git a/defs.h b/defs.h
-index 9594950..e1a18e9 100644
---- a/defs.h
-+++ b/defs.h
-@@ -2106,6 +2106,28 @@ struct offset_table { /* stash of commonly-used offsets */
- long irq_common_data_affinity;
- long irq_desc_irq_common_data;
- long uts_namespace_name;
-+ long printk_info_seq;
-+ long printk_info_ts_nsec;
-+ long printk_info_text_len;
-+ long printk_info_level;
-+ long printk_info_caller_id;
-+ long printk_info_dev_info;
-+ long dev_printk_info_subsystem;
-+ long dev_printk_info_device;
-+ long prb_desc_ring;
-+ long prb_text_data_ring;
-+ long prb_desc_ring_count_bits;
-+ long prb_desc_ring_descs;
-+ long prb_desc_ring_infos;
-+ long prb_desc_ring_head_id;
-+ long prb_desc_ring_tail_id;
-+ long prb_desc_state_var;
-+ long prb_desc_text_blk_lpos;
-+ long prb_data_blk_lpos_begin;
-+ long prb_data_blk_lpos_next;
-+ long prb_data_ring_size_bits;
-+ long prb_data_ring_data;
-+ long atomic_long_t_counter;
- };
-
- struct size_table { /* stash of commonly-used sizes */
-@@ -2265,6 +2287,9 @@ struct size_table { /* stash of commonly-used sizes */
- long xa_node;
- long zram_table_entry;
- long irq_common_data;
-+ long printk_info;
-+ long printk_ringbuffer;
-+ long prb_desc;
- };
-
- struct array_table {
-@@ -6696,6 +6721,11 @@ int vmware_guestdump_memory_dump(FILE *);
- */
- int calc_kaslr_offset(ulong *, ulong *);
-
-+/*
-+ * printk.c
-+ */
-+void dump_lockless_record_log(int);
-+
- /*
- * gnu_binutils.c
- */
-diff --git a/kernel.c b/kernel.c
-index 9871637..e722ff9 100644
---- a/kernel.c
-+++ b/kernel.c
-@@ -5042,6 +5042,11 @@ dump_log(int msg_flags)
- struct syment *nsp;
- int log_wrap, loglevel, log_buf_len;
-
-+ if (kernel_symbol_exists("prb")) {
-+ dump_lockless_record_log(msg_flags);
-+ return;
-+ }
-+
- if (kernel_symbol_exists("log_first_idx") &&
- kernel_symbol_exists("log_next_idx")) {
- dump_variable_length_record_log(msg_flags);
-@@ -5289,7 +5294,7 @@ dump_log_entry(char *logptr, int msg_flags)
- }
-
- /*
-- * Handle the new variable-length-record log_buf.
-+ * Handle the variable-length-record log_buf.
- */
- static void
- dump_variable_length_record_log(int msg_flags)
-diff --git a/printk.c b/printk.c
-new file mode 100644
-index 0000000..f6d54ce
---- /dev/null
-+++ b/printk.c
-@@ -0,0 +1,256 @@
-+#include "defs.h"
-+#include <ctype.h>
-+
-+#define DESC_SV_BITS (sizeof(unsigned long) * 8)
-+#define DESC_COMMITTED_MASK (1UL << (DESC_SV_BITS - 1))
-+#define DESC_REUSE_MASK (1UL << (DESC_SV_BITS - 2))
-+#define DESC_FLAGS_MASK (DESC_COMMITTED_MASK | DESC_REUSE_MASK)
-+#define DESC_ID_MASK (~DESC_FLAGS_MASK)
-+
-+/* convenience struct for passing many values to helper functions */
-+struct prb_map {
-+ char *prb;
-+
-+ char *desc_ring;
-+ unsigned long desc_ring_count;
-+ char *descs;
-+ char *infos;
-+
-+ char *text_data_ring;
-+ unsigned long text_data_ring_size;
-+ char *text_data;
-+};
-+
-+static void
-+init_offsets(void)
-+{
-+ char *n;
-+
-+ n = "printk_info";
-+ STRUCT_SIZE_INIT(printk_info, n);
-+ MEMBER_OFFSET_INIT(printk_info_seq, n, "seq");
-+ MEMBER_OFFSET_INIT(printk_info_ts_nsec, n, "ts_nsec");
-+ MEMBER_OFFSET_INIT(printk_info_text_len, n, "text_len");
-+ MEMBER_OFFSET_INIT(printk_info_level, n, "level");
-+ MEMBER_OFFSET_INIT(printk_info_caller_id, n, "caller_id");
-+ MEMBER_OFFSET_INIT(printk_info_dev_info, n, "dev_info");
-+
-+ n = "dev_printk_info";
-+ MEMBER_OFFSET_INIT(dev_printk_info_subsystem, n, "subsystem");
-+ MEMBER_OFFSET_INIT(dev_printk_info_device, n, "device");
-+
-+ n = "printk_ringbuffer";
-+ STRUCT_SIZE_INIT(printk_ringbuffer, n);
-+ MEMBER_OFFSET_INIT(prb_desc_ring, n, "desc_ring");
-+ MEMBER_OFFSET_INIT(prb_text_data_ring, n, "text_data_ring");
-+
-+ n = "prb_desc_ring";
-+ MEMBER_OFFSET_INIT(prb_desc_ring_count_bits, n, "count_bits");
-+ MEMBER_OFFSET_INIT(prb_desc_ring_descs, n, "descs");
-+ MEMBER_OFFSET_INIT(prb_desc_ring_infos, n, "infos");
-+ MEMBER_OFFSET_INIT(prb_desc_ring_head_id, n, "head_id");
-+ MEMBER_OFFSET_INIT(prb_desc_ring_tail_id, n, "tail_id");
-+
-+ n = "prb_desc";
-+ STRUCT_SIZE_INIT(prb_desc, n);
-+ MEMBER_OFFSET_INIT(prb_desc_state_var, n, "state_var");
-+ MEMBER_OFFSET_INIT(prb_desc_text_blk_lpos, n, "text_blk_lpos");
-+
-+ n = "prb_data_blk_lpos";
-+ MEMBER_OFFSET_INIT(prb_data_blk_lpos_begin, n, "begin");
-+ MEMBER_OFFSET_INIT(prb_data_blk_lpos_next, n, "next");
-+
-+ n = "prb_data_ring";
-+ MEMBER_OFFSET_INIT(prb_data_ring_size_bits, n, "size_bits");
-+ MEMBER_OFFSET_INIT(prb_data_ring_data, n, "data");
-+
-+ n = "atomic_long_t";
-+ MEMBER_OFFSET_INIT(atomic_long_t_counter, n, "counter");
-+}
-+
-+static void
-+dump_record(struct prb_map *m, unsigned long id, int msg_flags)
-+{
-+ unsigned short text_len;
-+ unsigned long state_var;
-+ unsigned int caller_id;
-+ unsigned char level;
-+ unsigned long begin;
-+ unsigned long next;
-+ char buf[BUFSIZE];
-+ uint64_t ts_nsec;
-+ ulonglong nanos;
-+ ulonglong seq;
-+ int ilen = 0, i;
-+ char *desc, *info, *text, *p;
-+ ulong rem;
-+
-+ desc = m->descs + ((id % m->desc_ring_count) * SIZE(prb_desc));
-+
-+ /* skip non-committed record */
-+ state_var = ULONG(desc + OFFSET(prb_desc_state_var) +
-+ OFFSET(atomic_long_t_counter));
-+ if ((state_var & DESC_FLAGS_MASK) != DESC_COMMITTED_MASK)
-+ return;
-+
-+ info = m->infos + ((id % m->desc_ring_count) * SIZE(printk_info));
-+
-+ seq = ULONGLONG(info + OFFSET(printk_info_seq));
-+ caller_id = UINT(info + OFFSET(printk_info_caller_id));
-+ if (CRASHDEBUG(1))
-+ fprintf(fp, "seq: %llu caller_id: %x (%s: %u)\n", seq, caller_id,
-+ caller_id & 0x80000000 ? "cpu" : "pid", caller_id & ~0x80000000);
-+
-+ text_len = USHORT(info + OFFSET(printk_info_text_len));
-+
-+ begin = ULONG(desc + OFFSET(prb_desc_text_blk_lpos) +
-+ OFFSET(prb_data_blk_lpos_begin)) %
-+ m->text_data_ring_size;
-+ next = ULONG(desc + OFFSET(prb_desc_text_blk_lpos) +
-+ OFFSET(prb_data_blk_lpos_next)) %
-+ m->text_data_ring_size;
-+
-+ /* skip data-less text blocks */
-+ if (begin == next)
-+ goto out;
-+
-+ if ((msg_flags & SHOW_LOG_TEXT) == 0) {
-+ ts_nsec = ULONGLONG(info + OFFSET(printk_info_ts_nsec));
-+ nanos = (ulonglong)ts_nsec / (ulonglong)1000000000;
-+ rem = (ulonglong)ts_nsec % (ulonglong)1000000000;
-+ if (msg_flags & SHOW_LOG_CTIME) {
-+ time_t t = kt->boot_date.tv_sec + nanos;
-+ sprintf(buf, "[%s] ", ctime_tz(&t));
-+ } else
-+ sprintf(buf, "[%5lld.%06ld] ", nanos, rem/1000);
-+
-+ ilen += strlen(buf);
-+ fprintf(fp, "%s", buf);
-+ }
-+
-+ if (msg_flags & SHOW_LOG_LEVEL) {
-+ level = UCHAR(info + OFFSET(printk_info_level)) >> 5;
-+ sprintf(buf, "<%x>", level);
-+ ilen += strlen(buf);
-+ fprintf(fp, "%s", buf);
-+ }
-+
-+ /* handle wrapping data block */
-+ if (begin > next)
-+ begin = 0;
-+
-+ /* skip over descriptor ID */
-+ begin += sizeof(unsigned long);
-+
-+ /* handle truncated messages */
-+ if (next - begin < text_len)
-+ text_len = next - begin;
-+
-+ text = m->text_data + begin;
-+
-+ for (i = 0, p = text; i < text_len; i++, p++) {
-+ if (*p == '\n')
-+ fprintf(fp, "\n%s", space(ilen));
-+ else if (isprint(*p) || isspace(*p))
-+ fputc(*p, fp);
-+ else
-+ fputc('.', fp);
-+ }
-+
-+ if (msg_flags & SHOW_LOG_DICT) {
-+ text = info + OFFSET(printk_info_dev_info) +
-+ OFFSET(dev_printk_info_subsystem);
-+ if (strlen(text))
-+ fprintf(fp, "\n%sSUBSYSTEM=%s", space(ilen), text);
-+
-+ text = info + OFFSET(printk_info_dev_info) +
-+ OFFSET(dev_printk_info_device);
-+ if (strlen(text))
-+ fprintf(fp, "\n%sDEVICE=%s", space(ilen), text);
-+ }
-+out:
-+ fprintf(fp, "\n");
-+}
-+
-+/*
-+ * Handle the lockless printk_ringbuffer.
-+ */
-+void
-+dump_lockless_record_log(int msg_flags)
-+{
-+ unsigned long head_id;
-+ unsigned long tail_id;
-+ unsigned long kaddr;
-+ unsigned long id;
-+ struct prb_map m;
-+
-+ if (INVALID_SIZE(printk_info))
-+ init_offsets();
-+
-+ /* setup printk_ringbuffer */
-+ get_symbol_data("prb", sizeof(char *), &kaddr);
-+ m.prb = GETBUF(SIZE(printk_ringbuffer));
-+ if (!readmem(kaddr, KVADDR, m.prb, SIZE(printk_ringbuffer),
-+ "printk_ringbuffer contents", RETURN_ON_ERROR|QUIET)) {
-+ error(WARNING, "\ncannot read printk_ringbuffer contents\n");
-+ goto out_prb;
-+ }
-+
-+ /* setup descriptor ring */
-+ m.desc_ring = m.prb + OFFSET(prb_desc_ring);
-+ m.desc_ring_count = 1 << UINT(m.desc_ring + OFFSET(prb_desc_ring_count_bits));
-+
-+ kaddr = ULONG(m.desc_ring + OFFSET(prb_desc_ring_descs));
-+ m.descs = GETBUF(SIZE(prb_desc) * m.desc_ring_count);
-+ if (!readmem(kaddr, KVADDR, m.descs, SIZE(prb_desc) * m.desc_ring_count,
-+ "prb_desc_ring contents", RETURN_ON_ERROR|QUIET)) {
-+ error(WARNING, "\ncannot read prb_desc_ring contents\n");
-+ goto out_descs;
-+ }
-+
-+ kaddr = ULONG(m.desc_ring + OFFSET(prb_desc_ring_infos));
-+ m.infos = GETBUF(SIZE(printk_info) * m.desc_ring_count);
-+ if (!readmem(kaddr, KVADDR, m.infos, SIZE(printk_info) * m.desc_ring_count,
-+ "prb_info_ring contents", RETURN_ON_ERROR|QUIET)) {
-+ error(WARNING, "\ncannot read prb_info_ring contents\n");
-+ goto out_infos;
-+ }
-+
-+ /* setup text data ring */
-+ m.text_data_ring = m.prb + OFFSET(prb_text_data_ring);
-+ m.text_data_ring_size = 1 << UINT(m.text_data_ring + OFFSET(prb_data_ring_size_bits));
-+
-+ kaddr = ULONG(m.text_data_ring + OFFSET(prb_data_ring_data));
-+ m.text_data = GETBUF(m.text_data_ring_size);
-+ if (!readmem(kaddr, KVADDR, m.text_data, m.text_data_ring_size,
-+ "prb_text_data_ring contents", RETURN_ON_ERROR|QUIET)) {
-+ error(WARNING, "\ncannot read prb_text_data_ring contents\n");
-+ goto out_text_data;
-+ }
-+
-+ /* ready to go */
-+
-+ tail_id = ULONG(m.desc_ring + OFFSET(prb_desc_ring_tail_id) +
-+ OFFSET(atomic_long_t_counter));
-+ head_id = ULONG(m.desc_ring + OFFSET(prb_desc_ring_head_id) +
-+ OFFSET(atomic_long_t_counter));
-+
-+ hq_open();
-+
-+ for (id = tail_id; id != head_id; id = (id + 1) & DESC_ID_MASK)
-+ dump_record(&m, id, msg_flags);
-+
-+ /* dump head record */
-+ dump_record(&m, id, msg_flags);
-+
-+ hq_close();
-+
-+out_text_data:
-+ FREEBUF(m.text_data);
-+out_infos:
-+ FREEBUF(m.infos);
-+out_descs:
-+ FREEBUF(m.descs);
-+out_prb:
-+ FREEBUF(m.prb);
-+}
-diff --git a/symbols.c b/symbols.c
-index b2f4eb5..a51078d 100644
---- a/symbols.c
-+++ b/symbols.c
-@@ -10426,6 +10426,30 @@ dump_offset_table(char *spec, ulong makestruct)
- OFFSET(log_level));
- fprintf(fp, " log_flags_level: %ld\n",
- OFFSET(log_flags_level));
-+
-+ fprintf(fp, " printk_info_seq: %ld\n", OFFSET(printk_info_seq));
-+ fprintf(fp, " printk_info_ts_nseq: %ld\n", OFFSET(printk_info_ts_nsec));
-+ fprintf(fp, " printk_info_text_len: %ld\n", OFFSET(printk_info_text_len));
-+ fprintf(fp, " printk_info_level: %ld\n", OFFSET(printk_info_level));
-+ fprintf(fp, " printk_info_caller_id: %ld\n", OFFSET(printk_info_caller_id));
-+ fprintf(fp, " printk_info_dev_info: %ld\n", OFFSET(printk_info_dev_info));
-+ fprintf(fp, " dev_printk_info_subsystem: %ld\n", OFFSET(dev_printk_info_subsystem));
-+ fprintf(fp, " dev_printk_info_device: %ld\n", OFFSET(dev_printk_info_device));
-+ fprintf(fp, " prb_desc_ring: %ld\n", OFFSET(prb_desc_ring));
-+ fprintf(fp, " prb_text_data_ring: %ld\n", OFFSET(prb_text_data_ring));
-+ fprintf(fp, " prb_desc_ring_count_bits: %ld\n", OFFSET(prb_desc_ring_count_bits));
-+ fprintf(fp, " prb_desc_ring_descs: %ld\n", OFFSET(prb_desc_ring_descs));
-+ fprintf(fp, " prb_desc_ring_infos: %ld\n", OFFSET(prb_desc_ring_infos));
-+ fprintf(fp, " prb_desc_ring_head_id: %ld\n", OFFSET(prb_desc_ring_head_id));
-+ fprintf(fp, " prb_desc_ring_tail_id: %ld\n", OFFSET(prb_desc_ring_tail_id));
-+ fprintf(fp, " prb_desc_state_var: %ld\n", OFFSET(prb_desc_state_var));
-+ fprintf(fp, " prb_desc_text_blk_lpos: %ld\n", OFFSET(prb_desc_text_blk_lpos));
-+ fprintf(fp, " prb_data_blk_lpos_begin: %ld\n", OFFSET(prb_data_blk_lpos_begin));
-+ fprintf(fp, " prb_data_blk_lpos_next: %ld\n", OFFSET(prb_data_blk_lpos_next));
-+ fprintf(fp, " prb_data_ring_size_bits: %ld\n", OFFSET(prb_data_ring_size_bits));
-+ fprintf(fp, " prb_data_ring_data: %ld\n", OFFSET(prb_data_ring_data));
-+ fprintf(fp, " atomit_long_t_counter: %ld\n", OFFSET(atomic_long_t_counter));
-+
- fprintf(fp, " sched_rt_entity_my_q: %ld\n",
- OFFSET(sched_rt_entity_my_q));
- fprintf(fp, " task_group_parent: %ld\n",
-@@ -10850,6 +10874,9 @@ dump_offset_table(char *spec, ulong makestruct)
- SIZE(xarray));
- fprintf(fp, " xa_node: %ld\n",
- SIZE(xa_node));
-+ fprintf(fp, " printk_info: %ld\n", SIZE(printk_info));
-+ fprintf(fp, " printk_ringbuffer: %ld\n", SIZE(printk_ringbuffer));
-+ fprintf(fp, " prb_desc: %ld\n", SIZE(prb_desc));
-
-
- fprintf(fp, "\n array_table:\n");
---
-2.17.1
-
diff --git a/meta-oe/recipes-kernel/crash/crash/0002-crash-fix-build-error-unknown-type-name-gdb_fpregset.patch b/meta-oe/recipes-kernel/crash/crash/0002-crash-fix-build-error-unknown-type-name-gdb_fpregset.patch
deleted file mode 100644
index 8355fe44ea..0000000000
--- a/meta-oe/recipes-kernel/crash/crash/0002-crash-fix-build-error-unknown-type-name-gdb_fpregset.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 52fc1a7c17768fd52c3577d21dad84e8babb94b5 Mon Sep 17 00:00:00 2001
-From: Dengke Du <dengke.du@windriver.com>
-Date: Thu, 6 Apr 2017 23:01:14 -0400
-Subject: [PATCH 2/3] crash: fix build error unknown type name 'gdb_fpregset_t'
-
-Upstream-Status: Pending
-
-Signed-off-by: Dengke Du <dengke.du@windriver.com>
----
- gdb-7.6/gdb/gdb_proc_service.h | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/gdb-7.6/gdb/gdb_proc_service.h b/gdb-7.6/gdb/gdb_proc_service.h
-index 8bc6088..99c6496 100644
---- a/gdb-7.6/gdb/gdb_proc_service.h
-+++ b/gdb-7.6/gdb/gdb_proc_service.h
-@@ -20,6 +20,7 @@
- #define GDB_PROC_SERVICE_H
-
- #include <sys/types.h>
-+#include "gregset.h"
-
- #ifdef HAVE_PROC_SERVICE_H
- #include <proc_service.h>
-@@ -53,8 +54,6 @@
- #include <sys/procfs.h>
- #endif
-
--#include "gregset.h"
--
- /* Functions in this interface return one of these status codes. */
- typedef enum
- {
---
-2.8.1
-
diff --git a/meta-oe/recipes-kernel/crash/crash/0002-printk-use-committed-finalized-state-values.patch b/meta-oe/recipes-kernel/crash/crash/0002-printk-use-committed-finalized-state-values.patch
deleted file mode 100644
index 5213195c7d..0000000000
--- a/meta-oe/recipes-kernel/crash/crash/0002-printk-use-committed-finalized-state-values.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-From 71e159c64000467e94e08aefc144f5e1cdaa4aa0 Mon Sep 17 00:00:00 2001
-From: John Ogness <john.ogness@linutronix.de>
-Date: Wed, 25 Nov 2020 05:27:53 +0106
-Subject: [PATCH 2/2] printk: use committed/finalized state values
-
-An addendum to the previous crash commit a5531b24750e.
-The ringbuffer entries use 2 state values (committed and finalized)
-rather than a single flag to represent being available for reading.
-Copy the definitions and state lookup function directly from the
-kernel source and use the new states.
-
-Upstream-Status: Backport [https://github.com/crash-utility/crash/commit/71e159c64000467e94e08aefc144f5e1cdaa4aa0]
-
-Signed-off-by: John Ogness <john.ogness@linutronix.de>
-Signed-off-by: Nikolay Borisov <nborisov@suse.com>
-Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
----
- printk.c | 48 +++++++++++++++++++++++++++++++++++++++++-------
- 1 file changed, 41 insertions(+), 7 deletions(-)
-
-diff --git a/printk.c b/printk.c
-index f6d54ce..8658016 100644
---- a/printk.c
-+++ b/printk.c
-@@ -1,12 +1,6 @@
- #include "defs.h"
- #include <ctype.h>
-
--#define DESC_SV_BITS (sizeof(unsigned long) * 8)
--#define DESC_COMMITTED_MASK (1UL << (DESC_SV_BITS - 1))
--#define DESC_REUSE_MASK (1UL << (DESC_SV_BITS - 2))
--#define DESC_FLAGS_MASK (DESC_COMMITTED_MASK | DESC_REUSE_MASK)
--#define DESC_ID_MASK (~DESC_FLAGS_MASK)
--
- /* convenience struct for passing many values to helper functions */
- struct prb_map {
- char *prb;
-@@ -21,6 +15,44 @@ struct prb_map {
- char *text_data;
- };
-
-+/*
-+ * desc_state and DESC_* definitions taken from kernel source:
-+ *
-+ * kernel/printk/printk_ringbuffer.h
-+ */
-+
-+/* The possible responses of a descriptor state-query. */
-+enum desc_state {
-+ desc_miss = -1, /* ID mismatch (pseudo state) */
-+ desc_reserved = 0x0, /* reserved, in use by writer */
-+ desc_committed = 0x1, /* committed by writer, could get reopened */
-+ desc_finalized = 0x2, /* committed, no further modification allowed */
-+ desc_reusable = 0x3, /* free, not yet used by any writer */
-+};
-+
-+#define DESC_SV_BITS (sizeof(unsigned long) * 8)
-+#define DESC_FLAGS_SHIFT (DESC_SV_BITS - 2)
-+#define DESC_FLAGS_MASK (3UL << DESC_FLAGS_SHIFT)
-+#define DESC_STATE(sv) (3UL & (sv >> DESC_FLAGS_SHIFT))
-+#define DESC_ID_MASK (~DESC_FLAGS_MASK)
-+#define DESC_ID(sv) ((sv) & DESC_ID_MASK)
-+
-+/*
-+ * get_desc_state() taken from kernel source:
-+ *
-+ * kernel/printk/printk_ringbuffer.c
-+ */
-+
-+/* Query the state of a descriptor. */
-+static enum desc_state get_desc_state(unsigned long id,
-+ unsigned long state_val)
-+{
-+ if (id != DESC_ID(state_val))
-+ return desc_miss;
-+
-+ return DESC_STATE(state_val);
-+}
-+
- static void
- init_offsets(void)
- {
-@@ -74,6 +106,7 @@ dump_record(struct prb_map *m, unsigned long id, int msg_flags)
- unsigned short text_len;
- unsigned long state_var;
- unsigned int caller_id;
-+ enum desc_state state;
- unsigned char level;
- unsigned long begin;
- unsigned long next;
-@@ -90,7 +123,8 @@ dump_record(struct prb_map *m, unsigned long id, int msg_flags)
- /* skip non-committed record */
- state_var = ULONG(desc + OFFSET(prb_desc_state_var) +
- OFFSET(atomic_long_t_counter));
-- if ((state_var & DESC_FLAGS_MASK) != DESC_COMMITTED_MASK)
-+ state = get_desc_state(id, state_var);
-+ if (state != desc_committed && state != desc_finalized)
- return;
-
- info = m->infos + ((id % m->desc_ring_count) * SIZE(printk_info));
---
-2.17.1
-
diff --git a/meta-oe/recipes-kernel/crash/crash/0003-crash-detect-the-sysroot-s-glibc-header-file.patch b/meta-oe/recipes-kernel/crash/crash/0003-crash-detect-the-sysroot-s-glibc-header-file.patch
deleted file mode 100644
index 1f4bd01da4..0000000000
--- a/meta-oe/recipes-kernel/crash/crash/0003-crash-detect-the-sysroot-s-glibc-header-file.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From c7950ef5228adc52a500b4fc67d7e48c3c09c1df Mon Sep 17 00:00:00 2001
-From: Dengke Du <dengke.du@windriver.com>
-Date: Thu, 6 Apr 2017 23:02:44 -0400
-Subject: [PATCH 3/3] crash: detect the sysroot's glibc header file
-
-This is cross compile, so let the Makefile detect the sysroot's glibc
-header file, not the host's glibc header file.
-
-Upstream-Status: Pending
-
-Signed-off-by: Dengke Du <dengke.du@windriver.com>
----
- Makefile | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index b6b7e80..94f21a5 100644
---- a/Makefile
-+++ b/Makefile
-@@ -264,8 +264,8 @@ gdb_patch:
- if [ "${ARCH}" = "x86_64" ] && [ "${TARGET}" = "PPC64" ] && [ -f ${GDB}-ppc64le-support.patch ]; then \
- patch -d ${GDB} -p1 -F0 < ${GDB}-ppc64le-support.patch ; \
- fi
-- if [ -f /usr/include/proc_service.h ]; then \
-- grep 'extern ps_err_e ps_get_thread_area (struct' /usr/include/proc_service.h; \
-+ if [ -f ${RECIPE_SYSROOT}/usr/include/proc_service.h ]; then \
-+ grep 'extern ps_err_e ps_get_thread_area (struct' ${RECIPE_SYSROOT}/usr/include/proc_service.h; \
- if [ $$? -eq 0 ]; then \
- patch -p0 < ${GDB}-proc_service.h.patch; \
- fi; \
---
-2.8.1
-
diff --git a/meta-oe/recipes-kernel/crash/crash/7001force_define_architecture.patch b/meta-oe/recipes-kernel/crash/crash/7001force_define_architecture.patch
index 0d44c7f176..b5f97228de 100644
--- a/meta-oe/recipes-kernel/crash/crash/7001force_define_architecture.patch
+++ b/meta-oe/recipes-kernel/crash/crash/7001force_define_architecture.patch
@@ -1,3 +1,5 @@
+Upstream-Status: Pending
+
diff -uprN crash-5.1.8.org/configure.c crash-5.1.8/configure.c
--- crash-5.1.8.org/configure.c 2011-09-17 04:01:12.000000000 +0900
+++ crash-5.1.8/configure.c 2012-09-13 13:28:45.393344108 +0900
diff --git a/meta-oe/recipes-kernel/crash/crash/7003cross_ranlib.patch b/meta-oe/recipes-kernel/crash/crash/7003cross_ranlib.patch
index d567fa0a82..2d01453059 100644
--- a/meta-oe/recipes-kernel/crash/crash/7003cross_ranlib.patch
+++ b/meta-oe/recipes-kernel/crash/crash/7003cross_ranlib.patch
@@ -1,8 +1,21 @@
---- crash-5.1.8/Makefile.orig 2011-12-27 11:21:58.220652105 +0900
-+++ crash-5.1.8/Makefile 2011-12-27 11:22:29.563651593 +0900
-@@ -285,6 +285,7 @@
+From 2f200ceed289f935b5e7ec230454a22dd76e42b0 Mon Sep 17 00:00:00 2001
+From: leimaohui <leimaohui@cn.fujitsu.com>
+Date: Mon, 12 Jan 2015 11:52:35 +0800
+Subject: [PATCH] crash: add new recipe
+
+---
+Upstream-Status: Pending
+
+ Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile b/Makefile
+index 79aef176..7266e305 100644
+--- a/Makefile
++++ b/Makefile
+@@ -295,6 +295,7 @@ gdb_patch:
- library: make_build_data ${OBJECT_FILES}
+ library: ${OBJECT_FILES}
ar -rs ${PROGRAM}lib.a ${OBJECT_FILES}
+ ${RANLIB} ${PROGRAM}lib.a
diff --git a/meta-oe/recipes-kernel/crash/crash/config-site.crash-7.0.9 b/meta-oe/recipes-kernel/crash/crash/config-site.crash-7.0.9
deleted file mode 100644
index d6fc22fb34..0000000000
--- a/meta-oe/recipes-kernel/crash/crash/config-site.crash-7.0.9
+++ /dev/null
@@ -1 +0,0 @@
-bash_cv_have_mbstate_t=yes
diff --git a/meta-oe/recipes-kernel/crash/crash/donnot-extract-gdb-during-do-compile.patch b/meta-oe/recipes-kernel/crash/crash/donnot-extract-gdb-during-do-compile.patch
index e254fe8772..16382877d0 100644
--- a/meta-oe/recipes-kernel/crash/crash/donnot-extract-gdb-during-do-compile.patch
+++ b/meta-oe/recipes-kernel/crash/crash/donnot-extract-gdb-during-do-compile.patch
@@ -1,32 +1,45 @@
+From 8b882650b730cb6e025d47d65574f43549b7a1a3 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+Date: Thu, 9 Mar 2023 10:28:28 +0800
+Subject: [PATCH] Makefile: Put gdb source tarball in SRC_URI
+
Put gdb source tarball in SRC_URI and don't fetch and extract it during
do_compile.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Kai Kang <kai.kang@windriver.com>
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
+ Makefile | 8 +-------
+ 1 file changed, 1 insertion(+), 7 deletions(-)
+
diff --git a/Makefile b/Makefile
-index bb0a34e..5eb7604 100644
+index 79aef17..146da6a 100644
--- a/Makefile
+++ b/Makefile
-@@ -226,7 +226,7 @@ all: make_configure
- # @make --no-print-directory extensions
+@@ -254,7 +254,7 @@ all: make_configure
+ # @$(MAKE) extensions
gdb_merge: force
- @if [ ! -f ${GDB}/README ]; then \
+ @if [ ! -f ${GDB}/${GDB}.patch ]; then \
- make --no-print-directory gdb_unzip; fi
+ $(MAKE) gdb_unzip; fi
@echo "${LDFLAGS} -lz -ldl -rdynamic" > ${GDB}/gdb/mergelibs
@echo "../../${PROGRAM} ../../${PROGRAM}lib.a" > ${GDB}/gdb/mergeobj
-@@ -253,11 +253,6 @@ gdb_unzip:
+@@ -281,12 +281,6 @@ gdb_unzip:
@rm -f gdb.files
@for FILE in ${GDB_FILES} dummy; do\
echo $$FILE >> gdb.files; done
- @if [ ! -f ${GDB}.tar.gz ] && [ ! -f /usr/bin/wget ]; then \
- echo /usr/bin/wget is required to download ${GDB}.tar.gz; echo; exit 1; fi
- @if [ ! -f ${GDB}.tar.gz ] && [ -f /usr/bin/wget ]; then \
-- wget http://ftp.gnu.org/gnu/gdb/${GDB}.tar.gz; fi
-- @tar --exclude-from gdb.files -xvzmf ${GDB}.tar.gz
- @make --no-print-directory gdb_patch
+- [ ! -t 2 ] && WGET_OPTS="--progress=dot:mega"; \
+- wget $$WGET_OPTS http://ftp.gnu.org/gnu/gdb/${GDB}.tar.gz; fi
+- @tar --exclude-from gdb.files -xzmf ${GDB}.tar.gz
+ @$(MAKE) gdb_patch
gdb_patch:
+--
+2.25.1
+
diff --git a/meta-oe/recipes-kernel/crash/crash/gdb_build_jobs_and_not_write_crash_target.patch b/meta-oe/recipes-kernel/crash/crash/gdb_build_jobs_and_not_write_crash_target.patch
index aa5f44dd42..257b4dd2bf 100644
--- a/meta-oe/recipes-kernel/crash/crash/gdb_build_jobs_and_not_write_crash_target.patch
+++ b/meta-oe/recipes-kernel/crash/crash/gdb_build_jobs_and_not_write_crash_target.patch
@@ -1,3 +1,8 @@
+From af49d8df559aa18f97d14ab7971f211238a16041 Mon Sep 17 00:00:00 2001
+From: Mingli Yu <mingli.yu@windriver.com>
+Date: Thu, 9 Mar 2023 10:50:10 +0800
+Subject: [PATCH] Makefile: Don't write ${TARGET} to crash.target
+
This enables parallel building (multiple jobs in gdb) by reading the
value from GDB_MAKE_JOBS.
@@ -8,19 +13,26 @@ Upstream-Status: Pending
Don't write ${TARGET} to crash.target which causes rebuild fails.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
+Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
diff --git a/Makefile b/Makefile
-index 27a1d47..bcf2d2f 100644
+index cd25c7d..d61c4c5 100644
--- a/Makefile
+++ b/Makefile
-@@ -232,8 +232,8 @@ gdb_merge: force
+@@ -262,8 +262,8 @@ gdb_merge: force
@if [ ! -f ${GDB}/config.status ]; then \
(cd ${GDB}; ./configure --host=${GDB_TARGET} --build=${GDB_HOST} --with-separate-debug-dir=/usr/lib/debug \
--with-bugurl="" --with-expat=no --with-python=no --disable-sim; \
-- make --no-print-directory CRASH_TARGET=${TARGET}; echo ${TARGET} > crash.target) \
-- else make --no-print-directory rebuild; fi
-+ make --no-print-directory CRASH_TARGET=${TARGET} ${GDB_MAKE_JOBS}; ) \
-+ else make --no-print-directory ${GDB_MAKE_JOBS} rebuild; fi
+- $(MAKE) CRASH_TARGET=${TARGET}; echo ${TARGET} > crash.target) \
+- else $(MAKE) rebuild; fi
++ $(MAKE) CRASH_TARGET=${TARGET} ${GDB_MAKE_JOBS}; ) \
++ else $(MAKE) ${GDB_MAKE_JOBS} rebuild; fi
@if [ ! -f ${PROGRAM} ]; then \
echo; echo "${PROGRAM} build failed"; \
echo; exit 1; fi
+--
+2.25.1
+
diff --git a/meta-oe/recipes-kernel/crash/crash/remove-unrecognized-gcc-option-m32-for-mips.patch b/meta-oe/recipes-kernel/crash/crash/remove-unrecognized-gcc-option-m32-for-mips.patch
deleted file mode 100644
index 905b4c2cd0..0000000000
--- a/meta-oe/recipes-kernel/crash/crash/remove-unrecognized-gcc-option-m32-for-mips.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-Upstream-Status: Pending
-
-It fails to build crash for mips with error:
-
-| mips-wrs-linux-gcc: error: unrecognized command line option '-m32'
-| Makefile:291: recipe for target 'make_build_data' failed
-
-So remove the unrecognized option '-m32' for mips.
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
----
-diff --git a/configure.c b/configure.c
-index cf1973b..71e97b3 100644
---- a/configure.c
-+++ b/configure.c
-@@ -151,7 +151,7 @@ void add_extra_lib(char *);
- #define TARGET_CFLAGS_PPC64_ON_X86_64 "TARGET_CFLAGS="
- #define TARGET_CFLAGS_MIPS "TARGET_CFLAGS=-D_FILE_OFFSET_BITS=64"
- #define TARGET_CFLAGS_MIPS_ON_X86 "TARGET_CFLAGS=-D_FILE_OFFSET_BITS=64"
--#define TARGET_CFLAGS_MIPS_ON_X86_64 "TARGET_CFLAGS=-m32 -D_FILE_OFFSET_BITS=64"
-+#define TARGET_CFLAGS_MIPS_ON_X86_64 "TARGET_CFLAGS=-D_FILE_OFFSET_BITS=64"
- #define TARGET_CFLAGS_SPARC64 "TARGET_CFLAGS="
-
- #define GDB_TARGET_DEFAULT "GDB_CONF_FLAGS="
-@@ -162,7 +162,7 @@ void add_extra_lib(char *);
- #define GDB_TARGET_ARM64_ON_X86_64 "GDB_CONF_FLAGS=--target=aarch64-elf-linux" /* TBD */
- #define GDB_TARGET_PPC64_ON_X86_64 "GDB_CONF_FLAGS=--target=powerpc64le-unknown-linux-gnu"
- #define GDB_TARGET_MIPS_ON_X86 "GDB_CONF_FLAGS=--target=mipsel-elf-linux"
--#define GDB_TARGET_MIPS_ON_X86_64 "GDB_CONF_FLAGS=--target=mipsel-elf-linux CFLAGS=-m32"
-+#define GDB_TARGET_MIPS_ON_X86_64 "GDB_CONF_FLAGS=--target=mipsel-elf-linux"
-
- /*
- * The original plan was to allow the use of a particular version
diff --git a/meta-oe/recipes-kernel/crash/crash/sim-common-sim-arange-fix-extern-inline-handling.patch b/meta-oe/recipes-kernel/crash/crash/sim-common-sim-arange-fix-extern-inline-handling.patch
deleted file mode 100644
index 0185b57045..0000000000
--- a/meta-oe/recipes-kernel/crash/crash/sim-common-sim-arange-fix-extern-inline-handling.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-Upstream-Status: Backport
-
-https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=92fc615
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
-From 92fc6153a6fdf2a027d9780f5945712aafad4a9e Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Sun, 29 Mar 2015 15:59:01 -0400
-Subject: [PATCH] sim: common: sim-arange: fix extern inline handling
-
-With newer versions of gcc (5.x), the extern inline we're using with the
-sim-arange module no longer works. Since this code really wants the gnu
-inline semantics, use that attribute explicitly.
-
-Reported-by: DJ Delorie <dj@redhat.com>
-Reported-by: Joel Sherrill <joel.sherrill@oarcorp.com>
----
- gdb-7.6/sim/common/sim-arange.h | 20 ++++++++++++--------
- gdb-7.6/sim/common/sim-inline.h | 4 +++-
- 2 files changed, 15 insertions(+), 9 deletions(-)
-
-diff --git a/gdb-7.6/sim/common/sim-arange.h b/gdb-7.6/sim/common/sim-arange.h
-index 73117f3..de842c9 100644
---- a/gdb-7.6/sim/common/sim-arange.h
-+++ b/gdb-7.6/sim/common/sim-arange.h
-@@ -60,22 +60,26 @@ extern void sim_addr_range_delete (ADDR_RANGE * /*ar*/,
- address_word /*start*/,
- address_word /*end*/);
-
-+/* TODO: This should get moved into sim-inline.h. */
-+#ifdef HAVE_INLINE
-+#ifdef SIM_ARANGE_C
-+#define SIM_ARANGE_INLINE INLINE
-+#else
-+#define SIM_ARANGE_INLINE EXTERN_INLINE
-+#endif
-+#else
-+#define SIM_ARANGE_INLINE EXTERN
-+#endif
-+
- /* Return non-zero if ADDR is in range AR, traversing the entire tree.
- If no range is specified, that is defined to mean "everything". */
--extern INLINE int
-+SIM_ARANGE_INLINE int
- sim_addr_range_hit_p (ADDR_RANGE * /*ar*/, address_word /*addr*/);
- #define ADDR_RANGE_HIT_P(ar, addr) \
- ((ar)->range_tree == NULL || sim_addr_range_hit_p ((ar), (addr)))
-
- #ifdef HAVE_INLINE
--#ifdef SIM_ARANGE_C
--#define SIM_ARANGE_INLINE INLINE
--#else
--#define SIM_ARANGE_INLINE EXTERN_INLINE
--#endif
- #include "sim-arange.c"
--#else
--#define SIM_ARANGE_INLINE
- #endif
- #define SIM_ARANGE_C_INCLUDED
-
-diff --git a/gdb-7.6/sim/common/sim-inline.h b/gdb-7.6/sim/common/sim-inline.h
-index af75562..8a9c286 100644
---- a/gdb-7.6/sim/common/sim-inline.h
-+++ b/gdb-7.6/sim/common/sim-inline.h
-@@ -303,7 +303,9 @@
- /* ??? Temporary, pending decision to always use extern inline and do a vast
- cleanup of inline support. */
- #ifndef INLINE2
--#if defined (__GNUC__)
-+#if defined (__GNUC_GNU_INLINE__) || defined (__GNUC_STDC_INLINE__)
-+#define INLINE2 __inline__ __attribute__ ((__gnu_inline__))
-+#elif defined (__GNUC__)
- #define INLINE2 __inline__
- #else
- #define INLINE2 /*inline*/
---
-2.6.1
-
diff --git a/meta-oe/recipes-kernel/crash/crash/sim-ppc-drop-LIBS-from-psim-dependency.patch b/meta-oe/recipes-kernel/crash/crash/sim-ppc-drop-LIBS-from-psim-dependency.patch
deleted file mode 100644
index 77a287f146..0000000000
--- a/meta-oe/recipes-kernel/crash/crash/sim-ppc-drop-LIBS-from-psim-dependency.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Upstream-Status: Backport
-
-https://sourceware.org/git/?p=binutils-gdb.git;h=0d8a6ab
-
-Signed-off-by: Kai Kang <kai.kang@windriver.com>
----
-From 0d8a6ab7d39d28fb1557e2a62e9e4b336341ab34 Mon Sep 17 00:00:00 2001
-From: Aaro Koskinen <aaro.koskinen@iki.fi>
-Date: Mon, 17 Feb 2014 17:12:59 -0500
-Subject: [PATCH] sim: ppc: drop $(LIBS) from psim dependency
-
-When cross-compiling GDB for PPC, there's a prerequisite "-lz" for psim
-that results in a build failure. With such prerequisite, GNU Make will
-try to search the library from build machine's /usr/lib which is wrong.
-On 64-bit Linux build machines the compilation will fail because of this.
-
-URL: https://sourceware.org/bugzilla/show_bug.cgi?id=12202
----
- sim/ppc/Makefile.in | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/gdb-7.6/sim/ppc/Makefile.in b/gdb-7.6/sim/ppc/Makefile.in
-index b811f6f..740bdb0 100644
---- a/gdb-7.6/sim/ppc/Makefile.in
-+++ b/gdb-7.6/sim/ppc/Makefile.in
-@@ -552,7 +552,7 @@ PACKAGE_SRC = @sim_pk_src@
- PACKAGE_OBJ = @sim_pk_obj@
-
-
--psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBS) $(LIBINTL_DEP)
-+psim: $(TARGETLIB) main.o $(LIBIBERTY_LIB) $(BFD_LIB) $(LIBINTL_DEP)
- $(CC) $(CFLAGS) $(SIM_CFLAGS) $(LDFLAGS) -o psim$(EXEEXT) main.o $(TARGETLIB) $(BFD_LIB) $(LIBINTL) $(LIBIBERTY_LIB) $(LIBS)
-
- run: psim
---
-1.9.4
-
diff --git a/meta-oe/recipes-kernel/crash/crash_8.0.4.bb b/meta-oe/recipes-kernel/crash/crash_8.0.4.bb
new file mode 100644
index 0000000000..1af90978e0
--- /dev/null
+++ b/meta-oe/recipes-kernel/crash/crash_8.0.4.bb
@@ -0,0 +1,28 @@
+require crash.inc
+
+
+BBCLASSEXTEND = "native cross"
+
+EXTRA_OEMAKE:class-cross = 'RPMPKG="${PV}" \
+ GDB_TARGET="${BUILD_SYS} --target=${TARGET_SYS}" \
+ GDB_HOST="${BUILD_SYS}" \
+ GDB_MAKE_JOBS="${PARALLEL_MAKE}" \
+ '
+
+EXTRA_OEMAKE:append:class-native = " LDFLAGS='${BUILD_LDFLAGS}'"
+EXTRA_OEMAKE:append:class-cross = " LDFLAGS='${BUILD_LDFLAGS}'"
+
+do_install:class-target () {
+ oe_runmake DESTDIR=${D} install
+}
+
+do_install:class-native () {
+ oe_runmake DESTDIR=${D}${STAGING_DIR_NATIVE} install
+}
+
+do_install:class-cross () {
+ install -m 0755 ${S}/crash ${D}/${bindir}
+}
+
+RDEPENDS:${PN}:class-native = ""
+RDEPENDS:${PN}:class-cross = ""