[RFC,11/23] hurd: Initializy _dl_pagesize early in static builds

Message ID 20240103171502.1358371-12-bugaevc@gmail.com
State Committed
Commit fbfe0b20ab82550de65827e70aa89d8ae462b34d
Headers
Series aarch64-gnu port |

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-arm fail Patch failed to apply

Commit Message

Sergey Bugaev Jan. 3, 2024, 5:14 p.m. UTC
  We fetch __vm_page_size as the very first RPC that we do, inside
__mach_init (). Propagate that to _dl_pagesize ASAP after that,
before any other initialization.

In dynamic builds, this is already done immediately after
__mach_init (), inside _dl_sysdep_start ().

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
---
 sysdeps/mach/hurd/init-first.c | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Samuel Thibault Jan. 4, 2024, 10:48 p.m. UTC | #1
Applied, thanks!

Sergey Bugaev, le mer. 03 janv. 2024 20:14:44 +0300, a ecrit:
> We fetch __vm_page_size as the very first RPC that we do, inside
> __mach_init (). Propagate that to _dl_pagesize ASAP after that,
> before any other initialization.
> 
> In dynamic builds, this is already done immediately after
> __mach_init (), inside _dl_sysdep_start ().
> 
> Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
> ---
>  sysdeps/mach/hurd/init-first.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/sysdeps/mach/hurd/init-first.c b/sysdeps/mach/hurd/init-first.c
> index 26ccd37e..22c35747 100644
> --- a/sysdeps/mach/hurd/init-first.c
> +++ b/sysdeps/mach/hurd/init-first.c
> @@ -162,6 +162,10 @@ first_init (void)
>    /* Initialize data structures so we can do RPCs.  */
>    __mach_init ();
>  
> +#ifndef SHARED
> +  GLRO(dl_pagesize) = __vm_page_size;
> +#endif
> +
>  #if USE_INIT1_TCBHEAD
>    _hurd_tls_init (&__init1_tcbhead, 0);
>  #endif
> -- 
> 2.43.0
> 
>
  

Patch

diff --git a/sysdeps/mach/hurd/init-first.c b/sysdeps/mach/hurd/init-first.c
index 26ccd37e..22c35747 100644
--- a/sysdeps/mach/hurd/init-first.c
+++ b/sysdeps/mach/hurd/init-first.c
@@ -162,6 +162,10 @@  first_init (void)
   /* Initialize data structures so we can do RPCs.  */
   __mach_init ();
 
+#ifndef SHARED
+  GLRO(dl_pagesize) = __vm_page_size;
+#endif
+
 #if USE_INIT1_TCBHEAD
   _hurd_tls_init (&__init1_tcbhead, 0);
 #endif