[Darwin] update t-* and x-* fragments after switch to auto-deps.

Submitted by Iain Sandoe on Sept. 28, 2013, 9:21 a.m.

Details

Message ID 5A4296A4-10B6-4C9B-AF0A-1955B4DF40F4@codesourcery.com
State New
Headers show

Commit Message

Iain Sandoe Sept. 28, 2013, 9:21 a.m.
Hi,

This updates the Darwin port {t,x}-* fragments after the switch to auto-deps (thanks Tom!).

bootstrapped (all langs, incl Ada) on i686-darwin9(bootstrap=gcc-4.8), i686-darwin10, x86-64-darwin11, x86_64-darwin12 (bootstrap=recent trunk)
powerpc-darwin9 (c,c++,lto,objc,fortran) (bootstrap=gcc-4.0.1).

OK?
Iain

gcc:

	* config/t-darwin (darwin.o, darwin-c.o, darwin-f.o, darwin-driver.o):
	Use COMPILE and POSTCOMPILE.
	* config/x-darwin (host-darwin.o): Likewise.
	* config/i386/x-darwin (host-i386-darwin.o): Likewise.
	* config/rs6000/x-darwin (host-ppc-darwin.o): Likewise.
	* config/rs6000/x-darwin64 (host-ppc64-darwin.o): Likewise.

Comments

Joseph S. Myers Sept. 28, 2013, 4:40 p.m.
On Sat, 28 Sep 2013, Iain Sandoe wrote:

> 	* config/t-darwin (darwin.o, darwin-c.o, darwin-f.o, darwin-driver.o):
> 	Use COMPILE and POSTCOMPILE.
> 	* config/x-darwin (host-darwin.o): Likewise.
> 	* config/i386/x-darwin (host-i386-darwin.o): Likewise.
> 	* config/rs6000/x-darwin (host-ppc-darwin.o): Likewise.
> 	* config/rs6000/x-darwin64 (host-ppc64-darwin.o): Likewise.

Do you need these compilation rules at all?  Or could you change 
config.host to use paths such as config/host-darwin.o rather than just 
host-darwin.o, and so allow the generic rules to be used (my understanding 
was that the auto-deps patch series made lots of such changes to the 
locations of .o files in the build tree to avoid needing special 
compilation rules for particular files)?
Iain Sandoe Sept. 28, 2013, 4:44 p.m.
On 28 Sep 2013, at 17:40, Joseph S. Myers wrote:

> On Sat, 28 Sep 2013, Iain Sandoe wrote:
> 
>> 	* config/t-darwin (darwin.o, darwin-c.o, darwin-f.o, darwin-driver.o):
>> 	Use COMPILE and POSTCOMPILE.
>> 	* config/x-darwin (host-darwin.o): Likewise.
>> 	* config/i386/x-darwin (host-i386-darwin.o): Likewise.
>> 	* config/rs6000/x-darwin (host-ppc-darwin.o): Likewise.
>> 	* config/rs6000/x-darwin64 (host-ppc64-darwin.o): Likewise.
> 
> Do you need these compilation rules at all?  Or could you change 
> config.host to use paths such as config/host-darwin.o rather than just 
> host-darwin.o, and so allow the generic rules to be used (my understanding 
> was that the auto-deps patch series made lots of such changes to the 
> locations of .o files in the build tree to avoid needing special 
> compilation rules for particular files)?

Good id, I'll investigate this.
Iain
Iain Sandoe Sept. 28, 2013, 8:48 p.m.
Hello Joseph,

On 28 Sep 2013, at 17:44, Iain Sandoe wrote:
> On 28 Sep 2013, at 17:40, Joseph S. Myers wrote:
> 
>> On Sat, 28 Sep 2013, Iain Sandoe wrote:
>> 
>>> 	* config/t-darwin (darwin.o, darwin-c.o, darwin-f.o, darwin-driver.o):
>>> 	Use COMPILE and POSTCOMPILE.
>>> 	* config/x-darwin (host-darwin.o): Likewise.
>>> 	* config/i386/x-darwin (host-i386-darwin.o): Likewise.
>>> 	* config/rs6000/x-darwin (host-ppc-darwin.o): Likewise.
>>> 	* config/rs6000/x-darwin64 (host-ppc64-darwin.o): Likewise.
>> 
>> Do you need these compilation rules at all?  Or could you change 
>> config.host to use paths such as config/host-darwin.o rather than just 
>> host-darwin.o, and so allow the generic rules to be used (my understanding 
>> was that the auto-deps patch series made lots of such changes to the 
>> locations of .o files in the build tree to avoid needing special 
>> compilation rules for particular files)?
> 
> Good id, I'll investigate this.

