From b0f4098d0a64aac651558d2f6286fe68815c0308 Mon Sep 17 00:00:00 2001 From: wuyuechang Date: Tue, 20 May 2025 08:11:07 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3libxml2=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E7=BC=96=E8=AF=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wuyuechang --- llvm-build/build.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/llvm-build/build.py b/llvm-build/build.py index db8cbed51934..9f9cb8cd635b 100755 --- a/llvm-build/build.py +++ b/llvm-build/build.py @@ -709,20 +709,19 @@ class BuildUtils(object): return self.merge_out_path('third_party', 'ncurses', 'build', platform_triple, *args) def get_libxml2_version(self): - version_file = os.path.join(self.build_config.REPOROOT_DIR, 'third_party', 'libxml2', 'libxml2.spec') - if os.path.isfile(version_file): - pattern = r'Version:\s+(\d+\.\d+\.\d+)' - with open(version_file, 'r') as file: - lines = file.readlines() - VERSION = '' - for line in lines: - if 'Version: ' in line: - VERSION = re.search(pattern, line).group(1) - if VERSION != '': - return VERSION - return None - - return None + #version_file = os.path.join(self.build_config.REPOROOT_DIR, 'third_party', 'libxml2', 'libxml2.spec') + #if os.path.isfile(version_file): + # pattern = r'Version:\s+(\d+\.\d+\.\d+)' + # with open(version_file, 'r') as file: + # lines = file.readlines() + # VERSION = '' + # for line in lines: + # if 'Version: ' in line: + # VERSION = re.search(pattern, line).group(1) + # if VERSION != '': + # return VERSION + # return None + return '2.14.0' def merge_libxml2_install_dir(self, platform_triple, *args): return self.merge_out_path('third_party', 'libxml2', 'install', platform_triple, *args) -- Gitee From 13cbc8e4251822f4145cc6f44b10bd449dbedec4 Mon Sep 17 00:00:00 2001 From: wuyuechang Date: Tue, 20 May 2025 08:13:11 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3process=5Fvm=5Freadv?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wuyuechang --- libunwind/src/UnwindCursor.hpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/libunwind/src/UnwindCursor.hpp b/libunwind/src/UnwindCursor.hpp index 1ee67b87c2bb..7bff121d3e93 100644 --- a/libunwind/src/UnwindCursor.hpp +++ b/libunwind/src/UnwindCursor.hpp @@ -2712,20 +2712,12 @@ bool UnwindCursor::setInfoForSigReturn(Registers_arm64 &) { // [1] https://github.com/torvalds/linux/blob/master/arch/arm64/kernel/vdso/sigreturn.S const pint_t pc = static_cast(this->getReg(UNW_REG_IP)); // The PC might contain an invalid address if the unwind info is bad, so - // directly accessing it could cause a segfault. Use process_vm_readv to read - // the memory safely instead. process_vm_readv was added in Linux 3.2, and - // AArch64 supported was added in Linux 3.7, so the syscall is guaranteed to - // be present. Unfortunately, there are Linux AArch64 environments where the - // libc wrapper for the syscall might not be present (e.g. Android 5), so call - // the syscall directly instead. - uint32_t instructions[2]; - struct iovec local_iov = {&instructions, sizeof instructions}; - struct iovec remote_iov = {reinterpret_cast(pc), sizeof instructions}; - long bytesRead = - syscall(SYS_process_vm_readv, getpid(), &local_iov, 1, &remote_iov, 1, 0); + // directly accessing it could cause a SIGSEGV. + if (!isReadableAddr(pc)) + return false; + auto *instructions = reinterpret_cast(pc); // Look for instructions: mov x8, #0x8b; svc #0x0 - if (bytesRead != sizeof instructions || instructions[0] != 0xd2801168 || - instructions[1] != 0xd4000001) + if (instructions[0] != 0xd2801168 || instructions[1] != 0xd4000001) return false; _info = {}; -- Gitee