File tree Expand file tree Collapse file tree 5 files changed +16
-5
lines changed Expand file tree Collapse file tree 5 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ set(ALL_UBSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${RISCV64}
73
73
set (ALL_SAFESTACK_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM64} ${MIPS32} ${MIPS64}
74
74
${HEXAGON} ${LOONGARCH64} )
75
75
set (ALL_CFI_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${MIPS64}
76
- ${HEXAGON} )
76
+ ${HEXAGON} ${LOONGARCH64} )
77
77
set (ALL_SCUDO_STANDALONE_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}
78
78
${MIPS32} ${MIPS64} ${PPC64} ${HEXAGON} ${LOONGARCH64} ${RISCV64} )
79
79
if (APPLE )
Original file line number Diff line number Diff line change @@ -51,7 +51,11 @@ using namespace __sanitizer;
51
51
52
52
namespace __cfi {
53
53
54
+ #if SANITIZER_LOONGARCH64
55
+ #define kCfiShadowLimitsStorageSize 16384 // 16KiB on loongarch64 per page
56
+ #else
54
57
#define kCfiShadowLimitsStorageSize 4096 // 1 page
58
+ #endif
55
59
// Lets hope that the data segment is mapped with 4K pages.
56
60
// The pointer to the cfi shadow region is stored at the start of this page.
57
61
// The rest of the page is unused and re-mapped read-only.
Original file line number Diff line number Diff line change @@ -53,6 +53,13 @@ struct A {
53
53
virtual void f ();
54
54
};
55
55
56
+ // The page size of LoongArch is 16KiB, aligned to the memory page size.
57
+ #ifdef __loongarch__
58
+ # define PAGESIZE 16384
59
+ #else
60
+ # define PAGESIZE 4096
61
+ #endif
62
+
56
63
#ifdef SHARED_LIB
57
64
58
65
#include " ../../utils.h"
@@ -66,13 +73,13 @@ extern "C" void *create_B() {
66
73
return (void *)(new B ());
67
74
}
68
75
69
- extern " C" __attribute__((aligned(4096 ))) void do_nothing () {}
76
+ extern " C" __attribute__((aligned(PAGESIZE ))) void do_nothing () {}
70
77
71
78
#else
72
79
73
80
void A::f () {}
74
81
75
- static const int kCodeAlign = 4096 ;
82
+ static const int kCodeAlign = PAGESIZE ;
76
83
static const int kCodeSize = 4096 ;
77
84
static char saved_code[kCodeSize ];
78
85
static char *real_start;
Original file line number Diff line number Diff line change 1
1
# The cfi-icall checker is only supported on x86 and x86_64 for now.
2
- if config .root .host_arch not in ["x86" , "x86_64" ]:
2
+ if config .root .host_arch not in ["x86" , "x86_64" , "loongarch64" ]:
3
3
config .unsupported = True
Original file line number Diff line number Diff line change 1
1
# The cfi-icall checker is only supported on x86 and x86_64 for now.
2
- if config .root .host_arch not in ["x86" , "x86_64" ]:
2
+ if config .root .host_arch not in ["x86" , "x86_64" , "loongarch64" ]:
3
3
config .unsupported = True
You can’t perform that action at this time.
0 commit comments