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}
7373set (ALL_SAFESTACK_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM64} ${MIPS32} ${MIPS64}
7474 ${HEXAGON} ${LOONGARCH64} )
7575set (ALL_CFI_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${MIPS64}
76- ${HEXAGON} )
76+ ${HEXAGON} ${LOONGARCH64} )
7777set (ALL_SCUDO_STANDALONE_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}
7878 ${MIPS32} ${MIPS64} ${PPC64} ${HEXAGON} ${LOONGARCH64} ${RISCV64} )
7979if (APPLE )
Original file line number Diff line number Diff line change @@ -51,7 +51,11 @@ using namespace __sanitizer;
5151
5252namespace __cfi {
5353
54+ #if SANITIZER_LOONGARCH64
55+ #define kCfiShadowLimitsStorageSize 16384 // 16KiB on loongarch64 per page
56+ #else
5457#define kCfiShadowLimitsStorageSize 4096 // 1 page
58+ #endif
5559// Lets hope that the data segment is mapped with 4K pages.
5660// The pointer to the cfi shadow region is stored at the start of this page.
5761// 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 {
5353 virtual void f ();
5454};
5555
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+
5663#ifdef SHARED_LIB
5764
5865#include " ../../utils.h"
@@ -66,13 +73,13 @@ extern "C" void *create_B() {
6673 return (void *)(new B ());
6774}
6875
69- extern " C" __attribute__((aligned(4096 ))) void do_nothing () {}
76+ extern " C" __attribute__((aligned(PAGESIZE ))) void do_nothing () {}
7077
7178#else
7279
7380void A::f () {}
7481
75- static const int kCodeAlign = 4096 ;
82+ static const int kCodeAlign = PAGESIZE ;
7683static const int kCodeSize = 4096 ;
7784static char saved_code[kCodeSize ];
7885static char *real_start;
Original file line number Diff line number Diff line change 11# 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" ]:
33 config .unsupported = True
Original file line number Diff line number Diff line change 11# 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" ]:
33 config .unsupported = True
You can’t perform that action at this time.
0 commit comments