From 5230eb7f8c6b43c71d7e38d138935c48de930b76 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Fri, 16 Sep 2022 16:04:21 -0400 Subject: Implement sysconf for Arm - add support for using sysconf to get page size in _mallocr.c via HAVE_SYSCONF_PAGESIZE flag set in configure.host - set flag in configure.host for arm and add a default sysconf implementation in libc/sys/arm that returns the page size - the default implementation can be overridden outside newlib to allow a different page size to improve malloc on devices with a small footprint without needing to rebuild newlib - this patch is based on a contribution from Torbjorn Svensson and Niklas Dahlquist (https://ecos.sourceware.org/ml/newlib/current/017616.html) --- newlib/configure.host | 2 ++ 1 file changed, 2 insertions(+) (limited to 'newlib/configure.host') diff --git a/newlib/configure.host b/newlib/configure.host index 98ce07d82..32d1436ba 100644 --- a/newlib/configure.host +++ b/newlib/configure.host @@ -628,6 +628,7 @@ newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DEXIT_PROVID ;; arm*-*-pe) syscall_dir=syscalls + newlib_cflags="${newlib_cflags} -DHAVE_SYSCONF_PAGESIZE" ;; arm*-*-*) syscall_dir=syscalls @@ -642,6 +643,7 @@ newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DEXIT_PROVID # newlib_cflags="${newlib_cflags} -DARM_RDP_MONITOR" newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR" fi + newlib_cflags="${newlib_cflags} -DHAVE_SYSCONF_PAGESIZE" ;; avr*) newlib_cflags="${newlib_cflags} -DNO_EXEC -DSMALL_MEMORY -DMISSING_SYSCALL_NAMES" -- cgit v1.2.3