Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,34 @@
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] cross_add_configure_option
---
Upstream-Status: Pending
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 7266e305..390fc0ef 100644
--- a/Makefile
+++ b/Makefile
@@ -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) CRASH_TARGET=${TARGET}; echo ${TARGET} > crash.target) \
else $(MAKE) rebuild; fi
@@ -306,7 +306,7 @@ force:
make_configure: force
@rm -f configure
- @${CC} ${CONF_FLAGS} -o configure configure.c ${WARNING_ERROR} ${WARNING_OPTIONS}
+ @${BUILD_CC} ${CONF_FLAGS} -o configure configure.c ${WARNING_ERROR} ${WARNING_OPTIONS}
clean: make_configure
@./configure ${CONF_TARGET_FLAG} -q -b
@@ -0,0 +1,69 @@
From 4ee56105881d7bb1da1e668ac5bb47a4e0846676 Mon Sep 17 00:00:00 2001
From: Lianbo Jiang <lijiang@redhat.com>
Date: Wed, 5 Jul 2023 10:02:59 +0800
Subject: [PATCH] Fix compilation error due to new strlcpy function that glibc
added
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The crash-utility has its own strlcpy(), but recently the latest glibc
has also implemented the strlcpy function, which is derived from
OpenBSD. Eventually this caused the following compilation error:
# make -j8 lzo
...
In file included from global_data.c:18:
defs.h:5556:8: error: conflicting types for strlcpy; have size_t(char *, char *, size_t) {aka long unsigned int(char *, char *, long unsigned int)}
5556 | size_t strlcpy(char *, char *, size_t);
| ^~~~~~~
In file included from memory.c:19:
defs.h:5556:8: error: conflicting types for strlcpy; have size_t(char *, char *, size_t) {aka long unsigned int(char *, char *, long unsigned int)}
5556 | size_t strlcpy(char *, char *, size_t);
| ^~~~~~~
...
To fix the issue, let's declare the strlcpy() as a weak function and
keep the same parameter types as the glibc function has.
Related glibc commits:
454a20c8756c ("Implement strlcpy and strlcat [BZ #178]")
d2fda60e7c40 ("manual: Manual update for strlcat, strlcpy, wcslcat, wclscpy")
388ae538ddcb ("hurd: Add strlcpy, strlcat, wcslcpy, wcslcat to libc.abilist")
Upstream-Status: Backport [https://github.com/kraj/crash/commit/4ee56105881d7bb1da1e668ac5bb47a4e0846676]
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
---
defs.h | 2 +-
tools.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/defs.h b/defs.h
index 8f7d1fa..26afe23 100644
--- a/defs.h
+++ b/defs.h
@@ -5553,7 +5553,7 @@ uint32_t swap32(uint32_t, int);
uint64_t swap64(uint64_t, int);
ulong *get_cpumask_buf(void);
int make_cpumask(char *, ulong *, int, int *);
-size_t strlcpy(char *, char *, size_t);
+size_t strlcpy(char *, const char *, size_t) __attribute__ ((__weak__));
struct rb_node *rb_first(struct rb_root *);
struct rb_node *rb_parent(struct rb_node *, struct rb_node *);
struct rb_node *rb_right(struct rb_node *, struct rb_node *);
diff --git a/tools.c b/tools.c
index 392a797..0f2db10 100644
--- a/tools.c
+++ b/tools.c
@@ -6795,7 +6795,7 @@ make_cpumask_error:
* always be NULL-terminated.
*/
size_t
-strlcpy(char *dest, char *src, size_t size)
+strlcpy(char *dest, const char *src, size_t size)
{
size_t ret = strlen(src);
--
2.41.0
@@ -0,0 +1,15 @@
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
@@ -391,6 +391,9 @@ get_current_configuration(struct support
arch_mismatch(sp);
}
+ /** Force define archtecture */
+ target_data.target = FORCE_DEFINE_ARCH;
+
if ((fp = fopen("Makefile", "r")) == NULL) {
perror("Makefile");
goto get_release;
@@ -0,0 +1,23 @@
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: ${OBJECT_FILES}
ar -rs ${PROGRAM}lib.a ${OBJECT_FILES}
+ ${RANLIB} ${PROGRAM}lib.a
gdb: force
rm -f ${GDB_OFILES}
@@ -0,0 +1 @@
bash_cv_have_mbstate_t=yes
@@ -0,0 +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 79aef17..146da6a 100644
--- a/Makefile
+++ b/Makefile
@@ -254,7 +254,7 @@ all: make_configure
# @$(MAKE) extensions
gdb_merge: force
- @if [ ! -f ${GDB}/README ]; then \
+ @if [ ! -f ${GDB}/${GDB}.patch ]; then \
$(MAKE) gdb_unzip; fi
@echo "${LDFLAGS} -lz -ldl -rdynamic" > ${GDB}/gdb/mergelibs
@echo "../../${PROGRAM} ../../${PROGRAM}lib.a" > ${GDB}/gdb/mergeobj
@@ -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 \
- [ ! -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
@@ -0,0 +1,38 @@
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.
Signed-off-by: Amy Fong <amy.fong@windriver.com>
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 cd25c7d..d61c4c5 100644
--- a/Makefile
+++ b/Makefile
@@ -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) 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
@@ -0,0 +1,114 @@
SUMMARY = "Kernel analysis utility for live systems, netdump, diskdump, kdump, LKCD or mcore dumpfiles"
DESCRIPTION = "The core analysis suite is a self-contained tool that can be used to\
investigate either live systems, kernel core dumps created from the\
netdump, diskdump and kdump packages from Red Hat Linux, the mcore kernel patch\
offered by Mission Critical Linux, or the LKCD kernel patch."
HOMEPAGE = "http://people.redhat.com/anderson"
SECTION = "devel"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://COPYING3;md5=d32239bcb673463ab874e80d47fae504"
DEPENDS = "zlib readline coreutils-native ncurses-native"
S = "${WORKDIR}/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://donnot-extract-gdb-during-do-compile.patch \
file://gdb_build_jobs_and_not_write_crash_target.patch \
file://0001-make-src-string-const-in-strlcpy.patch \
"
SRCREV = "f1cd581d1c4afa5b8ffdfaa6a3ea9f545fe4ec91"
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}"
# 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"
EXTRA_OEMAKE = 'RPMPKG="${PV}" \
GDB_TARGET="${TARGET_SYS}" \
GDB_HOST="${BUILD_SYS}" \
GDB_MAKE_JOBS="${PARALLEL_MAKE}" \
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() {
case ${TARGET_ARCH} in
aarch64*) ARCH=ARM64 ;;
arm*) ARCH=ARM ;;
i*86*) ARCH=X86 ;;
x86_64*) ARCH=X86_64 ;;
powerpc64*) ARCH=PPC64 ;;
powerpc*) ARCH=PPC ;;
mips*) ARCH=MIPS ;;
esac
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
}
do_compile() {
oe_runmake ${EXTRA_OEMAKE} RECIPE_SYSROOT=${RECIPE_SYSROOT}
}
do_install:prepend () {
install -d ${D}${bindir}
install -d ${D}/${mandir}/man8
install -d ${D}${includedir}/crash
install -m 0644 ${S}/crash.8 ${D}/${mandir}/man8/
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 = ""
# 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'