This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Use automatic dependencies for mkoffload.o
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>, Paolo Bonzini <bonzini at gnu dot org>, Alexandre Oliva <aoliva at redhat dot com>
- Cc: Thomas Schwinge <thomas at codesourcery dot com>, gcc-patches at gcc dot gnu dot org, Kirill Yukhin <kirill dot yukhin at gmail dot com>, Andrey Turetskiy <andrey dot turetskiy at gmail dot com>
- Date: Wed, 18 Feb 2015 13:23:00 +0100
- Subject: [PATCH] Use automatic dependencies for mkoffload.o
- Authentication-results: sourceware.org; auth=none
- References: <20141021171323 dot GA47586 at msticlxl57 dot ims dot intel dot com> <20141021171602 dot GB47586 at msticlxl57 dot ims dot intel dot com> <20141022082103 dot GH10376 at tucnak dot redhat dot com> <20141022185701 dot GA21398 at msticlxl57 dot ims dot intel dot com> <87k2zfe8ze dot fsf at kepler dot schwinge dot homeip dot net> <20150218115607 dot GB62715 at msticlxl57 dot ims dot intel dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Feb 18, 2015 at 02:56:07PM +0300, Ilya Verbin wrote:
> On Wed, Feb 18, 2015 at 12:48:21 +0100, Thomas Schwinge wrote:
> > What is the rationale for the insn-modes.h order-only prerequisites for
> > mkoffload.o? Is this simply to get past the build issue which, for
> > example, Jakub also reported for the nvptx mkoffload,
> > <http://news.gmane.org/find-root.php?message_id=%3C20150217153918.GX1746%40tucnak.redhat.com%3E>
> > (»missing mkoffload.o dependencies, patch attached«), or is there a
> > better rationale for adding (only) this one (indirect) dependency,
> > instead of listing all of the (real) dependencies? (After all, we do
> > want the mkoffload executables to be rebuilt if one of their dependencies
> > is updated.) (I have not yet tried to figure out how to do that.)
>
> Yes, mkoffload is just not working without this dependency, and works well with
> it. Do you know the right way how to add all other dependencies?
I've tested this for both intelmic and nvptx and it works fine.
Ok for trunk?
2015-02-18 Jakub Jelinek <jakub@redhat.com>
* config/i386/t-intelmic (mkoffload.o): Remove dependency on
insn-modes.h.
(ALL_HOST_OBJS): Add mkoffload.o.
* config/nvptx/t-nvptx (ALL_HOST_OBJS): Likewise.
--- gcc/config/i386/t-intelmic.jj 2014-11-13 15:13:25.000000000 +0100
+++ gcc/config/i386/t-intelmic 2015-02-18 13:11:15.650820901 +0100
@@ -1,9 +1,10 @@
-mkoffload.o: $(srcdir)/config/i386/intelmic-mkoffload.c | insn-modes.h
+mkoffload.o: $(srcdir)/config/i386/intelmic-mkoffload.c
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-I$(srcdir)/../libgomp \
-DDEFAULT_REAL_TARGET_MACHINE=\"$(real_target_noncanonical)\" \
-DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\" \
$< $(OUTPUT_OPTION)
+ALL_HOST_OBJS += mkoffload.o
mkoffload$(exeext): mkoffload.o collect-utils.o libcommon-target.a $(LIBIBERTY) $(LIBDEPS)
$(COMPILER) -o $@ mkoffload.o collect-utils.o libcommon-target.a $(LIBIBERTY) $(LIBS)
--- gcc/config/nvptx/t-nvptx.jj 2015-02-18 12:36:20.000000000 +0100
+++ gcc/config/nvptx/t-nvptx 2015-02-18 13:10:19.822762534 +0100
@@ -3,6 +3,7 @@ CFLAGS-mkoffload.o += $(DRIVER_DEFINES)
mkoffload.o: $(srcdir)/config/nvptx/mkoffload.c
$(COMPILE) $<
$(POSTCOMPILE)
+ALL_HOST_OBJS += mkoffload.o
mkoffload$(exeext): mkoffload.o collect-utils.o libcommon-target.a $(LIBIBERTY) $(LIBDEPS)
+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
Jakub