[compiler-rt] 8993f3e - [sanitizer] Add symbolizer support for loongarch64
Weining Lu via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 9 21:38:46 PST 2022
Author: Youling Tang
Date: 2022-11-10T13:38:09+08:00
New Revision: 8993f3eed64bd1592a8478d0a6a608e64f8edc01
URL: https://github.com/llvm/llvm-project/commit/8993f3eed64bd1592a8478d0a6a608e64f8edc01
DIFF: https://github.com/llvm/llvm-project/commit/8993f3eed64bd1592a8478d0a6a608e64f8edc01.diff
LOG: [sanitizer] Add symbolizer support for loongarch64
Reviewed By: xry111
Differential Revision: https://reviews.llvm.org/D137383
Added:
Modified:
compiler-rt/lib/asan/scripts/asan_symbolize.py
compiler-rt/lib/sanitizer_common/sanitizer_common.h
compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/asan/scripts/asan_symbolize.py b/compiler-rt/lib/asan/scripts/asan_symbolize.py
index ab04b1c67e5a8..4d5312858fdbb 100755
--- a/compiler-rt/lib/asan/scripts/asan_symbolize.py
+++ b/compiler-rt/lib/asan/scripts/asan_symbolize.py
@@ -50,7 +50,7 @@ def fix_filename(file_name):
def is_valid_arch(s):
return s in ["i386", "x86_64", "x86_64h", "arm", "armv6", "armv7", "armv7s",
"armv7k", "arm64", "powerpc64", "powerpc64le", "s390x", "s390",
- "riscv64"]
+ "riscv64", "loongarch64"]
def guess_arch(addr):
# Guess which arch we're running. 10 = len('0x') + 8 hex digits.
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common.h b/compiler-rt/lib/sanitizer_common/sanitizer_common.h
index 08c6062ba0678..b462e388c232e 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common.h
@@ -709,6 +709,7 @@ enum ModuleArch {
kModuleArchARMV7S,
kModuleArchARMV7K,
kModuleArchARM64,
+ kModuleArchLoongArch64,
kModuleArchRISCV64,
kModuleArchHexagon
};
@@ -781,6 +782,8 @@ inline const char *ModuleArchToString(ModuleArch arch) {
return "armv7k";
case kModuleArchARM64:
return "arm64";
+ case kModuleArchLoongArch64:
+ return "loongarch64";
case kModuleArchRISCV64:
return "riscv64";
case kModuleArchHexagon:
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp
index 461fe96613688..a6f82ced20367 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cpp
@@ -256,6 +256,8 @@ class LLVMSymbolizerProcess final : public SymbolizerProcess {
const char* const kSymbolizerArch = "--default-arch=x86_64";
#elif defined(__i386__)
const char* const kSymbolizerArch = "--default-arch=i386";
+#elif SANITIZER_LOONGARCH64
+ const char *const kSymbolizerArch = "--default-arch=loongarch64";
#elif SANITIZER_RISCV64
const char *const kSymbolizerArch = "--default-arch=riscv64";
#elif defined(__aarch64__)
More information about the llvm-commits
mailing list