From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 119EC3858D34 for ; Mon, 15 Apr 2024 03:07:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 119EC3858D34 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 119EC3858D34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713150462; cv=none; b=QjpqZvhxvTZUmMeVv/nd9QmBD9YDF9Z1Eb3wdm8gE21et8XP3bME04n/JGs+YpmEJ/nOHPC8WdVBdwfT8Ou/42q319m5rQBdFaKu00o9INzPyYF+yS5iSUY2d6l+0H9zLluNHt365OY3R6U7Xfpz0UWBOm8lwZ8iehhrRtvj7Oc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713150462; c=relaxed/simple; bh=w/kF+i4o5o9PVnaMGhLqlZgoyfuocRWfabmZcR2bf3Y=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=X5sGufIi9g1a3sQZwqJhHP04bH5jty5zgtOhCIhJuCAke+vbE6T6v9VZFrARIO5SxJKIpunNWqJnorIR901S7GcJ4QxuP0yK3+uP1p2XzOj/fSVZm94cBadMe5QmHDsXJlwwl7MyMgPGJLNknvL8LWwCUwVI8T402iQltr7hPy8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1713150459; bh=w/kF+i4o5o9PVnaMGhLqlZgoyfuocRWfabmZcR2bf3Y=; h=Date:Subject:To:References:From:In-Reply-To:From; b=gmfLolh6FXiZd3wHFs2tRsNNi3mMY+gALtHXs32EG0bRkwCauxPBUJTFBu23KcSps etr6xtOCj9NpvM9e8HYN7ANg6VAmuSOMT6vAMDoIBzBOZ26o4Xku5QyTRsfn+kWHab jekX6kGqwCIQRDhwtCG8vBxSnRa7+nlxS/OiAgzA= Received: from [10.0.0.11] (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 71FB81E030; Sun, 14 Apr 2024 23:07:39 -0400 (EDT) Message-ID: Date: Sun, 14 Apr 2024 23:07:38 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/6] autoregen.py: Use autoreconf in most GCC directories To: Christophe Lyon , buildbot@sourceware.org References: <20240412200559.1649050-1-christophe.lyon@linaro.org> <20240412200559.1649050-5-christophe.lyon@linaro.org> Content-Language: en-US From: Simon Marchi In-Reply-To: <20240412200559.1649050-5-christophe.lyon@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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 List-Id: On 2024-04-12 16:05, Christophe Lyon wrote: > Add most of GCC's subdirectories to AUTORECONF_DIRS, since 'autoreconf > -f' works for them. > > A few subdirs still need to be regenerated "manually", because they do > not have Makefile.am which autoreconf uses to determine which aclocal > flags to use. gdb, for instance, doesn't use Makefile.am, and yet autoreconf works. It finds the aclocal include paths from the AC_CONFIG_MACRO_DIRS macro in configure.ac. If the remaining subdirs that still need to be manually handled used AC_CONFIG_MACRO_DIRS, would autoreconf work in them? Out of the directories you commented out from AUTORECONF_DIRS, the following re-generated cleanly with autoreconf for me: - libdecnumber - gcc - libiberty - libobjc So I would suggest adding them to AUTORECONF_DIRS. > Most use our default aclocal -I../config, but a few need special > flags, which I copied from the corresponding Makefile.in: > * fixincludes: -I.. -I../config > * gcc, libiberty, libobjc: -I../config -I.. > * libgm2: -I../config -I.. although Makefile.in says otherwise. Using > what Makefile.in defines results in generating aclocal.m4 with a > different contents than what it is in the repo. The repo is > presumably wrong, but use this until this is fixed. > > Note that we do not regenerate > libvtv/testsuite/other-tests/Makefile.in, because > libvtv/testsuite/other-tests/ has no configure.ac. > > Running this script over GCC's repository generates quite a few > warnings, which are the same as before this patch. Namely, these > subdirs seem to have incorrect autotools files (at least partially): > * libgfortran > * libgomp > * libsanitizer > > This patch does not support regenerating gcc/m2/gm2-libs/config-host > and gcc/m2/gm2-libs/gm2-libs-host.h.in because I didn't manage to > regenerate them with the exact same content. FTR I tried: > autoconf -f config-host.in > config-host > autoheader config-host.in > as described in gcc/m2/Make-maintainer.in > > Similarly, we skip libcpp because the files we regenerate have small > differences with the current versions. libcpp's files appear to be in an invalid state in the repo itself. According to libcpp/Makefile.in line 123, aclocal.m4 should be regenerated with `aclocal -I ../config`. When I use that, I get the same results as what autoreconf would give me. For that one, I think you could send a patch to gcc to fix it in the repo, after which we can switch it to use autoreconf. > Tested by removing all aclocal.m4 files, Makefile.in files derived > from Makefile.am, configure files derived from configure.ac and > checking they are correctly regenerated (that is, 'git status' does > not report deleted nor modified files). > --- > builder/containers/autoregen.py | 60 ++++++++++++++++++++++++++++++++- > 1 file changed, 59 insertions(+), 1 deletion(-) > > diff --git a/builder/containers/autoregen.py b/builder/containers/autoregen.py > index c52a524..4731a87 100755 > --- a/builder/containers/autoregen.py > +++ b/builder/containers/autoregen.py > @@ -40,15 +40,56 @@ SKIP_DIRS = [ > # readline and minizip are maintained with different autotools versions > "readline", > "minizip", > + > + # aclocal.m4 gets an additional ../config/override.m4, > + # and config.in gets a few more empty lines. > + "libcpp", > ] > > # these directories are known to can be re-generatable with a simple autoreconf > # without special -I flags > AUTORECONF_DIRS = [ > + # binutils-gdb subdirs > "gdb", > "gdbserver", > "gdbsupport", > "gnulib", > + > + # gcc subdirs > + "c++tools", # No aclocal.m4 > + #"gcc", # No Makefile.am > + #"fixincludes", # autoreconf complains about GCC_AC_FUNC_MMAP_BLACKLIST > + "gnattools", # No aclocal.m4 > + "gotools", > + "libada", # No aclocal.m4 > + "libatomic", > + "libbacktrace", > + "libcc1", > + "libcody", # No aclocal.m4 > + #"libcpp", # No Makefile.am > + #"libdecnumber", # No Makefile.am > + "libffi", > + "libgcc", # No aclocal.m4 > + "libgfortran", > + # Hack: ACLOCAL_AMFLAGS = -I .. -I ../config in Makefile.in but we > + # apply -I../config -I.. otherwise we do not match the current > + # contents > + #"libgm2", > + "libgo", > + "libgomp", > + "libgrust", > + #"libiberty", # No Makefile.am > + "libitm", > + #"libobjc", # No Makefile.am > + "libphobos", > + "libquadmath", > + "libsanitizer", > + "libssp", > + "libstdc++-v3", > + # This does not cover libvtv/testsuite/other-tests/Makefile.in > + "libvtv", > + "lto-plugin", > + "zlib", If you really want to make the distinction between binutils-gdb and gcc subdirs, perhaps add a "common" section for those directories that appear in both repos? > ] > > > @@ -71,7 +112,9 @@ def regenerate_with_autoreconf(): > > def regenerate_manually(): > configure_lines = open("configure.ac").read().splitlines() > - if any(True for line in configure_lines if line.startswith("AC_CONFIG_MACRO_DIR")): > + if folder.stem == "fixincludes" or folder.stem == "libgm2" or any( > + True for line in configure_lines if line.startswith("AC_CONFIG_MACRO_DIR") > + ): > include_arg = "" > include_arg2 = "" > if (folder / ".." / "config").is_dir(): > @@ -83,6 +126,14 @@ def regenerate_manually(): > include_arg = "-I../.." > include_arg2 = "-I../../config" > > + if folder.stem == "fixincludes": > + include_arg = "-I.." > + include_arg2 = "-I../config" > + > + if folder.stem == "libgm2" or folder.stem == "gcc" or folder.stem == "libiberty" or folder.stem == "libobjc": This could be a bit shorter: if folder.stem in ["libgm2", "gcc", "libiberty", "libobjc"]: Simon