From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id 4C52C3858D35 for ; Tue, 16 Apr 2024 16:12:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4C52C3858D35 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 4C52C3858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::62d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713283954; cv=none; b=LLv1mAsSAF2tbHh8isCmmKqJZGbzKRiEOJlQPE3tLqCqPSqo9x/WoyIe/BgZlZn958NSX+WqhtJpeFHJMfRtgeaeFd83iBw+tHFHlot8i7Tkg4kDrpsbtyUbKZpY3+Wk2cBfdP/FPj5fDLV8N9dDpPheXE+Atodk5EU9jDj5SAk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713283954; c=relaxed/simple; bh=fFlt9qS1Cc1T/lKg07Y8bvs8+FuoIGqLxxd3SuwvzbY=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=dBEINPinU/KnEBRbOrm9usa8MjmUDI28HFAcgsop+bhJUsMslut5+7kmRwPYZid4N1UsgguttUrsKekXcViQM2xYGUJOjuHRojELf/skBeM+B8g6fZHKjiL7mSOZslyuuheEwX6v7Pxn0DPmO20uwX6XX+SpzuH2dnPTCu5J/Qg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a51ddc783e3so577710666b.0 for ; Tue, 16 Apr 2024 09:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713283951; x=1713888751; darn=sourceware.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0esRQQ6k7Hs3uWGJDOCWDabAbXhwJkWmmRPhQ23RBWM=; b=TFx0wRbMMVu6BNDAg9wFr+qiUWdVMVV1kt21cVFONvfLcm3siNkrPxpvZ0z28vPoFk i1hc/d+EsoJAB0krPISLZfWvF3lqU3kir6qU1xKYLUzlRxQT0D1ivReY0SkO2mY83D5s Y0LSYSY0WONORTeWlc7cr21zwg9bogx7ZBZAd33ZTcYzWFMq8GNeCtc7QgTAKB72enaN d7W/l0uXJp7u0w9SnxHIsN2HuV97Q6q5Q0LKNGPN6j70zHtzWZgPAouYdPdMJlf+pq3c WZUoPx8nOqFAlwfV3S4MB3MOVijGmd7QpSo89cgvnLc2e74qC+mVGw4ZhfrcqiUVdc93 FD1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713283951; x=1713888751; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0esRQQ6k7Hs3uWGJDOCWDabAbXhwJkWmmRPhQ23RBWM=; b=OKqy+vtW7mE5tWuv9ZKP7RfuDj35f38tiPxyEbAehpygR6AkQ1cY8hEWryN+QA/ngP aHElLldYS7KxubTZUekGHWNe1RsIhCi1IME/g4FHK8ZT/2afa/OrIRUbyXCvvwf02Yoj XDd2AXJZbJa3sgbQhmo+VEB/MC6FFF5NkICbUYta4XKj0ouE9ZHtg2yF0lojmwCVRn0U qIJXs1dm6whs9ihC6WZTHEbfJSJELHvK3jJbaivoz6birXZw4wNmPej1PxR/DcIJd8lu mQVvI3pIFX7kzj+XHUGjtNk4MCgGRvxmRKl2sDoRZRFiTKsHp9kNf2NH9MJPcuZOpDBJ Izdw== X-Gm-Message-State: AOJu0YwSBYo6dZWrxnlSqW8+uZq5/IabohxhjnIvb/liNsBazhMhhA1P Ra6QKgrZgyhMzBT2PTrgsTULfLpIUFjuXHc9J9OupxWF8RTlxSYEQCBb7lTh50pb1A/7ptm01fo 7mnzEVBol5J0MRC4CiFnfaxr8/0Oiy1hPV0DasBR0oZaj82iNbig9SQ== X-Google-Smtp-Source: AGHT+IEri//cXnaPO0QiOTdpkeb2Rmltt8LlPN+VOmV7UzWKTeyW3oJulWBkNUCn+hfcRvw78gU3Z1LAOaYUIosKzWw= X-Received: by 2002:a17:906:e06:b0:a52:6a9c:9ef5 with SMTP id l6-20020a1709060e0600b00a526a9c9ef5mr4058905eji.64.1713283950714; Tue, 16 Apr 2024 09:12:30 -0700 (PDT) MIME-Version: 1.0 References: <20240412200559.1649050-1-christophe.lyon@linaro.org> <20240412200559.1649050-5-christophe.lyon@linaro.org> <96fda049-f7a5-4527-bfb2-0ec5cdefca13@simark.ca> In-Reply-To: <96fda049-f7a5-4527-bfb2-0ec5cdefca13@simark.ca> From: Christophe Lyon Date: Tue, 16 Apr 2024 18:12:25 +0200 Message-ID: Subject: Re: [PATCH 4/6] autoregen.py: Use autoreconf in most GCC directories To: Simon Marchi Cc: buildbot@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,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: On Tue, 16 Apr 2024 at 17:33, Simon Marchi wrote: > > > > On 2024-04-16 10:47, Christophe Lyon wrote: > >> If I call `aclocal` without args in gcc/gcc, it re-generates aclocal.m4 > >> fine, because it got the include path info from configure.ac. If I > >> remove the `AC_CONFIG_MACRO_DIRS` line from gcc/gcc/configure.ac and run > >> aclocal.m4, then I am missing a bunch of m4 files in the resulting > >> aclocal.m4. If I remove the `ACLOCAL_AMFLAGS` variable from > >> gcc/gcc/Makefile.am, it has no effect on `aclocal`. That variable only > > Sorry, I wrote Makefile.am here, it should be Makefile.in. > > >> exists for the benefit of the Makefile rule that regenerates aclocal.m4, > >> lower in Makefile.am. But I would argue that it's unnecessary, since > >> that info is encoded in configure.ac, so the rule could call aclocal > >> without any -I args. > > > > Of course: aclocal does NOT read Makefile.am, but autoreconf does. > > Ok, I wasn't aware of autoreconf getting flags for aclocal from > ACLOCAL_AMFLAGS in Makefile.am, now I see it in the docs. But it seems > to me like autoreconf will "just work" in most cases then: > > - for directories with a Makefile.am, autoreconf will read the -I flags > specified in Makefile.am/ACLOCAL_AMFLAGS and pass them to aclocal. > - for directories without a Makefile.am (like GDB), autoreconf will > call aclocal without -I flags, but aclocal will use the include paths > specified in configure.ac/AC_CONFIG_MACRO_DIRS. > yes > > So what I noticed for the 'gcc' subdir is that autoreconf will > > generate the same contents but also print a few warnings. > > This is because when calling aclocal with some -I flags, the contents > > of those included .m4 files is taken into account before scanning > > configure.ac, so macros like AM_PATH_PROG_WITH_TEST are defined before > > being used, while when using autoreconf (thus calling aclocal without > > any -I flag), those .m4 files are processed later, leading to warnings > > that AM_PATH_PROG_WITH_TEST is "not found in library". IIUC, there's > > an iterative process which means that things are re-assessed later. > > > > So.... it seems it's not a real problem to use autoreconf as you > > suggest, but we'll see such warnings in the buildbot logs (not causing > > errors IIUC). > > I don't really know how this is supposed to work then, it seems > illogical to me. aclocal recommends using AC_CONFIG_MACRO_DIRS: > > https://www.gnu.org/software/automake/manual/html_node/Local-Macros.html > > So it seems to me like it should consider the macros found in these > directories when processing the rest of the files... > Agreed, this is not super clear :-) I added some traces to my aclocal. When called with -I../config, the main loop calls scan_configure which calls scan_configure_dep on: acinclude.m4 configure.ac ../config/acx.m4 ../config/picflag.m4 etc... automake-1.15.1/build/../install/share/aclocal-1.15/cond.m4 automake-1.15.1/build/../install/share/aclocal-1.15/substnot.m4 ../config/zlib.m4 ../config/gcc-plugin.m4 ../config/cet.m4 ../config/enable.m4 then a 2nd iteration adds: ../lt~obsolete.m4 ../libtool.m4 ../ltoptions.m4 ../ltsugar.m4 ../ltversion.m4 ../ltgcc.m4 When called by autoreconf (thus without -I), the main loop calls scan_configure which calls scan_configure_dep on: acinclude.m4 configure.ac (and warns about AM_PATH_PROG_WITH_TEST AM_ICONV AM_LC_MESSAGES and AM_LANGINFO_CODESET) automake-1.15.1/build/../install/share/aclocal-1.15/cond.m4 automake-1.15.1/build/../install/share/aclocal-1.15/substnot.m4 (warns about AM_ZLIB) then a 2nd iteration adds: ../config/acx.m4 ../config/picflag.m4 etc... Not sure how to understand that from the documentation.... > Simon