From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by sourceware.org (Postfix) with ESMTPS id A6AC2385840E for ; Fri, 12 Apr 2024 20:06:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A6AC2385840E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A6AC2385840E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::22a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712952407; cv=none; b=Sk2hd7cji+9g5ISAfy9DHtvUjsPuq7L/U+PbKgJaNvG/4eBMkJ0k2bSOPahSpIfupgceCuottlbiktAv5PxLJMZ6VeJsK2YimvNfF8iJVjE/eJkJ/tImC+NM4SPqxVVaLV1zgtS+qqKJANhgXJV/e/QKDQpq6YHJgvwYXZq74Ac= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712952407; c=relaxed/simple; bh=oYjYhf0xwu6wDn8OWhIHGX5q0xn4YH3otDWRQJ6pIFA=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=u8YSm7GZMNpHi+/tI+jNtTGIknMyB168alaBx6pmXZm0PgInUyG5JmdjwvJcpOlWjBhGjUvQbWdKhEUb/TZAMEGFqYbS247YqS7X7YOnJ48X7qXncJpe/wmRURTUAL/2nfibNaUDP2d8eljv9lAMR+r60Jcy+cw/3mGsaVDAi8Q= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3c603f6eb37so485499b6e.1 for ; Fri, 12 Apr 2024 13:06:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712952403; x=1713557203; 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=v9A+mo8IYS8kw2Lr4xzk0GO4fTpqb/2T4/BN2SPOiAo=; b=Kqfh7F9vxpWVD04YM4OE2Eb9XhVJciBaVrPRcZQNL8MLPZkv0Asn37igm0MMOKHJZ+ m0u+WeWoDFIFobYp+C5MqZNyjMsZeO+MMu1Ni1OahVzUlIs2FiKuDfFDtOmTsj12rfuY t4Q6AWxPIBDwfkPXsoywQWfHodMyBtOyNokGy40GIu3BdZm3TKdj7dIo9RrovkRvOR4K HfeYE4JV2xi7cgYAJNyBqL6EkocbGzZTP/9NIS0DL7pafW7fjJZmhLrPMwYKQ3iZOvDK h59Sg/zseVeHZsQyvIHL4tc0GHAMBrV3Q704iNZx4A1evIr53bnrcrjBxu4JTe2eXeFe bgzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712952403; x=1713557203; 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=v9A+mo8IYS8kw2Lr4xzk0GO4fTpqb/2T4/BN2SPOiAo=; b=k2JuqblQ2IKOFFMX5oZ+mVMgFQdpqxeUyiqRDen9axWQVZ+kDtHipRwbnbhOjbFv3M lxNMI2XEKxUbmN4tXCzttT7z+/KpdVDFnwvyI3CJfomqqnj8JVHrLuz04EqQzARGKLh0 ISSMRze9j8zJooWRKFDHd3xWRbtDRP2xwDMCou9b5/wROVz7P2NnnDMUCbEu9UU8OW+Q EJSjqqt0dSDS5KXm/+EqxvrUUoHzhdjonS45zE+M9xFZ/H7ly6h8yVnKZ6/Pf2C5MPLb 57cLiDW3bDKH747PmbCTnC3xRA7fnTpIBciGJrdP+RLQ/CqLCrRhCXEWegg3uY2ZP4IN 2dzA== X-Gm-Message-State: AOJu0Yy2NtpRVadxyvf/ZF4gVH2XogR569O0apFYOkK+KsEboZY//6rf hWIoUTpvaO50Vth51yKnS+/UUIY3XdFpeeE37bcXZlhZ5PFsCqRaoV67C+MBLnjxtqDr8cBOg9u cy2Ms/g== X-Google-Smtp-Source: AGHT+IEpGl/EuYdsdBQPpCqN7Q3TKVGRiJqjvmUOPiPxFfqK4WmgHT7xSbYKVbUwMLFi2GBpNA9zSw== X-Received: by 2002:a05:6808:9a7:b0:3c3:cd86:b834 with SMTP id e7-20020a05680809a700b003c3cd86b834mr3846896oig.42.1712952403226; Fri, 12 Apr 2024 13:06:43 -0700 (PDT) Received: from localhost.localdomain ([139.178.84.207]) by smtp.gmail.com with ESMTPSA id b1-20020a056808010100b003c5f54d014dsm701654oie.51.2024.04.12.13.06.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 13:06:42 -0700 (PDT) From: Christophe Lyon To: buildbot@sourceware.org Cc: Christophe Lyon Subject: [PATCH 4/6] autoregen.py: Use autoreconf in most GCC directories Date: Fri, 12 Apr 2024 20:05:57 +0000 Message-Id: <20240412200559.1649050-5-christophe.lyon@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240412200559.1649050-1-christophe.lyon@linaro.org> References: <20240412200559.1649050-1-christophe.lyon@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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: 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. 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. 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", ] @@ -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": + include_arg = "-I../config" + include_arg2 = "-I.." + # aclocal does not support the -f short option for force run_shell(f"{ACLOCAL_BIN} --force {include_arg} {include_arg2}") @@ -91,6 +142,13 @@ def regenerate_manually(): ): run_shell(f"{AUTOHEADER_BIN} -f") + # The few lines below do not regenerate the exact same content as + # currently in the repo. Disable them for now. + # if (folder / "gm2-libs").is_dir(): + # run_shell(f"{AUTOCONF_BIN} -f gm2-libs/config-host.in > gm2-libs/config-host") + # run_shell(f"{AUTOHEADER_BIN} gm2-libs/config-host.in") + + # apparently automake is somehow unstable -> skip it for gotools if any( True for line in configure_lines if line.startswith("AM_INIT_AUTOMAKE") -- 2.34.1