I had a look at this, and it seems like a useful objective.  However, unless I'm missing a step, [following the template of config.gcc:out_file] it seem to require a fair amount of modification (introduction of common-object placeholders etc. in the configury and Makefile.in) - plus application and testing of this on multiple targets.  Not something I can realistically volunteer to do in the immediate future.

Therefore, I'm going to suggest keeping this patch 'as is' and following up later, when there is more time available, with a patch for the other modification.
Iain
Mike Stump Sept. 29, 2013, 5:18 p.m.
On Sep 28, 2013, at 2:21 AM, Iain Sandoe <iain@codesourcery.com> wrote:
> This updates the Darwin port {t,x}-* fragments after the switch to auto-deps (thanks Tom!).

> OK?

Ok.
Tom Tromey Sept. 30, 2013, 2:25 p.m.
>>>>> "Iain" == Iain Sandoe <iain@codesourcery.com> writes:

Joseph> Do you need these compilation rules at all?  Or could you change
Joseph> config.host to use paths such as config/host-darwin.o rather
Joseph> than just host-darwin.o, and so allow the generic rules to be
Joseph> used (my understanding was that the auto-deps patch series made
Joseph> lots of such changes to the locations of .o files in the build
Joseph> tree to avoid needing special compilation rules for particular
Joseph> files)?

Iain> I had a look at this, and it seems like a useful objective.  However,
Iain> unless I'm missing a step, [following the template of
Iain> config.gcc:out_file] it seem to require a fair amount of modification
Iain> (introduction of common-object placeholders etc. in the configury and
Iain> Makefile.in) - plus application and testing of this on multiple
Iain> targets.  Not something I can realistically volunteer to do in the
Iain> immediate future.

I think it can be done more simply using vpath.  (But I haven't tried
this.)  It seems to me though that the out_file stuff is overly manual
and perhaps predates the GNU make requirement.

Something like:

    vpath %.c $(dir $(tmake_file))
    vpath %.c $(dir $(xmake_file))

This would let us keep the .o file in ".".  Right now, adding a new
directory in which .o files may appear is a bit of a pain, because
configure.ac hard-codes the list of such directories.  (This could also
be moved into Makefile, it just seemed more complicated that way...)

Maybe it could also be done by writing a pattern rule that looks in
those directories; though this is more of a pain because tmake_file and
xmake_file can each list multiple files.

Tom

Patch hide | download patch | download mbox

