diff --git a/0002-fix-build-error-on-loongarch64.patch b/0002-fix-build-error-on-loongarch64.patch new file mode 100644 index 0000000000000000000000000000000000000000..f606cb2132b6ca47a4749680166c879b201615ec --- /dev/null +++ b/0002-fix-build-error-on-loongarch64.patch @@ -0,0 +1,45 @@ +From 755743785892c3030674586ba84c0ad3de224b97 Mon Sep 17 00:00:00 2001 +From: Jingyun Hua +Date: Thu, 20 Jul 2023 02:46:28 +0000 +Subject: [PATCH] fix build error on loongarch64 + +--- + machines.h | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/machines.h b/machines.h +index 4472bd1..3e184d5 100644 +--- a/machines.h ++++ b/machines.h +@@ -90,23 +90,23 @@ static inline int is_breakpoint(pid_t pid, uintptr_t address) + #elif defined(MLX_LOONGARCH64) + static inline uintptr_t call_return_address(pid_t pid, registers_info_t *regs) + { +- return ptrace_get_data(pid, regs->gpr[3]); ++ return ptrace_get_data(pid, regs->regs[3]); + } + static inline uintptr_t call_return_value(registers_info_t *regs) + { +- return regs->gpr[1]; ++ return regs->regs[1]; + } + static inline uintptr_t call_arg1(pid_t pid, registers_info_t *regs) + { +- return regs->gpr[6]; ++ return regs->regs[6]; + } + static inline uintptr_t call_arg2(pid_t pid, registers_info_t *regs) + { +- return regs->gpr[7]; ++ return regs->regs[7]; + } + static inline uintptr_t pc_unwind(pid_t pid, registers_info_t *regs) + { +- return regs->pc; ++ return regs->csr_era; + } + static inline void set_breakpoint(pid_t pid, uintptr_t address, uintptr_t code) + { +-- +2.33.0 + diff --git a/memleax.spec b/memleax.spec index d2aee0d483d944ed864f9491a9f240b34c3d00d7..b1379e2237dc12d631e1fb9f24073ddfb8884991 100644 --- a/memleax.spec +++ b/memleax.spec @@ -1,11 +1,12 @@ Name: memleax Version: 1.1.1 -Release: 6 +Release: 7 Summary: Memory lead detection tool License: GPLv2 URL: https://github.com/WuBingzheng/memleax Source0: https://github.com/WuBingzheng/memleax/archive/v%{version}.tar.gz#/memleax-%{version}.tar.gz Patch0: 0001-add-loongarch64-support.patch +Patch1: 0002-fix-build-error-on-loongarch64.patch BuildRequires: make libunwind-devel elfutils-devel gcc @@ -48,6 +49,9 @@ make install DESTDIR="%{buildroot}" %{_mandir}/man1/%{name}.1* %changelog +* Thu Jul 20 2023 huajingyun - 1.1.1-7 +- fix build error on loongarch64 + * Wed Dec 14 2022 doupengda - 1.1.1-6 - add loongarch64 support