* libgo patch committed: Only rebuild package if dependent .gox changed
@ 2016-11-01 13:54 Ian Lance Taylor
0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2016-11-01 13:54 UTC (permalink / raw)
To: gcc-patches, gofrontend-dev
[-- Attachment #1: Type: text/plain, Size: 750 bytes --]
This patch to libgo tweaks the libgo Makefile so that we only rebuild
a package if the .gox file of some imported package changes. We now
use mvifdiff and stamp files to track whether a .gox file has changed.
When package A depends on package B, and we rebuild package B, we only
rebuild package A if package B's .gox file changes. This is safe
because when package A imports package B it only reads package B's
.gox file. This means that changes that do not affect export
information will not cause dependent packages to be recompiled. This
doesn't matter in a clean build, but it speeds up an incremental build
when the export information does not change. Bootstrapped and ran Go
testsuite on x86_64-pc-linux-gnu. Committed to mainline.
Ian
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1186 bytes --]
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE (revision 241741)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -1,4 +1,4 @@
-9ee8ad540d6f2f77af1821bfd977dc1820e1be8f
+90f12ac1fa72a95e73cb88b6114fa3131c4ca8ee
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
Index: libgo/Makefile.am
===================================================================
--- libgo/Makefile.am (revision 241741)
+++ libgo/Makefile.am (working copy)
@@ -924,7 +924,8 @@ BUILDPACKAGE = \
# How to build a .gox file from a .lo file.
BUILDGOX = \
f=`echo $< | sed -e 's/.lo$$/.o/'`; \
- $(OBJCOPY) -j .go_export $$f $@.tmp && mv -f $@.tmp $@
+ $(OBJCOPY) -j .go_export $$f $@.tmp; \
+ $(SHELL) $(srcdir)/mvifdiff.sh $@.tmp `echo $@ | sed -e 's/s-gox/gox/'`
GOTESTFLAGS =
GOBENCH =
@@ -1022,8 +1023,10 @@ $(1).lo:
$(1)/check: $$(CHECK_DEPS)
@$$(CHECK)
.PHONY: $(1)/check
-$(1).gox: $(1).lo
+$(1).gox: $(1).s-gox; @true
+$(1).s-gox: $(1).lo
$$(BUILDGOX)
+ $$(STAMP) $$@
endef
# This line expands PACKAGE_template once for each package name listed
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-11-01 13:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-01 13:54 libgo patch committed: Only rebuild package if dependent .gox changed Ian Lance Taylor
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).