public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Makefile.in: Make TM_P_H depend on $(TREE_H) [PR111021]
@ 2023-08-17  6:14 Kewen.Lin
  2023-08-18  9:32 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Kewen.Lin @ 2023-08-17  6:14 UTC (permalink / raw)
  To: GCC Patches; +Cc: Richard Biener, Richard Sandiford

Hi,

As PR111021 shows, the below ${port}-protos.h include tree.h
for code_helper and tree_code:

  arm/arm-protos.h:#include "tree.h"
  cris/cris-protos.h:#include "tree.h" (H-P removed this in r14-3218)
  microblaze/microblaze-protos.h:#include "tree.h"
  rl78/rl78-protos.h:#include "tree.h"
  stormy16/stormy16-protos.h:#include "tree.h"

, when compiling build/gencondmd.cc, the include hierarchy
makes it depend on tm_p.h -> ${port}-protos.h -> tree.h,
which further includes (depends on) some files that are
generated during the building, such as: all-tree.def,
tree-check.h and so on.  The previous commit r14-3215
should already force build/gencondmd.cc to depend on
${TREE_H}, so the reported build failure should be gone.

But for a long term maintenance, especially one day some
build/xxx.cc requires tm_p.h but not recog.h, the ${TREE_H}
dependence could be missed and a build failure will show
up.  So this patch is to make TM_P_H depend on $(TREE_H),
any new build/xxx.cc depending on tm_p.h will be able to
consider ${TREE_H}.

It's tested with cross-builds for the affected ports with
steps:
 1) dropped the fix r14-3215;
 2) reproduced the build failure with serial build;
 3) applied this patch, serially built and verified all passed;
 4) added back r14-3215, serially built and verified all passed;

Also bootstrapped and regtested on x86_64-redhat-linux and
powerpc64{,le}-linux-gnu.

Is it ok for trunk?

BR,
Kewen
-----
	PR bootstrap/111021

gcc/ChangeLog:

	* Makefile.in (TM_P_H): Add $(TREE_H) as dependence.
---
 gcc/Makefile.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 9dddb65b45d..b85c967951b 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -893,7 +893,8 @@ OPTIONS_C_EXTRA = $(PRETTY_PRINT_H)
 BCONFIG_H = bconfig.h $(build_xm_file_list)
 CONFIG_H  = config.h  $(host_xm_file_list)
 TCONFIG_H = tconfig.h $(xm_file_list)
-TM_P_H    = tm_p.h    $(tm_p_file_list)
+# Some $(target)-protos.h depends on tree.h
+TM_P_H    = tm_p.h    $(tm_p_file_list) $(TREE_H)
 TM_D_H    = tm_d.h    $(tm_d_file_list)
 GTM_H     = tm.h      $(tm_file_list) insn-constants.h
 TM_H      = $(GTM_H) insn-flags.h $(OPTIONS_H)
--
2.39.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Makefile.in: Make TM_P_H depend on $(TREE_H) [PR111021]
  2023-08-17  6:14 [PATCH] Makefile.in: Make TM_P_H depend on $(TREE_H) [PR111021] Kewen.Lin
@ 2023-08-18  9:32 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2023-08-18  9:32 UTC (permalink / raw)
  To: Kewen.Lin; +Cc: GCC Patches, Richard Sandiford

On Thu, Aug 17, 2023 at 8:15 AM Kewen.Lin <linkw@linux.ibm.com> wrote:
>
> Hi,
>
> As PR111021 shows, the below ${port}-protos.h include tree.h
> for code_helper and tree_code:
>
>   arm/arm-protos.h:#include "tree.h"
>   cris/cris-protos.h:#include "tree.h" (H-P removed this in r14-3218)
>   microblaze/microblaze-protos.h:#include "tree.h"
>   rl78/rl78-protos.h:#include "tree.h"
>   stormy16/stormy16-protos.h:#include "tree.h"
>
> , when compiling build/gencondmd.cc, the include hierarchy
> makes it depend on tm_p.h -> ${port}-protos.h -> tree.h,
> which further includes (depends on) some files that are
> generated during the building, such as: all-tree.def,
> tree-check.h and so on.  The previous commit r14-3215
> should already force build/gencondmd.cc to depend on
> ${TREE_H}, so the reported build failure should be gone.
>
> But for a long term maintenance, especially one day some
> build/xxx.cc requires tm_p.h but not recog.h, the ${TREE_H}
> dependence could be missed and a build failure will show
> up.  So this patch is to make TM_P_H depend on $(TREE_H),
> any new build/xxx.cc depending on tm_p.h will be able to
> consider ${TREE_H}.
>
> It's tested with cross-builds for the affected ports with
> steps:
>  1) dropped the fix r14-3215;
>  2) reproduced the build failure with serial build;
>  3) applied this patch, serially built and verified all passed;
>  4) added back r14-3215, serially built and verified all passed;
>
> Also bootstrapped and regtested on x86_64-redhat-linux and
> powerpc64{,le}-linux-gnu.
>
> Is it ok for trunk?

OK.

> BR,
> Kewen
> -----
>         PR bootstrap/111021
>
> gcc/ChangeLog:
>
>         * Makefile.in (TM_P_H): Add $(TREE_H) as dependence.
> ---
>  gcc/Makefile.in | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/Makefile.in b/gcc/Makefile.in
> index 9dddb65b45d..b85c967951b 100644
> --- a/gcc/Makefile.in
> +++ b/gcc/Makefile.in
> @@ -893,7 +893,8 @@ OPTIONS_C_EXTRA = $(PRETTY_PRINT_H)
>  BCONFIG_H = bconfig.h $(build_xm_file_list)
>  CONFIG_H  = config.h  $(host_xm_file_list)
>  TCONFIG_H = tconfig.h $(xm_file_list)
> -TM_P_H    = tm_p.h    $(tm_p_file_list)
> +# Some $(target)-protos.h depends on tree.h
> +TM_P_H    = tm_p.h    $(tm_p_file_list) $(TREE_H)
>  TM_D_H    = tm_d.h    $(tm_d_file_list)
>  GTM_H     = tm.h      $(tm_file_list) insn-constants.h
>  TM_H      = $(GTM_H) insn-flags.h $(OPTIONS_H)
> --
> 2.39.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-18  9:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-17  6:14 [PATCH] Makefile.in: Make TM_P_H depend on $(TREE_H) [PR111021] Kewen.Lin
2023-08-18  9:32 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).