From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 248E71F44D for ; Sat, 23 Mar 2024 17:36:15 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=R1ayKYK4; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 738E53858D38 for ; Sat, 23 Mar 2024 17:36:14 +0000 (GMT) Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by sourceware.org (Postfix) with ESMTPS id 81B103858C42 for ; Sat, 23 Mar 2024 17:35:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 81B103858C42 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 81B103858C42 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::12a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711215312; cv=none; b=Z4fA8CjWLn77JXgi36NLaSQ2vg3hFVXzcSvr0fY9CDTS9hFFUdNsjwElsv17MtWFLzRYWDIMFv2kTb//MnUA23wIbXDLNjGPooUDatPbBRaFFMKL5pTwDJN9UABxkSxreQEuRg6N8xWNw4jTZ7m0pCMxMBUB7eaJDMY6fM8gopg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711215312; c=relaxed/simple; bh=z6133yTPiW6WZxsTfatam9keZQQngkRn9+l8Tr0HGSg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=pBT/Y/sEaK6i5fuliGeyi4rrTEMhGbaZP5ajCCTf/Jq6Q1b5PNWd/AGFQACPxKjLpfaZqZs/l4h0wZmWsfmeTNDa1pWa77b254fwQGqXpPoCWci+L0AOhdPymAoMVNTRmRb72mvvSHI7fpEEKGMBgjJv/a2nrsiTxi177AcZohg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-513d23be0b6so3743322e87.0 for ; Sat, 23 Mar 2024 10:35:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711215309; x=1711820109; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rZQxVyPaR5GUzBbW7tD6O23ZGDM+bg/aT0xfi+eFmQQ=; b=R1ayKYK4aLg0KgVhxM4+YMuk7HhKEwC8BJ1yiLwEOcWnW4O4zHKfR+IejN94WItZrO Upwqy4qvk7SUToeY7YARG6siHyXOzuHywxa8ZEMyWwlsoFp/dE2ieZdiDpRWuf++hLWh NdM6/+JmzKkjIg416r+hg9Kw0uR8UL8463w1d0ugCzSgvwf9xYyVSUyFNoo6i5zTqnlG cj/xwfPv/PmhCMQDRK02OqXKSybz/PyK9vK4PriMJIQ20zKIGoF/N8iKYXx0/DYKORUo dOR4laVMPMkvTUx0Yf+LmL7kHccBrLIpTH8/1Tz/ksDJBqdEDQTKIYqJx2iKSIr6qEun 6o3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711215309; x=1711820109; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rZQxVyPaR5GUzBbW7tD6O23ZGDM+bg/aT0xfi+eFmQQ=; b=L0s7+Xzf2fQ6sCU0hpz2f++hU+7Iaw/6rDUL6uRoKAs/nRomGaKirotePZnsOvzT4v xhV6puw8Wxvdln3iXJWpwjpChTb+R8891icUx7vfroB5tqVaUMcYQrkZ2Rc0k/s/5O0J bCTzzgB2W0IwOIlc+AjCB1bJAobfKz9R93KwaK14u/ba0fPNa+p2H2iC5OWnPfEtSJF6 miJaCJuHY16GffXWhhmnNjlv7UlMhA/wonSbil7sU9PsKJMKDdMaddLjyh53eBI8sz9X WJA3u5G7+FXzyS6Ktrgvd+oIQ+FuXWHa4Wa2hUa+9YzFUOe6rjBwIca3nSSOEmkyWS/R o+5Q== X-Gm-Message-State: AOJu0YwyqXvyzvuAHaowHWSyK2uWxlF+vUPJYPr3XUU6QdHsw5wdsLnp boZMF1KrLT5VbZr2qrFlvStYDRa1qyXoI6rgqTbRPV4bj+9ixdidJvWHKxBc X-Google-Smtp-Source: AGHT+IEFIwSaho5uZvS7oXj528u0xW2pCAQkjFm5AikLb0lIomj8gTQ5dCMiCls3/IPFCEM70nu1LA== X-Received: by 2002:ac2:514a:0:b0:514:b7ff:95d9 with SMTP id q10-20020ac2514a000000b00514b7ff95d9mr1793788lfd.22.1711215308523; Sat, 23 Mar 2024 10:35:08 -0700 (PDT) Received: from surface-pro-6.. (79-139-171-253.dynamic.spd-mgts.ru. [79.139.171.253]) by smtp.gmail.com with ESMTPSA id g20-20020ac25394000000b00513973dee6fsm361290lfh.150.2024.03.23.10.35.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 10:35:08 -0700 (PDT) From: Sergey Bugaev To: libc-alpha@sourceware.org, bug-hurd@gnu.org Cc: Maxim Kuvyrkov , Luca Subject: [PATCH v2 03/20] Allow glibc to be compiled without EXEC_PAGESIZE Date: Sat, 23 Mar 2024 20:32:44 +0300 Message-ID: <20240323173301.151066-4-bugaevc@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240323173301.151066-1-bugaevc@gmail.com> References: <20240323173301.151066-1-bugaevc@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org We would like to avoid statically defining any specific page size on aarch64-gnu, and instead make sure that everything uses the dynamic page size, available via vm_page_size and GLRO(dl_pagesize). There are currently a few places in glibc that require EXEC_PAGESIZE to be defined. Per Roland's suggestion [0], drop the static GLRO(dl_pagesize) initializers (for now, only if EXEC_PAGESIZE is not defined), and don't require EXEC_PAGESIZE definition for libio to enable mmap usage. [0]: https://mail.gnu.org/archive/html/bug-hurd/2011-10/msg00035.html Signed-off-by: Sergey Bugaev --- Same patch as last time. At least in the Hurd port, GLRO(dl_pagesize) is one of the very things to get initialized, so this shouldn't cause any initialization order issues. But, if it's really undesirable for EXEC_PAGESIZE to be dropped, we could of course also define EXEC_PAGESIZE to some large value (16K?) on aarch64-gnu, provided that nothing actually tries to use it for anything. PAGE_SIZE is 4k in the current AArch64 GNU Mach, for what it's worth, but this is intended to eventually be build-time configurable. elf/dl-support.c | 6 +++++- elf/rtld.c | 2 ++ libio/libioP.h | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/elf/dl-support.c b/elf/dl-support.c index 451932dd..cb0bbd21 100644 --- a/elf/dl-support.c +++ b/elf/dl-support.c @@ -135,7 +135,11 @@ void *_dl_random; #include #include -size_t _dl_pagesize = EXEC_PAGESIZE; +size_t _dl_pagesize +#ifdef EXEC_PAGESIZE + = EXEC_PAGESIZE +#endif +; size_t _dl_minsigstacksize = CONSTANT_MINSIGSTKSZ; diff --git a/elf/rtld.c b/elf/rtld.c index ac4bb236..18d73f19 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -358,7 +358,9 @@ struct rtld_global_ro _rtld_global_ro attribute_relro = ._dl_debug_fd = STDERR_FILENO, ._dl_lazy = 1, ._dl_fpu_control = _FPU_DEFAULT, +#ifdef EXEC_PAGESIZE ._dl_pagesize = EXEC_PAGESIZE, +#endif ._dl_inhibit_cache = 0, ._dl_profile_output = "/var/tmp", diff --git a/libio/libioP.h b/libio/libioP.h index 1af287b1..1a7f547e 100644 --- a/libio/libioP.h +++ b/libio/libioP.h @@ -852,7 +852,7 @@ extern off64_t _IO_seekpos_unlocked (FILE *, off64_t, int) # define MAP_ANONYMOUS MAP_ANON # endif -# if !defined(MAP_ANONYMOUS) || !defined(EXEC_PAGESIZE) +# if !defined(MAP_ANONYMOUS) # undef _G_HAVE_MMAP # define _G_HAVE_MMAP 0 # endif -- 2.44.0