diff --git a/libunwind/src/UnwindCursor.hpp b/libunwind/src/UnwindCursor.hpp index 1ee67b87c2bbe823f32af9538b5570cc793c81a5..7bff121d3e931c7a17114879bff6cb14d3349c9c 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 = {}; diff --git a/llvm-build/build.py b/llvm-build/build.py index db8cbed51934c03609ab44e2da17b0c931ff6e0f..9f9cb8cd635bfdbdf61d9d56e9581cd17bd6d573 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)