[v3,06/29] arm: Add <bits/pagesize.h>

Message ID e297f66c0046821adf1598b6694d3ee87893e2b5.1727624528.git.fweimer@redhat.com (mailing list archive)
State Under Review
Delegated to: Adhemerval Zanella Netto
Headers
Series Teach glibc about possible page sizes and handle gaps in ld.so |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Test passed

Commit Message

Florian Weimer Sept. 29, 2024, 4 p.m. UTC
  While Linux only use HAVE_PAGE_SIZE_4KB in arch/arm/Kconfig, 32-bit
Arm binaries can run on AArch64 kernels in compat mode, so they
can observe the full range of page sizes that are possible on
AArch64.  The toolchain defaults do not reflect this, so xfail
the future elf/tst-load-alignment test.

Note: Alternatively, we could fix the page size at 4 KiB and tell people
to use a 4 KiB kernel if running on AArch64.  Maybe that's the right
approach here?

---
 sysdeps/arm/bits/pagesize.h          | 2 ++
 sysdeps/unix/sysv/linux/arm/Makefile | 3 +++
 2 files changed, 5 insertions(+)
 create mode 100644 sysdeps/arm/bits/pagesize.h
  

Patch

diff --git a/sysdeps/arm/bits/pagesize.h b/sysdeps/arm/bits/pagesize.h
new file mode 100644
index 0000000000..cd688d3fb0
--- /dev/null
+++ b/sysdeps/arm/bits/pagesize.h
@@ -0,0 +1,2 @@ 
+#define __GLIBC_PAGE_SHIFT_MIN 12
+#define __GLIBC_PAGE_SHIFT_MAX 16
diff --git a/sysdeps/unix/sysv/linux/arm/Makefile b/sysdeps/unix/sysv/linux/arm/Makefile
index a73c897f43..5f9e03978d 100644
--- a/sysdeps/unix/sysv/linux/arm/Makefile
+++ b/sysdeps/unix/sysv/linux/arm/Makefile
@@ -1,5 +1,8 @@ 
 ifeq ($(subdir),elf)
 sysdep-rtld-routines += aeabi_read_tp libc-do-syscall
+# The toolchain defaults to 4K pages even though compat mode on 64-bit
+# kernels may require larger page sizes.
+test-xfail-tst-load-alignment = yes
 endif
 
 ifeq ($(subdir),misc)