Skip to content

Commit e431780

Browse files
committed
[sanitizer_common] Add arm64e module type
This will fix some symbolication failures on arm64e machines when the symbolicator passes the architecture string to atos.
1 parent 605a7d6 commit e431780

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

compiler-rt/lib/asan/scripts/asan_symbolize.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def is_valid_arch(s):
5959
"armv7s",
6060
"armv7k",
6161
"arm64",
62+
"arm64e",
6263
"powerpc64",
6364
"powerpc64le",
6465
"s390x",

compiler-rt/lib/sanitizer_common/sanitizer_common.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,7 @@ enum ModuleArch {
737737
kModuleArchARMV7S,
738738
kModuleArchARMV7K,
739739
kModuleArchARM64,
740+
kModuleArchARM64E,
740741
kModuleArchLoongArch64,
741742
kModuleArchRISCV64,
742743
kModuleArchHexagon
@@ -810,6 +811,8 @@ inline const char *ModuleArchToString(ModuleArch arch) {
810811
return "armv7k";
811812
case kModuleArchARM64:
812813
return "arm64";
814+
case kModuleArchARM64E:
815+
return "arm64e";
813816
case kModuleArchLoongArch64:
814817
return "loongarch64";
815818
case kModuleArchRISCV64:

compiler-rt/lib/sanitizer_common/sanitizer_procmaps_mac.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
#ifndef CPU_TYPE_ARM64
3333
#define CPU_TYPE_ARM64 (CPU_TYPE_ARM | CPU_ARCH_ABI64)
3434
#endif
35+
#ifndef CPU_SUBTYPE_ARM64E
36+
#define CPU_SUBTYPE_ARM64E ((cpu_subtype_t)2)
37+
#endif
3538

3639
namespace __sanitizer {
3740

@@ -323,6 +326,7 @@ ModuleArch ModuleArchFromCpuType(cpu_type_t cputype, cpu_subtype_t cpusubtype) {
323326
CHECK(0 && "Invalid subtype of ARM");
324327
return kModuleArchUnknown;
325328
case CPU_TYPE_ARM64:
329+
if (cpusubtype == CPU_SUBTYPE_ARM64E) return kModuleArchARM64E;
326330
return kModuleArchARM64;
327331
default:
328332
CHECK(0 && "Invalid CPU type");

compiler-rt/lib/sanitizer_common/tests/sanitizer_procmaps_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ TEST(MemoryMapping, LoadedModuleArchAndUUID) {
7070
EXPECT_EQ(arch, kModuleArchI386);
7171
} else if (SANITIZER_WORDSIZE == 64) {
7272
EXPECT_TRUE(arch == kModuleArchX86_64 || arch == kModuleArchX86_64H ||
73-
arch == kModuleArchARM64);
73+
arch == kModuleArchARM64 || arch == kModuleArchARM64E);
7474
}
7575
const u8 *uuid = modules[i].uuid();
7676
u8 null_uuid[kModuleUUIDSize] = {0};

0 commit comments

Comments
 (0)