diff --git a/gcc/config/i386/x-darwin b/gcc/config/i386/x-darwin
index f0196ba..4967d69 100644
--- a/gcc/config/i386/x-darwin
+++ b/gcc/config/i386/x-darwin
@@ -1,4 +1,3 @@ 
-host-i386-darwin.o : $(srcdir)/config/i386/host-i386-darwin.c \
-  $(CONFIG_H) $(SYSTEM_H) coretypes.h hosthooks.h $(HOSTHOOKS_DEF_H) \
-  config/host-darwin.h
-	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+host-i386-darwin.o : $(srcdir)/config/i386/host-i386-darwin.c
+	$(COMPILE) $<
+	$(POSTCOMPILE)
diff --git a/gcc/config/rs6000/x-darwin b/gcc/config/rs6000/x-darwin
index 5672c69..9d92ef5 100644
--- a/gcc/config/rs6000/x-darwin
+++ b/gcc/config/rs6000/x-darwin
@@ -1,5 +1,3 @@ 
-host-ppc-darwin.o : $(srcdir)/config/rs6000/host-darwin.c \
-  $(CONFIG_H) $(SYSTEM_H) coretypes.h hosthooks.h $(HOSTHOOKS_DEF_H) toplev.h \
-  config/host-darwin.h $(DIAGNOSTIC_H)
-	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
-		$(INCLUDES) $< -o $@
+host-ppc-darwin.o : $(srcdir)/config/rs6000/host-darwin.c
+	$(COMPILE) $<
+	$(POSTCOMPILE)
diff --git a/gcc/config/rs6000/x-darwin64 b/gcc/config/rs6000/x-darwin64
index 921d555..0932771 100644
--- a/gcc/config/rs6000/x-darwin64
+++ b/gcc/config/rs6000/x-darwin64
@@ -1,5 +1,3 @@ 
-host-ppc64-darwin.o : $(srcdir)/config/rs6000/host-ppc64-darwin.c \
-  $(CONFIG_H) $(SYSTEM_H) coretypes.h hosthooks.h $(HOSTHOOKS_DEF_H) toplev.h \
-  config/host-darwin.h $(DIAGNOSTIC_H)
-	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) \
-		$(INCLUDES) $< -o $@
+host-ppc64-darwin.o : $(srcdir)/config/rs6000/host-ppc64-darwin.c
+	$(COMPILE) $<
+	$(POSTCOMPILE)
diff --git a/gcc/config/t-darwin b/gcc/config/t-darwin
index fdd52c2..87d5df7 100644
--- a/gcc/config/t-darwin
+++ b/gcc/config/t-darwin
@@ -18,25 +18,19 @@ 
 
 TM_H += $(srcdir)/config/darwin-sections.def
 
-darwin.o: $(srcdir)/config/darwin.c $(CONFIG_H) $(SYSTEM_H) coretypes.h     \
-  $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(REAL_H) insn-config.h         \
-  conditions.h insn-flags.h output.h insn-attr.h flags.h $(TREE_H) expr.h   \
-  reload.h function.h $(GGC_H) langhooks.h $(TARGET_H) $(TM_P_H) gt-darwin.h \
-  config/darwin-sections.def
-	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-		$(srcdir)/config/darwin.c
+darwin.o: $(srcdir)/config/darwin.c config/darwin-sections.def
+	$(COMPILE) $<
+	$(POSTCOMPILE)
 
-darwin-c.o: $(srcdir)/config/darwin-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
-  $(TM_H) $(CPPLIB_H) $(TREE_H) $(C_PRAGMA_H) $(TM_P_H) \
-  incpath.h flags.h $(C_COMMON_H) $(C_TARGET_H) $(C_TARGET_DEF_H) $(CPP_INTERNAL_H)
-	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-		$(srcdir)/config/darwin-c.c $(PREPROCESSOR_DEFINES)
+darwin-c.o: $(srcdir)/config/darwin-c.c
+	$(COMPILE) $(PREPROCESSOR_DEFINES) $<
+	$(POSTCOMPILE)
 
-darwin-f.o: $(srcdir)/config/darwin-f.c $(CONFIG_H) $(SYSTEM_H) coretypes.h
-	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-	  $(srcdir)/config/darwin-f.c $(PREPROCESSOR_DEFINES)
 
-darwin-driver.o: $(srcdir)/config/darwin-driver.c \
-  $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) opts.h
-	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-	  $(srcdir)/config/darwin-driver.c
+darwin-f.o: $(srcdir)/config/darwin-f.c
+	$(COMPILE) $<
+	$(POSTCOMPILE)
+
+darwin-driver.o: $(srcdir)/config/darwin-driver.c
+	$(COMPILE) $<
+	$(POSTCOMPILE)
diff --git a/gcc/config/x-darwin b/gcc/config/x-darwin
index f671d91..c6226c0 100644
--- a/gcc/config/x-darwin
+++ b/gcc/config/x-darwin
@@ -1,3 +1,3 @@ 
-host-darwin.o : $(srcdir)/config/host-darwin.c $(CONFIG_H) $(SYSTEM_H) \
-  coretypes.h toplev.h config/host-darwin.h
-	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+host-darwin.o : $(srcdir)/config/host-darwin.c
+	$(COMPILE) $<
+	$(POSTCOMPILE)