From b4e8cf695864919d3073e0d6489129996ad21ce4 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 22 Oct 2023 11:27:36 +0200 Subject: [PATCH] dist: Fix crash running deploy-stub on arm64 with 16 KiB pages arm64/aarch64 kernels may be configured with 4K, 16K or 64K pages, 16K seems to be most common. The alignment does cause a big waste of space, we may have to revisit the use of mmap, or just mmap the whole executable --- direct/src/dist/FreezeTool.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/direct/src/dist/FreezeTool.py b/direct/src/dist/FreezeTool.py index 5d9d785e4e..93981a9c81 100644 --- a/direct/src/dist/FreezeTool.py +++ b/direct/src/dist/FreezeTool.py @@ -2057,6 +2057,9 @@ class Freezer: if self.platform.startswith('win'): # We don't use mmap on Windows. Align just for good measure. blob_align = 32 + elif self.platform.endswith('_aarch64') or self.platform.endswith('_arm64'): + # Most arm64 operating systems are configured with 16 KiB pages. + blob_align = 16384 else: # Align to page size, so that it can be mmapped. blob_align = 4096