[v3,19/29] sparc: Add <bits/pagesize.h>

Message ID 7a042a691b91dd0450e53228b5682d227aae1799.1727624528.git.fweimer@redhat.com
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:33 p.m. UTC
  According to arch/sparc/Kconfig in the Linux sources, 32-bit
SPARC has 4K pages, while 64-bit SPARC has 8K pages.  To enable
running 32-bit binaries in compat mode on 64-bit kernels, support
4 KiB and 8 KiB page sizes for 32-bit, but only 8 KiB pages for
64-bit.

The 64-bit toolchain defaults to 1 MiB page size support, so bump
the page size range on 64-bit to that, disregarding Linux support.

Note: We could fix the 64-bit page size at 8 KiB and XFAIL a future
alignment test (currently the gaps test will fail because of the excess
load segment alignment).
---
 sysdeps/sparc/sparc32/bits/pagesize.h | 2 ++
 sysdeps/sparc/sparc64/bits/pagesize.h | 2 ++
 2 files changed, 4 insertions(+)
 create mode 100644 sysdeps/sparc/sparc32/bits/pagesize.h
 create mode 100644 sysdeps/sparc/sparc64/bits/pagesize.h
  

Patch

diff --git a/sysdeps/sparc/sparc32/bits/pagesize.h b/sysdeps/sparc/sparc32/bits/pagesize.h
new file mode 100644
index 0000000000..373d367b7b
--- /dev/null
+++ b/sysdeps/sparc/sparc32/bits/pagesize.h
@@ -0,0 +1,2 @@ 
+#define __GLIBC_PAGE_SHIFT_MIN 12
+#define __GLIBC_PAGE_SHIFT_MAX 13
diff --git a/sysdeps/sparc/sparc64/bits/pagesize.h b/sysdeps/sparc/sparc64/bits/pagesize.h
new file mode 100644
index 0000000000..aec8f97a10
--- /dev/null
+++ b/sysdeps/sparc/sparc64/bits/pagesize.h
@@ -0,0 +1,2 @@ 
+#define __GLIBC_PAGE_SHIFT_MIN 13
+#define __GLIBC_PAGE_SHIFT_MAX 20