[01/57] Allow targets to specify build dependencies for out_object_file

Message ID d4b9e8a82ede3aa12c817646145442a818f8dc72.1619537141.git.wschmidt@linux.ibm.com
State New
Headers show
Series
  • Replace the Power target-specific built-in machinery
Related show

Commit Message

Hongtao Liu via Gcc-patches April 27, 2021, 3:32 p.m.
2021-03-03  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
	* Makefile.in (OUT_FILE_DEPS): New variable.
	(out_object_file): Depend on OUT_FILE_DEPS.
---
 gcc/Makefile.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.27.0

Comments

Hongtao Liu via Gcc-patches April 27, 2021, 3:57 p.m. | #1
On Tue, Apr 27, 2021 at 10:32:36AM -0500, Bill Schmidt wrote:
> 2021-03-03  Bill Schmidt  <wschmidt@linux.ibm.com>

> 

> gcc/

> 	* Makefile.in (OUT_FILE_DEPS): New variable.

> 	(out_object_file): Depend on OUT_FILE_DEPS.


Why?

E.g. gcc/config/i386/t-i386 contains:
i386.o: i386-builtin-types.inc
Similarly gcc/config/{arm/t-arm,ia64/t-ia64}

	Jakub
Hongtao Liu via Gcc-patches April 27, 2021, 4:14 p.m. | #2
On 4/27/21 10:57 AM, Jakub Jelinek wrote:
> On Tue, Apr 27, 2021 at 10:32:36AM -0500, Bill Schmidt wrote:

>> 2021-03-03  Bill Schmidt  <wschmidt@linux.ibm.com>

>>

>> gcc/

>> 	* Makefile.in (OUT_FILE_DEPS): New variable.

>> 	(out_object_file): Depend on OUT_FILE_DEPS.

> Why?

>

> E.g. gcc/config/i386/t-i386 contains:

> i386.o: i386-builtin-types.inc

> Similarly gcc/config/{arm/t-arm,ia64/t-ia64}


Interesting!  Thanks.  This was probably an excess of caution on my 
part.  When I specify something like this, I get a warning message that 
I am overriding an automatically generated dependency.  If it's okay for 
me to ignore that warning, then I can withdraw this patch and simply 
specify the dependency directly.  Sorry, I should have specified the 
reason for this in the patch note.

Thanks,
Bill

>

> 	Jakub

>
Hongtao Liu via Gcc-patches April 27, 2021, 4:47 p.m. | #3
On Tue, Apr 27, 2021 at 11:14:00AM -0500, Bill Schmidt wrote:
> On 4/27/21 10:57 AM, Jakub Jelinek wrote:

> > On Tue, Apr 27, 2021 at 10:32:36AM -0500, Bill Schmidt wrote:

> > > 2021-03-03  Bill Schmidt  <wschmidt@linux.ibm.com>

> > > 

> > > gcc/

> > > 	* Makefile.in (OUT_FILE_DEPS): New variable.

> > > 	(out_object_file): Depend on OUT_FILE_DEPS.

> > Why?

> > 

> > E.g. gcc/config/i386/t-i386 contains:

> > i386.o: i386-builtin-types.inc

> > Similarly gcc/config/{arm/t-arm,ia64/t-ia64}

> 

> Interesting!  Thanks.  This was probably an excess of caution on my part. 

> When I specify something like this, I get a warning message that I am

> overriding an automatically generated dependency.  If it's okay for me to

> ignore that warning, then I can withdraw this patch and simply specify the

> dependency directly.  Sorry, I should have specified the reason for this in

> the patch note.


Can you state what exact warning is it and perhaps can you try to reproduce
that warning with a minimal Makefile example?
I don't remember seeing any such warning on i386 or arm.
Whether the dependency is specified on the goal with the commands to build
it or separately shouldn't really matter.

	Jakub
Hongtao Liu via Gcc-patches April 27, 2021, 5:44 p.m. | #4
On 4/27/21 11:47 AM, Jakub Jelinek wrote:
> On Tue, Apr 27, 2021 at 11:14:00AM -0500, Bill Schmidt wrote:

>> On 4/27/21 10:57 AM, Jakub Jelinek wrote:

>>> On Tue, Apr 27, 2021 at 10:32:36AM -0500, Bill Schmidt wrote:

>>>> 2021-03-03  Bill Schmidt  <wschmidt@linux.ibm.com>

>>>>

>>>> gcc/

>>>> 	* Makefile.in (OUT_FILE_DEPS): New variable.

>>>> 	(out_object_file): Depend on OUT_FILE_DEPS.

>>> Why?

>>>

>>> E.g. gcc/config/i386/t-i386 contains:

>>> i386.o: i386-builtin-types.inc

>>> Similarly gcc/config/{arm/t-arm,ia64/t-ia64}

>> Interesting!  Thanks.  This was probably an excess of caution on my part.

>> When I specify something like this, I get a warning message that I am

>> overriding an automatically generated dependency.  If it's okay for me to

>> ignore that warning, then I can withdraw this patch and simply specify the

>> dependency directly.  Sorry, I should have specified the reason for this in

>> the patch note.

> Can you state what exact warning is it and perhaps can you try to reproduce

> that warning with a minimal Makefile example?

> I don't remember seeing any such warning on i386 or arm.

> Whether the dependency is specified on the goal with the commands to build

> it or separately shouldn't really matter.


It turns out that this was me simply misreading the warning.  If I 
provide the dependency *and* a recipe, I get:

Makefile:2401: warning: overriding recipe for target 'rs6000.o'
/home/wschmidt/newgcc/gcc/config/rs6000/t-rs6000:89: warning: ignoring 
old recipe for target 'rs6000.o'

But if I provide just the dependency, the warning doesn't show up, as 
expected.  So I withdraw this patch, and will change t-rs6000 
accordingly instead.

Thanks for the help!
Bill


>

> 	Jakub

>

Patch

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 8a5fb3fd99c..2fd94fc7dba 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -558,6 +558,7 @@  TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@
 TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@
 out_file=$(srcdir)/config/@out_file@
 out_object_file=@out_object_file@
+OUT_FILE_DEPS=
 common_out_file=$(srcdir)/common/config/@common_out_file@
 common_out_object_file=@common_out_object_file@
 md_file=$(srcdir)/common.md $(srcdir)/config/@md_file@
@@ -2361,7 +2362,7 @@  pass-instances.def: $(srcdir)/passes.def $(PASSES_EXTRA) \
 	$(AWK) -f $(srcdir)/gen-pass-instances.awk \
 	  $(srcdir)/passes.def $(PASSES_EXTRA) > pass-instances.def
 
-$(out_object_file): $(out_file)
+$(out_object_file): $(out_file) $(OUT_FILE_DEPS)
 	$(COMPILE) $<
 	$(POSTCOMPILE)