From patchwork Fri Aug 8 23:09:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ericson X-Patchwork-Id: 118110 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C4D8A3858019 for ; Fri, 8 Aug 2025 23:09:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C4D8A3858019 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=johnericson.me header.i=@johnericson.me header.a=rsa-sha256 header.s=fm2 header.b=jpdkfKVO; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=i1+2abhn X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from fhigh-b3-smtp.messagingengine.com (fhigh-b3-smtp.messagingengine.com [202.12.124.154]) by sourceware.org (Postfix) with ESMTPS id 6B4ED385842C for ; Fri, 8 Aug 2025 23:09:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6B4ED385842C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=JohnEricson.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=JohnEricson.me ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6B4ED385842C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=202.12.124.154 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1754694565; cv=none; b=Juip2RJUaqvUeC3vYwWTL1URSivgkofRA8usX4zxeCiZqawvPBFzPHdJDg/1ZZFJVcvWdiiZizpFNQE9lqkt5xxVpsuLVUXeNTJR/A+jKcmjTODfgLGdq5Vch0yfdkcxzvX8OcLV/p1v6xT0DnkWaN8kh0ULEk2myXqDeSu4qis= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1754694565; c=relaxed/simple; bh=hPzlkZbIMyF+8iBYb1ewS4BsPopNoy/kvGSN9x0HwNs=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=FZE2Utb3COx9PIBI1KrZUGvP3c4v2KtgcVgfR0wC5clj4jh6SH6+OYvz+wOeCANmq/UX2m+sAedtH44897blcSo/pNQIyhR6LklxdsLTvP/KIaFz5GQsDiMgy7PaPHDQmuE3cXorZnUHaG5g0bFtmciIpsdr0SDZ7QykXLlr368= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6B4ED385842C Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.stl.internal (Postfix) with ESMTP id E28897A00C2; Fri, 8 Aug 2025 19:09:24 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Fri, 08 Aug 2025 19:09:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=johnericson.me; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to; s=fm2; t=1754694564; x=1754780964; bh=7T1LToi3d2 2PDWPBd3XzkwSTT8dB1lx0DW5jdHUwsGQ=; b=jpdkfKVOAGCxFozg0cIx+sNibN qTN8wis02+pktwrBdgti5t427g5L4Y+X2cADeEo+AID338+VY4zJW3zedOQmF8M+ 13Iw/7jvPgs08zzS44yo79ASxISx2i41AhGuDrm6rAaikJSPun7sKsILY6qSTMtc BAi4p8mVjp+BAfBnNawzYi5EQhpVxoCsErQhCGZs7FMBnH4iI5DcVS+v4Jmm6llw NZ+gQkkqWa21aSFEBimdYzkwU+gb27HFMcFiG/ul5h+8JPohmYvRPZrC7vEiG5bN THdt4ORzSWmNUuVwMOZ7+mFOrnTJ4rd/Lem/VDv6/e144hC/uIrgXo6RvDGQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1754694564; x=1754780964; bh=7T1LToi3d22PDWPBd3XzkwSTT8dB1lx0DW5 jdHUwsGQ=; b=i1+2abhncsucCYHVDtUF1SyTNi6m/2dYGJ4DcpOzDlLDT01NJqS bMWVVhT/StzoVYeQ1+bh458xZeT/MLTXuj/4N2Gy/L/GjIddpOrhY3g5M57cf3n7 zh/61u+s1GqvsNBCAHqzDrNeNqtKA6q5OtKd5ccxkcpgbD/0gNZ+ouFldkeiWnN/ XfllWpVn1qEGXJxb2lHHZrfTImCZ5mAXfcYxr2IKo1iXKK4yDuEpP8tNLTveKSk7 ZQsJWJQcs9kOgLyzlmQXQxufkGVWMg3Jf+bK+xdn/wQ/eUzyn3BWhdO3TjIKnen6 AiU1PlzUD/SD51woJKpyqdG2nkmYEYKYIzA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdduvdehtdelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertdertd dtnecuhfhrohhmpeflohhhnhcugfhrihgtshhonhcuoehgihhtseflohhhnhfgrhhitghs ohhnrdhmvgeqnecuggftrfgrthhtvghrnhepkefhtdekhffghfehieefleevhfdvtedthe eileefveeugfdvgfduheeltdegudefnecuffhomhgrihhnpehsohhurhgtvgifrghrvgdr ohhrghdpohgsshhiughirghnrdhshihsthgvmhhsnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepghhitheslfhohhhngfhrihgtshhonhdrmhgv pdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehnvg iflhhisgesshhouhhrtggvfigrrhgvrdhorhhgpdhrtghpthhtohepghhithesjhhohhhn vghrihgtshhonhdrmhgv X-ME-Proxy: Feedback-ID: idab146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 8 Aug 2025 19:09:24 -0400 (EDT) From: John Ericson To: newlib@sourceware.org Cc: John Ericson Subject: [PATCH] Get rid of `with_multisrctop` Date: Fri, 8 Aug 2025 19:09:13 -0400 Message-ID: <20250808230913.2774401-1-git@JohnEricson.me> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_INFOUSMEBIZ, RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces~patchwork=sourceware.org@sourceware.org See the new comment in `config-ml.in`, and the email chain starting with [1]. The short story is that I am trying to do a bunch of build system improvements to GCC to make it easier to build GCC's runtime libraries separately (see [1] for why). As part of this, I started looking at the current multilib implementation, with a hunch that things could be simpler, and with those simplifications, we could refine the idiomatic division of labor between the outer and inner build systems in a way that I think would be just better, and also would make the separate or "per component" builds I want to do more maintainable. In that linked thread I found variable/mechanism that looked unused, and after some back and forth with Joseph Myers, we came to an agreement that since GNU Make was mandatory now, and thus VPATH support was assumed, there was no need to do these convoluted symlink tree things to unnaturally allow multilib to get away with `srcdir = objdir` building. (When indeed, `srcdir != objdir_for_machine1 != objdir_for_machine2` is multilib in a nutshell.) The last (as of this patch) email in the chain is Joseph writing: > I think it's reasonable to eliminate such a workaround, but I don't know > how the newlib community feels, should they wish to update the shared > toplevel build infrastructure with changes from GCC. This email is thus me submitting the same change (well, actually a slightly improved one -- the `config-ml.in` comment is new, reflecting what went on in the email thread) to ask you all that question. If our reasoning looks correct, and you see no reason to support these no-VPATH workarounds either, then we have our concensus! I think we can land this change in both repos (GCC, newlib-cygwin), in either order (no repo need wait on the other repo). [1]: https://sourceware.org/pipermail/gcc-patches/2025-August/691963.html [2]: https://blog.obsidian.systems/compiler-bootstrapping-in-nixpkgs/ [3]: https://sourceware.org/pipermail/gcc-patches/2025-August/692233.html Signed-off-by: John Ericson --- config-ml.in | 25 +++++++++++++------------ config/multi.m4 | 7 +++---- libgloss/configure | 7 +++---- newlib/acinclude.m4 | 6 +++--- newlib/configure | 11 +++++------ 5 files changed, 27 insertions(+), 29 deletions(-) diff --git a/config-ml.in b/config-ml.in index 5e519942b..6507e2a4f 100644 --- a/config-ml.in +++ b/config-ml.in @@ -35,9 +35,9 @@ # # if [ "${srcdir}" = "." ] ; then # if [ "${with_target_subdir}" != "." ] ; then -# . ${with_multisrctop}../../config-ml.in +# . ${srcdir}/../../config-ml.in # else -# . ${with_multisrctop}../config-ml.in +# . ${srcdir}/../config-ml.in # fi # else # . ${srcdir}/../config-ml.in @@ -47,9 +47,9 @@ # Things are complicated because 6 separate cases must be handled: # 2 (native, cross) x 3 (absolute-path, relative-not-dot, dot) = 6. # -# srcdir=. is special. It must handle make programs that don't handle VPATH. -# To implement this, a symlink tree is built for each library and for each -# multilib subdir. +# srcdir=. is special. We used to want to handle make programs that +# don't handle VPATH. To implement this, a symlink tree is built for +# each library and for each multilib subdir. # # The build tree is layed out as # @@ -60,6 +60,13 @@ # m68881/ # newlib # +# (Now though, GNU Make is required, and GNU Make always supports VPATH. +# We can therefore drop support for these symlink trees. And +# accordingly, we can know that ${srcdir}/.. always does what we expect +# in all supported configurations, and use that to further simplify this +# multilib infrastructure. These simplifications are not yet +# implemented.) +# # The nice feature about this arrangement is that inter-library references # in the build tree work without having to care where you are. Note that # inter-library references also work in the source tree because symlink trees @@ -72,14 +79,10 @@ # Configure variables: # ${with_target_subdir} = "." for native, or ${target_alias} for cross. # Set by top level Makefile. -# ${with_multisrctop} = how many levels of multilibs there are in the source -# tree. It exists to handle the case of configuring in the source tree: -# ${srcdir} is not constant. # ${with_multisubdir} = name of multilib subdirectory (eg: m68020/m68881). # # Makefile variables: # MULTISRCTOP = number of multilib levels in source tree (+1 if cross) -# (FIXME: note that this is different than ${with_multisrctop}. Check out.). # MULTIBUILDTOP = number of multilib levels in build tree # MULTIDIRS = list of multilib subdirs (eg: m68000 m68020 ...) # (only defined in each library's main Makefile). @@ -709,7 +712,6 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then fi ml_newsrcdir="." ml_srcdiroption= - multisrctop=${dotdot} ;; *) case "${srcdir}" in @@ -721,7 +723,6 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then ;; esac ml_srcdiroption="-srcdir=${ml_newsrcdir}" - multisrctop= ;; esac @@ -867,7 +868,7 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then fi if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \ - --with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \ + --with-multisubdir=${ml_dir} \ "${ac_configure_args}" ${ml_config_env} ${ml_srcdiroption} ; then true else diff --git a/config/multi.m4 b/config/multi.m4 index 5b62ecc0a..c3dc60b46 100644 --- a/config/multi.m4 +++ b/config/multi.m4 @@ -23,14 +23,14 @@ AC_ARG_ENABLE(multilib, [multilib=yes]) # We may get other options which we leave undocumented: -# --with-target-subdir, --with-multisrctop, --with-multisubdir +# --with-target-subdir, --with-multisubdir # See config-ml.in if you want the gory details. if test "$srcdir" = "."; then if test "$with_target_subdir" != "."; then - multi_basedir="$srcdir/$with_multisrctop../$2" + multi_basedir="$srcdir/../$2" else - multi_basedir="$srcdir/$with_multisrctop$2" + multi_basedir="$srcdir/$2" fi else multi_basedir="$srcdir/$2" @@ -57,7 +57,6 @@ srcdir="$srcdir" host="$host" target="$target" with_multisubdir="$with_multisubdir" -with_multisrctop="$with_multisrctop" with_target_subdir="$with_target_subdir" ac_configure_args="${multilib_arg} ${ac_configure_args}" multi_basedir="$multi_basedir" diff --git a/libgloss/configure b/libgloss/configure index ba071824b..ca12e9b84 100755 --- a/libgloss/configure +++ b/libgloss/configure @@ -5652,14 +5652,14 @@ fi # We may get other options which we leave undocumented: -# --with-target-subdir, --with-multisrctop, --with-multisubdir +# --with-target-subdir, --with-multisubdir # See config-ml.in if you want the gory details. if test "$srcdir" = "."; then if test "$with_target_subdir" != "."; then - multi_basedir="$srcdir/$with_multisrctop../.." + multi_basedir="$srcdir/../.." else - multi_basedir="$srcdir/$with_multisrctop.." + multi_basedir="$srcdir/.." fi else multi_basedir="$srcdir/.." @@ -6616,7 +6616,6 @@ srcdir="$srcdir" host="$host" target="$target" with_multisubdir="$with_multisubdir" -with_multisrctop="$with_multisrctop" with_target_subdir="$with_target_subdir" ac_configure_args="${multilib_arg} ${ac_configure_args}" multi_basedir="$multi_basedir" diff --git a/newlib/acinclude.m4 b/newlib/acinclude.m4 index 19301289f..9bd32f147 100644 --- a/newlib/acinclude.m4 +++ b/newlib/acinclude.m4 @@ -94,15 +94,15 @@ AC_ARG_ENABLE(newlib-fno-builtin, dnl We may get other options which we don't document: -dnl --with-target-subdir, --with-multisrctop, --with-multisubdir +dnl --with-target-subdir, --with-multisubdir test -z "[$]{with_target_subdir}" && with_target_subdir=. if test "[$]{srcdir}" = "."; then if test "[$]{with_target_subdir}" != "."; then - newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1" + newlib_basedir="[$]{srcdir}/../$1" else - newlib_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" + newlib_basedir="[$]{srcdir}/$1" fi else newlib_basedir="[$]{srcdir}/$1" diff --git a/newlib/configure b/newlib/configure index 33a2ed1c5..a76dc8322 100755 --- a/newlib/configure +++ b/newlib/configure @@ -2648,14 +2648,14 @@ fi # We may get other options which we leave undocumented: -# --with-target-subdir, --with-multisrctop, --with-multisubdir +# --with-target-subdir, --with-multisubdir # See config-ml.in if you want the gory details. if test "$srcdir" = "."; then if test "$with_target_subdir" != "."; then - multi_basedir="$srcdir/$with_multisrctop../.." + multi_basedir="$srcdir/../.." else - multi_basedir="$srcdir/$with_multisrctop.." + multi_basedir="$srcdir/.." fi else multi_basedir="$srcdir/.." @@ -4874,9 +4874,9 @@ test -z "${with_target_subdir}" && with_target_subdir=. if test "${srcdir}" = "."; then if test "${with_target_subdir}" != "."; then - newlib_basedir="${srcdir}/${with_multisrctop}../." + newlib_basedir="${srcdir}/../." else - newlib_basedir="${srcdir}/${with_multisrctop}." + newlib_basedir="${srcdir}/." fi else newlib_basedir="${srcdir}/." @@ -8732,7 +8732,6 @@ srcdir="$srcdir" host="$host" target="$target" with_multisubdir="$with_multisubdir" -with_multisrctop="$with_multisrctop" with_target_subdir="$with_target_subdir" ac_configure_args="${multilib_arg} ${ac_configure_args}" multi_basedir="$multi_basedir"