Projects
openEuler:Mainline
crash
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 6
View file
_service:tar_scm:crash.spec
Changed
@@ -1,6 +1,6 @@ Name: crash Version: 8.0.2 -Release: 1 +Release: 2 Summary: Linux kernel crash utility. License: GPLv3 URL: https://crash-utility.github.io @@ -13,6 +13,9 @@ Patch3: 0002-crash-8.0.2-sw.patch %endif Patch4: 0003-arm64-fix-backtraces-of-KASAN-kernel-dumpfile-truncated.patch +%ifarch riscv64 +Patch5: 0004-riscv-support.patch +%endif BuildRequires: ncurses-devel zlib-devel lzo-devel snappy-devel texinfo libzstd-devel BuildRequires: gcc gcc-c++ bison m4 @@ -78,6 +81,9 @@ %{_mandir}/man8/crash.8* %changelog +* Fri Jul 7 2023 EastDong <xudong23@iscas.ac.cn> - 8.0.2-2 +- add riscv64 support + * Sun Jan 29 2023 chenhaixiang<chenhaixiang3@huawei.com> - 8.0.2-1 - update to crash-8.0.2
View file
_service:tar_scm:0004-riscv-support.patch
Added
@@ -0,0 +1,2820 @@ +From f45a2a59119c9a2dda0ab7f58d61f5ea64589411 Mon Sep 17 00:00:00 2001 +From: Xianting Tian <xianting.tian@linux.alibaba.com> +Date: Thu, 20 Oct 2022 09:50:06 +0800 +Subject: PATCH 1/9 Add RISCV64 framework code support + +This patch mainly added some environment configurations, macro definitions, +specific architecture structures and some function declarations supported +by the RISCV64 architecture. + +We can use the build command to get the simplest version crash tool: + make target=RISCV64 -j2 + +Co-developed-by: Lifang Xia <lifang_xia@linux.alibaba.com> +Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com> +--- + Makefile | 7 +- + README | 6 +- + configure.c | 43 ++++++++++++- + defs.h | 154 +++++++++++++++++++++++++++++++++++++++++++- + diskdump.c | 11 +++- + help.c | 6 +- + lkcd_vmdump_v1.h | 8 +-- + lkcd_vmdump_v2_v3.h | 8 +-- + netdump.c | 9 ++- + ramdump.c | 2 + + riscv64.c | 54 ++++++++++++++++ + symbols.c | 10 +++ + 12 files changed, 294 insertions(+), 24 deletions(-) + create mode 100644 riscv64.c + +diff --git a/Makefile b/Makefile +index 79aef17..1506dd4 100644 +--- a/Makefile ++++ b/Makefile +@@ -64,7 +64,7 @@ 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 mips64.c sparc64.c \ ++ arm.c arm64.c mips.c mips64.c riscv64.c sparc64.c \ + extensions.c remote.c va_server.c va_server_v1.c symbols.c cmdline.c \ + lkcd_common.c lkcd_v1.c lkcd_v2_v3.c lkcd_v5.c lkcd_v7.c lkcd_v8.c\ + lkcd_fix_mem.c s390_dump.c lkcd_x86_trace.c \ +@@ -84,7 +84,7 @@ 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 mips64.o sparc64.o \ ++ arm.o arm64.o mips.o mips64.o riscv64.o sparc64.o \ + extensions.o remote.o va_server.o va_server_v1.o symbols.o cmdline.o \ + lkcd_common.o lkcd_v1.o lkcd_v2_v3.o lkcd_v5.o lkcd_v7.o lkcd_v8.o \ + lkcd_fix_mem.o s390_dump.o netdump.o diskdump.o makedumpfile.o xendump.o \ +@@ -438,6 +438,9 @@ mips.o: ${GENERIC_HFILES} ${REDHAT_HFILES} mips.c + mips64.o: ${GENERIC_HFILES} ${REDHAT_HFILES} mips64.c + ${CC} -c ${CRASH_CFLAGS} mips64.c ${WARNING_OPTIONS} ${WARNING_ERROR} + ++riscv64.o: ${GENERIC_HFILES} ${REDHAT_HFILES} riscv64.c ++ ${CC} -c ${CRASH_CFLAGS} riscv64.c ${WARNING_OPTIONS} ${WARNING_ERROR} ++ + sparc64.o: ${GENERIC_HFILES} ${REDHAT_HFILES} sparc64.c + ${CC} -c ${CRASH_CFLAGS} sparc64.c ${WARNING_OPTIONS} ${WARNING_ERROR} + +diff --git a/README b/README +index 1f98fbf..9850a29 100644 +--- a/README ++++ b/README +@@ -37,8 +37,8 @@ + These are the current prerequisites: + + o At this point, x86, ia64, x86_64, ppc64, ppc, arm, arm64, alpha, mips, +- mips64, s390 and s390x-based kernels are supported. Other architectures +- may be addressed in the future. ++ mips64, riscv64, s390 and s390x-based kernels are supported. Other ++ architectures may be addressed in the future. + + o One size fits all -- the utility can be run on any Linux kernel version + version dating back to 2.2.5-15. A primary design goal is to always +@@ -98,6 +98,8 @@ + arm64 dumpfiles may be built by typing "make target=ARM64". + o On an x86_64 host, an x86_64 binary that can be used to analyze + ppc64le dumpfiles may be built by typing "make target=PPC64". ++ o On an x86_64 host, an x86_64 binary that can be used to analyze ++ riscv64 dumpfiles may be built by typing "make target=RISCV64". + + Traditionally when vmcores are compressed via the makedumpfile(8) facility + the libz compression library is used, and by default the crash utility +diff --git a/configure.c b/configure.c +index 5188851..08b52be 100644 +--- a/configure.c ++++ b/configure.c +@@ -107,6 +107,7 @@ void add_extra_lib(char *); + #undef MIPS + #undef SPARC64 + #undef MIPS64 ++#undef RISCV64 + + #define UNKNOWN 0 + #define X86 1 +@@ -122,6 +123,7 @@ void add_extra_lib(char *); + #define MIPS 11 + #define SPARC64 12 + #define MIPS64 13 ++#define RISCV64 14 + + #define TARGET_X86 "TARGET=X86" + #define TARGET_ALPHA "TARGET=ALPHA" +@@ -136,6 +138,7 @@ void add_extra_lib(char *); + #define TARGET_MIPS "TARGET=MIPS" + #define TARGET_MIPS64 "TARGET=MIPS64" + #define TARGET_SPARC64 "TARGET=SPARC64" ++#define TARGET_RISCV64 "TARGET=RISCV64" + + #define TARGET_CFLAGS_X86 "TARGET_CFLAGS=-D_FILE_OFFSET_BITS=64" + #define TARGET_CFLAGS_ALPHA "TARGET_CFLAGS=" +@@ -158,6 +161,8 @@ void add_extra_lib(char *); + #define TARGET_CFLAGS_MIPS_ON_X86_64 "TARGET_CFLAGS=-m32 -D_FILE_OFFSET_BITS=64" + #define TARGET_CFLAGS_MIPS64 "TARGET_CFLAGS=" + #define TARGET_CFLAGS_SPARC64 "TARGET_CFLAGS=" ++#define TARGET_CFLAGS_RISCV64 "TARGET_CFLAGS=" ++#define TARGET_CFLAGS_RISCV64_ON_X86_64 "TARGET_CFLAGS=" + + #define GDB_TARGET_DEFAULT "GDB_CONF_FLAGS=" + #define GDB_TARGET_ARM_ON_X86 "GDB_CONF_FLAGS=--target=arm-elf-linux" +@@ -168,6 +173,7 @@ void add_extra_lib(char *); + #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 CXXFLAGS=-m32" ++#define GDB_TARGET_RISCV64_ON_X86_64 "GDB_CONF_FLAGS=--target=riscv64-unknown-linux-gnu" + + /* + * The original plan was to allow the use of a particular version +@@ -404,6 +410,9 @@ get_current_configuration(struct supported_gdb_version *sp) + #ifdef __sparc_v9__ + target_data.target = SPARC64; + #endif ++#if defined(__riscv) && (__riscv_xlen == 64) ++ target_data.target = RISCV64; ++#endif + + set_initial_target(sp); + +@@ -457,6 +466,12 @@ get_current_configuration(struct supported_gdb_version *sp) + if ((target_data.initial_gdb_target != UNKNOWN) && + (target_data.host != target_data.initial_gdb_target)) + arch_mismatch(sp); ++ } else if ((target_data.target == X86_64) && ++ (name_to_target((char *)target_data.target_as_param) == RISCV64)) { ++ /* ++ * Build an RISCV64 crash binary on an X86_64 host. ++ */ ++ target_data.target = RISCV64; + } else { + fprintf(stderr, + "\ntarget=%s is not supported on the %s host architecture\n\n", +@@ -497,6 +512,14 @@ get_current_configuration(struct supported_gdb_version *sp) + (target_data.target != MIPS64)) + arch_mismatch(sp); + ++ if ((target_data.initial_gdb_target == RISCV64) && ++ (target_data.target != RISCV64)) { ++ if (target_data.target == X86_64) ++ target_data.target = RISCV64; ++ else ++ arch_mismatch(sp); ++ } ++ + if ((target_data.initial_gdb_target == X86) && + (target_data.target != X86)) { + if (target_data.target == X86_64) +@@ -660,6 +683,9 @@ show_configuration(void) + case SPARC64: + printf("TARGET: SPARC64\n"); + break; ++ case RISCV64: ++ printf("TARGET: RISCV64\n"); ++ break; + } + + if (strlen(target_data.program)) { +@@ -777,6 +803,14 @@ build_configure(struct supported_gdb_version *sp) + target = TARGET_SPARC64; + target_CFLAGS = TARGET_CFLAGS_SPARC64; + break; ++ case RISCV64: ++ target = TARGET_RISCV64; ++ if (target_data.host == X86_64) { ++ target_CFLAGS = TARGET_CFLAGS_RISCV64_ON_X86_64; ++ gdb_conf_flags = GDB_TARGET_RISCV64_ON_X86_64; ++ } else ++ target_CFLAGS = TARGET_CFLAGS_RISCV64; ++ break; + } + + ldflags = get_extra_flags("LDFLAGS.extra", NULL); +@@ -1374,7 +1408,7 @@ make_spec_file(struct supported_gdb_version *sp) + printf("Vendor: Red Hat, Inc.\n"); + printf("Packager: Dave Anderson <anderson@redhat.com>\n"); + printf("ExclusiveOS: Linux\n"); +- printf("ExclusiveArch: %%{ix86} alpha ia64 ppc ppc64 ppc64pseries ppc64iseries x86_64 s390 s390x arm aarch64 ppc64le mips mipsel mips64el sparc64\n");
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2