Index: bolt/include/bolt/Core/BinaryContext.h =================================================================== --- bolt/include/bolt/Core/BinaryContext.h +++ bolt/include/bolt/Core/BinaryContext.h @@ -489,10 +489,12 @@ void adjustCodePadding(); /// Regular page size. - static constexpr unsigned RegularPageSize = 0x1000; + unsigned RegularPageSize{0x1000}; + static constexpr unsigned RegularPageSizeX86 = 0x1000; + static constexpr unsigned RegularPageSizeAArch64 = 0x10000; /// Huge page size to use. - static constexpr unsigned HugePageSize = 0x200000; + const unsigned HugePageSize{0x200000}; /// Map address to a constant island owner (constant data in code section) std::map AddressToConstantIslandMap; Index: bolt/lib/Core/BinaryContext.cpp =================================================================== --- bolt/lib/Core/BinaryContext.cpp +++ bolt/lib/Core/BinaryContext.cpp @@ -97,6 +97,7 @@ InstPrinter(std::move(InstPrinter)), MIA(std::move(MIA)), MIB(std::move(MIB)), MRI(std::move(MRI)), DisAsm(std::move(DisAsm)) { Relocation::Arch = this->TheTriple->getArch(); + RegularPageSize = isAArch64() ? RegularPageSizeAArch64 : RegularPageSizeX86; PageAlign = opts::NoHugePages ? RegularPageSize : HugePageSize; }